updated waybar
This commit is contained in:
@@ -12,7 +12,7 @@ general {
|
|||||||
# BACKGROUND
|
# BACKGROUND
|
||||||
background {
|
background {
|
||||||
monitor =
|
monitor =
|
||||||
path = $HOME/Pictures/wallpapers/rem-latte.jpg
|
path = $HOME/Pictures/red_moon/red_moon-latte.jpg
|
||||||
blur_passes = 0
|
blur_passes = 0
|
||||||
color = $base
|
color = $base
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||||
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
# See https://wiki.hyprland.org/Configuring/Workspace-Rules/ for workspace rules
|
||||||
|
|
||||||
@@ -11,56 +10,74 @@ windowrulev2=noblur,class:^()$,title:^()$
|
|||||||
|
|
||||||
|
|
||||||
# games for tearing add the immediate rule
|
# games for tearing add the immediate rule
|
||||||
windowrule = immediate, class:^(cs2)$
|
|
||||||
windowrule = immediate, class:^(gamescope)$
|
|
||||||
|
|
||||||
# Float Windows
|
# Float Windows
|
||||||
windowrule=float,title:^(Open File)$
|
windowrulev2=float,title:^(Open File)$
|
||||||
windowrule=float,title:^(Select a File)$
|
windowrulev2=float,title:^(Select a File)$
|
||||||
windowrule=float,title:^(Choose a file)$
|
windowrulev2=float,title:^(Choose a file)$
|
||||||
windowrule=float,title:^(Save As)$
|
windowrulev2=float,title:^(Save As)$
|
||||||
windowrule=float,title:^(Save File)$
|
windowrulev2=float,title:^(Save File)$
|
||||||
windowrule=float,title:^(branchdialog)$
|
windowrulev2=float,title:^(branchdialog)$
|
||||||
windowrule=float,title:^(pinentry-gtk-2)$
|
windowrulev2=float,title:^(pinentry-gtk-2)$
|
||||||
windowrule=float,title:^(Confirm to replace files)$
|
windowrulev2=float,title:^(Confirm to replace files)$
|
||||||
windowrule=float,title:^(File Operation Progress)$
|
windowrulev2=float,title:^(File Operation Progress)$
|
||||||
windowrule=float,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
windowrulev2=float,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||||
|
|
||||||
# Center and Resize Windows
|
# Center and Resize Windows
|
||||||
windowrule=size 800 600,title:^(Open File)$
|
windowrulev2=size 800 600,title:^(Open File)$
|
||||||
windowrule=size 800 600,title:^(Select a File)$
|
windowrulev2=size 800 600,title:^(Select a File)$
|
||||||
windowrule=size 800 600,title:^(Choose a file)$
|
windowrulev2=size 800 600,title:^(Choose a file)$
|
||||||
windowrule=size 800 600,title:^(Save As)$
|
windowrulev2=size 800 600,title:^(Save As)$
|
||||||
windowrule=size 800 600,title:^(Save File)$
|
windowrulev2=size 800 600,title:^(Save File)$
|
||||||
windowrule=size 800 600,title:^(branchdialog)$
|
windowrulev2=size 800 600,title:^(branchdialog)$
|
||||||
windowrule=size 800 600,title:^(pinentry-gtk-2)$
|
windowrulev2=size 800 600,title:^(pinentry-gtk-2)$
|
||||||
windowrule=size 800 600,title:^(Confirm to replace files)$
|
windowrulev2=size 800 600,title:^(Confirm to replace files)$
|
||||||
windowrule=size 800 600,title:^(File Operation Progress)$
|
windowrulev2=size 800 600,title:^(File Operation Progress)$
|
||||||
windowrule=size 800 600,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
windowrulev2=size 800 600,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||||
windowrule=center,title:^(Open File)$
|
windowrulev2=center,title:^(Open File)$
|
||||||
windowrule=center,title:^(Select a File)$
|
windowrulev2=center,title:^(Select a File)$
|
||||||
windowrule=center,title:^(Choose a file)$
|
windowrulev2=center,title:^(Choose a file)$
|
||||||
windowrule=center,title:^(Save As)$
|
windowrulev2=center,title:^(Save As)$
|
||||||
windowrule=center,title:^(Save File)$
|
windowrulev2=center,title:^(Save File)$
|
||||||
windowrule=center,title:^(branchdialog)$
|
windowrulev2=center,title:^(branchdialog)$
|
||||||
windowrule=center,title:^(pinentry-gtk-2)$
|
windowrulev2=center,title:^(pinentry-gtk-2)$
|
||||||
windowrule=center,title:^(Confirm to replace files)$
|
windowrulev2=center,title:^(Confirm to replace files)$
|
||||||
windowrule=center,title:^(File Operation Progress)$
|
windowrulev2=center,title:^(File Operation Progress)$
|
||||||
windowrule=center,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
windowrulev2=center,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||||
windowrule=noblur,title:^(Open File)$
|
windowrulev2=noblur,title:^(Open File)$
|
||||||
windowrule=noblur,title:^(Select a File)$
|
windowrulev2=noblur,title:^(Select a File)$
|
||||||
windowrule=noblur,title:^(Choose a file)$
|
windowrulev2=noblur,title:^(Choose a file)$
|
||||||
windowrule=noblur,title:^(Save As)$
|
windowrulev2=noblur,title:^(Save As)$
|
||||||
windowrule=noblur,title:^(Save File)$
|
windowrulev2=noblur,title:^(Save File)$
|
||||||
windowrule=noblur,title:^(branchdialog)$
|
windowrulev2=noblur,title:^(branchdialog)$
|
||||||
windowrule=noblur,title:^(pinentry-gtk-2)$
|
windowrulev2=noblur,title:^(pinentry-gtk-2)$
|
||||||
windowrule=noblur,title:^(Confirm to replace files)$
|
windowrulev2=noblur,title:^(Confirm to replace files)$
|
||||||
windowrule=noblur,title:^(File Operation Progress)$
|
windowrulev2=noblur,title:^(File Operation Progress)$
|
||||||
windowrule=noblur,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
windowrulev2=noblur,class:^(pavucontrol|blueman-manager|nm-connection-editor)$
|
||||||
|
|
||||||
# Workspace Rules
|
# Workspace Rules
|
||||||
# windowrule=workspace 1,class:^(firefox)$
|
# windowrule=workspace 1,class:^(firefox)$
|
||||||
# windowrule=workspace 2,class:^(kitty)$
|
# windowrule=workspace 2,class:^(kitty)$
|
||||||
# windowrule=workspace 3,class:^(Code)$
|
# windowrule=workspace 3,class:^(Code)$
|
||||||
# windowrule=workspace 4,class:^(steam)$
|
|
||||||
# windowrule=workspace 5,class:^(discord)$
|
|
||||||
|
windowrulev2=workspace special:magic silent,class:^(Spotify)$
|
||||||
|
windowrulev2=workspace special:magic silent,class:^(discord|vesktop)$
|
||||||
|
|
||||||
|
# steam rules
|
||||||
|
|
||||||
|
windowrulev2=workspace 3 silent, class:^(steam)$, title:^(Steam)$
|
||||||
|
windowrulev2=workspace 4, class:^(gamescope)$
|
||||||
|
|
||||||
|
# fixed sizes for different windows
|
||||||
|
windowrulev2=size 400 800,title:^(Friends List)$ class:^(steam)$
|
||||||
|
windowrulev2=size 1000 800,title:^(Steam Settings)$ class:^(steam)$
|
||||||
|
windowrulev2=size 1000 800,title:^(Add Non-Steam Game)$ class:^(steam)$
|
||||||
|
|
||||||
|
# float windows that arent the main steam window
|
||||||
|
windowrulev2 = float, class:^(steam)$, title:negative:^(Steam)$
|
||||||
|
windowrulev2 = noblur, class:^(steam)$, title:negative:^(Steam)$
|
||||||
|
# windowrulev2 = center, class:^(steam)$, title:negative:^(Steam)$
|
||||||
|
|
||||||
|
# allow tearing for games started with gamescope
|
||||||
|
windowrulev2 = immediate, class:^(gamescope)$
|
||||||
|
@@ -7,13 +7,13 @@
|
|||||||
"modules-left": ["hyprland/workspaces"],
|
"modules-left": ["hyprland/workspaces"],
|
||||||
"modules-center": [],
|
"modules-center": [],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"custom/bluetooth-audio",
|
// "custom/bluetooth-audio",
|
||||||
"custom/pixelbuds_pro",
|
"custom/pixelbuds_pro",
|
||||||
"wireplumber",
|
"wireplumber",
|
||||||
// "custom/audio-output",
|
"custom/audio-output",
|
||||||
"network",
|
"network",
|
||||||
"cpu",
|
"custom/cpu",
|
||||||
"memory",
|
"custom/mem",
|
||||||
"custom/tlp",
|
"custom/tlp",
|
||||||
"tray",
|
"tray",
|
||||||
"clock"
|
"clock"
|
||||||
@@ -34,11 +34,17 @@
|
|||||||
"on-click-right": "xdg-open https://calendar.proton.me/u/0/month &> /dev/null & disown",
|
"on-click-right": "xdg-open https://calendar.proton.me/u/0/month &> /dev/null & disown",
|
||||||
"tooltip": false,
|
"tooltip": false,
|
||||||
},
|
},
|
||||||
"custom/gpu": {
|
"custom/cpu": {
|
||||||
"format": "GPU: {}%",
|
"format": "{}",
|
||||||
"exec": "~/.config/waybar/scripts/gpu_usage.sh",
|
"return-type": "json",
|
||||||
"interval": 1,
|
"exec": "~/.config/waybar/scripts/cpu_info.sh",
|
||||||
"tooltip": true
|
"interval": 3
|
||||||
|
},
|
||||||
|
"custom/mem": {
|
||||||
|
"format": "{}",
|
||||||
|
"return-type": "json",
|
||||||
|
"exec": "~/.config/waybar/scripts/memory.sh",
|
||||||
|
"interval": 3
|
||||||
},
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"format": "CPU: {usage}%",
|
"format": "CPU: {usage}%",
|
||||||
@@ -55,7 +61,7 @@
|
|||||||
},
|
},
|
||||||
"wireplumber": {
|
"wireplumber": {
|
||||||
"format": "{volume}% {icon}",
|
"format": "{volume}% {icon}",
|
||||||
"format-muted": "{node_name} ",
|
"format-muted": "",
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"headphone": "",
|
"headphone": "",
|
||||||
"hands-free": "",
|
"hands-free": "",
|
||||||
@@ -126,8 +132,8 @@
|
|||||||
"custom/audio-output": {
|
"custom/audio-output": {
|
||||||
"format": "{}",
|
"format": "{}",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"exec": "/home/narl/.config/waybar/scripts/get_audio_output.sh",
|
"exec": "/home/narl/.config/waybar/scripts/audio.sh show",
|
||||||
"on-click": "/home/narl/.config/waybar/scripts/cycle_audio_output.sh",
|
"on-click": "/home/narl/.config/waybar/scripts/audio.sh cycle",
|
||||||
"interval": 1
|
"interval": 1
|
||||||
},
|
},
|
||||||
"custom/gamemode": {
|
"custom/gamemode": {
|
||||||
@@ -159,13 +165,13 @@
|
|||||||
"modules-left": ["hyprland/workspaces"],
|
"modules-left": ["hyprland/workspaces"],
|
||||||
"modules-center": [],
|
"modules-center": [],
|
||||||
"modules-right": [
|
"modules-right": [
|
||||||
"custom/bluetooth-audio",
|
// "custom/bluetooth-audio",
|
||||||
// "custom/pixelbuds_pro",
|
// "custom/pixelbuds_pro",
|
||||||
"wireplumber",
|
"wireplumber",
|
||||||
// "custom/audio-output",
|
"custom/audio-output",
|
||||||
"network",
|
"network",
|
||||||
"cpu",
|
"custom/cpu",
|
||||||
"memory",
|
"custom/mem",
|
||||||
"custom/tlp",
|
"custom/tlp",
|
||||||
"tray",
|
"tray",
|
||||||
"clock"
|
"clock"
|
||||||
@@ -192,6 +198,18 @@
|
|||||||
"interval": 1,
|
"interval": 1,
|
||||||
"tooltip": true
|
"tooltip": true
|
||||||
},
|
},
|
||||||
|
"custom/cpu": {
|
||||||
|
"format": "{}",
|
||||||
|
"return-type": "json",
|
||||||
|
"exec": "~/.config/waybar/scripts/cpu_info.sh",
|
||||||
|
"interval": 3
|
||||||
|
},
|
||||||
|
"custom/mem": {
|
||||||
|
"format": "{}",
|
||||||
|
"return-type": "json",
|
||||||
|
"exec": "~/.config/waybar/scripts/memory.sh",
|
||||||
|
"interval": 3
|
||||||
|
},
|
||||||
"cpu": {
|
"cpu": {
|
||||||
"format": "CPU: {usage}%",
|
"format": "CPU: {usage}%",
|
||||||
"tooltip": true
|
"tooltip": true
|
||||||
@@ -206,15 +224,16 @@
|
|||||||
"tooltip-format": "{ifname} via {gwaddr}"
|
"tooltip-format": "{ifname} via {gwaddr}"
|
||||||
},
|
},
|
||||||
"wireplumber": {
|
"wireplumber": {
|
||||||
"format": "{volume}% {icon}",
|
"format": "{volume}% {icon}",
|
||||||
"format-muted": "{node_name} ",
|
"format-muted": "",
|
||||||
"format-icons": {
|
"format-icons": {
|
||||||
"headphone": "",
|
"headphone": "",
|
||||||
"hands-free": "",
|
"hands-free": "",
|
||||||
"default": ["", "", ""]
|
"default": ["", "", ""]
|
||||||
},
|
},
|
||||||
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
|
"on-click": "wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle",
|
||||||
"on-click-right": "~/.config/waybar/scripts/cycle_audio_output.sh",
|
"on-click-right": "~/.config/waybar/scripts/audio.sh cycle",
|
||||||
|
"on-click-middle": "pavucontrol",
|
||||||
"scroll-step": 1
|
"scroll-step": 1
|
||||||
},
|
},
|
||||||
"custom/bluetooth-audio": {
|
"custom/bluetooth-audio": {
|
||||||
@@ -277,8 +296,8 @@
|
|||||||
"custom/audio-output": {
|
"custom/audio-output": {
|
||||||
"format": "{}",
|
"format": "{}",
|
||||||
"return-type": "json",
|
"return-type": "json",
|
||||||
"exec": "/home/narl/.config/waybar/scripts/get_audio_output.sh",
|
"exec": "/home/narl/.config/waybar/scripts/audio.sh show",
|
||||||
"on-click": "/home/narl/.config/waybar/scripts/cycle_audio_output.sh",
|
"on-click": "/home/narl/.config/waybar/scripts/audio.sh cycle",
|
||||||
"interval": 1
|
"interval": 1
|
||||||
},
|
},
|
||||||
"custom/gamemode": {
|
"custom/gamemode": {
|
||||||
|
40
waybar/scripts/audio.sh
Executable file
40
waybar/scripts/audio.sh
Executable file
@@ -0,0 +1,40 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
DEFAULT_SINK=$(pactl info | grep 'Default Sink' | cut -d ' ' -f3)
|
||||||
|
DESCRIPTION=$(pactl list sinks | grep -A2 "Name: $DEFAULT_SINK" | grep "Description:" | cut -d ' ' -f2-)
|
||||||
|
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
cycle)
|
||||||
|
SINKS=($(pactl list short sinks | awk '{print $2}'))
|
||||||
|
NUM_SINKS=${#SINKS[@]}
|
||||||
|
CURRENT_SINK=$(pactl info | grep 'Default Sink' | cut -d ' ' -f3)
|
||||||
|
|
||||||
|
for i in "${!SINKS[@]}"; do
|
||||||
|
if [[ "${SINKS[$i]}" == "$CURRENT_SINK" ]]; then
|
||||||
|
NEXT_INDEX=$(( (i + 1) % NUM_SINKS ))
|
||||||
|
pactl set-default-sink "${SINKS[$NEXT_INDEX]}"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
show)
|
||||||
|
TEXT=$(echo "$DESCRIPTION" | cut -c -20)
|
||||||
|
if [ -z "$DESCRIPTION" ]; then
|
||||||
|
DESCRIPTION=$DEFAULT_SINK
|
||||||
|
fi
|
||||||
|
CLASS=""
|
||||||
|
case $(pactl get-sink-mute @DEFAULT_SINK@ | awk '{print $2}') in
|
||||||
|
yes)
|
||||||
|
CLASS="muted"
|
||||||
|
;;
|
||||||
|
no)
|
||||||
|
CLASS="unmuted"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
printf '{"text": "%s", "tooltip": "%s", "class": "%s"}' "$TEXT" "$DESCRIPTION" "$CLASS"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "usage audio.sh {cycle|show}"
|
||||||
|
;;
|
||||||
|
esac
|
@@ -109,7 +109,7 @@ if [ -n "$device_mac" ]; then
|
|||||||
device_name=$(bluetoothctl info "$device_mac" | rg "Alias:" | cut -d ' ' -f 2-)
|
device_name=$(bluetoothctl info "$device_mac" | rg "Alias:" | cut -d ' ' -f 2-)
|
||||||
# Output in Waybar's JSON format
|
# Output in Waybar's JSON format
|
||||||
tooltip=$(bt-audio-info $device_mac)
|
tooltip=$(bt-audio-info $device_mac)
|
||||||
echo "{\"text\": \"$device_name <span size='large'></span>\", \"tooltip\": \"$tooltip\"}"
|
echo "{\"text\": \"$device_name <span size='large'></span>\", \"tooltip\": \"$tooltip\"}"
|
||||||
else
|
else
|
||||||
# Output empty string when no device is connected
|
# Output empty string when no device is connected
|
||||||
echo "{}"
|
echo "{}"
|
||||||
|
18
waybar/scripts/cpu_info.sh
Executable file
18
waybar/scripts/cpu_info.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
USAGE=$(mpstat 1 1 | awk '/Average:/ {print 100 - $12}')
|
||||||
|
TEMP=$(cat /sys/class/hwmon/hwmon6/temp1_input)
|
||||||
|
TEXT="$(printf "%.1f" $(echo "$USAGE"))% TEMP: $(printf "%.1f" $(echo "scale=2; $TEMP"/1000 | bc -l))C"
|
||||||
|
CPU=$(lscpu | grep 'Model name' | awk -F': ' '{print $2}' | sed 's/^[ \t]*//')
|
||||||
|
TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\\n", $1/ncores, $2}')
|
||||||
|
|
||||||
|
CLASS=""
|
||||||
|
|
||||||
|
if (( $(echo "$USAGE > 95" | bc -l) )); then
|
||||||
|
CLASS="max"
|
||||||
|
elif (( $(echo "$USAGE > 75" | bc -l) )); then
|
||||||
|
CLASS="high"
|
||||||
|
else
|
||||||
|
CLASS="normal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "{\"text\":\"CPU: $TEXT\", \"tooltip\": \"$TOOLTIP\", \"class\":\"$CLASS\"}"
|
@@ -1,7 +1,10 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
FORMAT_ACTIVATED="<span size='large'></span>"
|
||||||
|
FORMAT_DEACTIVATED="<span size='large'></span>"
|
||||||
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
HYPRGAMEMODE=$(hyprctl getoption animations:enabled | awk 'NR==1{print $2}')
|
||||||
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
if [ "$HYPRGAMEMODE" = 1 ] ; then
|
||||||
echo '{"text": "Gamemode", "tooltip": "Gamemode deactivated"}'
|
printf "{\"text\": \"$FORMAT_DEACTIVATED\", \"tooltip\": \"Gamemode deactivated\"}"
|
||||||
else
|
else
|
||||||
echo '{"text": "Gamemode", "tooltip": "Gamemode activated", "class": "active"}'
|
printf "{\"text\": \"$FORMAT_ACTIVATED\", \"tooltip\": \"Gamemode activated\", \"class\": \"active\"}"
|
||||||
fi
|
fi
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
PID_FILE="/tmp/gpu-screen-recorder.pid"
|
PID_FILE="/tmp/gpu-screen-recorder.pid"
|
||||||
|
FORMAT_RECORDING="<span size='large'></span>"
|
||||||
|
FORMAT_STOPPED="<span size='large'></span>"
|
||||||
|
|
||||||
if [ -f "$PID_FILE" ]; then
|
if [ -f "$PID_FILE" ]; then
|
||||||
PID=$(cat "$PID_FILE")
|
PID=$(cat "$PID_FILE")
|
||||||
if ps -p "$PID" > /dev/null; then
|
if ps -p "$PID" > /dev/null; then
|
||||||
echo '{"text": "Replay", "tooltip": "Replay running", "class": "recording"}'
|
echo "{\"text\": \"$FORMAT_RECORDING\", \"tooltip\": \"Replay running\", \"class\": \"recording\"}"
|
||||||
else
|
else
|
||||||
# The process is not running, but the PID file exists.
|
# The process is not running, but the PID file exists.
|
||||||
# This can happen if the process crashed.
|
# This can happen if the process crashed.
|
||||||
# We'll remove the stale PID file.
|
# We'll remove the stale PID file.
|
||||||
rm "$PID_FILE"
|
rm "$PID_FILE"
|
||||||
echo '{"text": "Replay", "tooltip": "Replay paused"}'
|
echo "{\"text\": \"$FORMAT_STOPPED\", \"tooltip\": \"Replay paused\"}"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo '{"text": "Replay", "tooltip": "Replay paused"}'
|
echo "{\"text\": \"$FORMAT_STOPPED\", \"tooltip\": \"Replay paused\"}"
|
||||||
fi
|
fi
|
||||||
|
22
waybar/scripts/gpu_info.sh
Executable file
22
waybar/scripts/gpu_info.sh
Executable file
@@ -0,0 +1,22 @@
|
|||||||
|
#!/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)
|
||||||
|
EDGE_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp1_input)
|
||||||
|
JUNC_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp2_input)
|
||||||
|
MEM_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp3_input)
|
||||||
|
GPU=$(/opt/rocm/bin/rocm-smi --showproductname | grep "Card Series" | awk -F':' '{print $3}' | xargs)
|
||||||
|
TEXT="$USAGE% $(printf "%.1f" $(echo "scale=2; $MEM_USED/1024/1024/1024" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TOTAL/1024/1024/1024" | bc -l))GB TEMP: $(printf "%.1f" $(echo "scale=2; $EDGE_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $JUNC_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TEMP/1000" | bc -l))C"
|
||||||
|
RATIO=$(echo "$MEM_USED/ $MEM_TOTAL" | bc -l)
|
||||||
|
|
||||||
|
CLASS=""
|
||||||
|
|
||||||
|
if (( $(echo "$USAGE > 95" | bc -l) )); then
|
||||||
|
CLASS="max"
|
||||||
|
elif (( $(echo "$USAGE > 75" | bc -l) )); then
|
||||||
|
CLASS="high"
|
||||||
|
else
|
||||||
|
CLASS="normal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "{\"text\":\"GPU: $TEXT\", \"tooltip\": \"$GPU\", \"class\":\"$CLASS\"}"
|
18
waybar/scripts/memory.sh
Executable file
18
waybar/scripts/memory.sh
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TOOLTIP=$(ps -eo rss,comm --sort=-rss | head -n 6 | sed '1d' | awk '{output = output sprintf("%.2f GB\t%s\\n", $1/1024/1024, $2)} END {printf "%s", output}')
|
||||||
|
TOTAL=$(awk '/MemTotal/ {printf "%.2f\n", $2/1024/1024}' /proc/meminfo)
|
||||||
|
USED=$(awk '/MemTotal/ {total=$2} /MemAvailable/ {available=$2} END {printf "%.2f\n", (total-available)/1024/1024}' /proc/meminfo)
|
||||||
|
RATIO=$(echo "$USED/ $TOTAL" | bc -l)
|
||||||
|
|
||||||
|
CLASS=""
|
||||||
|
|
||||||
|
if (( $(echo "$RATIO> 95" | bc -l) )); then
|
||||||
|
CLASS="max"
|
||||||
|
elif (( $(echo "$RATIO> 75" | bc -l) )); then
|
||||||
|
CLASS="high"
|
||||||
|
else
|
||||||
|
CLASS="normal"
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf '{"text": "MEM: %s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
|
@@ -6,8 +6,8 @@ MAC_ADDRESS="B4:23:A2:09:D3:53"
|
|||||||
# --- END CONFIGURATION ---
|
# --- END CONFIGURATION ---
|
||||||
|
|
||||||
not_connected() {
|
not_connected() {
|
||||||
printf '{"text": "L: --- | R: ---", "tooltip": "Pixel Buds Pro 2 not connected", "class": "disconnected"}\n'
|
printf "{\"text\": \"<span size='large'></span>\", \"tooltip\": \"Pixel Buds Pro 2 not connected\", \"class\": \"disconnected\"}\n"
|
||||||
exit 0
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# This function gets the current status and formats it for Waybar.
|
# This function gets the current status and formats it for Waybar.
|
||||||
@@ -27,7 +27,7 @@ get_status() {
|
|||||||
if ([[ "$left_bud" == "unknown" ]] && [[ "$right_bud" == "unknown" ]]) || \
|
if ([[ "$left_bud" == "unknown" ]] && [[ "$right_bud" == "unknown" ]]) || \
|
||||||
[[ -z "$left_bud" && -z "$right_bud" ]]; then
|
[[ -z "$left_bud" && -z "$right_bud" ]]; then
|
||||||
echo "{}"
|
echo "{}"
|
||||||
exit 0
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$left_bud" == "unknown" ]]; then
|
if [[ "$left_bud" == "unknown" ]]; then
|
||||||
@@ -67,6 +67,7 @@ get_status() {
|
|||||||
# --- FORMAT OUTPUT ---
|
# --- FORMAT OUTPUT ---
|
||||||
printf '{"text": "%s | %s | %s", "tooltip": "Pixel Buds Pro 2", "class": "%s"}\n' \
|
printf '{"text": "%s | %s | %s", "tooltip": "Pixel Buds Pro 2", "class": "%s"}\n' \
|
||||||
"$left_display" "$right_display" "$anc_icon" "$class"
|
"$left_display" "$right_display" "$anc_icon" "$class"
|
||||||
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
status() {
|
status() {
|
||||||
@@ -98,22 +99,28 @@ case "$1" in
|
|||||||
esac
|
esac
|
||||||
pbpctrl set anc "$next_mode"
|
pbpctrl set anc "$next_mode"
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
exit
|
||||||
;;
|
;;
|
||||||
connect)
|
connect)
|
||||||
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
||||||
notify-send "Pixel Buds Pro 2 are already connected"
|
notify-send "Pixel Buds Pro 2 are already connected"
|
||||||
|
exit
|
||||||
else
|
else
|
||||||
bluetoothctl connect "$MAC_ADDRESS" & disown
|
bluetoothctl connect "$MAC_ADDRESS"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
disconnect)
|
disconnect)
|
||||||
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
if bluetoothctl info "$MAC_ADDRESS" | grep -q "Connected: yes"; then
|
||||||
bluetoothctl disconnect "$MAC_ADDRESS" & disown
|
bluetoothctl disconnect "$MAC_ADDRESS"
|
||||||
|
exit
|
||||||
else
|
else
|
||||||
notify-send "Pixel Buds Pro 2 aren't connected"
|
notify-send "Pixel Buds Pro 2 aren't connected"
|
||||||
|
exit
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
status
|
status
|
||||||
|
exit
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
@@ -51,12 +51,14 @@ window#waybar.hidden {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#workspaces button.urgent {
|
#workspaces button.urgent {
|
||||||
border-bottom: 3px solid @red;
|
border-bottom: 3px solid @maroon;
|
||||||
}
|
}
|
||||||
|
|
||||||
#memory,
|
#memory,
|
||||||
#cpu,
|
#cpu,
|
||||||
#custom-gpu-usage,
|
#custom-gpu,
|
||||||
|
#custom-cpu,
|
||||||
|
#custom-mem,
|
||||||
#custom-power,
|
#custom-power,
|
||||||
#custom-gamemode,
|
#custom-gamemode,
|
||||||
#custom-tlp,
|
#custom-tlp,
|
||||||
@@ -77,12 +79,28 @@ window#waybar.hidden {
|
|||||||
color: @text;
|
color: @text;
|
||||||
}
|
}
|
||||||
|
|
||||||
#wireplumber.muted, #custom-pixelbuds_pro {
|
#wireplumber.muted, #custom-pixelbuds_pro, #custom-audio-output.muted {
|
||||||
background-color: @base;
|
background-color: @base;
|
||||||
color: @subtext1;
|
color: @subtext1;
|
||||||
border-bottom: 3px solid @subtext1;
|
border-bottom: 3px solid @subtext1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-pixelbuds_pro.disconnected {
|
||||||
|
padding-right: 16px;
|
||||||
|
padding-left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-gpu-screen-recorder,
|
||||||
|
#custom-gpu-screen-recorder.recording {
|
||||||
|
padding-right: 18px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-gamemode {
|
||||||
|
padding-right: 15px;
|
||||||
|
padding-left: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
#custom-pixelbuds_pro.anc-active {
|
#custom-pixelbuds_pro.anc-active {
|
||||||
color: @sapphire;
|
color: @sapphire;
|
||||||
border-bottom: 3px solid @sapphire;
|
border-bottom: 3px solid @sapphire;
|
||||||
@@ -105,16 +123,19 @@ window#waybar.hidden {
|
|||||||
|
|
||||||
#custom-gpu-screen-recorder,
|
#custom-gpu-screen-recorder,
|
||||||
#custom-gamemode {
|
#custom-gamemode {
|
||||||
color: @teal;
|
background-color: @base;
|
||||||
|
color: @subtext1;
|
||||||
|
border-bottom: 3px solid @subtext1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-power {
|
#custom-power {
|
||||||
color: @red;
|
color: @maroon;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-gpu-screen-recorder.recording,
|
#custom-gpu-screen-recorder.recording,
|
||||||
#custom-gamemode.active {
|
#custom-gamemode.active {
|
||||||
color: @red;
|
color: @teal;
|
||||||
|
border-bottom: 3px solid @teal;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-tlp {
|
#custom-tlp {
|
||||||
@@ -155,24 +176,28 @@ window#waybar.hidden {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-gpu-usage.max_usage {
|
#custom-gpu.max,
|
||||||
|
#custom-cpu.max,
|
||||||
|
#custom-mem.max {
|
||||||
color: @maroon;
|
color: @maroon;
|
||||||
/* border-bottom: 3px solid @maroon; */
|
/* border-bottom: 3px solid @maroon; */
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-gpu-usage.high_usage {
|
#custom-gpu.high,
|
||||||
|
#custom-gpu.high,
|
||||||
|
#custom-mem.high {
|
||||||
color: @yellow;
|
color: @yellow;
|
||||||
/* border-bottom: 3px solid @yellow; */
|
/* border-bottom: 3px solid @yellow; */
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-gpu-usage.normal_usage {
|
#memory,
|
||||||
color: @teal;
|
#cpu,
|
||||||
/* border-bottom: 3px solid @teal; */
|
#network,
|
||||||
}
|
#custom-gpu.normal,
|
||||||
|
#custom-cpu.normal,
|
||||||
#memory, #cpu, #network {
|
#custom-mem.normal {
|
||||||
color: @mauve;
|
color: @lavender;
|
||||||
border-bottom: 3px solid @mauve;
|
/* border-bottom: 3px solid @mauve; */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -181,22 +206,24 @@ window#waybar.hidden {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#wireplumber {
|
#wireplumber {
|
||||||
padding-right: 15px;
|
padding-right: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#custom-audio-output, #wireplumber {
|
#custom-audio-output.unmuted, #wireplumber {
|
||||||
color: @teal;
|
color: @maroon;
|
||||||
border-bottom: 3px solid @teal;
|
border-bottom: 3px solid @maroon;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
color: @maroon;
|
||||||
}
|
}
|
||||||
|
|
||||||
#network {
|
#network {
|
||||||
padding-right: 15px;
|
padding-right: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#clock {
|
|
||||||
color: @teal;
|
|
||||||
}
|
|
||||||
|
|
||||||
tooltip {
|
tooltip {
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 15px;
|
padding: 15px;
|
||||||
|
Reference in New Issue
Block a user