diff options
Diffstat (limited to 'dot_config/waybar')
| -rw-r--r-- | dot_config/waybar/config | 188 | ||||
| -rw-r--r-- | dot_config/waybar/custom_modules/executable_cpugovernor.sh | 7 | ||||
| -rw-r--r-- | dot_config/waybar/custom_modules/executable_custom-gpu.sh | 14 | ||||
| -rw-r--r-- | dot_config/waybar/style.css | 308 |
4 files changed, 517 insertions, 0 deletions
diff --git a/dot_config/waybar/config b/dot_config/waybar/config new file mode 100644 index 0000000..866c83a --- /dev/null +++ b/dot_config/waybar/config @@ -0,0 +1,188 @@ +{ + "layer": "top", // Waybar at top layer + "position": "top", // Waybar position (top|bottom|left|right) + // "height": 36, // Waybar height (to be removed for auto height) + // Archived modules + // "custom/gpu", "bluetooth", "custom/weather", "temperature", "sway/window" + // Choose the order of the modules + "modules-left": [ "clock", "custom/pomodoro", "sway/mode", "idle_inhibitor", "custom/media"], + "modules-center": ["sway/workspaces"], + "modules-right": ["custom/crypto", "custom/pacman", "cpu", "temperature", "custom/gpu", "pulseaudio", "bluetooth", "network", "custom/vpn", "tray", "battery"], + // Modules configuration + "sway/workspaces": { + "disable-scroll": true, + "all-outputs": true, + "format": "{icon}", + }, + "sway/mode": { + "format": "<span style=\"italic\">{}</span>" + }, + "sway/window": { + "format": "{}", + "max-length": 50, + "tooltip": false + }, + "bluetooth": { + "interval": 30, + "format": "{icon}", + // "format-alt": "{status}", + "format-icons": { + "enabled": "", + "disabled": "" + }, + "on-click": "blueberry" + }, + "sway/language": { + "format": "<big></big> {}", + // "max-length": 5, + "min-length": 5, + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + }, + "tooltip": "true" + }, + "tray": { + //"icon-size": 11, + "spacing": 5 + }, + "custom/vpn": { + "format": "VPN ", + "exec": "echo '{\"class\": \"connected\"}'", + "exec-if": "test -d /proc/sys/net/ipv4/conf/wg0-mullvad", + "return-type": "json", + "interval": 5, + + }, + "clock": { + "format": " {:%I:%M %p %b %e}", + "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", + "today-format": "<b>{}</b>", + "on-click": "gnome-calendar" + }, + "cpu": { + "interval": "1", + "format": " {max_frequency}GHz <span color=\"darkgray\">| {usage}%</span>", + //"max-length": 13, + "min-length": 13, + "on-click": "wezterm -e htop --sort-key PERCENT_CPU", + "tooltip": false + }, + "temperature": { + //"thermal-zone": 1, + "interval": "4", + "hwmon-path": "/sys/class/hwmon/hwmon3/temp1_input", + "critical-threshold": 74, + "format-critical": " {temperatureC}°C", + "format": "{icon} {temperatureC}°C", + "format-icons": ["", "", ""], + "max-length": 7, + "min-length": 7 + }, + "network": { + // "interface": "wlan0", // (Optional) To force the use of this interface, + "format-wifi": " ", + "format-ethernet": "{ifname}: {ipaddr}/{cidr} ", + "format-linked": "{ifname} (No IP) ", + "format-disconnected": "", + "format-alt": "{ifname}: {ipaddr}/{cidr}", + "family": "ipv4", + "tooltip-format-wifi": " {ifname} @ {essid}\nIP: {ipaddr}\nStrength: {signalStrength}%\nFreq: {frequency}MHz\n {bandwidthUpBits} {bandwidthDownBits}", + "tooltip-format-ethernet": " {ifname}\nIP: {ipaddr}\n {bandwidthUpBits} {bandwidthDownBits}" + }, + "pulseaudio": { + "scroll-step": 3, // %, can be a float + "format": "{icon} {volume}% {format_source}", + "format-bluetooth": "{volume}% {icon} {format_source}", + "format-bluetooth-muted": " {icon} {format_source}", + "format-muted": " {format_source}", + //"format-source": "{volume}% ", + //"format-source-muted": "", + "format-source": "", + "format-source-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + }, + "on-click": "pavucontrol", + "on-click-right": "pactl set-source-mute @DEFAULT_SOURCE@ toggle" + }, + "custom/pacman": { + "format": "<big></big> {}", + "interval": 3600, // every hour + "exec": "checkupdates | wc -l", // # of updates + "exec-if": "exit 0", // always run; consider advanced run conditions + "on-click": "wezterm -e 'paru'; pkill -SIGRTMIN+8 waybar", // update system + "signal": 8, + // "max-length": 5, + "min-length": 3 + }, + "custom/weather": { + "exec": "curl 'https://wttr.in/?format=1'", + "interval": 3600 + }, + "custom/gpu": { + "exec": "$HOME/.config/waybar/custom_modules/custom-gpu.sh", + "return-type": "json", + "format": "{}", + "interval": 2, + "tooltip": "{tooltip}", + // "max-length": 19, + "on-click": "powerupp" + + }, + "custom/cpugovernor": { + "format": "{icon}", + "interval": "30", + "return-type": "json", + "exec": "$HOME/.config/waybar/custom_modules/cpugovernor.sh", + "min-length": 2, + "max-length": 2, + "format-icons": { + "perf": "", + "sched": "" + }, + }, + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "🎜" + }, + "escape": true, + "exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder + // "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name + }, + "custom/scratchpad-indicator": { + "interval": 3, + "return-type": "json", + "exec": "swaymsg -t get_tree | jq --unbuffered --compact-output '( select(.name == \"root\") | .nodes[] | select(.name == \"__i3\") | .nodes[] | select(.name == \"__i3_scratch\") | .focus) as $scratch_ids | [.. | (.nodes? + .floating_nodes?) // empty | .[] | select(.id |IN($scratch_ids[]))] as $scratch_nodes | { text: \"\\($scratch_nodes | length)\", tooltip: $scratch_nodes | map(\"\\(.app_id // .window_properties.class) (\\(.id)): \\(.name)\") | join(\"\\n\") }'", + "format": "{} ", + "on-click": "exec swaymsg 'scratchpad show'", + "on-click-right": "exec swaymsg 'move scratchpad'" + }, + "custom/pomodoro": { + "format": "{}", + "return-type": "json", + "exec": "waybar-module-pomodoro -w 30 -l 20", + "on-click": "waybar-module-pomodoro toggle", + "on-click-right": "waybar-module-pomodoro reset", + }, + "custom/crypto": { + "format": "{}", + "interval": 600, + "return-type": "json", + "exec": "waybar-crypto", // change this if you installed manually + "exec-if": "ping pro-api.coinmarketcap.com -c1" + }, +} diff --git a/dot_config/waybar/custom_modules/executable_cpugovernor.sh b/dot_config/waybar/custom_modules/executable_cpugovernor.sh new file mode 100644 index 0000000..bdd0b00 --- /dev/null +++ b/dot_config/waybar/custom_modules/executable_cpugovernor.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [ `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`="performance" ]; then + echo '{"text": "perf", "alt": "perf", "class": "performance", "tooltip": "<b>Governor</b> Performance"}' + #echo '' +elif [ `cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`="schedutil" ]; then + echo '{"text": "sched", "class": "schedutil", "tooltip": "<b>Governor</b> Schedutil"}' +fi
\ No newline at end of file diff --git a/dot_config/waybar/custom_modules/executable_custom-gpu.sh b/dot_config/waybar/custom_modules/executable_custom-gpu.sh new file mode 100644 index 0000000..822704b --- /dev/null +++ b/dot_config/waybar/custom_modules/executable_custom-gpu.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +raw_clock=$(cat /sys/class/drm/card1/device/pp_dpm_sclk | grep -oe '[0-9]{0,4}Mhz \W' | sed "s/Mhz \*//") +# clock=$(echo "scale=1;$raw_clock/1000" | bc | sed -e 's/^-\./-0./' -e 's/^\./0./') + +raw_temp=$(cat /sys/class/drm/card1/device/hwmon/hwmon4/temp1_input) +temperature=$(($raw_temp/1000)) +busypercent=$(cat /sys/class/hwmon/hwmon4/device/gpu_busy_percent) +deviceinfo=$(glxinfo -B | grep 'Device:' | sed 's/^.*: //') +driverinfo=$(glxinfo -B | grep "OpenGL version") + +# echo '{"text": "'$clock'GHz | '$temperature'°C <span color=\"darkgray\">| '$busypercent'%</span>", "class": "custom-gpu", "tooltip": "<b>'$deviceinfo'</b>\n'$driverinfo'"}' + +echo '{"text": "'$temperature'°C <span color=\"darkgray\">| '$busypercent'%</span>", "class": "custom-gpu", "tooltip": "<b>'$deviceinfo'</b>\n'$driverinfo'"}' diff --git a/dot_config/waybar/style.css b/dot_config/waybar/style.css new file mode 100644 index 0000000..98a6aec --- /dev/null +++ b/dot_config/waybar/style.css @@ -0,0 +1,308 @@ + +@keyframes blink-warning { + 70% { + color: @light; + } + + to { + color: @light; + background-color: @warning; + } +} + +@keyframes blink-critical { + 70% { + color: @light; + } + + to { + color: @light; + background-color: @critical; + } +} + + +/* ----------------------------------------------------------------------------- + * Styles + * -------------------------------------------------------------------------- */ + +/* COLORS */ + +/* Nord */ +@define-color bg #2E3440; +/*@define-color bg #353C4A;*/ +@define-color light #D8DEE9; +/*@define-color dark @nord_dark_font;*/ +@define-color warning #ebcb8b; +@define-color critical #BF616A; +@define-color mode #434C5E; +/*@define-color workspaces @bg;*/ +/*@define-color workspaces @nord_dark_font;*/ +/*@define-color workspacesfocused #434C5E;*/ +@define-color workspacesfocused #4C566A; +@define-color tray @workspacesfocused; +@define-color sound #EBCB8B; +@define-color network #5D7096; +@define-color memory #546484; +@define-color cpu #596A8D; +@define-color temp #4D5C78; +@define-color layout #5e81ac; +@define-color battery #88c0d0; +@define-color date #434C5E; +@define-color time #434C5E; +@define-color backlight #434C5E; +@define-color nord_bg #434C5E; +@define-color nord_bg_blue #546484; +@define-color nord_light #D8DEE9; +@define-color nord_light_font #D8DEE9; +@define-color nord_dark_font #434C5E; + +/* Reset all styles */ +* { + border: none; + border-radius: 3px; + min-height: 0; + margin: 0.2em 0.3em 0.2em 0.3em; +} + +/* The whole bar */ +#waybar { + background: @bg; + color: @light; + font-family: "Commit Mono", "Symbols Nerd Font"; + font-size: 13px; + font-weight: bold; +} + +/* Each module */ +#battery, +#clock, +#cpu, +#custom-layout, +#memory, +#mode, +#network, +#custom-vpn, +#pulseaudio, +#temperature, +#custom-alsa, +#custom-pacman, +#custom-weather, +#custom-gpu, +#tray, +#backlight, +#language, +#custom-crypto, +#custom-cpugovernor { + padding-left: 0.6em; + padding-right: 0.6em; +} + +/* Each module that should blink */ +#mode, +#memory, +#temperature, +#battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; +} + +/* Each critical module */ +#memory.critical, +#cpu.critical, +#temperature.critical, +#battery.critical { + color: @critical; +} + +/* Each critical that should blink */ +#mode, +#memory.critical, +#temperature.critical, +#battery.critical.discharging { + animation-name: blink-critical; + animation-duration: 2s; +} + +/* Each warning */ +#network.disconnected, +#memory.warning, +#cpu.warning, +#temperature.warning, +#battery.warning { + background: @warning; + color: @nord_dark_font; +} + +/* Each warning that should blink */ +#battery.warning.discharging { + animation-name: blink-warning; + animation-duration: 3s; +} + +/* And now modules themselves in their respective order */ + +#mode { /* Shown current Sway mode (resize etc.) */ + color: @light; + background: @mode; +} + +/* Workspaces stuff */ + +#workspaces { + color: #D8DEE9; + margin-right: 10px; +} + +#workspaces button { + font-weight: bold; /* Somewhy the bar-wide setting is ignored*/ + padding: 0; + /*color: #999;*/ + opacity: 0.3; + background: none; + font-size: 1em; +} + +#workspaces button.focused { + background: @workspacesfocused; + color: #D8DEE9; + opacity: 1; + padding: 0 0.4em; +} + +#workspaces button.urgent { + border-color: #c9545d; + color: #c9545d; + opacity: 1; +} + +#window { + margin-right: 40px; + margin-left: 40px; + font-weight: normal; +} +#bluetooth { + background: @nord_bg_blue; + font-size: 1.2em; + font-weight: bold; + padding: 0 0.6em; +} +#custom-gpu, #custom-vpn { + background: @nord_bg; + font-weight: bold; + padding: 0 0.6em; +} +#custom-weather { + background: @mode; + font-weight: bold; + padding: 0 0.6em; +} +#custom-pomodoro { + background: @mode; + font-weight: bold; + padding: 0 0.6em; +} +#custom-pacman { + background: @nord_light; + color: @nord_dark_font; + font-weight: bold; + padding: 0 0.6em; +} +#custom-scratchpad-indicator { + background: @nord_light; + color: @nord_dark_font; + font-weight: bold; + padding: 0 0.6em; +} +#idle_inhibitor { + background: @mode; + /*font-size: 1.6em;*/ + font-weight: bold; + padding: 0 0.6em; +} +#custom-alsa { + background: @sound; +} + +#network { + background: @nord_bg_blue; +} + +#memory { + background: @memory; +} + +#cpu { + background: @nord_bg; + color: #D8DEE9; +} +#cpu.critical { + color: @nord_dark_font; +} +#language { + background: @nord_bg_blue; + color: #D8DEE9; + padding: 0 0.4em; +} +#custom-cpugovernor { + background-color: @nord_light; + color: @nord_dark_font; +} +#custom-cpugovernor.perf { + +} +#temperature { + background-color: @nord_bg; + color: #D8DEE9; +} +#temperature.critical { + background: @critical; +} +#custom-layout { + background: @layout; +} + +#battery { + background: @battery; +} + +#backlight { + background: @backlight; +} + +#clock { + background: @nord_bg_blue; + color: #D8DEE9; +} +#clock.date { + background: @date; +} + +#clock.time { + background: @mode; +} + +#pulseaudio { /* Unsused but kept for those who needs it */ + background: @nord_bg_blue; + color: #D8DEE9; +} + +#pulseaudio.muted { + background: #BF616A; + color: #BF616A; + /* No styles */ +} +#pulseaudio.source-muted { + background: #D08770; + color: #D8DEE9; + /* No styles */ +} +#tray { + background: #434C5E; +} + +#custom-crypto { + background: @mode; + font-weight: bold; +} |
