Custom packages

This commit is contained in:
Filippo Berto 2024-10-21 15:57:23 +02:00
parent 1096479c4a
commit 3286c02857
No known key found for this signature in database
GPG key ID: FE98AE5EC52B1056
8 changed files with 122 additions and 229 deletions

View file

@ -1,22 +0,0 @@
{ writeShellScriptBin
, lib
, xclip
, coreutils
, terminal-command ? "kitty -e"
,
}:
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
writeShellScriptBin "clipedit" ''
PATH=$PATH:"${
lib.makeBinPath [
coreutils
xclip
]
}"
tmp_file=$(mktemp)
xclip -out -selection -clipboard > $tmp_file
${terminal-command} $VISUAL $tmp_file || ${terminal-command} $EDITOR $tmp_file
xclip -in -selection clipboard < $tmp_file
rm $tmp_file
''

View file

@ -1,57 +0,0 @@
{ lib
, rice
, roboto
, i3lock-color
, writeScriptBin
, font ? {
package = roboto;
name = "Roboto";
}
, palette ? rice.palette.palette { }
, ...
}:
let
strPalette = lib.nix-rice.palette.toRGBAHex palette;
in
writeScriptBin "lockscreen" ''
# Using font package ${font.package}
${i3lock-color}/bin/i3lock-color \
--insidever-color="${strPalette.normal.green}" \
--insidewrong-color="${strPalette.normal.red}" \
--inside-color="${strPalette.normal.black}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ringver-color="${strPalette.bright.green}" \
--ringwrong-color="${strPalette.bright.red}" \
--ring-color="${strPalette.bright.blue}" \
--line-uses-ring \
--keyhl-color="${strPalette.bright.red}" \
--bshl-color="${strPalette.bright.red}" \
--separator-color="${strPalette.normal.black}" \
--verif-color="${strPalette.normal.green}" \
--wrong-color="${strPalette.normal.red}" \
--layout-color="${strPalette.normal.blue}" \
--date-color="${strPalette.normal.blue}" \
--time-color="${strPalette.normal.blue}" \
--blur 10 \
--clock \
--indicator \
--time-str="%H:%M:%S" \
--date-str="%a %e %b %Y" \
--verif-text="Verifying..." \
--wrong-text="Auth Failed" \
--noinput="No Input" \
--lock-text="Locking..." \
--lockfailed="Lock Failed" \
--time-font="${font.name}" \
--date-font="${font.name}" \
--layout-font="${font.name}" \
--verif-font="${font.name}" \
--wrong-font="${font.name}" \
--radius=120 \
--ring-width=20 \
--pass-media-keys \
--pass-screen-keys \
--pass-volume-keys \
--nofork
''

View file

@ -3,7 +3,6 @@
, fetchFromGitHub
, sddm
, qt5
,
}:
stdenv.mkDerivation {
pname = "sddm-sugar-dark";

View file

@ -3,7 +3,6 @@
, fetchFromGitHub
, fira-mono
, wallpaper ? null
,
}:
with lib;
stdenv.mkDerivation {

View file

@ -1,26 +0,0 @@
{ feh
, glib
, findutils
, gnugrep
, coreutils
, writeScriptBin
, backgrounds_directory ? "$HOME/Immagini/Sfondi"
,
}:
let
find = "${findutils}/bin/find";
grep = "${gnugrep}/bin/grep";
shuf = "${coreutils}/bin/shuf";
in
writeScriptBin "update-background" ''
#!/bin/sh
if [ $# -eq 0 ]; then
image=`${find} ${backgrounds_directory} -type f | ${grep} -v "/\." | ${shuf} -n 1`
else
image="$1"
fi
echo "image: $image"
${feh}/bin/feh --bg-fill --no-fehbg "$image"
${glib}/bin/gsettings set org.gnome.desktop.background picture-uri "file://$image"
true
''

View file

@ -1,35 +1,32 @@
{ lib
, rice
, roboto
{ roboto
, swaylock
, writeScriptBin
, font ? {
package = roboto;
name = "Roboto";
, font ? { package = roboto; name = "Roboto"; size = 10; }
, colors ? {
base = "000000ff";
inside = { ver = "00ff00ff"; wrong = "ff0000ff"; base = "000000ff"; };
ring = { ver = "10ff10ff"; wrong = "ff1010ff"; base = "1010ffff"; };
key.hl = "ff1010ff";
bs.hl = "ff1010ff";
separator = "000000ff";
}
, wallpaper ? ../../wallpapers/n8ca4obsys991.png
, palette ? rice.palette.palette { }
, ...
}:
let
strPalette = lib.nix-rice.palette.toRgbaShortHex palette;
in
writeScriptBin "wl-lockscreen" ''
}: writeScriptBin "wl-lockscreen" ''
# Using font package ${font.package}
${swaylock}/bin/swaylock \
--color "${strPalette.primary.background}" \
--inside-ver-color "${strPalette.normal.green}" \
--inside-wrong-color "${strPalette.normal.red}" \
--inside-color "${strPalette.normal.black}" \
--ring-ver-color "${strPalette.bright.green}" \
--ring-wrong-color "${strPalette.bright.red}" \
--ring-ver-color "${strPalette.bright.green}" \
--ring-wrong-color "${strPalette.bright.red}" \
--ring-color "${strPalette.bright.blue}" \
--color "${colors.base}" \
--inside-ver-color "${colors.inside.ver}" \
--inside-wrong-color "${colors.inside.wrong}" \
--inside-color "${colors.inside.base}" \
--ring-ver-color "${colors.ring.ver}" \
--ring-wrong-color "${colors.ring.wrong}" \
--ring-ver-color "${colors.ring.ver}" \
--ring-wrong-color "${colors.ring.wrong}" \
--ring-color "${colors.ring.base}" \
--line-uses-ring \
--key-hl-color "${strPalette.bright.red}" \
--bs-hl-color "${strPalette.bright.red}" \
--separator-color "${strPalette.normal.black}" \
--key-hl-color "${colors.key.hl}" \
--bs-hl-color "${colors.bs.hl}" \
--separator-color "${colors.separator}" \
--font "${font.name}" \
--font-size "${toString font.size}" \
--image "${toString wallpaper}" \