From 1787103cec716c14e2d464db579d4e96f7445f29 Mon Sep 17 00:00:00 2001 From: Kabbone Date: Sun, 11 Aug 2024 19:44:14 +0200 Subject: [PATCH] wm: sway: switch to rofi add rot8 --- modules/programs/default.nix | 2 +- modules/wm/sway/default.nix | 1 + modules/wm/sway/home.nix | 88 +++++++++++++++++++++++------------- 3 files changed, 58 insertions(+), 33 deletions(-) diff --git a/modules/programs/default.nix b/modules/programs/default.nix index df309ed..ab93d24 100644 --- a/modules/programs/default.nix +++ b/modules/programs/default.nix @@ -12,7 +12,7 @@ [ ./alacritty.nix - ./rofi.nix +# ./rofi.nix ./firefox.nix #./waybar.nix #./games.nix diff --git a/modules/wm/sway/default.nix b/modules/wm/sway/default.nix index 569e90c..9ac681e 100644 --- a/modules/wm/sway/default.nix +++ b/modules/wm/sway/default.nix @@ -41,6 +41,7 @@ rocmPackages.clr clinfo waybar + rot8 ]; }; diff --git a/modules/wm/sway/home.nix b/modules/wm/sway/home.nix index 811d904..853f6d1 100644 --- a/modules/wm/sway/home.nix +++ b/modules/wm/sway/home.nix @@ -20,7 +20,7 @@ enable = true; checkConfig = false; config = rec { - menu = "${pkgs.bemenu}/bin/bemenu-run -m -1 --hf '#ffff00' --tf '#888888' --nf '#00ff40' --hb '#424242' | xargs ${pkgs.sway}/bin/swaymsg exec --"; + menu = "${pkgs.rofi}/bin/rofi -show combi -show-icons"; left = "m"; down = "n"; up = "e"; @@ -61,7 +61,7 @@ }; "DP-3" = { mode = "1920x1200"; - pos = "2560,120"; + pos = "2560,180"; }; #"eDP-1" = { # mode = "1920x1080"; @@ -88,7 +88,7 @@ }; startup = [ - #{ command = "$HOME/.config/sway/scripts/2in1screen"; } + { command = "exec ${pkgs.rot8}/bin/rot8"; } { command = "xrdb -load ~/.Xresources"; } { command = "gsettings set org.gnome.desktop.interface gtk-theme Arc"; } { command = "gsettings set org.gnome.desktop.interface icon-theme ePapirus"; } @@ -156,27 +156,28 @@ "${alt}+Shift+${right}" = "move container to workspace next, workspace next"; "XF86TouchpadToggle" = "input type:touchpad events toggle enabled disabled"; - "XF86AudioRaiseVolume" = "exec pulsemixer --change-volume +5 && ${config.cmds.notifications.volume}"; - "XF86AudioLowerVolume" = "exec pulsemixer --change-volume -5 && ${config.cmds.notifications.volume}"; - "XF86AudioMute" = "exec pulsemixer --toggle-mute && ${config.cmds.notifications.volume}"; - #"XF86AudioRaiseVolume" = "exec pulsemixer --change-volume +5"; - #"XF86AudioLowerVolume" = "exec pulsemixer --change-volume -5"; - #"XF86AudioMute" = "exec pulsemixer --toggle-mute"; - "XF86AudioMicMute" = "exec pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessDown" = "exec light -s sysfs/backlight/intel_backlight -U 5% && ${config.cmds.notifications.brightness}"; - "XF86MonBrightnessUp" = "exec light -s sysfs/backlight/intel_backlight -A 5% && ${config.cmds.notifications.brightness}"; "XF86AudioPlay" = "exec playerctl play-pause"; "XF86AudioNext" = "exec playerctl next"; "XF86AudioPrev" = "exec playerctl previous"; "XF86AudioStop" = "exec playerctl stop"; - #XF86AudioMute = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle"; - #XF86AudioRaiseVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ +5%"; - #XF86AudioLowerVolume = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%"; - #XF86AudioPlay = "exec ~/.config/waybar/scripts/toggle-play"; - #XF86AudioNext = "exec playerctl --player=spotify next"; - #XF86AudioPrev = "exec playerctl --player=spotify previous"; - + # Sink volume raise optionally with --device + "XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise"; + "XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower"; + # Sink volume toggle mute + "XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle"; + # Source volume toggle mute + "XF86AudioMicMute" = "exec swayosd-client --input-volume mute-toggle"; + + # Capslock (If you don't want to use the backend) + #bindsym --release Caps_Lock exec swayosd-client --caps-lock; + + # Brightness raise + "XF86MonBrightnessUp" = "exec swayosd-client --brightness raise"; + # Brightness lower + "XF86MonBrightnessDown" = "exec swayosd-client --brightness lower"; + + "${mod}+${left}" = "focus left"; "${mod}+${down}" = "focus down"; "${mod}+${up}" = "focus up"; @@ -263,7 +264,8 @@ ''; }; - programs.swaylock = { + programs = { + swaylock = { enable = true; settings = { color = "000000"; @@ -271,19 +273,41 @@ indicator-caps-lock = true; show-keyboard-layout = true; }; + }; + rofi = { + enable = true; + package = pkgs.rofi-wayland; + extraConfig = { + modi = "window,drun,ssh"; + kb-primary-paste = "Control+V,Shift+Insert"; + kb-secondary-paste = "Control+v,Insert"; + }; + font = "Cascadia Code"; + location = "top-left"; + plugins = [ + pkgs.rofi-calc + pkgs.rofi-bluetooth + pkgs.pinentry-rofi + ]; + terminal = "${pkgs.alacritty}/bin/alacritty"; + theme = "arthur"; + }; }; - services.swayidle = { - enable = true; - events = [ - { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; } - { event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -fF"; } - { event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } - { event = "unlock"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } - ]; - timeouts = [ - { timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; } - { timeout = 600; command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } - ]; + services = { + swayidle = { + enable = true; + events = [ + { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; } + { event = "lock"; command = "${pkgs.swaylock}/bin/swaylock -fF"; } + { event = "after-resume"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } + { event = "unlock"; command = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } + ]; + timeouts = [ + { timeout = 300; command = "${pkgs.swaylock}/bin/swaylock -fF"; } + { timeout = 600; command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'"; resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'"; } + ]; + }; + swayosd.enable = true; }; }