monitor mirroring

This commit is contained in:
Vivian 2024-04-02 17:54:13 +02:00
parent 6215afa533
commit ef35ed546e
20 changed files with 977 additions and 536 deletions

View file

@ -0,0 +1,10 @@
#!/usr/bin/env nix-shell
#! nix-shell -p jq -i bash
if makoctl mode | rg -q "do-not-disturb"; then
eww update dnd=""
makoctl mode -r do-not-disturb > /dev/null
else
eww update dnd=""
makoctl mode -a do-not-disturb > /dev/null
fi

View file

@ -0,0 +1,15 @@
#!/bin/sh
per="???"
if pamixer --get-mute | rg -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}\"}"

View file

@ -0,0 +1,11 @@
#!/bin/sh
if wpa_cli status | rg -q "wpa_state=COMPLETED"; then
icon="直"
status="Connected"
else
icon="睊"
status="offline"
fi
printf "{\"icon\": \"${icon}\", \"status\": \"${status}\"}"

View 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)

View file

@ -0,0 +1,10 @@
#!/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