Eww: More improvements to radio & css & powermenu
This commit is contained in:
parent
c87ccc2ed7
commit
5e569bbb48
26
modules/home/wayland/apps/eww/bar/css/_powermenu.scss
Normal file
26
modules/home/wayland/apps/eww/bar/css/_powermenu.scss
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
.powermenu-box {
|
||||||
|
padding-left: 2.5rem;
|
||||||
|
padding-right: 2.5rem;
|
||||||
|
padding-top: 3rem;
|
||||||
|
padding-bottom: 3rem;
|
||||||
|
margin:0 0 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.powermenu-entry {
|
||||||
|
margin: 0 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.powermenu-button {
|
||||||
|
background-color: $base02;
|
||||||
|
border-radius: 1rem;
|
||||||
|
transition: 0.3s;
|
||||||
|
padding: 3.25rem 4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.powermenu-button:hover {
|
||||||
|
background-color:$base03;
|
||||||
|
}
|
||||||
|
|
||||||
|
.powermenu-icon {
|
||||||
|
font-size: 4rem;
|
||||||
|
}
|
@ -35,7 +35,6 @@
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: $gaps-screen 0px;
|
margin: $gaps-screen 0px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn_play {
|
.btn_play {
|
||||||
@ -44,6 +43,11 @@
|
|||||||
margin: 0 12px;
|
margin: 0 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn_play:hover {
|
||||||
|
color: $base07;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.station_list {
|
.station_list {
|
||||||
border-right-color: $base03;
|
border-right-color: $base03;
|
||||||
border-right-style: solid;
|
border-right-style: solid;
|
||||||
@ -60,4 +64,15 @@
|
|||||||
margin-right: $gaps-screen;
|
margin-right: $gaps-screen;
|
||||||
background-color: $base00;
|
background-color: $base00;
|
||||||
border-radius: $border-radius;
|
border-radius: $border-radius;
|
||||||
|
border-color: $base00;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: $border-width;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station_art:hover {
|
||||||
|
border-color: $base04;
|
||||||
|
}
|
||||||
|
|
||||||
|
.station_sel {
|
||||||
|
border-color: $base03;
|
||||||
}
|
}
|
@ -71,3 +71,8 @@ color: $base0B;
|
|||||||
margin: $gaps-screen;
|
margin: $gaps-screen;
|
||||||
padding: .5em;
|
padding: .5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sys-label {
|
||||||
|
font-weight: bolder;
|
||||||
|
color: $base04;
|
||||||
|
}
|
@ -14,6 +14,7 @@
|
|||||||
@import 'css/net';
|
@import 'css/net';
|
||||||
@import 'css/clock';
|
@import 'css/clock';
|
||||||
@import 'css/radio';
|
@import 'css/radio';
|
||||||
|
@import 'css/powermenu';
|
||||||
|
|
||||||
* {
|
* {
|
||||||
all: unset;
|
all: unset;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
(include "windows/calendar.yuck")
|
(include "windows/calendar.yuck")
|
||||||
(include "windows/sys.yuck")
|
(include "windows/sys.yuck")
|
||||||
(include "windows/radio.yuck")
|
(include "windows/radio.yuck")
|
||||||
|
(include "windows/powermenu.yuck")
|
||||||
|
|
||||||
|
|
||||||
(defwidget left []
|
(defwidget left []
|
||||||
|
@ -20,9 +20,11 @@
|
|||||||
:orientation "v"
|
:orientation "v"
|
||||||
(button
|
(button
|
||||||
:onclick "${EWW_CMD} open --toggle calendar"
|
:onclick "${EWW_CMD} open --toggle calendar"
|
||||||
|
:onrightclick "${EWW_CMD} open --toggle powermenu"
|
||||||
:class "day" day)
|
:class "day" day)
|
||||||
(button
|
(button
|
||||||
:onclick "${EWW_CMD} open --toggle calendar"
|
:onclick "${EWW_CMD} open --toggle calendar"
|
||||||
|
:onrightclick "${EWW_CMD} open --toggle powermenu"
|
||||||
:class "month" month)))))))
|
:class "month" month)))))))
|
||||||
|
|
||||||
(defpoll hour :interval "15s" "date '+%H'")
|
(defpoll hour :interval "15s" "date '+%H'")
|
||||||
|
@ -4,97 +4,91 @@ function get_time_ms {
|
|||||||
date -u +%s%3N
|
date -u +%s%3N
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
URL_BASE="https://www.radiorecord.ru/api"
|
URL_BASE="https://www.radiorecord.ru/api"
|
||||||
STATIONS=$(curl -s "$URL_BASE/stations/" | jq --argjson ids '[507,522,523,536,537,42532,42602]' '.result.stations | map(select(.id | IN($ids[]))) | map({id, title, stream_hls, icon_fill_white})')
|
|
||||||
|
|
||||||
MPV_PID_FILE="/tmp/mpv_radio_pid"
|
MPV_PID_FILE="/tmp/mpv_radio_pid"
|
||||||
RADIO_ID_FILE="/tmp/radio_id"
|
RADIO_ID_FILE="/tmp/radio_id"
|
||||||
|
|
||||||
|
STATIONS="[]"
|
||||||
|
|
||||||
|
PID=$( [ -e "$MPV_PID_FILE" ] && cat "$MPV_PID_FILE" || echo 0 )
|
||||||
|
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
||||||
|
RADIO_URL=""
|
||||||
|
INFO='{"id":null,"artist":null,"song":null,"image600":null}'
|
||||||
|
PAUSED=$(( $PID == 0 && $RADIO_ID > 0 ? 1 : 0 ))
|
||||||
|
STATUS="{}"
|
||||||
|
|
||||||
get_radio() {
|
get_radio() {
|
||||||
echo "$STATIONS" | jq -r --argjson sel_id "$1" 'map(select(.id == $sel_id)).[0]'
|
echo "$STATIONS" | jq -r --argjson sel_id "$RADIO_ID" 'map(select(.id == $sel_id)).[0]'
|
||||||
}
|
}
|
||||||
|
|
||||||
get_song() {
|
get_song() {
|
||||||
echo $(curl -s "$URL_BASE/station/history/?id=$1" | jq '.result.history[0] | ({id, artist, song, image600})')
|
echo $(curl -s "$URL_BASE/station/history/?id=$RADIO_ID" | jq '.result.history[0] | ({id, artist, song, image600})')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Function to play audio stream
|
update() {
|
||||||
start() {
|
|
||||||
radio_url=$(get_radio $1 | jq -r ".stream_hls")
|
|
||||||
if [ -f "$MPV_PID_FILE" ]; then
|
|
||||||
mpv_pid=$(cat "$MPV_PID_FILE")
|
|
||||||
if ps -p "$mpv_pid" > /dev/null; then
|
|
||||||
kill -SIGTERM "$mpv_pid"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
mpv "$radio_url" & echo $! > "$MPV_PID_FILE"
|
|
||||||
echo $1 > "$RADIO_ID_FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Function to pause/play the audio stream
|
|
||||||
pause() {
|
|
||||||
if [ -f "$MPV_PID_FILE" ]; then
|
|
||||||
mpv_pid=$(cat "$MPV_PID_FILE")
|
|
||||||
if ps -p "$mpv_pid" > /dev/null; then
|
|
||||||
kill -9 "$mpv_pid"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rm -f $MPV_PID_FILE
|
|
||||||
}
|
|
||||||
|
|
||||||
play() {
|
|
||||||
pause
|
|
||||||
radio_id=$(cat "$RADIO_ID_FILE")
|
|
||||||
start "$radio_id"
|
|
||||||
}
|
|
||||||
|
|
||||||
toggle() {
|
|
||||||
PID=$( [ -e "$MPV_PID_FILE" ] && cat "$MPV_PID_FILE" || echo 0 )
|
PID=$( [ -e "$MPV_PID_FILE" ] && cat "$MPV_PID_FILE" || echo 0 )
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
||||||
PAUSED=$(( $PID == 0 && $RADIO_ID > 0 ? 1 : 0 ))
|
PAUSED=$(( $PID == 0 && $RADIO_ID > 0 ? 1 : 0 ))
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
STATIONS=$(curl -s "$URL_BASE/stations/" | jq --argjson ids '[507,522,523,536,537,42532,42602]' '.result.stations | map(select(.id | IN($ids[]))) | map({id, title, stream_hls, icon_fill_white})')
|
||||||
|
RADIO_URL=$(get_radio | jq -r '.stream_hls')
|
||||||
|
if [ "$PAUSED" = 0 ]; then
|
||||||
|
kill -9 $PID
|
||||||
|
fi
|
||||||
|
mpv "$RADIO_URL" & echo $! > "$MPV_PID_FILE"
|
||||||
|
echo $RADIO_ID > "$RADIO_ID_FILE"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
toggle() {
|
||||||
if [ "$PAUSED" = 1 ]; then
|
if [ "$PAUSED" = 1 ]; then
|
||||||
play
|
echo $RADIO_ID $PID
|
||||||
|
start
|
||||||
else
|
else
|
||||||
pause
|
kill -9 "$PID"
|
||||||
|
rm -f $MPV_PID_FILE
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
PID=$( [ -e "$MPV_PID_FILE" ] && cat "$MPV_PID_FILE" || echo 0 )
|
echo $(jq -cnr --argjson pid "$PID" --argjson stations "$STATIONS" --argjson radio_id "$RADIO_ID" --argjson is_paused "$PAUSED" --argjson info "$INFO" '{"is_paused": $is_paused, "song": $info, "radio": $radio_id, "stations": $stations}')
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
|
||||||
PAUSED=$(( $PID == 0 && $RADIO_ID > 0 ? 1 : 0 ))
|
|
||||||
INFO=$1
|
|
||||||
RES=$(jq -cn --argjson pid "$PID" --argjson stations "$STATIONS" --argjson radio_id "$RADIO_ID" --argjson is_paused "$PAUSED" --argjson info "$INFO" '{"is_paused": $is_paused, "song": $info, "radio": $radio_id, "stations": $stations}')
|
|
||||||
echo "$RES"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_loop() {
|
status_loop() {
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
STATUS=$(status)
|
||||||
INFO=$(get_song "$RADIO_ID")
|
echo $STATUS
|
||||||
status "$INFO"
|
STATIONS=$(curl -s "$URL_BASE/stations/" | jq --argjson ids '[507,522,523,536,537,42532,42602]' '.result.stations | map(select(.id | IN($ids[]))) | map({id, title, stream_hls, icon_fill_white})')
|
||||||
last_time_info=$(get_time_ms)
|
last_time_info=0
|
||||||
last_time=$(get_time_ms)
|
last_time=0
|
||||||
while true; do
|
while true; do
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
|
||||||
current_time=$(get_time_ms)
|
|
||||||
delta=$((current_time - last_time_info))
|
|
||||||
if [[ $delta -gt 15000 ]]; then
|
|
||||||
NEW_INFO=$(get_song $RADIO_ID)
|
|
||||||
INFO=$(echo "$INFO" "$NEW_INFO" | jq -s ' reduce .[] as $item ( {}; . + (
|
|
||||||
reduce ($item | to_entries[]) as $entry ( {};
|
|
||||||
if $entry.value != null then .[$entry.key] = $entry.value else . end
|
|
||||||
)) )')
|
|
||||||
|
|
||||||
last_time_info=$(get_time_ms)
|
|
||||||
fi
|
|
||||||
current_time=$(get_time_ms)
|
current_time=$(get_time_ms)
|
||||||
delta=$((current_time - last_time))
|
delta=$((current_time - last_time))
|
||||||
|
delta_i=$((current_time - last_time_info))
|
||||||
if [[ $delta -gt 1000 ]]; then
|
if [[ $delta -gt 1000 ]]; then
|
||||||
status "$INFO"
|
PID=$( [ -e "$MPV_PID_FILE" ] && cat "$MPV_PID_FILE" || echo 0 )
|
||||||
last_time=$(get_time_ms)
|
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
||||||
|
PAUSED=$(( $PID == 0 && $RADIO_ID > 0 ? 1 : 0 ))
|
||||||
|
NEW_STATUS=$(status)
|
||||||
|
if [[ "$NEW_STATUS" != "$STATUS" ]]; then
|
||||||
|
STATUS=$NEW_STATUS
|
||||||
|
echo $STATUS
|
||||||
|
fi
|
||||||
|
last_time=$current_time
|
||||||
|
fi
|
||||||
|
if [[ $delta_i -gt 15000 ]]; then
|
||||||
|
if [ "$PAUSED" = 1 ]; then
|
||||||
|
INFO="{\"id\":null,\"artist\":null,\"song\":null,\"image600\": \"$(get_radio | jq -r '.icon_fill_white')\"}"
|
||||||
|
else
|
||||||
|
INFO=$(echo "$INFO" "$(get_song)" | jq -s ' reduce .[] as $item ( {}; . + (
|
||||||
|
reduce ($item | to_entries[]) as $entry ( {}; if $entry.value != null then .[$entry.key] = $entry.value else . end
|
||||||
|
)) )')
|
||||||
|
fi
|
||||||
|
last_time_info=$current_time
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@ -102,25 +96,13 @@ status_loop() {
|
|||||||
# Main script
|
# Main script
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"start")
|
"start")
|
||||||
start "$2"
|
RADIO_ID=$2
|
||||||
|
start
|
||||||
;;
|
;;
|
||||||
"toggle")
|
"toggle")
|
||||||
toggle
|
toggle
|
||||||
;;
|
;;
|
||||||
"pause")
|
|
||||||
pause
|
|
||||||
;;
|
|
||||||
"play")
|
|
||||||
play
|
|
||||||
;;
|
|
||||||
"status")
|
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
|
||||||
INFO=$(get_song $RADIO_ID)
|
|
||||||
status "$INFO"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
RADIO_ID=$( [ -e "$RADIO_ID_FILE" ] && cat "$RADIO_ID_FILE" || echo 0 )
|
|
||||||
echo $(get_song $RADIO_ID)
|
|
||||||
status_loop
|
status_loop
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
45
modules/home/wayland/apps/eww/bar/windows/powermenu.yuck
Normal file
45
modules/home/wayland/apps/eww/bar/windows/powermenu.yuck
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
(defwidget powermenu_entry [label icon onclick]
|
||||||
|
(box :orientation "v" :space-evenly false :class "powermenu-entry"
|
||||||
|
(button :class "powermenu-button" :onclick {onclick}
|
||||||
|
:tooltip "${label}"
|
||||||
|
(label :class "powermenu-icon" :text {icon})
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwidget powermenu []
|
||||||
|
(box :orientation "h" :space-evenly true :valign "center" :halign "center" :class "powermenu-box"
|
||||||
|
(powermenu_entry :label "Power off"
|
||||||
|
:icon ""
|
||||||
|
:onclick "systemctl poweroff")
|
||||||
|
(powermenu_entry :label "Reboot"
|
||||||
|
:icon ""
|
||||||
|
:onclick "systemctl reboot")
|
||||||
|
(powermenu_entry :label "Lock"
|
||||||
|
:icon ""
|
||||||
|
:onclick "sleep 0.1 && gtklock & eww close powermenu &")
|
||||||
|
|
||||||
|
(powermenu_entry :label "Suspend"
|
||||||
|
:icon ""
|
||||||
|
:onclick "sleep 0.1 && gtklock & systemctl suspend & eww close powermenu &")
|
||||||
|
|
||||||
|
(powermenu_entry :label "Sign out"
|
||||||
|
:icon ""
|
||||||
|
:onclick "hyprctl dispatch exit 0")
|
||||||
|
|
||||||
|
(powermenu_entry :label "Cancel"
|
||||||
|
:icon ""
|
||||||
|
:onclick "eww close powermenu")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
(defwindow powermenu
|
||||||
|
:monitor 0
|
||||||
|
:stacking "overlay"
|
||||||
|
:geometry (geometry
|
||||||
|
:anchor "center"
|
||||||
|
:width "120%"
|
||||||
|
:height "120%")
|
||||||
|
:namespace "eww-blur"
|
||||||
|
(powermenu)
|
||||||
|
)
|
@ -12,8 +12,8 @@
|
|||||||
:x "0%"
|
:x "0%"
|
||||||
:y "0%"
|
:y "0%"
|
||||||
:anchor "bottom right"
|
:anchor "bottom right"
|
||||||
:width "200px"
|
:width "0px"
|
||||||
:height "300px")
|
:height "0px")
|
||||||
(radio-win))
|
(radio-win))
|
||||||
|
|
||||||
|
|
||||||
@ -32,9 +32,7 @@
|
|||||||
|
|
||||||
(box
|
(box
|
||||||
:class "album_art"
|
:class "album_art"
|
||||||
:vexpand "false"
|
:style "background-size:cover; background-image: url('${radio.song.image600?:'https://www.radiorecord.ru/upload/stations_images/record_image600_white_fill.png'}');")
|
||||||
:hexpand "false"
|
|
||||||
:style "background-size:cover; background-image: url('${radio.song.image600}');")
|
|
||||||
(box
|
(box
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
@ -42,14 +40,14 @@
|
|||||||
:halign "center"
|
:halign "center"
|
||||||
:class "song"
|
:class "song"
|
||||||
:wrap "true"
|
:wrap "true"
|
||||||
:limit-width 25
|
:limit-width 18
|
||||||
:text "${radio.song.song}")
|
:text "${radio.song.song?:'...'}")
|
||||||
(label
|
(label
|
||||||
:halign "center"
|
:halign "center"
|
||||||
:class "artist"
|
:class "artist"
|
||||||
:wrap "true"
|
:wrap "true"
|
||||||
:limit-width 22
|
:limit-width 22
|
||||||
:text "${radio.song.artist}")
|
:text "${radio.song.artist?:'...'}")
|
||||||
(box
|
(box
|
||||||
:space-evenly true
|
:space-evenly true
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
@ -61,9 +59,9 @@
|
|||||||
:onclick "${EWW_CMD} update radio_rev=${!radio_rev}"
|
:onclick "${EWW_CMD} update radio_rev=${!radio_rev}"
|
||||||
(box ""))
|
(box ""))
|
||||||
|
|
||||||
(button
|
(button
|
||||||
:class "btn_play"
|
:class "btn_play"
|
||||||
:timeout "1s"
|
:timeout "2s"
|
||||||
:onclick "scripts/radio toggle"
|
:onclick "scripts/radio toggle"
|
||||||
"${radio.is_paused==1 ? "" : ""}")
|
"${radio.is_paused==1 ? "" : ""}")
|
||||||
|
|
||||||
@ -91,8 +89,8 @@
|
|||||||
|
|
||||||
(for station in {radio.stations}
|
(for station in {radio.stations}
|
||||||
(button
|
(button
|
||||||
:class "station_art"
|
:class "station_art ${(radio.radio == station.id)?'station_sel':''}"
|
||||||
:timeout "1s"
|
:timeout "2s"
|
||||||
:onclick "scripts/radio start ${station.id}"
|
:onclick "scripts/radio start ${station.id}"
|
||||||
:tooltip "${station.title}"
|
:tooltip "${station.title}"
|
||||||
:style "background-size:cover; background-image: url('${station.icon_fill_white}');"
|
:style "background-size:cover; background-image: url('${station.icon_fill_white}');"
|
||||||
@ -104,7 +102,7 @@
|
|||||||
|
|
||||||
(defwidget radio-button []
|
(defwidget radio-button []
|
||||||
(button
|
(button
|
||||||
:onclick "${EWW_CMD} open --toggle radio"
|
:onclick "${EWW_CMD} open --toggle --no-daemonize radio"
|
||||||
(box
|
(box
|
||||||
:class "module"
|
:class "module"
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
|
(box :class "sys-label" "CPU")
|
||||||
(box
|
(box
|
||||||
|
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
(for core in {EWW_CPU.cores}
|
(for core in {EWW_CPU.cores}
|
||||||
(box
|
(box
|
||||||
@ -27,22 +27,23 @@
|
|||||||
(box
|
(box
|
||||||
:orientation "v"
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
|
(box :class "sys-label" "GPU")
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Compute.value}
|
:value {gpu.devices[0].GRBM2?.CommandProcessor-Compute?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
:tooltip "Compute"
|
:tooltip "Compute"
|
||||||
)
|
)
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Fetcher.value}
|
:value {gpu.devices[0].GRBM2?.CommandProcessor-Fetcher?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
:tooltip "Fetcher"
|
:tooltip "Fetcher"
|
||||||
)
|
)
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].GRBM2.CommandProcessor-Graphics.value}
|
:value {gpu.devices[0].GRBM2?.CommandProcessor-Graphics?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
@ -50,21 +51,21 @@
|
|||||||
)
|
)
|
||||||
(box :class "spacer")
|
(box :class "spacer")
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].gpu_activity.GFX.value}
|
:value {gpu.devices[0]?.gpu_activity?.GFX?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
:tooltip "GFX"
|
:tooltip "GFX"
|
||||||
)
|
)
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].gpu_activity.Memory.value}
|
:value {gpu.devices[0]?.gpu_activity?.Memory?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
:tooltip "Memory"
|
:tooltip "Memory"
|
||||||
)
|
)
|
||||||
(progress
|
(progress
|
||||||
:value {gpu.devices[0].gpu_activity.MediaEngine.value}
|
:value {gpu.devices[0]?.gpu_activity?.MediaEngine?.value?:0.0}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
@ -72,7 +73,7 @@
|
|||||||
)
|
)
|
||||||
(box :class "spacer")
|
(box :class "spacer")
|
||||||
(progress
|
(progress
|
||||||
:value {100*gpu.devices[0].VRAM.TotalVRAMUsage.value/gpu.devices[0].VRAM.TotalVRAM.value}
|
:value {100*(gpu.devices[0]?.VRAM?.TotalVRAMUsage?.value?:0.0)/(gpu.devices[0]?.VRAM?.TotalVRAM?.value?:1.0)}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
:flipped true
|
:flipped true
|
||||||
:class "gpu-core-usage"
|
:class "gpu-core-usage"
|
||||||
@ -83,7 +84,9 @@
|
|||||||
|
|
||||||
(defwidget ram-sys-win []
|
(defwidget ram-sys-win []
|
||||||
(box
|
(box
|
||||||
|
:orientation "v"
|
||||||
:space-evenly false
|
:space-evenly false
|
||||||
|
(box :class "sys-label" "RAM")
|
||||||
(progress
|
(progress
|
||||||
:value {100*memory.used/memory.total}
|
:value {100*memory.used/memory.total}
|
||||||
:orientation "h"
|
:orientation "h"
|
||||||
|
@ -220,7 +220,7 @@ in {
|
|||||||
"custom/powermenu" = {
|
"custom/powermenu" = {
|
||||||
"format" = "{icon}";
|
"format" = "{icon}";
|
||||||
"format-icons" = [ "" ];
|
"format-icons" = [ "" ];
|
||||||
"on-click" = "wlogout";
|
"on-click" = "eww open powermenu";
|
||||||
"tooltip" = false;
|
"tooltip" = false;
|
||||||
};
|
};
|
||||||
"tray" = {
|
"tray" = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{ lib, pkgs, config, ... }: {
|
{ lib, pkgs, config, ... }: {
|
||||||
config = lib.mkIf (config.homecfg.wm == "Wayland") {
|
config = lib.mkIf (config.homecfg.wm == "Wayland") {
|
||||||
|
|
||||||
home.packages = with pkgs; [ swayidle swaylock-effects wlogout ];
|
home.packages = with pkgs; [ swayidle swaylock-effects ];
|
||||||
|
|
||||||
xdg.configFile."swaylock/config".text = ''
|
xdg.configFile."swaylock/config".text = ''
|
||||||
screenshots
|
screenshots
|
||||||
|
@ -147,6 +147,8 @@
|
|||||||
windowrulev2 = float,class:^(org.telegram.desktop)$,title:^(Media viewer)$
|
windowrulev2 = float,class:^(org.telegram.desktop)$,title:^(Media viewer)$
|
||||||
windowrulev2 = center,class:^(org.telegram.desktop)$,title:^(Media viewer)$
|
windowrulev2 = center,class:^(org.telegram.desktop)$,title:^(Media viewer)$
|
||||||
|
|
||||||
|
layerrule = blur,^(eww-blur)
|
||||||
|
|
||||||
#binds
|
#binds
|
||||||
bind = SUPER, RETURN, exec, kitty
|
bind = SUPER, RETURN, exec, kitty
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user