From 004e036629f5ad49280c23e5cfefaad72006d60c Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Fri, 30 Dec 2022 23:29:43 +0100 Subject: [PATCH] swaylock --- home/desktop-river/default.nix | 31 ++++++++++++++++++++++++++--- home/desktop-river/init | 3 +++ home/desktop-river/swaylock.nix | 35 +++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 home/desktop-river/swaylock.nix diff --git a/home/desktop-river/default.nix b/home/desktop-river/default.nix index 0b59b0f..4947dd1 100644 --- a/home/desktop-river/default.nix +++ b/home/desktop-river/default.nix @@ -1,9 +1,34 @@ { config, pkgs, ... }: -{ - imports = [ ./bemenu.nix ./waybar.nix ./foot.nix ./mako.nix ]; +let + configure-gtk = let + schema = pkgs.gsettings-desktop-schemas; + datadir = "${schema}/share/gsettings-schemas/${schema.name}"; + gsettings = "${pkgs.glib}/bin/gsettings"; + in pkgs.writeScriptBin "configure-gtk" '' + #!${pkgs.dash}/bin/dash - home.packages = with pkgs; [ river swaybg playerctl pamixer light ]; + export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS + + ${gsettings} set org.gnome.desktop.interface gtk-theme 'gruvbox-dark' + ${gsettings} set org.gnome.desktop.interface icon-theme 'Papirus-Dark' + ${gsettings} set org.gnome.desktop.wm.preferences button-layout "" + ''; +in { + imports = [ ./bemenu.nix ./waybar.nix ./foot.nix ./mako.nix ./swaylock.nix ]; + + home.packages = with pkgs; [ + configure-gtk + glib + gsettings-desktop-schemas + light + pamixer + playerctl + river + swaybg + wl-clipboard + xdg-utils + ]; programs.zsh.loginExtra = '' [[ -z "''${DISPLAY}" ]] && [[ "$(tty)" = "/dev/tty1" ]] && \ diff --git a/home/desktop-river/init b/home/desktop-river/init index 5f502c8..2252e54 100644 --- a/home/desktop-river/init +++ b/home/desktop-river/init @@ -13,6 +13,8 @@ riverctl map normal Super+Shift C close # Super+Shift+Esc to exit river riverctl map normal Super+Shift Escape exit +riverctl map normal Super Escape spawn swaylock + # Super+J and Super+K to focus the next/previous view in the layout stack riverctl map normal Super J focus-view next riverctl map normal Super K focus-view previous @@ -157,6 +159,7 @@ riverctl csd-filter-add app-id "gedit" riverctl spawn "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river" riverctl spawn "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river" riverctl spawn "waybar" +riverctl spawn "configure-gtk" BG="$(find "$WALLPAPERS" -type f | shuf -n 1)" riverctl spawn "swaybg --image $BG --mode fill" diff --git a/home/desktop-river/swaylock.nix b/home/desktop-river/swaylock.nix new file mode 100644 index 0000000..6fdc2c3 --- /dev/null +++ b/home/desktop-river/swaylock.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + home.packages = with pkgs; [ swaylock ]; + programs.swaylock.settings = { + ignore-empty-password = true; + font = "Inter"; + + color = "282828E6"; + inside-color = "504945"; + ring-color = "504945"; + line-color = "504945"; + separator-color = "504945"; + + inside-clear-color = "FE8019"; + line-clear-color = "FE8019"; + ring-clear-color = "FE8019"; + + inside-ver-color = "458588"; + line-ver-color = "458588"; + ring-ver-color = "458588"; + + inside-wrong-color = "CC241D"; + line-wrong-color = "CC241D"; + ring-wrong-color = "CC241D"; + + key-hl-color = "B8BB26"; + bs-hl-color = "FB4934"; + + text-color = "282828"; + text-clear-color = "282828"; + text-ver-color = "282828"; + text-wrong-color = "282828"; + }; +}