added modules to waybar
This commit is contained in:
7
waybar/scripts/gamemode_status.sh
Executable file
7
waybar/scripts/gamemode_status.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env sh
|
||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||
echo '{"text": "Gamemode", "tooltip": "Gamemode deactivated"}'
|
||||
else
|
||||
echo '{"text": "Gamemode", "tooltip": "Gamemode activated", "class": "active"}'
|
||||
fi
|
18
waybar/scripts/gpu-screen-recorder-status.sh
Executable file
18
waybar/scripts/gpu-screen-recorder-status.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
PID_FILE="/tmp/gpu-screen-recorder.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
PID=$(cat "$PID_FILE")
|
||||
if ps -p "$PID" > /dev/null; then
|
||||
echo '{"text": "Replay", "tooltip": "Replay running", "class": "recording"}'
|
||||
else
|
||||
# The process is not running, but the PID file exists.
|
||||
# This can happen if the process crashed.
|
||||
# We'll remove the stale PID file.
|
||||
rm "$PID_FILE"
|
||||
echo '{"text": "Replay", "tooltip": "Replay paused"}'
|
||||
fi
|
||||
else
|
||||
echo '{"text": "Replay", "tooltip": "Replay paused"}'
|
||||
fi
|
19
waybar/scripts/gpu_usage.sh
Executable file
19
waybar/scripts/gpu_usage.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
USAGE=$(cat /sys/class/drm/card1/device/gpu_busy_percent)
|
||||
MEM_USED=$(cat /sys/class/drm/card1/device/mem_info_vram_used)
|
||||
MEM_TOTAL=$(cat /sys/class/drm/card1/device/mem_info_vram_total)
|
||||
GPU=$(/opt/rocm/bin/rocm-smi --showproductname | grep "Card Series" | awk -F':' '{print $3}' | xargs)
|
||||
TEXT="$USAGE% $(printf "%.2f\n" $(echo "scale=2; $MEM_USED/1024/1024/1024" | bc -l))/$(echo "scale=2; $MEM_TOTAL/1024/1024/1024" | bc -l)GB"
|
||||
RATIO=$(echo "$MEM_USED/ $MEM_TOTAL" | bc -l)
|
||||
|
||||
CLASS=""
|
||||
|
||||
if (( $(echo "$USAGE > 95" | bc -l) )); then
|
||||
CLASS="max_usage"
|
||||
elif (( $(echo "$USAGE > 75" | bc -l) )); then
|
||||
CLASS="high_usage"
|
||||
else
|
||||
CLASS="normal_usage"
|
||||
fi
|
||||
|
||||
echo "{\"text\":\"GPU: $TEXT\", \"tooltip\": \"$GPU\", \"class\":\"$CLASS\"}"
|
9
waybar/scripts/toggle-replay.sh
Executable file
9
waybar/scripts/toggle-replay.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
PID_FILE="/tmp/gpu-screen-recorder.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ] && ps -p "$(cat "$PID_FILE")" > /dev/null; then
|
||||
$HOME/.config/hypr/scripts/replay-ctrl.sh stop
|
||||
else
|
||||
$HOME/.config/hypr/scripts/replay-ctrl.sh start
|
||||
fi
|
Reference in New Issue
Block a user