Major Update: created v5 (switching from x11 to wayland). Changed polybar to waybar in this commit.

This commit is contained in:
Keyitdev
2026-05-31 11:55:07 +02:00
parent b018c5edd3
commit 91723206b1
9 changed files with 689 additions and 695 deletions
+245
View File
@@ -0,0 +1,245 @@
{
"layer": "top",
"position": "top",
"exclusive": true,
"height": 36,
"spacing": 1,
"margin-top": 5,
"margin-left":10,
"margin-right": 10,
// big screens/pc
"modules-left": ["custom/menu", "sway/workspaces", "sway/mode", "network", "custom/screen_time", "custom/weather", "custom/playerctl" ],
"modules-center": ["clock"],
"modules-right": ["custom/advanced_cpu", "custom/nvidia", "memory", "disk", "custom/brightness", "pulseaudio", "battery", "custom/microphone", "idle_inhibitor", "tray"],
// small screens/laptops
//"modules-left": ["custom/menu", "sway/workspaces", "sway/mode", "network", "custom/screen_time", "custom/weather", "custom/playerctl" ],
//"modules-center": ["clock"],
//"modules-right": ["memory", "disk", "backlight", "pulseaudio", "battery", "idle_inhibitor", "tray"],
"custom/advanced_cpu": {
"format": " CPU <span color='#dedede'>{}</span>",
"interval": 1,
"return-type": "json",
"exec": "s-tui -j | jq -c '{text: \"\\((.Util.Avg|tonumber|floor))% \\((.Temp[\"Tctl,0\"]|tonumber|floor))°C \\((.Frequency.Avg|tonumber/1000)|tostring|tonumber|(. * 10 | floor / 10)) GHz\"}'"
},
"custom/brightness": {
"format": " <span color='#dedede'>{}%</span>",
"exec": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 getvcp 10 | awk -F'= *|,' '/current value/ {print $2}'",
"interval": 1,
"on-scroll-up": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 setvcp 10 + 10",
"on-scroll-down": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 setvcp 10 - 10",
"on-click": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 setvcp 10 0",
"on-click-middle": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 setvcp 10 40",
"on-click-right": "ddcutil --disable-dynamic-sleep --noverify --skip-ddc-checks --sleep-multiplier 0.1 --bus 12 setvcp 10 100"
},
"custom/menu": {
"format": "",
"tooltip": false,
"on-click": "rofi -show drun -no-default-config -config ~/.config/rofi/main.rasi",
"on-click-middle": "swaymsg workspace $(comm -23 <(seq 1 100) <(swaymsg -t get_workspaces | jq '.[].num' | sort -n) | head -n 1)",
"on-click-right": "rofi-powermenu"
},
"custom/microphone": {
"format": "{text}",
"tooltip": false,
"interval": 1,
"on-click": "~/.config/waybar/microphone.sh toggle",
"return-type": "json",
"exec": "~/.config/waybar/microphone.sh"
},
"custom/nvidia": {
"format": " GPU <span color='#dedede'>{}</span>",
"interval": 2,
"exec": "nvidia-smi --query-gpu=utilization.gpu,temperature.gpu,memory.used --format=csv,noheader,nounits | awk -F', ' '{print $1\"% \"$2\"°C \"$3\" MiB\"}'"
},
"custom/playerctl": {
"format": "{icon}<span color='#dedede'>{text}</span>",
"format-icons": {
"Playing": " ",
"Paused": " "
},
"max-length": 40,
"on-click": "playerctl play-pause",
"on-scroll-up": "playerctl next",
"on-scroll-down": "playerctl previous",
"return-type": "json",
"exec": "playerctl -a metadata --format '{\"text\": \"{{markup_escape(title)}}\", \"tooltip\": \"{{playerName}} : {{artist}} - {{markup_escape(title)}}\", \"alt\": \"{{status}}\", \"class\": \"{{status}}\"}' -F"
},
"custom/screen_time": {
"format": "󰍹 <span color='#dedede'>{}</span>",
"interval": 1,
"exec": "~/.config/waybar/screen_time.sh"
},
"custom/weather": {
"format": "{}",
"tooltip": true,
"interval": 300,
"exec": "~/.config/waybar/weather.sh"
},
"backlight": {
"format": "{icon} <span color='#dedede'>{percent}%</span>",
"format-icons": ["", ""],
"tooltip-format": "{icon} {percent}%",
"on-scroll-up": "brightness_control -s +2",
"on-scroll-down": "brightness_control -s -2",
"smooth-scrolling-threshold": 1.0
},
"battery": {
"format": "{icon} <span color='#dedede'>{capacity}% {power:.1f}W</span>",
"format-charging": " <span color='#dedede'>{capacity}%</span>",
"format-plugged": " <span color='#dedede'>{capacity}%</span>",
"format-alt": "{icon} <span color='#dedede'>{time}</span>",
"format-icons": [""],
"states": {
"good": 95,
"warning": 40,
"critical": 20
},
"interval": 2
},
"bluetooth": {
"format": " <span color='#dedede'>{status}</span>",
"format-disabled": "",
"format-connected": " <span color='#dedede'>{num_connections} connected</span>",
"tooltip-format": "{controller_alias}\t{controller_address}",
"tooltip-format-connected": "{controller_alias}\t{controller_address}\n\n{device_enumerate}",
"tooltip-format-enumerate-connected": "{device_alias}\t{device_address}"
},
"clock": {
"format": " <span color='#dedede'>{:%a %d %b %H:%M}</span>",
"format-alt": " <span color='#dedede'>{:%A %d %B %Y %H:%M:%S}</span>",
"tooltip-format": "<span size='20000'><tt>{calendar}</tt></span>",
"interval": 1,
"calendar": {
"mode": "month",
"mode-mon-col": 3,
"weeks-pos": "",
"on-scroll": 1,
"on-click-right": "mode",
"iso8601": true,
"format": {
"months": "<span color='#6c90a8'><b>{}</b></span>",
"days": "<span color='#dedede'>{}</span>",
"weeks": "<span color='#d4a067'><b>W{}</b></span>",
"weekdays": "<span color='#999f63'><b>{}</b></span>",
"today": "<span color='#cb5760'><b>{}</b></span>"
}
},
"actions": {
"on-click-right": "mode",
"on-click-forward": "tz_up",
"on-click-backward": "tz_down",
"on-scroll-up": "shift_up",
"on-scroll-down": "shift_down"
}
},
"cpu": {
"format": " CPU <span color='#dedede'>{usage}% {avg_frequency} Ghz</span>",
"format-alt": " <span color='#dedede'>{avg_frequency} Ghz</span>",
"tooltip": true,
"interval": 1
},
"disk": {
"format": " ROM <span color='#dedede'>{percentage_used}%</span>",
"format-alt": " ROM <span color='#dedede'>{used}/{total}</span>",
"path": "/",
"interval": 30
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
},
"tooltip": true
},
"memory": {
"format": " RAM <span color='#dedede'>{used:.1f} GiB</span>",
"format-alt": " RAM <span color='#dedede'>{percentage}%</span>",
"interval": 1
},
"network": {
"format-wifi": " <span color='#dedede'>{essid}</span>",
"format-ethernet": " <span color='#dedede'>{ifname}</span>",
"format-linked": " {ifname} <span color='#dedede'>(No IP)</span>",
"format-disconnected": " <span color='#dedede'>Offline</span>",
"format-alt": " <span color='#dedede'>{ifname}</span>  <span color='#dedede'>{bandwidthDownBits}</span>  <span color='#dedede'>{bandwidthUpBits}</span>",
"tooltip-format": "{ifname}: {ipaddr}/{cidr}",
"interval": 1
},
"pulseaudio": {
"format": "{icon} <span color='#dedede'>{volume}%</span>",
"format-bluetooth": " <span color='#dedede'>{volume}%</span>",
"format-bluetooth-muted": " <span color='#dedede'>{icon}</span>",
"format-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "󰥰",
"headset": "",
"phone": "",
"portable": "󰄝",
"car": "󰄋",
"default": ["", "", ""]
},
"on-click": "pactl set-sink-mute @DEFAULT_SINK@ toggle",
"on-click-right": "pactl set-sink-mute @DEFAULT_SINK@ toggle ",
"on-scroll-up": "volume_control -s +5 -m 125",
"on-scroll-down": "volume_control -s -5 -m 125",
"smooth-scrolling-threshold": 1.0
},
"sway/mode": {
"format": " <span color='#dedede'>{}</span>"
},
"sway/workspaces": {
"disable-scroll": false,
"all-outputs": true,
"format": "{icon}",
"format-icons": {
"1": "",
"2": "",
"3": "",
"4": "",
"5": "",
"6": "",
"7": "",
"8": "",
"9": "",
"10": ""
},
"smooth-scrolling-threshold": 1.0,
},
"temperature": {
"format": "{icon} <span color='#dedede'>{temperatureC}°C</span>",
"format-icons": [""],
"interval": 1,
"warning-threshold": 70,
"critical-threshold": 90
},
"tray": {
"icon-size": 18,
"spacing": 5
}
}
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
mic=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}')
if [ "$1" == "toggle" ]; then
pactl set-source-mute @DEFAULT_SOURCE@ toggle
fi
mic=$(pactl get-source-mute @DEFAULT_SOURCE@ | awk '{print $2}')
if [ "$mic" == "yes" ]; then
echo '{"text":"","class":"mic-muted"}'
else
echo '{"text":"","class":"mic-unmuted"}'
fi
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
echo "{\"alt\": \"$(cat /sys/firmware/acpi/platform_profile)\"}"
+27
View File
@@ -0,0 +1,27 @@
#!/bin/sh
LOG_FILE="$HOME/.system_stats.json"
today=$(date +%Y-%m-%d)
if [ ! -f "$LOG_FILE" ]; then
echo "0s"
exit 0
fi
total_seconds=$(jq -r ".\"$today\".screen.turned_on_s // 0" "$LOG_FILE")
if [ "$total_seconds" -eq 0 ]; then
echo "0s"
exit 0
fi
h=$(( total_seconds / 3600 ))
m=$(( (total_seconds % 3600) / 60 ))
s=$(( total_seconds % 60 ))
output=""
[ "$h" -gt 0 ] && output="${h}h "
[ "$m" -ge 0 ] && output="${output}${m}m "
# [ "$s" -gt 0 ] || [ -z "$output" ] && output="${output}${s}s"
echo "$output" | sed 's/ $//'
+367
View File
@@ -0,0 +1,367 @@
/* Everforest Dark Colors */
@define-color background #2b3339;
@define-color background-light #323c41;
@define-color foreground #d3c6aa;
@define-color black #3c474d;
@define-color red #e67e80;
@define-color green #a7c080;
@define-color yellow #dbbc7f;
@define-color blue #7fbbb3;
@define-color magenta #d699b6;
@define-color cyan #83c092;
@define-color white #d3c6aa;
@define-color orange #e69875;
/* Pastel TTY Colors */
@define-color background #212121;
@define-color background-light #3a3a3a;
@define-color foreground #e0e0e0;
@define-color black #5a5a5a;
@define-color red #ff9a9e;
@define-color green #b5e8a9;
@define-color yellow #ffe6a7;
@define-color blue #63a4ff;
@define-color magenta #dda0dd;
@define-color cyan #a3e8e8;
@define-color white #ffffff;
@define-color orange #ff8952;
/* Gruvbox Dark Colors */
@define-color background #282828;
@define-color background-light #3c3836;
@define-color foreground #ebdbb2;
@define-color black #32302f;
@define-color red #cc241d;
@define-color green #98971a;
@define-color yellow #d79921;
@define-color blue #458588;
@define-color magenta #b16286;
@define-color cyan #689d6a;
@define-color white #ebdbb2;
@define-color orange #d65d0e;
/* Tokyo Night */
@define-color background #1a1b26;
@define-color background-light #24283b;
@define-color foreground #c0caf5;
@define-color black #15161e;
@define-color red #f7768e;
@define-color green #9ece6a;
@define-color yellow #e0af68;
@define-color blue #7aa2f7;
@define-color magenta #bb9af7;
@define-color cyan #7dcfff;
@define-color white #a9b1d6;
@define-color orange #ff9e64;
/* Keyitdev's onedark */
@define-color background #1b1b25;
@define-color background-light #282A36;
@define-color foreground #dedede;
@define-color black #15161e;
@define-color red #cb5760;
@define-color green #999f63;
@define-color yellow #d4a067;
@define-color blue #6c90a8;
@define-color magenta #776690;
@define-color cyan #528a9b;
@define-color white #dedede;
@define-color orange #c87c3e;
/* Module-specific colors */
@define-color workspaces-color @foreground;
@define-color workspaces-focused-bg @green;
@define-color workspaces-focused-fg @green;
@define-color workspaces-urgent-bg @background;
@define-color workspaces-urgent-fg @red;
/* Text and border colors for modules */
@define-color backlight-color @yellow;
@define-color battery-charging-color @orange;
@define-color battery-color @orange;
@define-color battery-critical-color @red;
@define-color battery-warning-color @yellow;
@define-color bluetooth-color @yellow;
@define-color clock-color @red;
@define-color cpu-color @cyan;
@define-color disk-color @orange;
@define-color idle-inhibitor-active-color @red;
@define-color idle-inhibitor-color @green;
@define-color memory-color @red;
@define-color menu-color @yellow;
@define-color mode-color @orange;
@define-color network-color @blue;
@define-color network-ethernet-color @magenta;
@define-color network-disconnected-color @red;
@define-color nvidia-color @green;
@define-color playerctl-color @green;
@define-color playerctl-paused-color @orange;
@define-color pulseaudio-color @blue;
@define-color pulseaudio-muted-color @red;
@define-color screen_time-color @orange;
@define-color temperature-color @cyan;
@define-color temperature-critical-color @red;
@define-color temperature-warning-color @yellow;
@define-color tray-color @magenta;
@define-color weather-color @cyan;
/* Base styling for all modules */
*{
border: none;
border-radius: 0;
font-family: "Iosevka Nerd Font";
font-size: 18px;
min-height: 0;
}
window#waybar {
background-color: transparent;
color: transparent;
}
/* Common module styling with border-bottom */
#backlight,
#battery,
#bluetooth,
#clock,
#cpu,
#custom-advanced_cpu,
#custom-brightness,
#custom-nvidia,
#custom-menu,
#custom-microphone,
#custom-playerctl,
#custom-screen_time,
#custom-weather,
#disk,
#idle_inhibitor,
#memory,
#mode,
#network,
#pulseaudio,
#temperature,
#tray
{
padding: 6px 12px 4px 12px;
margin: 0 2px;
color: @foreground;
border-bottom: 2px solid;
background-color: @background;
border-radius: 20px;
}
/* Workspaces styling */
#workspaces{
/* padding: 2px 12px 0px 12px; */
padding: 2px 8px 0px 8px;
margin: 0 2px;
background-color: @background;
border-radius: 20px;
border-bottom: 2px solid @green;
}
#workspaces button {
/* padding: 0 8px; */
padding: 0px;
background-color: transparent;
color: @workspaces-color;
/* margin: 0; */
margin: 0 -4px;
border-radius: 20px;
}
#workspaces button:hover {
background: @background-light;
box-shadow: inherit;
}
#workspaces button.focused {
/* box-shadow: inset 0 -2px @workspaces-focused-fg; */
/* border-bottom: 2px solid @workspaces-focused-fg; */
color: @workspaces-focused-fg;
/* font-weight: 900; */
}
#workspaces button.urgent {
background-color: @workspaces-urgent-bg;
color: @workspaces-urgent-fg;
}
/* Module-specific styling */
#backlight, #custom-brightness{
color: @backlight-color;
border-bottom-color: @backlight-color;
}
#battery {
color: @battery-color;
border-bottom-color: @battery-color;
}
#battery.charging, #battery.plugged {
color: @battery-charging-color;
border-bottom-color: @battery-charging-color;
}
#battery.critical:not(.charging) {
color: @battery-critical-color;
border-bottom-color: @battery-critical-color;
}
#battery.warning:not(.charging) {
color: @battery-warning-color;
border-bottom-color: @battery-warning-color;
}
#bluetooth{
color: @bluetooth-color;
border-bottom-color: @bluetooth-color;
}
#clock {
color: @clock-color;
border-bottom-color: @clock-color;
}
#cpu, #custom-advanced_cpu {
color: @cpu-color;
border-bottom-color: @cpu-color;
}
#custom-menu{
color: @menu-color;
border-bottom-color: @menu-color;
}
#custom-microphone.mic-muted{
color: @red;
border-bottom-color: @red;
}
#custom-microphone.mic-unmuted{
color: @green;
border-bottom-color: @green;
}
#custom-nvidia {
color: @nvidia-color;
border-bottom-color: @nvidia-color;
}
#custom-playerctl {
color: @playerctl-color;
border-bottom-color: @playerctl-color;
}
#custom-playerctl.Paused {
color: @playerctl-paused-color;
border-bottom-color: @playerctl-paused-color;
}
#custom-playerctl.Playing {
color: @playerctl-color;
border-bottom-color: @playerctl-color;
}
#custom-screen_time{
color: @screen_time-color;
border-bottom-color: @screen_time-color;
}
#custom-weather {
color: @weather-color;
border-bottom-color: @weather-color;
}
#disk {
color: @disk-color;
border-bottom-color: @disk-color;
}
#idle_inhibitor {
color: @idle-inhibitor-color;
border-bottom-color: @idle-inhibitor-color;
}
#idle_inhibitor.activated {
color: @idle-inhibitor-active-color;
border-bottom-color: @idle-inhibitor-active-color;
}
#memory {
color: @memory-color;
border-bottom-color: @memory-color;
}
#mode {
color: @mode-color;
border-bottom-color: @mode-color;
}
#mpd {
color: @mpd-color;
border-bottom-color: @mpd-color;
}
#network {
color: @network-color;
border-bottom-color: @network-color;
}
#network.wifi {
color: @network-color;
border-bottom-color: @network-color;
}
#network.ethernet{
color: @network-ethernet-color;
border-bottom-color: @network-ethernet-color;
}
#network.disconnected {
color: @network-disconnected-color;
border-bottom-color: @network-disconnected-color;
}
#pulseaudio {
color: @pulseaudio-color;
border-bottom-color: @pulseaudio-color;
}
#pulseaudio.muted {
color: @pulseaudio-muted-color;
border-bottom-color: @pulseaudio-muted-color;
}
#temperature {
color: @temperature-color;
border-bottom-color: @temperature-color;
}
#temperature.warning {
color: @temperature-warning-color;
border-bottom-color: @temperature-warning-color;
}
#temperature.critical {
color: @temperature-critical-color;
border-bottom-color: @temperature-critical-color;
}
#tray {
background-color: @background;
border-bottom-color: @tray-color;
padding: 0 10px;
margin: 0 2px;
}
#tray > .needs-attention {
-gtk-icon-effect: highlight;
color: @red;
border-bottom-color: @red;
}
#tray > .passive {
-gtk-icon-effect: dim;
}
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
weather=$(curl -s "https://wttr.in/?format=%C")
temp=$(curl -s "https://wttr.in/?format=%t")
feels_like_time=$(curl -s "https://wttr.in/?format=%f")
if [[ $weather == *"Sunny"* ]]; then icon=""
elif [[ $weather == *"Clear"* ]]; then icon=""
elif [[ $weather == *"Partly cloudy"* ]]; then icon=""
elif [[ $weather == *"Cloudy"* ]]; then icon=""
elif [[ $weather == *"Very cloudy"* ]]; then icon=""
elif [[ $weather == *"Overcast"* ]]; then icon=""
elif [[ $weather == *"Fog"* ]]; then icon=""
elif [[ $weather == *"Mist"* ]]; then icon=""
elif [[ $weather == *"Light rain"* ]]; then icon=""
elif [[ $weather == *"Patchy rain"* ]]; then icon=""
elif [[ $weather == *"Light drizzle"* ]]; then icon=""
elif [[ $weather == *"Showers"* ]]; then icon=""
elif [[ $weather == *"Rain"* ]]; then icon=""
elif [[ $weather == *"Light snow"* ]]; then icon=""
elif [[ $weather == *"Patchy snow"* ]]; then icon=""
elif [[ $weather == *"Snow"* ]]; then icon=""
elif [[ $weather == *"Thunder"* ]]; then icon=""
else icon=""
fi
echo "$icon <span color='#dedede'>$temp ($feels_like_time)</span>"