dotfiles
My PC Dotfiles & Websitegit clone https://github.com/maydayv7/dotfiles
commit 37cea61cc36e4a867e4df465a26b720d79a536e4 parent 4f139cde4ac559931e14aaadc2603aad026e6f2f Author: maydayv7 <maydayv7@gmail.com> Date: Tue, 20 Feb 2024 10:24:37 +0530 fix(Hyprland): QOL Fixes And power notifications
Diffstat:
| M | devices/vortex.nix | | | 2 | +- |
| M | files/waybar/style.css | | | 4 | ++++ |
| M | flake.lock | | | 6 | +++--- |
| M | modules/gui/desktop/hyprland/apps/default.nix | | | 70 | ++++++++++++++++++++++++++++++++++++++++------------------------------ |
| M | modules/gui/desktop/hyprland/apps/rules.nix | | | 1 | + |
| M | scripts/utils.sh | | | 15 | +++++++++------ |
6 files changed, 58 insertions(+), 40 deletions(-)
diff --git a/devices/vortex.nix b/devices/vortex.nix @@ -41,7 +41,7 @@ gui = { desktop = "hyprland"; - wallpaper = "Tetris"; + wallpaper = "Thread"; fancy = true; }; diff --git a/files/waybar/style.css b/files/waybar/style.css @@ -5,6 +5,10 @@ min-height: 0; } +window#waybar { + background-color: transparent; +} + #waybar.empty #window { background: none; } diff --git a/flake.lock b/flake.lock @@ -824,11 +824,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1706956182, - "narHash": "sha256-kxAuGT+zZ2dXxhppFCGhcgwF1qRKvQGVX15CAVC/o74=", + "lastModified": 1708403055, + "narHash": "sha256-Ibr1gWeSi7fRw53tyw/R6tyL/WjoXuXPckV6Gdf+5f4=", "owner": "maydayv7", "repo": "proprietary", - "rev": "a8b02fd790ee33a1e705e833f8eb4dde5e8bf2d8", + "rev": "6ab29b15d37c6ab0c4302ee0a18342272145062d", "type": "github" }, "original": { diff --git a/modules/gui/desktop/hyprland/apps/default.nix b/modules/gui/desktop/hyprland/apps/default.nix @@ -113,6 +113,7 @@ in { # Utilities services.playerctld.enable = true; + services.poweralertd.enable = true; # Terminal wayland.windowManager.hyprland.settings.misc.swallow_regex = "^(kitty)$"; @@ -161,36 +162,45 @@ in { services.dunst = { enable = true; iconTheme = theme.icons; - settings = { - fullscreen_delay_everything = {fullscreen = "delay";}; - global = { - alignment = "center"; - corner_radius = 10; - follow = "mouse"; - format = "<b>%s</b>\\n%b"; - frame_width = 1; - offset = "5x5"; - horizontal_padding = 8; - icon_position = "left"; - indicate_hidden = "yes"; - markup = "yes"; - max_icon_size = 64; - mouse_left_click = "do_action"; - mouse_middle_click = "close_all"; - mouse_right_click = "close_current"; - padding = 8; - plain_text = "no"; - separator_height = 1; - show_indicators = false; - shrink = "no"; - word_wrap = "yes"; - }; - utility = { - appname = "ignore"; - history_ignore = "yes"; - fullscreen = "show"; - }; - }; + settings = + { + global = { + alignment = "center"; + corner_radius = 10; + follow = "mouse"; + format = "<b>%s</b>\\n%b"; + frame_width = 1; + horizontal_padding = 8; + icon_corner_radius = 10; + icon_position = "left"; + icon_theme = theme.icons.name; + indicate_hidden = "yes"; + markup = "yes"; + max_icon_size = 64; + mouse_left_click = "do_action"; + mouse_middle_click = "close_all"; + mouse_right_click = "close_current"; + offset = "5x5"; + padding = 8; + plain_text = "no"; + progress_bar_corner_radius = 10; + separator_height = 1; + show_indicators = false; + shrink = "no"; + transparency = 10; + word_wrap = "yes"; + }; + } + // (let + ignore = { + history_ignore = "yes"; + fullscreen = "show"; + }; + in { + fullscreen_delay = {fullscreen = "delay";}; + power = {appname = "poweralertd";} // ignore; + utility = {appname = "utility";} // ignore; + }); }; systemd.user.services = { diff --git a/modules/gui/desktop/hyprland/apps/rules.nix b/modules/gui/desktop/hyprland/apps/rules.nix @@ -2,6 +2,7 @@ _: { wayland.windowManager.hyprland.settings = { ## Layer Rules layerrule = [ + "blur, waybar" "blur, ^(gtk-layer-shell)$" "xray 1, ^(gtk-layer-shell)$" "ignorealpha 0.2, ^(gtk-layer-shell)$" diff --git a/scripts/utils.sh b/scripts/utils.sh @@ -37,11 +37,13 @@ function volume_notification { volume_icon="" fi - if $show_music_in_volume_indicator + song_title=$(playerctl -f "{{title}}" metadata) + if $show_music_in_volume_indicator && [ -n "$song_title" ] then - current_song=$(playerctl -f "{{title}} - {{artist}}" metadata) + song_artist=$(playerctl -f "{{artist}}" metadata) + if [ -z "$song_artist" ]; then song_artist="Unknown"; fi if $show_album_art; then get_album_art; fi - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" -i "$album_art" "$volume_icon $volume%" "$current_song" -h string:hlcolor:#ffffff + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" -i "$album_art" "$volume_icon $volume%" "$song_title\nBy $song_artist" -h string:hlcolor:#ffffff else notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:volume -h int:value:"$volume" "$volume_icon $volume%" -h string:hlcolor:#ffffff fi @@ -50,13 +52,14 @@ function volume_notification { function music_notification { song_title=$(playerctl -f "{{title}}" metadata) song_artist=$(playerctl -f "{{artist}}" metadata) - song_album=$(playerctl -f "{{album}}" metadata) + if [ -z "$song_artist" ]; then song_artist="Unknown"; fi if $show_album_art; then get_album_art; fi + song_album=$(playerctl -f "{{album}}" metadata) if [ -z "$song_album" ] then - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "$song_artist" + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "By $song_artist" else - notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "$song_artist - $song_album" + notify-send -a "utility" -t 1000 -h string:x-dunst-stack-tag:music -i "$album_art" "$song_title" "By $song_artist from $song_album" fi }