Compare commits
No commits in common. "f8ebae68a113ddc9fd483ee5cd85c65463e49ec0" and "1d301d8f9fbadea2e31dfebc4d23060736f9f699" have entirely different histories.
f8ebae68a1
...
1d301d8f9f
3 changed files with 54 additions and 48 deletions
|
@ -12,10 +12,6 @@
|
|||
"swaync-client --subscribe"
|
||||
)
|
||||
|
||||
(deflisten audio-status
|
||||
"./listen/audio"
|
||||
)
|
||||
|
||||
(defvar workspaces-icon '{
|
||||
"admin": "",
|
||||
"everything": "",
|
||||
|
@ -28,24 +24,38 @@
|
|||
"dnd": ""
|
||||
}')
|
||||
|
||||
(defvar battery-icon '[
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "" },
|
||||
{ "Discharging": "", "Charging": "", "Full": "" }
|
||||
]')
|
||||
|
||||
(defvar audio-icon '[
|
||||
{ "muted": "a", "unmuted": "b" },
|
||||
{ "muted": "c", "unmuted": "d" }
|
||||
]')
|
||||
(defvar battery-icon '{
|
||||
"Discharging": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"Charging": [
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"Full": [
|
||||
"",
|
||||
""
|
||||
]
|
||||
}')
|
||||
|
||||
(defwidget workspaces []
|
||||
(box
|
||||
|
@ -99,15 +109,29 @@
|
|||
))
|
||||
)
|
||||
|
||||
(defwidget audio []
|
||||
(label
|
||||
:text ""
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget battery []
|
||||
(label
|
||||
:text "${battery-icon[round((EWW_BATTERY.BAT0.capacity - 5) / 10, 0) - 1][EWW_BATTERY.BAT0.status]} ${EWW_BATTERY.BAT0.capacity}"
|
||||
:text "${EWW_BATTERY.BAT0.capacity == 100
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][0]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 90
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][1]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 80
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][2]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 70
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][3]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 60
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][4]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 50
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][5]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 40
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][6]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 30
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][7]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 20
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][8]}"
|
||||
: EWW_BATTERY.BAT0.capacity >= 10
|
||||
? "${battery-icon[EWW_BATTERY.BAT0.status][9]}"
|
||||
: "${battery-icon[EWW_BATTERY.BAT0.status][10]}"} ${EWW_BATTERY.BAT0.capacity}%"
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -149,7 +173,6 @@
|
|||
:halign "end"
|
||||
:space-evenly false
|
||||
|
||||
(audio)
|
||||
(battery)
|
||||
)
|
||||
)
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
print_audio_status() {
|
||||
volume=$(wpctl get-volume @DEFAULT_AUDIO_SINK@)
|
||||
if echo "$volume" | grep -q 'MUTE'; then
|
||||
mute=muted
|
||||
else
|
||||
mute=unmuted
|
||||
fi
|
||||
volume=$(echo "$volume" | awk '{ print $2 }')
|
||||
printf '{"volume": %s, "status": "%s"}\n' "$volume" "$mute"
|
||||
}
|
||||
|
||||
print_audio_status
|
||||
pactl subscribe | grep --line-buffered "'change'" | while read -r _line; do
|
||||
print_audio_status
|
||||
done
|
|
@ -7,7 +7,6 @@
|
|||
home.stateVersion = "24.05";
|
||||
|
||||
home.packages = with pkgs; [
|
||||
pulseaudio
|
||||
d2
|
||||
cargo
|
||||
tinymist
|
||||
|
@ -393,7 +392,7 @@
|
|||
"Mod+WheelScrollUp".action = focus-column-left;
|
||||
"Mod+Shift+WheelScrollDown".action = move-column-right;
|
||||
"Mod+Shift+WheelScrollUp".action = move-column-left;
|
||||
"Mod+N".action = spawn "swaync-client" "--toggle-panel";
|
||||
"Mod+N".action = spawn "swaync" "--toggle-panel";
|
||||
"Mod+Tab".action = focus-workspace-previous;
|
||||
"Mod+Shift+W".action = maximize-column;
|
||||
"Mod+W".action = switch-preset-column-width;
|
||||
|
|
Loading…
Reference in a new issue