This commit is contained in:
Viyurz 2024-10-21 13:57:40 +02:00
parent aef6d8f485
commit f9166152eb
Signed by: Viyurz
SSH key fingerprint: SHA256:IskOHTmhHSJIvAt04N6aaxd5SZCVWW1Guf9tEcxIMj8
4 changed files with 32 additions and 12 deletions

View file

@ -18,6 +18,9 @@
.bar > * > *:nth-child(even) {
color: $accent1;
.disabled {
color: $disabled;
}
scale trough {
background-color: $background1;
}
@ -28,6 +31,9 @@
.bar > * > *:nth-child(odd) {
color: $accent2;
.disabled {
color: $disabled2;
}
scale trough {
background-color: $disabled2;
}

View file

@ -1,5 +1,5 @@
; Brightness
(defpoll brightness :interval "1m" "cat /sys/class/backlight/amdgpu_bl1/brightness")
(deflisten brightness :initial "128" "while :; do cat /sys/class/backlight/amdgpu_bl1/brightness; sleep 0.1; done")
(defvar brightness-icons '["", "", "", "", "", "", "", "", "", "", "", "", "", "", ""]')
(defvar brightness-slide false)
@ -8,17 +8,20 @@
; DateTime
(defpoll datetime :interval "1s" "date +'%a %e %b %X'")
(defpoll month :interval "1m" "date +'%m'")
(defpoll day :interval "1m" "date +'%d'")
(defpoll year :interval "1m" "date +'%Y'")
(defpoll month :interval "1m" :initial "0" "date +'%m'")
(defpoll day :interval "1m" :initial "0" "date +'%d'")
(defpoll year :interval "1m" :initial "0" "date +'%Y'")
; Window Title
(deflisten window-title "hyprctl activewindow -j | jq --raw-output .title; socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}'")
(deflisten window-title "~/.config/eww/scripts/get-window-title.sh")
; Workspaces
(deflisten workspaces "~/.config/eww/scripts/get-workspaces.sh")
(deflisten workspaces :initial "[]" "~/.config/eww/scripts/get-workspaces.sh")
(deflisten active-workspace "~/.config/eww/scripts/get-active-workspace.sh")
; Notifications status
(deflisten nf-enabled :initial "true" "while :; do makoctl mode | grep -q dnd && echo true || echo false; sleep 0.1; done")
; Widgets
@ -30,6 +33,7 @@
:icon-size 16
:class "systray"
)
(nf-state)
)
)
@ -46,6 +50,13 @@
)
)
(defwidget nf-state []
(eventbox :onclick "makoctl mode -t dnd"
(label :text "${nf-enabled ? "󰂚" : "󰂛"} NF"
:class "${nf-enabled ? "" : "disabled"}"
)
)
)
(defwidget bar-middle []
(label :limit-width 2
@ -57,7 +68,7 @@
(defwidget bar-right []
(box :halign "end"
:space-evenly false
(brightness :brightness {brightness})
(brightness)
(battery :percent {EWW_BATTERY.BAT0.capacity}
:status {EWW_BATTERY.BAT0.status}
)
@ -76,7 +87,7 @@
)
)
(defwidget brightness [brightness]
(defwidget brightness []
(eventbox :onhover "${EWW_CMD} update brightness-slide=true"
:onhoverlost "${EWW_CMD} update brightness-slide=false"
(box :space-evenly false
@ -86,7 +97,7 @@
(scale :value {brightness}
:min 0
:max 255
:onchange "echo {} > /sys/class/backlight/amdgpu_bl1/brightness; eww update brightness={}"
:onchange "echo {} > /sys/class/backlight/amdgpu_bl1/brightness"
)
)
)

View file

@ -0,0 +1,3 @@
#!/bin/sh
hyprctl activewindow -j | jq --raw-output .title
socat -u UNIX-CONNECT:$XDG_RUNTIME_DIR/hypr/$HYPRLAND_INSTANCE_SIGNATURE/.socket2.sock - | stdbuf -o0 awk -F '>>|,' '/^activewindow>>/{print $3}'

View file

@ -8,7 +8,7 @@ binde = $mainMod_SHIFT, V, togglesplit,
bind = $mainMod, L, exec, loginctl lock-session
bind = $mainMod, F, fullscreen
bind = $mainMod_SHIFT, N, exec, $HOME/.config/waybar/dnd-toggle.sh; pkill -SIGRTMIN+2 waybar
bind = $mainMod_SHIFT, N, exec, makoctl mode -t dnd
bind = $mainMod, R, exec, wofi --show run
bind = $mainMod, E, exec, thunar
binde = $mainMod_SHIFT, T, exec, kitty
@ -71,8 +71,8 @@ binde = , XF86AudioRaiseVolume, exec, swayosd-client --output-volume=raise
binde = , XF86AudioLowerVolume, exec, swayosd-client --output-volume=lower
binde = , XF86AudioMute, exec, swayosd-client --output-volume=mute-toggle
binde = , XF86AudioMicMute, exec, swayosd-client --input-volume=mute-toggle
bindel = , XF86MonBrightnessUp, exec, swayosd-client --brightness raise; eww update brightness=$(cat /sys/class/backlight/amdgpu_bl1/brightness)
bindel = , XF86MonBrightnessDown, exec, swayosd-client --brightness lower; eww update brightness=$(cat /sys/class/backlight/amdgpu_bl1/brightness)
bindel = , XF86MonBrightnessUp, exec, swayosd-client --brightness raise
bindel = , XF86MonBrightnessDown, exec, swayosd-client --brightness lower
# Media keys
bindl = , XF86AudioPlay, exec, playerctl play-pause