diff --git a/config/dunst.conf b/config/dunst.conf index da4bc4e..63c019a 100644 --- a/config/dunst.conf +++ b/config/dunst.conf @@ -1,7 +1,7 @@ # https://github.com/catppuccin/dunst/blob/main/src/mocha.conf [global] -frame_color = "#89B4FA" -separator_color= frame +frame_color = "#f5c2e7" +separator_color = frame follow = "mouse" width = 300 @@ -25,41 +25,43 @@ progress_bar_max_width = 300 separator_height = 2 frame_width = 2 corner_radius = 8 -transparency = 0 +transparency = 1 gap_size = 8 line_height = 0 -notification_limit = 0 -idle_threshold = 120 -history_length = 20 -show_age_threshold = 60 markup = "full" format = "%a\n%s\n%b" font = "Atkinson Hyperlegible Pro 11" word_wrap = "yes" -sort = "yes" -shrink = "no" -indicate_hidden = "yes" -sticky_history = "yes" ignore_newline = "no" -show_indicators = "no" -stack_duplicates = true -always_run_script = true -hide_duplicate_count = false ignore_dbusclose = false -mouse_left_click = "do_action" +mouse_left_click = "do_action, close_current" mouse_middle_click = "close_all" mouse_right_click = "close_current" +sort = "update" +shrink = "no" + +notification_limit = 4 +indicate_hidden = "yes" +idle_threshold = 120 +history_length = 20 +show_age_threshold = 60 +sticky_history = "yes" +show_indicators = "yes" +stack_duplicates = true +hide_duplicate_count = false +always_run_script = true + [urgency_low] -background = "#1E1E2E" +background = "#1E1E2E30" foreground = "#CDD6F4" [urgency_normal] -background = "#1E1E2E" +background = "#1E1E2E30" foreground = "#CDD6F4" [urgency_critical] -background = "#1E1E2E" +background = "#1E1E2E30" foreground = "#CDD6F4" frame_color = "#FAB387" diff --git a/config/nwg-drawer.css b/config/nwg-drawer.css index fa7cf4b..278521a 100644 --- a/config/nwg-drawer.css +++ b/config/nwg-drawer.css @@ -10,11 +10,16 @@ window { /* search entry */ entry { background-color: alpha(@surface0, 0.5); + color: @text; } -button, image { +button, box, widget, image { background: none; - border: none + border: none; + color: @text; + text-shadow: 0 1px alpha(@base, 0.75); + box-shadow: none; + outline: none; } button { @@ -22,6 +27,6 @@ button { border-radius: 1em; } -button:hover { - background-color: alpha(@surface0, 0.5); +button:hover, button:active, box:hover, box:active { + background: alpha(@surface0, 0.5); } \ No newline at end of file diff --git a/config/waybar.css b/config/waybar.css index 3ee3ba2..5c2363c 100644 --- a/config/waybar.css +++ b/config/waybar.css @@ -4,16 +4,23 @@ min-height: 0; } +button, button:hover { + box-shadow: none; /* undo default styles */ +} + window#waybar { color: @text; + /*background: alpha(@base, 0.6);*/ background: @base; border-radius: 1em; - font-family: CozetteVector, FontAwesome, Noto Sans CJK; + /*font-family: VictorMono, Iosevka Nerd Font, Noto Sans CJK;*/ + /*font-family: 'Atkinson Hyperlegible', FontAwesome, Noto Sans CJK;*/ + font-family: CozetteVector, monospace, FontAwesome, Noto Sans CJK; font-size: 13px; font-style: normal; } -box.module, .modules-right box { +#workspaces, .modules-right box { background-color: @surface0; margin: 0 0.25em; padding: 0.15em 0.25em; @@ -39,6 +46,7 @@ box.module, .modules-right box { background-color: transparent; color: @text; padding: 0 0.4em; + transition: none; } #workspaces button:nth-child(1) { @@ -58,10 +66,23 @@ box.module, .modules-right box { background: @surface1; } +#workspaces button.focused { + box-shadow: none; +} + #workspaces button.active { background: @pink; color: @surface0; } +#workspaces button:hover { + background: rgba(255, 255, 255, 0.1); + color: @text; + box-shadow: none; +} +#workspaces button.active:hover { + background: @pink; + color: @surface0; +} #workspaces button.urgent { background: @red; @@ -115,8 +136,22 @@ window#waybar.floating #window { color: @red; } -tooltip { - color: @text; - background: @base; - border: 1px solid @pink; +#privacy { + margin: 0 0.25em; + padding: 0; } +#privacy-item { + padding: 0 1px; + color: @text; +} + +tooltip { + background: @base; + border: 1px solid @surface2; +} +tooltip * { + padding: 0px; + margin: 0px; + color: @text; + font-family: CozetteVector, monospace; +} \ No newline at end of file diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index 0a51c99..82b4f8b 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -49,11 +49,12 @@ hyprpaper.enable = true; gnome-keyring.enable = true; - polkit-gnome.enable = true; dunst.enable = true; rofi.enable = true; nwg-drawer.enable = true; waybar.enable = true; + batsignal.enable = true; + wob.enable = true; # display manager sddm.enable = true; diff --git a/modules/desktop/batsignal.nix b/modules/desktop/batsignal.nix new file mode 100644 index 0000000..c8020bf --- /dev/null +++ b/modules/desktop/batsignal.nix @@ -0,0 +1,23 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop.batsignal; +in { + options.modules.desktop.batsignal = { + enable = mkEnableOption "Enable batsignal, a battery notification service"; + package = mkOption { + type = types.package; + default = pkgs.batsignal; + }; + }; + + config = mkIf cfg.enable { + hm.wayland.windowManager.hyprland.settings.exec-once = [ + # -w 20 -c 10 -d 5 -- set battery levels + # -p -- notify on plug/unplug + # -m 2 -- set interval to 2 seconds + "${lib.getExe cfg.package} -w 20 -c 10 -d 5 -p -m 2" + ]; + }; +} \ No newline at end of file diff --git a/modules/desktop/hyprland.nix b/modules/desktop/hyprland.nix index 5b76a13..009bf72 100644 --- a/modules/desktop/hyprland.nix +++ b/modules/desktop/hyprland.nix @@ -47,7 +47,9 @@ in { systemd.variables = [ "--all" ]; - settings = { + settings = let + wobSock = config.modules.desktop.wob.sockPath; + in { source = []; "$mod" = "SUPER"; @@ -56,22 +58,31 @@ in { "$mod, mouse:272, movewindow" "$mod, mouse:273, resizewindow" ]; - bindel = [ # "bind held & locked" + bindel = (if config.modules.desktop.wob.enable then [ # "bind held & locked" + ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+ && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}" + ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%- && wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}" + ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s +5% | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}" + ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s 5%- | sed -n 's/.*(\\([0-9]*\\)%).*/\\1/p' > ${wobSock}" + ] else [ ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" ", XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-" - ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s +5%" ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} -c backlight s 5%-" - ]; - bindl = [ # "bind locked" - ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" - ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ]); + bindl = ([ # "bind locked" + ",switch:Lid Switch,exec,${lib.getExe config.modules.desktop.hyprlock.package}" ", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause" ", XF86AudioStop, exec, ${lib.getExe pkgs.playerctl} stop" ", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous" ", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next" - ]; + + ", XF86AudioMicMute, exec, wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle" + ] ++ (if config.modules.desktop.wob.enable then [ + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle && (wpctl get-volume @DEFAULT_AUDIO_SINK@ | grep -q MUTED && echo 0 > ${wobSock}) || wpctl get-volume @DEFAULT_AUDIO_SINK@ | sed 's/[^0-9]//g' > ${wobSock}" + ] else [ + ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" + ])); bindr = [ # "bind released" "SUPER, Super_L, exec, ${lib.getExe pkgs.nwg-drawer}" ]; @@ -97,16 +108,13 @@ in { ;; esac ''; - grabPasswordScript = pkgs.writeScript "grab-password" '' - ${lib.getExe pkgs.rbw} get $(${lib.getExe pkgs.zenity} --entry --text="Enter the name for your password entry to copy it to your clipboard" --title="Password") | ${lib.getExe pkgs.wl-clipboard-x11} -selection clipboard - ''; in [ "$mod, R, exec, ${lib.getExe pkgs.rofi-wayland} -show run" ", print, exec, ${screenshotScript}" "$mod, T, exec, ${lib.getExe pkgs.wezterm}" "$mod, Q, killactive, " - "$mod, V, togglefloating, " + "$mod, F, togglefloating, " "$mod, P, pseudo, " # dwindle "$mod, J, togglesplit, " # dwindle @@ -128,7 +136,9 @@ in { "$mod, bracketright, workspace, e+1" ", XF86LaunchA, exec, ${screenshotScript}" - ", XF86LaunchB, exec, ${grabPasswordScript}" + ", XF86LaunchB, exec, ${lib.getExe pkgs.rofi-rbw-wayland} -a copy -t password --clear-after 20" + + "ALT, Tab, exec, ${lib.getExe pkgs.rofi-wayland} -show window" ] ++ ( # workspaces # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} @@ -161,7 +171,11 @@ in { monitor=",highrr,auto,auto"; - exec-once = [ "${lib.getExe pkgs.networkmanagerapplet}" ]; + exec-once = [ + "${lib.getExe pkgs.networkmanagerapplet}" # network applet + "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" # polkit agent + "${lib.getExe pkgs.wl-clip-persist} --clipboard primary" # to fix wl clipboards disappearing + ]; env = [ "XCURSOR_THEME,${config.modules.desktop.themes.cursorTheme.name}" @@ -171,8 +185,8 @@ in { general = { gaps_in = 6; gaps_out = 6; - border_size = 2; - no_border_on_floating = true; + border_size = 1; + no_border_on_floating = false; layout = "dwindle"; @@ -214,14 +228,15 @@ in { "workspace 4, class:vesktop" ]; + blurls = [ + "gtk-layer-shell" + ]; + layerrule = [ "animation slide, notifications" "animation slide, waybar" - ]; - - blurls = [ - "gtk-layer-shell" # nwg-drawer - #"waybar" + "blur, notifications" + "blur, wob" ]; decoration = { @@ -253,6 +268,7 @@ in { "border, 1, 2, outExpo" "fade, 1, 3, outCubic" "workspaces, 1, 6, outExpo" + "specialWorkspace, 1, 2, outCubic, fade" ]; }; diff --git a/modules/desktop/polkit-gnome.nix b/modules/desktop/polkit-gnome.nix deleted file mode 100644 index 818395d..0000000 --- a/modules/desktop/polkit-gnome.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib, config, pkgs, ... }: - -with lib; -let - cfg = config.modules.desktop.polkit-gnome; -in { - options.modules.desktop.polkit-gnome = { - enable = mkEnableOption "Enable polkit-gnome, a simple polkit agent"; - }; - - config = mkIf cfg.enable { - systemd.user.services.polkit-gnome-authentication-agent-1 = { - description = "polkit-gnome-authentication-agent-1"; - - wantedBy = [ "graphical-session.target" ]; - wants = [ "graphical-session.target" ]; - after = [ "graphical-session.target" ]; - - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; - Restart = "on-failure"; - RestartSec = 1; - TimeoutStopSec = 10; - }; - }; - }; -} diff --git a/modules/desktop/waybar.nix b/modules/desktop/waybar.nix index 0c91d10..8430450 100644 --- a/modules/desktop/waybar.nix +++ b/modules/desktop/waybar.nix @@ -55,45 +55,38 @@ in { "memory" "power-profiles-daemon" "battery" + "privacy" ]; }; "group/power" = { orientation = "inherit"; - drawer = { - transition-duration = 200; - children-class = "not-power"; - transition-left-to-right = false; - }; modules = [ "custom/power" - "custom/lock" - "custom/reboot" - "custom/quit" ]; }; - "custom/quit" = { - format = ""; - tooltip = true; - tooltip-format = "Exit Hyprland"; - on-click = "${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exit"; - }; - "custom/lock" = { - format = ""; - tooltip = true; - tooltip-format = "Lock the system"; - on-click = "${lib.getExe config.modules.desktop.hyprlock.package}"; - }; - "custom/reboot" = { - format = "↻"; - tooltip = true; - tooltip-format = "Reboot"; - on-click = "reboot"; - }; - "custom/power" = { + "custom/power" = let + powerSelect = pkgs.writeScript "power-menu" '' + cmd=$(echo 'shutdown|reboot|lock|exit Hyprland' | ${lib.getExe pkgs.rofi-wayland} -dmenu -sep '|' -i -p 'what to do ?' -theme-str 'window { height: 132px; }') + case "$cmd" in + shutdown) + shutdown now + ;; + reboot) + reboot + ;; + lock) + ${lib.getExe config.modules.desktop.hyprlock.package} + ;; + "exit Hyprland") + ${config.modules.desktop.hyprland.package}/bin/hyprctl dispatch exit + ;; + esac + ''; + in { format = "⏻"; tooltip = true; - tooltip-format = "Power off"; - on-click = "shutdown now"; + tooltip-format = "Power menu"; + on-click = "${powerSelect}"; }; "hyprland/workspaces" = { format = "{icon}"; @@ -208,6 +201,15 @@ in { tooltip-format = "{timeTo} ({power}W)"; format-charging = " {capacity}%"; }; + privacy = { + icon-spacing = 0; + icon-size = 12; + transition-duration = 250; + modules = [ + { type = "screenshare"; } + { type = "audio-in"; } + ]; + }; clock = { format = "{:%H:%M}"; format-alt = "{:%a %b %d %R}"; diff --git a/modules/desktop/wob.nix b/modules/desktop/wob.nix new file mode 100644 index 0000000..5c0cb30 --- /dev/null +++ b/modules/desktop/wob.nix @@ -0,0 +1,49 @@ +{ lib, config, pkgs, ... }: + +with lib; +let + cfg = config.modules.desktop.wob; +in { + options.modules.desktop.wob = { + enable = mkEnableOption "Enable wob, a Wayland overlay bar"; + sockPath = mkOption { + description = "Wob sock location"; + type = types.str; + default = "$XDG_RUNTIME_DIR/wob.sock"; + }; + }; + + config = mkIf cfg.enable { + hm.wayland.windowManager.hyprland.settings.exec-once = let + path = cfg.sockPath; + script = pkgs.writeScript "launch-wob" '' + rm -f ${path} && mkfifo ${path} && tail -f ${path} | ${lib.getExe pkgs.wob} + ''; + in [ script ]; + hm.services.wob = { + enable = true; + settings = with config.colorScheme.palette; { + "" = { + timeout = 1000; + + border_offset = 2; + border_size = 2; + bar_padding = 2; + + anchor = "top"; + width = 300; + height = 30; + + margin = 12; + + border_color = "${base04}FF"; + background_color = "${base01}66"; + bar_color = "${base05}FF"; + + overflow_mode = "nowrap"; + output_mode = "focused"; + }; + }; + }; + }; +} \ No newline at end of file