dotfiles

My PC Dotfiles & Website
commit 0ed9dcbe096dfea3b87e56fcb21e97d8b761a2a7
parent 15037484e692bf9dbecc3aa34913043164d4a922
Author: maydayv7 <maydayv7@gmail.com>
Date:   Thu, 19 Jun 2025 15:48:27 +0530

feat(Hyprland): QOL Fixes
- `dunst` use pause levels
- `waybar` separate configuration for different monitors

Diffstat:

MCHANGELOG.md | 3+++
Mflake.lock | 10+++++-----
Mflake.nix | 2+-
Mmodules/gui/desktop/hyprland/apps/launcher.nix | 107+++++++++++++++++++++++++++++++++++++++++--------------------------------------
Mmodules/gui/desktop/hyprland/apps/notify.nix | 3++-
Mmodules/gui/desktop/hyprland/apps/panel.nix | 752+++++++++++++++++++++++++++++++++++++++++--------------------------------------
6 files changed, 461 insertions(+), 416 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md @@ -2,6 +2,9 @@ ### June +- Hyprland QOL Fixes + - `dunst` use pause levels + - `waybar` separate configuration for different monitors - Use `nixpkgs-wayland` - Add YT Music configuration - Add `tmux` configuration diff --git a/flake.lock b/flake.lock @@ -815,17 +815,17 @@ ] }, "locked": { - "lastModified": 1749648513, - "narHash": "sha256-2Gl1k1deCEsYHAGePJXSQzLG2GUs1QxzpQu4wpS1980=", + "lastModified": 1749648368, + "narHash": "sha256-LTK7Fu2XoUmA5zONnb6bmHCPZXWTUhNaA1a1BqOA98Y=", "owner": "H3rmt", - "repo": "hyprswitch", - "rev": "2b4243c7a32e39c53331ace08fad71c17bcf7252", + "repo": "hyprshell", + "rev": "3adc2b9aa0c4219d9eeb02ea89d1a85bf2524c7f", "type": "github" }, "original": { "owner": "H3rmt", "ref": "hyprshell", - "repo": "hyprswitch", + "repo": "hyprshell", "type": "github" } }, diff --git a/flake.nix b/flake.nix @@ -220,7 +220,7 @@ # Launcher hyprshell = { - url = "github:H3rmt/hyprswitch?ref=hyprshell"; + url = "github:H3rmt/hyprshell?ref=hyprshell"; inputs.nixpkgs.follows = "nixpkgs"; }; }; diff --git a/modules/gui/desktop/hyprland/apps/launcher.nix b/modules/gui/desktop/hyprland/apps/launcher.nix @@ -7,66 +7,69 @@ }: { ## Launcher Configuration - user.homeConfig = { - imports = [ inputs.hyprshell.homeModules.hyprshell ]; - programs.hyprshell = { - enable = true; - systemd.enable = true; - styleFile = util.build.theme { - inherit (config.lib.stylix) colors; - file = files.hyprland.hyprshell; - }; + user = { + persist.directories = [ ".local/share/hyprshell" ]; + homeConfig = { + imports = [ inputs.hyprshell.homeModules.hyprshell ]; + programs.hyprshell = { + enable = true; + systemd.enable = true; + styleFile = util.build.theme { + inherit (config.lib.stylix) colors; + file = files.hyprland.hyprshell; + }; - settings = { - layerrules = false; + settings = { + layerrules = false; - launcher = { - enable = true; - default_terminal = "kitty"; - width = 700; - max_items = 4; - show_when_empty = true; - plugins = { - applications = { - run_cache_weeks = 4; - show_execs = true; - show_actions_submenu = true; + launcher = { + enable = true; + default_terminal = "kitty"; + width = 700; + max_items = 4; + show_when_empty = true; + plugins = { + applications = { + run_cache_weeks = 4; + show_execs = true; + show_actions_submenu = true; + }; + websearch.engines = [ + { + url = "https://www.google.com/search?q={}"; + name = "Google"; + key = "g"; + } + ]; }; - websearch.engines = [ - { - url = "https://www.google.com/search?q={}"; - name = "Google"; - key = "g"; - } - ]; }; - }; - windows = { - scale = 9.0; - workspaces_per_row = 3; - strip_html_from_workspace_title = true; + windows = { + scale = 9.0; + workspaces_per_row = 3; + strip_html_from_workspace_title = true; - overview = { - open = { - modifier = "super"; - key = "tab"; + overview = { + open = { + modifier = "super"; + key = "tab"; + }; + navigate = { + forward = "tab"; + reverse.mod = "shift"; + }; }; - navigate = { - forward = "tab"; - reverse.mod = "shift"; - }; - }; - switch = { - open.modifier = "alt"; - navigate = { - forward = "tab"; - reverse.mod = "shift"; - }; - other = { - hide_filtered = true; - filter_by = [ "current_workspace" ]; + switch = { + open.modifier = "alt"; + navigate = { + forward = "tab"; + reverse.mod = "shift"; + }; + other = { + hide_filtered = true; + filter_by = [ "current_workspace" ]; + }; }; }; }; diff --git a/modules/gui/desktop/hyprland/apps/notify.nix b/modules/gui/desktop/hyprland/apps/notify.nix @@ -28,9 +28,10 @@ in services.dunst = let system = { - history_ignore = "yes"; fullscreen = "show"; highlight = "#${colors.base07}"; + history_ignore = "yes"; + override_pause_level = 70; }; in { diff --git a/modules/gui/desktop/hyprland/apps/panel.nix b/modules/gui/desktop/hyprland/apps/panel.nix @@ -5,6 +5,9 @@ theme, ... }: +let + inherit (config.gui) display; +in { ## Panel Configuration user.homeConfig = { @@ -22,404 +25,439 @@ style = files.hyprland.waybar; # Panel - settings = [ - { - layer = "top"; - position = "top"; - - height = 30; - spacing = 3; - margin-top = 2; - margin-right = 5; - margin-bottom = 1; - margin-left = 5; - - modules-left = [ - "custom/logo" - "group/users" - "hyprland/workspaces" - "hyprland/submap" - "hyprland/window" - ]; - - modules-center = [ - "wlr/taskbar" - "custom/minimized" - ]; - - modules-right = [ - "group/menu" - "bluetooth" - "network" - "group/media" - "group/display" - "group/power" - "custom/weather" - "clock" - "group/notify" - ]; - - "custom/logo" = { - format = "󱄅"; - tooltip = false; - on-click = "nwg-drawer"; - }; - - "group/users" = { - orientation = "horizontal"; - modules = [ - "user" - "custom/power" - ]; - drawer.transition-left-to-right = true; - }; + settings = + let + shared = { + layer = "top"; + position = "top"; - user = { - format = "{user}"; - icon = true; height = 30; - width = 30; - open-on-click = true; - }; + spacing = 3; + margin-top = 2; + margin-right = 5; + margin-bottom = 1; + margin-left = 5; + + "custom/logo" = { + format = "󱄅"; + tooltip = false; + on-click = "nwg-drawer"; + }; - "custom/power" = { - format = "⏻"; - tooltip = false; - on-click = "wlogout -p layer-shell"; - }; + "group/users" = { + orientation = "horizontal"; + modules = [ + "user" + "custom/power" + ]; + drawer.transition-left-to-right = true; + }; - "hyprland/workspaces" = { - all-outputs = false; - show-special = true; - format = "<small>{name}</small>{icon}"; - on-scroll-up = "hyprctl dispatch workspace m+1"; - on-scroll-down = "hyprctl dispatch workspace m-1"; - ignore-workspaces = [ - "special:scratch_.*" - "special:minimized" - ]; - format-icons = { - default = ""; - special = " "; - "1" = " "; - "2" = " "; - "3" = " "; - "4" = " "; - "5" = " "; - "6" = " "; - "7" = " "; - "8" = " "; - "9" = " "; + user = { + format = "{user}"; + icon = true; + height = 30; + width = 30; + open-on-click = true; }; - }; - "hyprland/submap" = { - always-on = false; - tooltip = false; - format = " {}"; - on-click = "hyprctl dispatch submap reset"; - }; + "custom/power" = { + format = "⏻"; + tooltip = false; + on-click = "wlogout -p layer-shell"; + }; - "hyprland/window" = { - format = "{class}"; - icon = false; - separate-outputs = true; - }; + "hyprland/workspaces" = { + all-outputs = false; + show-special = true; + format = "<small>{name}</small>{icon}"; + on-scroll-up = "hyprctl dispatch workspace m+1"; + on-scroll-down = "hyprctl dispatch workspace m-1"; + ignore-workspaces = [ + "special:scratch_.*" + "special:minimized" + ]; + format-icons = { + default = ""; + special = " "; + "1" = " "; + "2" = " "; + "3" = " "; + "4" = " "; + "5" = " "; + "6" = " "; + "7" = " "; + "8" = " "; + "9" = " "; + }; + }; - "wlr/taskbar" = { - format = "{icon}"; - icon-size = 20; - all-outputs = false; - active-first = false; - icon-theme = theme.icons.name; - markup = true; - tooltip-format = "Name: <big><b>{name}</b></big> <i>{short_state}</i>\nTitle: <b>{title}</b>"; - on-click = "activate"; - on-click-middle = "minimize"; - on-click-right = "close"; - ignore-list = [ - "kitty-clip" - "kitty-dropterm" - ]; - }; + "hyprland/submap" = { + always-on = false; + tooltip = false; + format = " {}"; + on-click = "hyprctl dispatch submap reset"; + }; - "custom/minimized" = { - format = ""; - on-click = "hyprutils toggle minimized"; - }; + "hyprland/window" = { + format = "{class}"; + icon = false; + separate-outputs = true; + }; - "group/menu" = { - orientation = "horizontal"; - modules = [ - "custom/hide" - "keyboard-state" - "tray" - ]; - drawer = { - click-to-reveal = true; - transition-left-to-right = true; + "wlr/taskbar" = { + format = "{icon}"; + icon-size = 20; + all-outputs = false; + active-first = false; + icon-theme = theme.icons.name; + markup = true; + tooltip-format = "Name: <big><b>{name}</b></big> <i>{short_state}</i>\nTitle: <b>{title}</b>"; + on-click = "activate"; + on-click-middle = "minimize"; + on-click-right = "close"; + ignore-list = [ + "kitty-clip" + "kitty-dropterm" + ]; }; - }; - "custom/hide" = { - format = ""; - tooltip = false; - }; + "custom/minimized" = { + format = ""; + on-click = "hyprutils toggle minimized"; + }; - tray.icon-size = 14; - keyboard-state = { - numlock = true; - capslock = true; - format = { - numlock = " N {icon}"; - capslock = "󰪛 {icon}"; + "group/menu" = { + orientation = "horizontal"; + modules = [ + "custom/hide" + "keyboard-state" + "tray" + ]; + drawer = { + click-to-reveal = true; + transition-left-to-right = true; + }; }; - format-icons = { - locked = ""; - unlocked = ""; + + "custom/hide" = { + format = ""; + tooltip = false; }; - }; - bluetooth = { - format = ""; - format-disabled = "󰂳"; - format-connected = "󰂱 {num_connections}"; - tooltip-format = " {status}"; - tooltip-format-connected = "{device_enumerate}"; - tooltip-format-enumerate-connected = " {device_alias} 󰂄 {device_battery_percentage}%"; - on-click = "overskride"; - }; + tray.icon-size = 14; + keyboard-state = { + numlock = true; + capslock = true; + format = { + numlock = " N {icon}"; + capslock = "󰪛 {icon}"; + }; + format-icons = { + locked = ""; + unlocked = ""; + }; + }; - network = - let - tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; - in - { - format = "{ifname}"; - format-disconnected = "󰌙"; - format-wifi = "{icon}"; - format-ethernet = "󰌘"; - format-icons = [ - "󰤯" - "󰤟" - "󰤢" - "󰤥" - "󰤨" + bluetooth = { + format = ""; + format-disabled = "󰂳"; + format-connected = "󰂱 {num_connections}"; + tooltip-format = " {status}"; + tooltip-format-connected = "{device_enumerate}"; + tooltip-format-enumerate-connected = " {device_alias} 󰂄 {device_battery_percentage}%"; + on-click = "overskride"; + }; + + network = + let + tooltip = "Strength: <b>{signaldBm}dBm ({signalStrength}%)</b>\nFrequency: <b>{frequency}MHz</b>\nInterface: <b>{ifname}</b>\nIP: <b>{ipaddr}/{cidr}</b>\nGateway: <b>{gwaddr}</b>\nNetmask: <b>{netmask}</b>"; + in + { + format = "{ifname}"; + format-disconnected = "󰌙"; + format-wifi = "{icon}"; + format-ethernet = "󰌘"; + format-icons = [ + "󰤯" + "󰤟" + "󰤢" + "󰤥" + "󰤨" + ]; + format-linked = "󰈁 {ifname}"; + tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; + tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; + tooltip-format-disconnected = "󰌙 Disconnected"; + on-click = "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'"; + }; + + "group/media" = { + orientation = "horizontal"; + modules = [ + "wireplumber" + "mpris" ]; - format-linked = "󰈁 {ifname}"; - tooltip-format-wifi = "Network: <big><b>{essid}</b></big>\n${tooltip}"; - tooltip-format-ethernet = "Network: <big><b>Wired</b></big>\n${tooltip}"; - tooltip-format-disconnected = "󰌙 Disconnected"; - on-click = "sh -c 'env XDG_CURRENT_DESKTOP=GNOME gnome-control-center wifi'"; + drawer = { + transition-left-to-right = false; + transition-duration = 1000; + }; }; - "group/media" = { - orientation = "horizontal"; - modules = [ - "wireplumber" - "mpris" - ]; - drawer = { - transition-left-to-right = false; - transition-duration = 1000; + wireplumber = { + max-volume = 150; + scroll-step = 1; + reverse-scrolling = 1; + format = "{icon}"; + tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; + format-icons = [ + "󰕿" + "󰖀" + "󰕾" + ]; + format-muted = ""; + on-click = "pavucontrol"; }; - }; - wireplumber = { - max-volume = 150; - scroll-step = 1; - reverse-scrolling = 1; - format = "{icon}"; - tooltip-format = "Volume: {volume}%\nDevice: {node_name}"; - format-icons = [ - "󰕿" - "󰖀" - "󰕾" - ]; - format-muted = ""; - on-click = "pavucontrol"; - }; + mpris = { + dynamic-len = 20; + dynamic-order = [ + "title" + "artist" + "length" + ]; + dynamic-separator = " - "; + format = " {player}"; + format-paused = "󰏤 <i>{player}</i>"; + format-stopped = ""; + tooltip-format-stopped = "Not Playing"; + on-click = "hyprutils media toggle"; + on-click-right = "hyprutils media next"; + on-click-middle = "hyprutils media previous"; + }; - mpris = { - dynamic-len = 20; - dynamic-order = [ - "title" - "artist" - "length" - ]; - dynamic-separator = " - "; - format = " {player}"; - format-paused = "󰏤 <i>{player}</i>"; - format-stopped = ""; - tooltip-format-stopped = "Not Playing"; - on-click = "hyprutils media toggle"; - on-click-right = "hyprutils media next"; - on-click-middle = "hyprutils media previous"; - }; + "group/display" = { + orientation = "horizontal"; + modules = [ + "backlight" + "custom/temperature" + ]; + drawer.transition-left-to-right = false; + }; - "group/display" = { - orientation = "horizontal"; - modules = [ - "backlight" - "custom/temperature" - ]; - drawer.transition-left-to-right = false; - }; + backlight = { + format = "{icon}"; + tooltip-format = "Backlight: {percent}%"; + format-icons = [ + "" + "" + "" + "" + "" + "" + "" + "" + "" + ]; + on-scroll-up = "hyprutils brightness down"; + on-scroll-down = "hyprutils brightness up"; + on-click = "nwg-displays"; + }; - backlight = { - format = "{icon}"; - tooltip-format = "Backlight: {percent}%"; - format-icons = [ - "" - "" - "" - "" - "" - "" - "" - "" - "" - ]; - on-scroll-up = "hyprutils brightness down"; - on-scroll-down = "hyprutils brightness up"; - on-click = "nwg-displays"; - }; + "custom/temperature" = { + format = ""; + tooltip = false; + on-scroll-up = "hyprutils temperature up"; + on-scroll-down = "hyprutils temperature down"; + on-click = "hyprutils temperature reset"; + }; - "custom/temperature" = { - format = ""; - tooltip = false; - on-scroll-up = "hyprutils temperature up"; - on-scroll-down = "hyprutils temperature down"; - on-click = "hyprutils temperature reset"; - }; + "group/power" = { + orientation = "horizontal"; + modules = [ + "battery" + "power-profiles-daemon" + ]; + drawer.transition-left-to-right = false; + }; - "group/power" = { - orientation = "horizontal"; - modules = [ - "battery" - "power-profiles-daemon" - ]; - drawer.transition-left-to-right = false; - }; + battery = { + interval = 5; + align = 0; + rotate = 0; + format = "{icon}"; + tooltip-format = "Battery: {capacity}%"; + format-charging = ""; + format-icons = [ + "" + "" + "" + "" + "" + ]; + on-click-right = "hyprutils toggle fancy"; + states = { + good = 80; + warning = 20; + critical = 10; + }; + }; - battery = { - interval = 5; - align = 0; - rotate = 0; - format = "{icon}"; - tooltip-format = "Battery: {capacity}%"; - format-charging = ""; - format-icons = [ - "" - "" - "" - "" - "" - ]; - on-click-right = "hyprutils toggle fancy"; - states = { - good = 80; - warning = 20; - critical = 10; + power-profiles-daemon = { + format = "{icon}"; + tooltip = true; + tooltip-format = "Power Profile: {profile}"; + format-icons = { + default = ""; + performance = "󱄟"; + balanced = ""; + power-saver = ""; + }; }; - }; - power-profiles-daemon = { - format = "{icon}"; - tooltip = true; - tooltip-format = "Power Profile: {profile}"; - format-icons = { - default = ""; - performance = "󱄟"; - balanced = ""; - power-saver = ""; + "custom/weather" = { + format = "{}°"; + return-type = "json"; + exec = "wttrbar --date-format %d/%m --nerd"; + tooltip = true; + interval = 3600; + signal = 7; + on-click = "pkill -RTMIN+7 waybar"; }; - }; - "custom/weather" = { - format = "{}°"; - return-type = "json"; - exec = "wttrbar --date-format %d/%m --nerd"; - tooltip = true; - interval = 3600; - signal = 7; - on-click = "pkill -RTMIN+7 waybar"; - }; + clock = { + interval = 1; + format = "󰅐 {:%H:%M:%S} "; + format-alt = "󰅐 {:%I:%M  %A, %d %B %Y} "; + tooltip-format = "<tt><small>{calendar}</small></tt>"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "left"; + on-scroll = 1; + format = with config.lib.stylix.colors; { + months = "<span color='#${base06}'><b>{}</b></span>"; + days = "<span color='#${base05}'><b>{}</b></span>"; + weeks = "<span color='#${base0C}'><b>W{}</b></span>"; + weekdays = "<span color='#${base0A}'><b>{}</b></span>"; + today = "<span color='#${base08}'><b><u>{}</u></b></span>"; + }; + }; - clock = { - interval = 1; - format = "󰅐 {:%H:%M:%S} "; - format-alt = "󰅐 {:%I:%M  %A, %d %B %Y} "; - tooltip-format = "<tt><small>{calendar}</small></tt>"; - calendar = { - mode = "year"; - mode-mon-col = 3; - weeks-pos = "left"; - on-scroll = 1; - format = with config.lib.stylix.colors; { - months = "<span color='#${base06}'><b>{}</b></span>"; - days = "<span color='#${base05}'><b>{}</b></span>"; - weeks = "<span color='#${base0C}'><b>W{}</b></span>"; - weekdays = "<span color='#${base0A}'><b>{}</b></span>"; - today = "<span color='#${base08}'><b><u>{}</u></b></span>"; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_down"; + on-scroll-down = "shift_up"; }; }; - actions = { - on-click-right = "mode"; - on-click-forward = "tz_up"; - on-click-backward = "tz_down"; - on-scroll-up = "shift_down"; - on-scroll-down = "shift_up"; + "group/notify" = { + orientation = "horizontal"; + modules = [ + "custom/dunst" + "idle_inhibitor" + ]; + drawer.transition-left-to-right = false; }; - }; - - "group/notify" = { - orientation = "horizontal"; - modules = [ - "custom/dunst" - "idle_inhibitor" - ]; - drawer.transition-left-to-right = false; - }; - "custom/dunst" = { - tooltip = false; - on-click = "dunstctl history-pop"; - on-click-right = "dunstctl set-paused toggle"; - restart-interval = 1; - exec = - with pkgs; - "${ - writeShellApplication { - name = "notify"; - runtimeInputs = [ - coreutils - dunst - ]; - text = '' - COUNT=$(dunstctl count waiting) - ENABLED="" - DISABLED="" - if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi - if dunstctl is-paused | grep -q "false" ; then echo "$ENABLED"; else echo "$DISABLED"; fi - ''; - } - }/bin/notify"; - }; + "custom/dunst" = + let + run = + text: + "${ + pkgs.writeShellApplication { + name = "notify"; + inherit text; + runtimeInputs = with pkgs; [ + coreutils + dunst + ]; + } + }/bin/notify"; + in + { + tooltip = false; + on-click = "dunstctl history-pop"; + restart-interval = 1; + on-click-right = run '' + if dunstctl is-paused | grep -q "false" + then + dunstctl set-pause-level 50 + else + dunstctl set-pause-level 0 + fi + ''; + exec = run '' + COUNT=$(dunstctl count waiting) + ENABLED="" + DISABLED="" + if [ "$COUNT" != 0 ]; then DISABLED=" $COUNT"; fi + if dunstctl is-paused | grep -q "false"; then echo "$ENABLED"; else echo "$DISABLED"; fi + ''; + }; - idle_inhibitor = { - format = "{icon}"; - on-click = "hyprutils toggle service swayidle"; - tooltip-format-activated = "Idle Inhibitor: On"; - tooltip-format-deactivated = "Idle Inhibitor: Off"; - format-icons = { - activated = ""; - deactivated = ""; + idle_inhibitor = { + format = "{icon}"; + on-click = "hyprutils toggle service swayidle"; + tooltip-format-activated = "Idle Inhibitor: On"; + tooltip-format-deactivated = "Idle Inhibitor: Off"; + format-icons = { + activated = ""; + deactivated = ""; + }; }; + + modules-left = [ + "custom/logo" + "group/users" + "hyprland/workspaces" + "hyprland/submap" + "hyprland/window" + ]; + + modules-center = [ + "wlr/taskbar" + "custom/minimized" + ]; }; - } - ]; + in + [ + ( + shared + // { + output = display; + modules-right = [ + "group/menu" + "bluetooth" + "network" + "group/media" + "group/display" + "group/power" + "custom/weather" + "clock" + "group/notify" + ]; + } + ) + ( + shared + // { + output = "!" + display; + modules-right = [ + "group/menu" + "bluetooth" + "network" + "group/media" + "group/power" + "custom/weather" + "clock" + "group/notify" + ]; + } + ) + ]; }; }; }