WIP: rice
This commit is contained in:
parent
f842c92339
commit
1096479c4a
14 changed files with 81 additions and 32 deletions
22
pkgs/clipedit/default.nix
Normal file
22
pkgs/clipedit/default.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{ 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
|
||||
''
|
||||
16
pkgs/default.nix
Normal file
16
pkgs/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs ? import <nixos> { inherit system; }
|
||||
, system ? builtins.currentSystem
|
||||
,
|
||||
}:
|
||||
let
|
||||
self = {
|
||||
clipedit = pkgs.callPackage ./clipedit { };
|
||||
cocktail-bar-cli = pkgs.callPackage ./cocktail-bar-cli { };
|
||||
lockscreen = pkgs.callPackage ./lockscreen { };
|
||||
sddm-theme-clairvoyance = pkgs.callPackage ./sddm-theme-clairvoyance { };
|
||||
sddm-sugar-dark = pkgs.callPackage ./sddm-sugar-dark { };
|
||||
update-background = pkgs.callPackage ./update-background { };
|
||||
keyboard-switch = pkgs.callPackage ./keyboard-switch { };
|
||||
};
|
||||
in
|
||||
self
|
||||
40
pkgs/keyboard-switch/default.nix
Normal file
40
pkgs/keyboard-switch/default.nix
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{ writeShellScriptBin
|
||||
, lib
|
||||
, xorg
|
||||
, libnotify
|
||||
, coreutils
|
||||
, keyboard_name ? "AT Translated Set 2 keyboard"
|
||||
,
|
||||
}:
|
||||
writeShellScriptBin "keyboard-switch" ''
|
||||
set -e
|
||||
|
||||
PATH=$PATH:"${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
xorg.xinput
|
||||
libnotify
|
||||
]
|
||||
}"
|
||||
fconfig="''${XDG_DATA_HOME:-$HOME/.local/share}/keyboard-switch.state"
|
||||
if [ ! -f $fconfig ]; then
|
||||
echo "Creating config file"
|
||||
mkdir -p `dirname $config_folder`
|
||||
echo "enabled" > $fconfig
|
||||
fi
|
||||
|
||||
read -r var< $fconfig
|
||||
echo "keyboard ${keyboard_name} is $var"
|
||||
|
||||
if [ "$var" = "disabled" ]; then
|
||||
notify-send "Enabling keyboard..." \ "Keyboard connected !";
|
||||
echo "enable keyboard..."
|
||||
xinput enable "${keyboard_name}"
|
||||
echo "enabled" > $fconfig
|
||||
elif [ "$var" = "enabled" ]; then
|
||||
notify-send "Disabling Keyboard" \ "Keyboard disconnected";
|
||||
echo "disable keyboard"
|
||||
xinput disable "${keyboard_name}"
|
||||
echo 'disabled' > $fconfig
|
||||
fi
|
||||
''
|
||||
57
pkgs/lockscreen/default.nix
Normal file
57
pkgs/lockscreen/default.nix
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{ 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
|
||||
''
|
||||
43
pkgs/sddm-sugar-dark/default.nix
Normal file
43
pkgs/sddm-sugar-dark/default.nix
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, sddm
|
||||
, qt5
|
||||
,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "sddm-sugar-dark";
|
||||
version = "2023-02-17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "MarianArlt";
|
||||
repo = "sddm-sugar-dark";
|
||||
rev = "ceb2c455663429be03ba62d9f898c571650ef7fe";
|
||||
sha256 = "sha256-flOspjpYezPvGZ6b4R/Mr18N7N3JdytCSwwu6mf4owQ=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
qt5.qtgraphicaleffects
|
||||
qt5.qtquickcontrols2
|
||||
qt5.qtsvg
|
||||
qt5.wrapQtAppsHook
|
||||
sddm
|
||||
];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/usr/share/sddm/themes/
|
||||
ln -s $src $out/usr/share/sddm/themes/sugar-dark
|
||||
''
|
||||
# + optionalString (wallpaper != null) ''
|
||||
# cp ${wallpaper} $out/usr/share/sddm/themes/clairvoyance/Assets/Background.jpg
|
||||
# ''
|
||||
;
|
||||
|
||||
meta = {
|
||||
description = "Clairvoyance theme for SDDM";
|
||||
homepage = "https://github.com/marianarlt/sddm-sugar-dark";
|
||||
license = lib.licenses.gpl3Plus;
|
||||
maintainers = [ lib.maintainers.bertof ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
38
pkgs/sddm-theme-clairvoyance/default.nix
Normal file
38
pkgs/sddm-theme-clairvoyance/default.nix
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fira-mono
|
||||
, wallpaper ? null
|
||||
,
|
||||
}:
|
||||
with lib;
|
||||
stdenv.mkDerivation {
|
||||
pname = "sddm-theme-clairvoyance";
|
||||
version = "20190530";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "eayus";
|
||||
repo = "sddm-theme-clairvoyance";
|
||||
rev = "dfc5984ff8f4a0049190da8c6173ba5667904487";
|
||||
sha256 = "sha256-AcVQpG6wPkMtAudqyu/iwZ4N6a2bCdfumCmdqE1E548=";
|
||||
};
|
||||
|
||||
buildInputs = [ fira-mono ];
|
||||
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/usr/share/sddm/themes/
|
||||
cp -a . $out/usr/share/sddm/themes/clairvoyance
|
||||
''
|
||||
+ optionalString (wallpaper != null) ''
|
||||
cp ${wallpaper} $out/usr/share/sddm/themes/clairvoyance/Assets/Background.jpg
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Clairvoyance theme for SDDM";
|
||||
homepage = "https://github.com/eayus/sddm-theme-clairvoyance";
|
||||
license = licenses.gpl3Plus;
|
||||
maintainers = [ maintainers.bertof ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
26
pkgs/update-background/default.nix
Normal file
26
pkgs/update-background/default.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{ 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
|
||||
''
|
||||
23
pkgs/wl-clipedit/default.nix
Normal file
23
pkgs/wl-clipedit/default.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ writeShellScriptBin
|
||||
, lib
|
||||
, wl-clipboard
|
||||
, coreutils
|
||||
, editor ? "hx"
|
||||
, terminal-command ? "kitty -e"
|
||||
,
|
||||
}:
|
||||
# 64 │ function clipcopy() { xclip -in -selection clipboard < "${1:-/dev/stdin}"; }
|
||||
# 65 │ function clippaste() { xclip -out -selection clipboard; } clip
|
||||
writeShellScriptBin "wl-clipedit" ''
|
||||
PATH=$PATH:"${
|
||||
lib.makeBinPath [
|
||||
coreutils
|
||||
wl-clipboard
|
||||
]
|
||||
}"
|
||||
tmp_file=$(mktemp)
|
||||
wl-paste -t 'text/plain;charset=utf-8' -n > "$tmp_file"
|
||||
${terminal-command} ''${VISUAL:-''${EDITOR:-${editor}}} "$tmp_file"
|
||||
wl-copy -t 'text/plain;charset=utf-8' -n < "$tmp_file"
|
||||
rm "$tmp_file"
|
||||
''
|
||||
39
pkgs/wl-lockscreen/default.nix
Normal file
39
pkgs/wl-lockscreen/default.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ lib
|
||||
, rice
|
||||
, roboto
|
||||
, swaylock
|
||||
, writeScriptBin
|
||||
, font ? {
|
||||
package = roboto;
|
||||
name = "Roboto";
|
||||
}
|
||||
, wallpaper ? ../../wallpapers/n8ca4obsys991.png
|
||||
, palette ? rice.palette.palette { }
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
strPalette = lib.nix-rice.palette.toRgbaShortHex palette;
|
||||
in
|
||||
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}" \
|
||||
--line-uses-ring \
|
||||
--key-hl-color "${strPalette.bright.red}" \
|
||||
--bs-hl-color "${strPalette.bright.red}" \
|
||||
--separator-color "${strPalette.normal.black}" \
|
||||
--font "${font.name}" \
|
||||
--font-size "${toString font.size}" \
|
||||
--image "${toString wallpaper}" \
|
||||
--scaling fill
|
||||
# --indicator-radius 120 \
|
||||
# --indicator-thickness 15 \
|
||||
''
|
||||
16
pkgs/wl-update-background/default.nix
Normal file
16
pkgs/wl-update-background/default.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ findutils
|
||||
, gnugrep
|
||||
, coreutils
|
||||
, writeShellScriptBin
|
||||
, swww
|
||||
, backgrounds_directory ? "$HOME/Immagini/Sfondi/1080+/1440+"
|
||||
}: writeShellScriptBin "wl-update-background" ''
|
||||
set -e
|
||||
if [ $# -eq 0 ]; then
|
||||
image=`${findutils}/bin/find ${backgrounds_directory} -type f | ${gnugrep}/bin/grep -v "/\." | ${coreutils}/bin/shuf -n 1`
|
||||
else
|
||||
image="$1"
|
||||
fi
|
||||
echo "image: $image"
|
||||
${swww}/bin/swww img "$image"
|
||||
''
|
||||
Loading…
Add table
Add a link
Reference in a new issue