reorganize and make work out of the box on nixos
This commit is contained in:
parent
cd7e93374e
commit
0f82dd2712
5 changed files with 16 additions and 17 deletions
16
eww/eww.yuck
16
eww/eww.yuck
|
@ -42,56 +42,56 @@
|
||||||
:widgetclass "cpu"
|
:widgetclass "cpu"
|
||||||
:hover "${round(EWW_CPU.avg, 1)}%"
|
:hover "${round(EWW_CPU.avg, 1)}%"
|
||||||
:percentage {round(EWW_CPU.avg, 1)}
|
:percentage {round(EWW_CPU.avg, 1)}
|
||||||
:image "images/cpu.png"))
|
:image "../images/cpu.png"))
|
||||||
|
|
||||||
(defwidget ram []
|
(defwidget ram []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass "ram"
|
:widgetclass "ram"
|
||||||
:hover "${round(EWW_RAM.used_mem /(1024*1024*1024), 1)} GiB | ${round(EWW_RAM.used_mem_perc, 1)}%"
|
:hover "${round(EWW_RAM.used_mem /(1024*1024*1024), 1)} GiB | ${round(EWW_RAM.used_mem_perc, 1)}%"
|
||||||
:percentage {round(EWW_RAM.used_mem_perc, 1)}
|
:percentage {round(EWW_RAM.used_mem_perc, 1)}
|
||||||
:image "images/ram.png"))
|
:image "../images/ram.png"))
|
||||||
|
|
||||||
(defwidget audio []
|
(defwidget audio []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass {volume.muted == 1 ? "muted" : "volume"}
|
:widgetclass {volume.muted == 1 ? "muted" : "volume"}
|
||||||
:hover "${volume.volume}%"
|
:hover "${volume.volume}%"
|
||||||
:percentage {volume.volume >= 0 && volume.volume <= 100 ? volume.volume : 0}
|
:percentage {volume.volume >= 0 && volume.volume <= 100 ? volume.volume : 0}
|
||||||
:image {volume.muted == 1 ? "images/volumeMuted.png" : "images/volume.png"}))
|
:image {volume.muted == 1 ? "../images/volumeMuted.png" : "../images/volume.png"}))
|
||||||
|
|
||||||
(defwidget brightness []
|
(defwidget brightness []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass "brightness"
|
:widgetclass "brightness"
|
||||||
:hover "${brightnessValue / 960}%"
|
:hover "${brightnessValue / 960}%"
|
||||||
:percentage {brightnessValue / 960}
|
:percentage {brightnessValue / 960}
|
||||||
:image "images/brightness.png"))
|
:image "../images/brightness.png"))
|
||||||
|
|
||||||
(defwidget network []
|
(defwidget network []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass "network"
|
:widgetclass "network"
|
||||||
:hover {network.name}
|
:hover {network.name}
|
||||||
:percentage "100"
|
:percentage "100"
|
||||||
:image "images/${network.image}.png"))
|
:image "../images/${network.image}.png"))
|
||||||
|
|
||||||
(defwidget bluetooth []
|
(defwidget bluetooth []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass "bluetooth"
|
:widgetclass "bluetooth"
|
||||||
:hover {bluetooth.name}
|
:hover {bluetooth.name}
|
||||||
:percentage {bluetooth.battery}
|
:percentage {bluetooth.battery}
|
||||||
:image "images/bluetooth.png"))
|
:image "../images/bluetooth.png"))
|
||||||
|
|
||||||
(defwidget battery []
|
(defwidget battery []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass {EWW_BATTERY.BAT1.status == "Charging" ? "battery" : EWW_BATTERY.total_avg > 25 ? "battery" : "batteryLow"}
|
:widgetclass {EWW_BATTERY.BAT1.status == "Charging" ? "battery" : EWW_BATTERY.total_avg > 25 ? "battery" : "batteryLow"}
|
||||||
:hover "${round(EWW_BATTERY.total_avg, 1)}%"
|
:hover "${round(EWW_BATTERY.total_avg, 1)}%"
|
||||||
:percentage {EWW_BATTERY.total_avg <= 90 ? round(EWW_BATTERY.total_avg, 1)/0.9 : 100}
|
:percentage {EWW_BATTERY.total_avg <= 90 ? round(EWW_BATTERY.total_avg, 1)/0.9 : 100}
|
||||||
:image {EWW_BATTERY.BAT1.status == "Charging" ? "images/charging.png" : EWW_BATTERY.total_avg > 25 ? "images/battery.png" : "images/batteryLow.png"}))
|
:image {EWW_BATTERY.BAT1.status == "Charging" ? "../images/charging.png" : EWW_BATTERY.total_avg > 25 ? "../images/battery.png" : "../images/batteryLow.png"}))
|
||||||
|
|
||||||
(defwidget power []
|
(defwidget power []
|
||||||
(icon
|
(icon
|
||||||
:widgetclass "power"
|
:widgetclass "power"
|
||||||
:hover "placeholder"
|
:hover "placeholder"
|
||||||
:percentage "0"
|
:percentage "0"
|
||||||
:image "images/power.png"))
|
:image "../images/power.png"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,25 +1,25 @@
|
||||||
(deflisten brightnessValue
|
(deflisten brightnessValue
|
||||||
:initial "0"
|
:initial "0"
|
||||||
`scripts/brightness.sh`)
|
`../scripts/brightness.sh`)
|
||||||
|
|
||||||
(deflisten network
|
(deflisten network
|
||||||
:initial '{"name":"No Connection","image":"n.A."}'
|
:initial '{"name":"No Connection","image":"n.A."}'
|
||||||
`sh scripts/network.sh`)
|
`../scripts/network.sh`)
|
||||||
|
|
||||||
(deflisten workspaces
|
(deflisten workspaces
|
||||||
:initial ''
|
:initial ''
|
||||||
`scripts/clients/build/clients`)
|
`../scripts/client`)
|
||||||
|
|
||||||
(defpoll bluetooth
|
(defpoll bluetooth
|
||||||
:initial '{"name":"","battery":"0"}'
|
:initial '{"name":"","battery":"0"}'
|
||||||
:interval "2s"
|
:interval "2s"
|
||||||
`sh scripts/bluetooth.sh`)
|
`../scripts/bluetooth.sh`)
|
||||||
|
|
||||||
(deflisten volume
|
(deflisten volume
|
||||||
:initial '{"volume":"0","muted":"0"}'
|
:initial '{"volume":"0","muted":"0"}'
|
||||||
`sh scripts/volume.sh`)
|
`../scripts/volume.sh`)
|
||||||
|
|
||||||
(defpoll media
|
(defpoll media
|
||||||
:initial '{"status":"","name":""}'
|
:initial '{"status":"","name":""}'
|
||||||
:interval "2s"
|
:interval "2s"
|
||||||
`scripts/media.sh`)
|
`../scripts/media.sh`)
|
||||||
|
|
BIN
scripts/client
Executable file
BIN
scripts/client
Executable file
Binary file not shown.
|
@ -244,8 +244,7 @@ int main(int argc, char const *argv[])
|
||||||
getAllWorkspaces();
|
getAllWorkspaces();
|
||||||
std::cout << workspacesOutput << std::endl;
|
std::cout << workspacesOutput << std::endl;
|
||||||
|
|
||||||
std::string socketPath = "/tmp/hypr/" + std::string(std::getenv("HYPRLAND_INSTANCE_SIGNATURE")) + "/.socket2.sock";
|
std::string socketPath = std::string(std::getenv("XDG_RUNTIME_DIR")) + "/hypr/" + std::string(std::getenv("HYPRLAND_INSTANCE_SIGNATURE")) + "/.socket2.sock";
|
||||||
|
|
||||||
|
|
||||||
// Create a socket
|
// Create a socket
|
||||||
int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
|
int sockfd = socket(AF_UNIX, SOCK_STREAM, 0);
|
||||||
|
|
|
@ -35,6 +35,6 @@ for ((i = 0; i < ${#id[@]}; i++)); do
|
||||||
|
|
||||||
monitorID=$(xrandr --listactivemonitors | grep +"${name[$i]}" | awk '{sub(/.$/,"",$1); print $1}')
|
monitorID=$(xrandr --listactivemonitors | grep +"${name[$i]}" | awk '{sub(/.$/,"",$1); print $1}')
|
||||||
|
|
||||||
eww open bar --id bar"${monitorID}" --arg monitor="${monitorID}" --arg width="${new_width}" --arg height=30
|
eww open bar --id bar"${monitorID}" --arg monitor="${monitorID}" --arg width="${new_width}" --arg height=30 --config ../eww
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue