Compare commits

...

3 Commits

Author SHA1 Message Date
a1ac6850bb updated waybar 2025-08-28 19:45:40 +02:00
bd49925080 updated style 2025-08-23 19:32:51 +02:00
f0739adf34 updated scripts 2025-08-23 19:28:41 +02:00
9 changed files with 174 additions and 43 deletions

View File

@@ -1,4 +1,4 @@
# preload = ~/Pictures/red_moon/red_moon-latte.jpg
preload = ~/Pictures/wallpapers/rem-latte.jpg
preload = ~/Pictures/wallpapers/rem.jpg
# wallpaper = ,~/Pictures/red_moon/red_moon-latte.jpg
wallpaper = ,~/Pictures/wallpapers/rem-latte.jpg
wallpaper = ,~/Pictures/wallpapers/rem.jpg

View File

@@ -13,7 +13,7 @@ general {
# https://wiki.hyprland.org/Configuring/Variables/#variable-types for info about colors
# col.active_border = rgba(cba6f7ee) rgba(f38ba8ee) 45deg
col.active_border = rgb($mauveAlpha) rgb($tealAlpha) 30deg
col.active_border = rgb($mauveAlpha) rgb($blueAlpha) 30deg
col.inactive_border = rgb($surface2Alpha)
# Set to true enable resizing windows by clicking and dragging on borders and gaps

View File

@@ -2,20 +2,25 @@
{
"layer": "top",
"position": "top",
"height": 50,
"height": 36,
"modules-left": [
"hyprland/workspaces"
],
"modules-center": [],
"modules-center": [
],
"modules-right": [
// "custom/bluetooth-audio",
// "custom/pixelbuds_pro",
"custom/mem",
"custom/cpu",
"custom/gpu",
"network",
"custom/disk-root",
"custom/disk-gdrive",
"custom/disk-data",
"custom/disk-games",
// "network",
"custom/audio-output",
"wireplumber",
"wireplumber",
"tray",
"custom/gpu-screen-recorder",
"custom/gamemode",
@@ -69,7 +74,7 @@
"return-type": "json",
"exec": "~/.config/waybar/scripts/bluetooth_audio.sh",
"interval": 3,
"on-click": "~/.config/waybar/scripts/bluetooth_audio.sh disconnect"
"on-click": "~/.config/waybar/scripts/bluetooth_audio.sh disconnect & disown"
},
"pulseaudio": {
@@ -84,7 +89,7 @@
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
"on-click": "pavucontrol & disown"
},
"tray": {
"icon-size": 18,
@@ -93,7 +98,7 @@
"custom/power": {
"format": "",
"tooltip": false,
"on-click": "~/.config/hypr/scripts/powermenu.sh"
"on-click": "~/.config/hypr/scripts/powermenu.sh & disown"
},
"custom/tlp": {
"format": "{}",
@@ -118,42 +123,44 @@
"return-type": "json",
"exec": "~/.config/waybar/scripts/pixelbuds_pro_control.sh",
"interval": 5,
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect",
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc"
"on-click": "~/.config/waybar/scripts/pixelbuds_pro_control.sh connect & disown",
"on-click-right": "~/.config/waybar/scripts/pixelbuds_pro_control.sh cycle_anc & disown"
},
"custom/audio-output": {
"format": "{}",
"return-type": "json",
"exec": "/home/narl/.config/waybar/scripts/audio.sh show",
"on-click": "/home/narl/.config/waybar/scripts/audio.sh cycle",
"on-click": "/home/narl/.config/waybar/scripts/audio.sh cycle & disown",
"interval": 1
},
"custom/gamemode": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/gamemode_status.sh",
"on-click": "~/.config/hypr/scripts/gamemode.sh",
"on-click": "~/.config/hypr/scripts/gamemode.sh & disown",
"interval": 1
},
"custom/gpu-screen-recorder": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/gpu-screen-recorder-status.sh",
"on-click-right": "~/.config/hypr/scripts/replay-ctrl.sh save",
"on-click-middle": "nautilus ~/Videos/replay",
"on-click": "~/.config/waybar/scripts/toggle-replay.sh",
"on-click-right": "~/.config/hypr/scripts/replay-ctrl.sh save & disown",
"on-click-middle": "nautilus ~/Videos/replay & disown",
"on-click": "~/.config/waybar/scripts/toggle-replay.sh & disown",
"interval": 1
},
"custom/gpu": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/gpu_info.sh",
"on-click": "lact gui & disown",
"interval": 3
},
"custom/cpu": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/cpu_info.sh",
"on-click": "zenmonitor & disown",
"interval": 3
},
"custom/mem": {
@@ -161,5 +168,35 @@
"return-type": "json",
"exec": "~/.config/waybar/scripts/memory.sh",
"interval": 3
},
"custom/btrfs": {
"format": "{}",
"exec": "~/.config/waybar/scripts/btrfs.sh",
"return-type": "json",
"interval": 30
},
"custom/disk-root": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/disk_info.sh /",
"interval": 30
},
"custom/disk-gdrive": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/disk_info.sh ~/gdrive",
"interval": 30
},
"custom/disk-data": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/disk_info.sh ~/data",
"interval": 30
},
"custom/disk-games": {
"format": "{}",
"return-type": "json",
"exec": "~/.config/waybar/scripts/disk_info.sh ~/games",
"interval": 30
}
}

45
waybar/scripts/btrfs.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
# Get BTRFS filesystems
btrfs_filesystems=$(df -hT | grep btrfs)
# Initialize variables
total_used=0
total_size=0
# Process each BTRFS filesystem
while read -r line; do
size_str=$(echo "$line" | awk '{print $3}')
used_str=$(echo "$line" | awk '{print $4}')
size=$(echo "$size_str" | sed 's/[GT]//')
used=$(echo "$used_str" | sed 's/[GT]//')
if [[ $size_str == *T ]]; then
size=$(awk -v s="$size" 'BEGIN {print s*1024}')
fi
if [[ $used_str == *T ]]; then
used=$(awk -v u="$used" 'BEGIN {print u*1024}')
fi
total_size=$(awk -v total="$total_size" -v size="$size" 'BEGIN {print total+size}')
total_used=$(awk -v total="$total_used" -v used="$used" 'BEGIN {print total+used}')
done <<< "$btrfs_filesystems"
# Calculate usage percentage
usage_percentage=$(awk -v used="$total_used" -v total="$total_size" 'BEGIN {printf "%.0f", (used/total)*100}')
# Set class based on usage
if [ "$usage_percentage" -gt 95 ]; then
class="max"
elif [ "$usage_percentage" -gt 80 ]; then
class="high"
else
class="normal"
fi
text="$(printf "%.0f" $total_used)G / $(printf "%.0f" $total_size)G"
# Manually construct the JSON output
echo "{\"text\": \"$text\", \"tooltip\": \"\", \"class\": \"$class\"}"

View File

@@ -1,11 +1,11 @@
#!/bin/bash
USAGE=$(mpstat 1 1 | awk '/Average:/ {print 100 - $12}')
TEMP=$(cat /sys/class/hwmon/hwmon3/temp1_input)
TEXT="$(printf "%.1f" $(echo "$USAGE"))% TEMP: $(printf "%.1f" $(echo "scale=2; $TEMP"/1000 | bc -l))C"
TEXT="$(printf "%.1f" $(echo "$USAGE"))% $(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 '{output = output sprintf("%.1f%%\t%s\\n", $1, $2)} END {printf "%s", output}')
# TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\n", $1/ncores, $2}')
TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\\n", $1/ncores, $2}')
# TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\\n", $1/ncores, $2}')
# TOOLTIP=$(top -b -n 1 | sed '1,7d' | head -n 5 | awk '{output = output sprintf("%.1f%%\t%s\\n", $9, $12)} END {printf "%s", output}')
CLASS=""
@@ -18,4 +18,5 @@ else
CLASS="normal"
fi
echo "{\"text\":\"CPU: $TEXT\", \"tooltip\": \"$TOOLTIP\", \"class\":\"$CLASS\"}"
# echo "{\"text\":\"CPU: $TEXT\", \"tooltip\": \"$TOOLTIP\", \"class\":\"$CLASS\"}"
echo "{\"text\":\"CPU: $TEXT\", \"class\":\"$CLASS\"}"

31
waybar/scripts/disk_info.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 <mountpoint>"
exit 1
fi
MOUNTPOINT=$1
# Get disk usage info
USED=$(df -h --output=used "$MOUNTPOINT" | sed '1d' | awk '{print $1}')
TOTAL=$(df -h --output=size "$MOUNTPOINT" | sed '1d' | awk '{print $1}')
PERCENTAGE=$(df --output=pcent "$MOUNTPOINT" | sed '1d' | tr -d '%' | awk '{print $1}')
# Set class based on usage
CLASS="normal"
if [ "$PERCENTAGE" -gt 95 ]; then
CLASS="max"
elif [ "$PERCENTAGE" -gt 80 ]; then
CLASS="high"
fi
# Create tooltip with more details
TOOLTIP=$(df -h "$MOUNTPOINT" | sed '1d' | awk '{printf "Used: %s\nTotal: %s\nFree: %s", $3, $2, $4}')
# Output JSON for Waybar using jq
jq -n -c \
--arg text "$1 $USED/$TOTAL" \
--arg tooltip "$TOOLTIP" \
--arg class "$CLASS" \
'{"text": $text, "tooltip": $tooltip, "class": $class}'

View File

@@ -6,7 +6,7 @@ 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"
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 $(printf "%.1f" $(echo "scale=2; $EDGE_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TEMP/1000" | bc -l))C"
RATIO=$(echo "$MEM_USED/ $MEM_TOTAL" | bc -l)
CLASS=""

View File

@@ -1,6 +1,6 @@
#!/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}')
# 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)
@@ -15,4 +15,5 @@ else
CLASS="normal"
fi
printf '{"text": "MEM: %s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
# printf '{"text": "%s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
printf '{"text": "%s/%sGB", "class": "%s"}' "$USED" "$TOTAL" "$CLASS"

View File

@@ -21,9 +21,6 @@ window#waybar.hidden {
opacity: 0.5;
}
#workspaces {
}
#workspaces button {
all: initial;
/* Remove GTK theme values (waybar #1351) */
@@ -32,15 +29,15 @@ window#waybar.hidden {
box-shadow: inset 0 -3px transparent;
/* Use box-shadow instead of border so the text isn't offset */
padding: 6px 18px;
margin: 6px 3px;
border-radius: 4px;
margin: 0px 3px;
border-radius: 10px;
background-color: @base;
color: @subtext0;
}
#workspaces button.active {
color: @text;
border-bottom: 3px solid @teal;
border-bottom: 3px solid @blue;
}
#workspaces button:hover {
@@ -68,12 +65,17 @@ window#waybar.hidden {
#network,
#clock,
#tray,
#custom-disk-root,
#custom-disk-gdrive,
#custom-disk-games,
#custom-disk-data,
#custom-pixelbuds_pro,
#custom-bluetooth-audio,
#custom-audio-output,
#custom-btrfs,
#custom-gpu-screen-recorder {
border-radius: 4px;
margin: 6px 3px;
border-radius: 10px;
margin: 0px 3px;
padding: 6px 12px;
background-color: @base;
color: @text;
@@ -134,8 +136,8 @@ window#waybar.hidden {
#custom-gpu-screen-recorder.recording,
#custom-gamemode.active {
color: @yellow;
border-bottom: 3px solid @yellow;
color: @maroon;
border-bottom: 3px solid @maroon;
}
#custom-tlp {
@@ -178,23 +180,39 @@ window#waybar.hidden {
#custom-gpu.max,
#custom-cpu.max,
#custom-mem.max {
#custom-mem.max,
#custom-btrfs.max,
#custom-disk-root.max,
#custom-disk-gdrive.max,
#custom-disk-games.max,
#custom-disk-data.max {
color: @maroon;
/* border-bottom: 3px solid @maroon; */
}
#custom-gpu.high,
#custom-gpu.high,
#custom-mem.high {
#custom-mem.high,
#custom-btrfs.high,
#custom-disk-root.high,
#custom-disk-gdrive.high,
#custom-disk-games.high,
#custom-disk-data.high {
color: @yellow;
/* border-bottom: 3px solid @yellow; */
}
#memory,
#cpu,
#cpu,
#disk,
#custom-gpu.normal,
#custom-cpu.normal,
#custom-mem.normal {
#custom-mem.normal,
#custom-btrfs.normal,
#custom-disk-root.normal,
#custom-disk-gdrive.normal,
#custom-disk-games.normal,
#custom-disk-data.normal {
color: @blue;
/* border-bottom: 3px solid @mauve; */
}
@@ -213,14 +231,12 @@ window#waybar.hidden {
}
#custom-audio-output.unmuted, #wireplumber {
color: @maroon;
border-bottom: 3px solid @maroon;
color: @mauve;
border-bottom: 3px solid @mauve;
}
#clock {
color: @teal;
color: @mauve;
}
#network {
@@ -228,7 +244,7 @@ window#waybar.hidden {
}
tooltip {
border-radius: 8px;
border-radius: 10px;
padding: 15px;
background-color: @base;
}