From 65b1f11f562c0d4de89e786b699484b813ece2cc Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Sun, 31 Mar 2024 18:23:17 +0200 Subject: [PATCH] [waybar] work in progress --- apps/hyprland/hypridle.sh | 8 ++-- apps/waybar/style.css | 55 +++++++++++++++++++----- apps/waybar/waybar.conf | 49 ++++++++++----------- apps/wireguard/wireguard.sh | 8 ++-- nix/home/hyprland/hyprland-bindings.nix | 6 +-- nix/home/hyprland/hyprland-execution.nix | 2 +- nix/home/mako/mako.nix | 2 +- nix/systems/packages.nix | 2 + 8 files changed, 83 insertions(+), 49 deletions(-) diff --git a/apps/hyprland/hypridle.sh b/apps/hyprland/hypridle.sh index d1d0b47..8f10542 100755 --- a/apps/hyprland/hypridle.sh +++ b/apps/hyprland/hypridle.sh @@ -6,10 +6,10 @@ function toggle () { if pgrep "hypridle" > /dev/null then pkill hypridle - notify-send -u normal -t 4500 "🙈 Hypridle Inactive" + notify-send -u normal -t 4500 "ķ°Š Hypridle Inactive" else hypridle & - notify-send -u normal -t 4500 "🙊 Hypridle Active" + notify-send -u normal -t 4500 "ķ°¨ Hypridle Active" fi } @@ -21,9 +21,9 @@ case $1 in *) if pgrep "hypridle" > /dev/null then - icon="🙊" + icon="ķ°¨" else - icon="🙈" + icon="ķ°Š" fi printf "%s" "$icon" ;; diff --git a/apps/waybar/style.css b/apps/waybar/style.css index 1201f35..fd866ca 100644 --- a/apps/waybar/style.css +++ b/apps/waybar/style.css @@ -1,9 +1,9 @@ +/* general settings */ * { - border: 3px; border-radius: 10px; - font-family: Ubuntu, Light; + font-family: "CommitMono Nerd Font"; font-weight: normal; - font-size: 17px; + font-size: 18px; min-height: 0; } @@ -35,23 +35,58 @@ tooltip { margin: 5px 5px; margin-top: 10px; margin-bottom: 0px; - border: 2px solid #595959; + border: 0px solid #595959; } -#clock { - color: #fab387; - border: 2px solid #4771c9; -} -#pulseaudio { - margin-right: 10px; +/* left segment */ +#window { + margin-left: 0px; + padding: 0px 10px; + border-radius: 0px 10px 10px 0px; } #workspaces{ margin-left: 10px; + margin-right: 0px; padding: 0px 0px; + border-radius: 10px 0px 0px 10px; } #workspaces button.active { color: #89b4fa; } + + +/* middle segment */ +#clock { + color: #fab387; + border: 2px solid #4771c9; +} + + +/* right segment */ +#tray { + border-radius: 10px 0px 0px 10px; + margin-left: 10px; + margin-right: 0px; + font-size: 20px; +} + +#backlight, +#battery, +#custom-hypridle, +#custom-wireguard, +#network { + border-radius: 0px 0px 0px 0px; + font-size: 20px; + margin-right: -3px; + margin-left: 0px; +} + +#pulseaudio { + border-radius: 0px 10px 10px 0px; + font-size: 20px; + margin-left: 0px; + margin-right: 10px; +} diff --git a/apps/waybar/waybar.conf b/apps/waybar/waybar.conf index 0360b61..1be895c 100644 --- a/apps/waybar/waybar.conf +++ b/apps/waybar/waybar.conf @@ -20,7 +20,6 @@ ], "modules-right": [ - "custom/spotify", "tray", "custom/hypridle", "custom/wireguard", @@ -35,12 +34,10 @@ "device": "intel_backlight", "format": "{icon} {percent}%", "format-icons": [ - "🔅", - "🔆", - "☀ī¸" + "ķ°ƒž", + "ķ°ƒŸ", + "ķ°ƒ " ], - "max-length": 7, - "min-length": 7, "on-scroll-up": "brightnessctl set 5%+", "on-scroll-down": "brightnessctl set 5%-" }, @@ -54,30 +51,30 @@ "format": "{icon} {capacity}%", "format-full": "{icon}", "format-icons": [ - "đŸĒĢ", - "đŸĒĢ", - "đŸĒĢ", - "🔋", - "🔋" + "ī‰„", + "ī‰ƒ", + "ī‰‚", + "ī‰", + "ī‰€" ], }, "clock": { - "format": "{:🕒 %R 🗓ī¸ %d-%m}", + "format": "{:ī€— %R īŗ %d-%m}", "timezones": ["Europe/Amsterdam", "Asia/Kolkata"], "actions": { "on-click": "tz_down" }, "tooltip-format": "{calendar}" }, "custom/hypridle": { - "interval": 2, + "interval": 1, "format": "{}", "exec": "$HOME/.dotfiles/apps/hyprland/hypridle.sh", "on-click": "$HOME/.dotfiles/apps/hyprland/hypridle.sh toggle" }, "custom/wireguard": { - "interval": 2, + "interval": 1, "format": "{}", "exec": "$HOME/.dotfiles/apps/wireguard/wireguard.sh status", "on-click": "$HOME/.dotfiles/apps/wireguard/wireguard.sh switch" @@ -107,26 +104,26 @@ "network": { "tooltip": true, - "format-wifi": "📡", - "format-ethernet": "🌐", + "format-wifi": "ķ°Ŗļ", + "format-ethernet": "ķ°ą“", "tooltip-format-wifi": "SSID: {essid}\nSignal Strength: {signalStrength}%\nIP: {ipaddr}\nNetmask: {netmask} (/{cidr})\nGateway: {gwaddr}", "tooltip-format-ethernet": "IP: {ipaddr}\nNetmask: {netmask} (/{cidr})\nGateway: {gwaddr}", "on-click": "alacritty --class nmtui --command ~/.dotfiles/apps/hyprland/nmtui.sh" }, "pulseaudio": { - "format": "{icon} {volume:2}%", - "format-muted": "🔇", + "format": "{icon} ", + "format-muted": "ķ°– ", "format-icons": { - "headphones": "🎧", - "default": [ - "🔉", - "🔊" - ] - }, + "headphone": "ī€¨", + "hands-free": "ī–", + "headset": "ī–", + "phone": "ī‚•", + "portable": "ī‚•", + "car": "ī†š", + "default": ["ī€Ļ", "ī€§", "ī€¨"] + }, "scroll-step": 5, - "max-length": 8, - "min-length": 8, "on-click": "easyeffects" }, diff --git a/apps/wireguard/wireguard.sh b/apps/wireguard/wireguard.sh index c140eec..36f396f 100755 --- a/apps/wireguard/wireguard.sh +++ b/apps/wireguard/wireguard.sh @@ -11,16 +11,16 @@ status_vpn () { # check for tailscale status if echo "$tailscale_status" | grep "$hostname_short" &> /dev/null; then - vpn_status+='🔒 ' + vpn_status+='ī” ' else - vpn_status+='🔓 ' + vpn_status+='ī”“ ' fi # check for direct connectivity if "$tailscale_bin" status | grep allegro | grep direct &> /dev/null; then - vpn_status+='✅' + vpn_status+='ķ°ž' else - vpn_status+='⚠ī¸' + vpn_status+='ķą€€' fi echo "$vpn_status" diff --git a/nix/home/hyprland/hyprland-bindings.nix b/nix/home/hyprland/hyprland-bindings.nix index c73b48f..d0605cd 100644 --- a/nix/home/hyprland/hyprland-bindings.nix +++ b/nix/home/hyprland/hyprland-bindings.nix @@ -87,9 +87,9 @@ bind = $mainMod SHIFT, right, resizeactive, 50 0 # multimedia key bindings - bind = ,XF86AudioMute, exec, wpctl set-mute @DEFAULT_SINK@ toggle - bind = ,XF86AudioRaiseVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+ - bind = ,XF86AudioLowerVolume, exec, wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%- + bind = ,XF86AudioMute, exec, pw-volume mute toggle + bind = ,XF86AudioRaiseVolume, exec, pw-volume change +5% + bind = ,XF86AudioLowerVolume, exec, pw-volume change -5% bind = ,XF86MonBrightnessDown, exec, brightnessctl set 10%- bind = ,XF86MonBrightnessUp, exec, brightnessctl set 10%+ diff --git a/nix/home/hyprland/hyprland-execution.nix b/nix/home/hyprland/hyprland-execution.nix index 2e3d038..b1508d6 100644 --- a/nix/home/hyprland/hyprland-execution.nix +++ b/nix/home/hyprland/hyprland-execution.nix @@ -26,7 +26,7 @@ exec = ~/.dotfiles/apps/wallpaper/startup.sh # set volume - exec-once = wpctl set-volume @DEFAULT_AUDIO_SINK@ 80% + exec-once = pw-volume change 80% # solaar exec-once = ~/.dotfiles/apps/hyprland/startup/solaar.sh diff --git a/nix/home/mako/mako.nix b/nix/home/mako/mako.nix index 5b44c01..c1983ca 100644 --- a/nix/home/mako/mako.nix +++ b/nix/home/mako/mako.nix @@ -16,7 +16,7 @@ margin = "10,10,10"; # theme - font = "Ubuntu Light 12"; + font = "CommitMono Nerd Font 12"; # size width = 350; diff --git a/nix/systems/packages.nix b/nix/systems/packages.nix index a0f804d..39aebb3 100644 --- a/nix/systems/packages.nix +++ b/nix/systems/packages.nix @@ -12,8 +12,10 @@ htop intel-gpu-tools killall + nerdfonts radeontop pciutils + pw-volume powertop solaar spice-vdagent