laptop, large refactor and some new stuff
This commit is contained in:
parent
c7a2895e5a
commit
07941251b5
15 changed files with 307 additions and 492 deletions
15
nixos/hosts/thalassa/null/home/eww/scripts/volume.sh
Executable file
15
nixos/hosts/thalassa/null/home/eww/scripts/volume.sh
Executable file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
per="$(pamixer --get-volume)"
|
||||
|
||||
if pamixer --get-mute | grep -q true; then
|
||||
icon="婢"
|
||||
elif [ "$per" -gt 66 ]; then
|
||||
icon="墳" # high
|
||||
elif [ "$per" -gt 33 ]; then
|
||||
icon="奔" # med
|
||||
else
|
||||
icon="奄" #low
|
||||
fi
|
||||
|
||||
printf "{\"icon\": \"${icon}\", \"percent\": \"${per}\"}"
|
16
nixos/hosts/thalassa/null/home/eww/scripts/wifi.sh
Executable file
16
nixos/hosts/thalassa/null/home/eww/scripts/wifi.sh
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
if nmcli g | rg -q "\bconnected\b"; then
|
||||
icon=""
|
||||
ssid=$(nmcli -t -f name connection show --active)
|
||||
if echo $ssid | rg -q "Wired"; then
|
||||
status="Connected via cable"
|
||||
else
|
||||
status="Connected to ${ssid}"
|
||||
fi
|
||||
else
|
||||
icon=""
|
||||
status="offline"
|
||||
fi
|
||||
|
||||
printf "{\"icon\": \"${icon}\", \"status\": \"${status}\"}"
|
21
nixos/hosts/thalassa/null/home/eww/scripts/workspaces.lua
Executable file
21
nixos/hosts/thalassa/null/home/eww/scripts/workspaces.lua
Executable file
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env lua
|
||||
|
||||
aw = io.popen("hyprctl monitors | grep active | sed 's/()/(1)/g' | sort | awk 'NR>1{print $1}' RS='(' FS=')'")
|
||||
active_workspace = aw:read("*a")
|
||||
aw:close()
|
||||
|
||||
box = "(box :orientation \"v\" :spacing 1 :space-evenly \"true\" "
|
||||
|
||||
for i = 1,10 do
|
||||
if i == tonumber(active_workspace) then
|
||||
local btn = "(button :class \"active\" :onclick \"hyprctl dispatch workspace "..i.." \" \"\")"
|
||||
box = box .. btn
|
||||
else
|
||||
local btn = "(button :class \"inactive\" :onclick \"hyprctl dispatch workspace "..i.."\" \"\")"
|
||||
box = box .. btn
|
||||
end
|
||||
end
|
||||
|
||||
box = box .. ")"
|
||||
|
||||
print(box)
|
8
nixos/hosts/thalassa/null/home/eww/scripts/workspaces.sh
Executable file
8
nixos/hosts/thalassa/null/home/eww/scripts/workspaces.sh
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/sh
|
||||
workspaces() {
|
||||
./scripts/workspaces.lua
|
||||
}
|
||||
workspaces
|
||||
tail -f /tmp/hypr/$HYPRLAND_INSTANCE_SIGNATURE/hyprland.log | grep --line-buffered "Changed to workspace" | while read -r; do
|
||||
workspaces
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue