mirror of
https://github.imc.re/void-land/hyprland-void-dots
synced 2025-06-05 19:43:44 +02:00
feat: playerctl and gpu status
This commit is contained in:
parent
17f46b149a
commit
85616e13f9
5 changed files with 32 additions and 10 deletions
20
hypr-configs/hyprland/eww/scripts/sys-info/get-gpu
Executable file
20
hypr-configs/hyprland/eww/scripts/sys-info/get-gpu
Executable file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
file_exists() {
|
||||||
|
if [ -f "$1" ]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
device_id="0"
|
||||||
|
gpu_busy_file="/sys/class/hwmon/hwmon$device_id/device/gpu_busy_percent"
|
||||||
|
|
||||||
|
if file_exists "$gpu_busy_file"; then
|
||||||
|
gpu_busy_percent=$(cat "$gpu_busy_file")
|
||||||
|
echo "$gpu_busy_percent"
|
||||||
|
else
|
||||||
|
echo "Error !" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
(defpoll bat0 :initial "0" :interval "30s" "bash ./scripts/sys_info --bat")
|
(defpoll bat0 :initial "0" :interval "30s" "bash ./scripts/sys_info --bat")
|
||||||
(defpoll homedir :initial "" :interval "24h" "echo ~")
|
(defpoll homedir :initial "" :interval "24h" "echo ~")
|
||||||
(defpoll theme :interval "24h" "./scripts/toggletheme")
|
(defpoll theme :interval "24h" "./scripts/toggletheme")
|
||||||
|
(defpoll gpu :interval "1s" "./scripts/sys-info/get-gpu")
|
||||||
; (defpoll cpu :interval "1s" "bash ./scripts/sys_info --cpu")
|
; (defpoll cpu :interval "1s" "bash ./scripts/sys_info --cpu")
|
||||||
; (defpoll mem :interval "1s" "bash ./scripts/sys_info --mem")
|
; (defpoll mem :interval "1s" "bash ./scripts/sys_info --mem")
|
||||||
|
|
||||||
|
@ -41,7 +42,6 @@
|
||||||
(defvar revealVolume false)
|
(defvar revealVolume false)
|
||||||
(defvar revealMicrophone false)
|
(defvar revealMicrophone false)
|
||||||
(defvar revealBrightness false)
|
(defvar revealBrightness false)
|
||||||
(defvar revealControlpanel false)
|
|
||||||
(defvar revealSystray true)
|
(defvar revealSystray true)
|
||||||
|
|
||||||
; Dock
|
; Dock
|
||||||
|
@ -65,9 +65,9 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
; Playerctl
|
; Playerctl
|
||||||
(defpoll pstatus :initial "" :interval "1s" "playerctl status")
|
(deflisten pstatus :initial "" "playerctl status -F")
|
||||||
(defpoll psong :initial "" :interval "1s" "playerctl metadata --format '{{ title }}'")
|
(deflisten psong :initial "" "playerctl metadata -F --format '{{ title }}'")
|
||||||
(defpoll partist :initial "" :interval "1s" "playerctl metadata --format '{{ artist }}'")
|
(deflisten partist :initial "" "playerctl metadata -F --format '{{ artist }}'")
|
||||||
(deflisten pcover "./scripts/pollcover.sh")
|
(deflisten pcover "./scripts/pollcover.sh")
|
||||||
(deflisten ptime
|
(deflisten ptime
|
||||||
:initial '{
|
:initial '{
|
||||||
|
@ -79,6 +79,7 @@
|
||||||
;; (deflisten pside "playerctl -F metadata -f '{ \"volume\": {{volume*100}}, \"shuffle\": \"{{shuffle}}\", \"loop\": \"{{loop}}\" }'")
|
;; (deflisten pside "playerctl -F metadata -f '{ \"volume\": {{volume*100}}, \"shuffle\": \"{{shuffle}}\", \"loop\": \"{{loop}}\" }'")
|
||||||
|
|
||||||
; Controlpanel
|
; Controlpanel
|
||||||
|
(defvar revealControlpanel false)
|
||||||
(defvar revealWeather false)
|
(defvar revealWeather false)
|
||||||
(deflisten timerdis "./scripts/timer.py subscribe")
|
(deflisten timerdis "./scripts/timer.py subscribe")
|
||||||
(defpoll hostname :initial "idk" :interval "24h" 'echo "$(whoami)"')
|
(defpoll hostname :initial "idk" :interval "24h" 'echo "$(whoami)"')
|
||||||
|
@ -111,7 +112,7 @@
|
||||||
"hourly": []
|
"hourly": []
|
||||||
}'
|
}'
|
||||||
:interval "1h"
|
:interval "1h"
|
||||||
:run-while revealcontrolpanel
|
:run-while revealControlpanel
|
||||||
"./scripts/weather.py")
|
"./scripts/weather.py")
|
||||||
(defpoll datehour :initial "12" :interval "30m" "date +'%H'")
|
(defpoll datehour :initial "12" :interval "30m" "date +'%H'")
|
||||||
(defpoll notesc :interval "2s" :run-while reveal4 "cat -s ~/Documents/fuck.txt")
|
(defpoll notesc :interval "2s" :run-while reveal4 "cat -s ~/Documents/fuck.txt")
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
:x 10
|
:x 10
|
||||||
:y 10
|
:y 10
|
||||||
:width 340
|
:width 340
|
||||||
:height 1000
|
|
||||||
:anchor "top left"
|
:anchor "top left"
|
||||||
)
|
)
|
||||||
:stacking "overlay"
|
:stacking "overlay"
|
||||||
|
@ -166,6 +165,7 @@
|
||||||
:height 140
|
:height 140
|
||||||
(systat :icon "" :val { EWW_CPU.avg })
|
(systat :icon "" :val { EWW_CPU.avg })
|
||||||
(systat :icon "" :val { EWW_RAM.used_mem_perc })
|
(systat :icon "" :val { EWW_RAM.used_mem_perc })
|
||||||
|
(systat :icon "" :val { gpu })
|
||||||
(systat :icon "" :val { EWW_BATTERY.BAT0.capacity })
|
(systat :icon "" :val { EWW_BATTERY.BAT0.capacity })
|
||||||
)))
|
)))
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@
|
||||||
(revealer
|
(revealer
|
||||||
:reveal revealWeather
|
:reveal revealWeather
|
||||||
:hexpand revealWeather
|
:hexpand revealWeather
|
||||||
:transition "slideright"
|
:transition "slideleft"
|
||||||
|
|
||||||
(weather)))))
|
(weather)))))
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
(revealer
|
(revealer
|
||||||
:transition "slideright"
|
:transition "slideleft"
|
||||||
:reveal revealControlpanel
|
:reveal revealControlpanel
|
||||||
(control_widget))
|
(control_widget))
|
||||||
(centerbox
|
(centerbox
|
||||||
:class "barwidget"
|
:class "barwidget"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:height "1080"
|
:height "1080"
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
:duration 500
|
:duration 500
|
||||||
|
|
||||||
(box
|
(box
|
||||||
:height 50
|
:height 45
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue