From 72c39240811f1def43fca71de51566d206f7728d Mon Sep 17 00:00:00 2001 From: Robert Günzler Date: Thu, 21 Jan 2021 19:33:10 +0100 Subject: Update 2021-01-21T18:33:10Z --- .config/waybar/config | 97 ++++++++++++++++++++++----------------- .config/waybar/modules/weather.sh | 4 ++ .config/waybar/style.css | 15 ++++-- 3 files changed, 70 insertions(+), 46 deletions(-) (limited to '.config/waybar') diff --git a/.config/waybar/config b/.config/waybar/config index aed7d08..40e06a4 100644 --- a/.config/waybar/config +++ b/.config/waybar/config @@ -7,7 +7,7 @@ "modules-left": ["sway/mode", "sway/workspaces", "sway/window", "custom/mpv", "custom/mpd", "custom/spotify", "custom/toggl"], "modules-center": ["custom/weather", "clock#local", "clock#utc"], - "modules-right": ["tray", "cpu", "memory", "disk#root", "disk#home", "temperature", "idle_inhibitor", "backlight", "custom/redshift", "pulseaudio", "network#wg", "network", "battery"], + "modules-right": ["tray", "cpu", "memory", "disk#root", "disk#home", "temperature", "idle_inhibitor", "backlight", "custom/redshift", "pulseaudio", "network#vpn", "network#tailscale", "network", "battery"], "sway/workspaces": { "disable-scroll": true, @@ -30,30 +30,31 @@ "idle_inhibitor": { "format": "{icon}", "format-icons": { - "activated": "󰛐", - "deactivated": "󰛑" + "activated": "󰅶", + "deactivated": "󰾪" } }, "tray": { "spacing": 10 }, "clock#local": { - "timezone": "Europe/Berlin", + // "timezone": "Europe/Berlin", + // "timezone": "Europe/Istanbul", "format": "{:%a %d %b %H:%M}", - "tooltip-format": "TZ: {:%Z %z}\n\n{calendar}" + "tooltip-format": "TZ: {:%Z %z}\n\n{calendar}" }, "clock#utc": { "timezone": "UTC", "format": "({:%Z %H:%M})", - "tooltip-format": "{:%Z %z}" + "tooltip-format": "{:%Z %z}" }, "disk#root": { - "path": "/", - "format": "󰋊 / {percentage_used}%" + "path": "/", + "format": "󰋊 / {percentage_used}%" }, "disk#home": { - "path": "/home", - "format": "/home {percentage_used}%" + "path": "/home", + "format": "/home {percentage_used}%" }, "cpu": { "format": "󰊚 {}%", @@ -69,13 +70,15 @@ "format-icons": ["󱃃", "󰔏", "󱃂", "󰸁"] }, "backlight": { - "states": { - "off": "1" - }, "format": "{icon} {percent}%", "format-icons": ["󰹐", "󰌶", "󰛩"], - "on-scroll-down": "light -D 5", + "on-scroll-down": "light -A 5", "on-scroll-up": "light -U 5", + // save current level + // then set to minimum brightness + "on-click-right": "light -O; light -S $(light -P)", + // revert to previously saved brightness + "on-click-middle": "light -I" }, "battery": { "states": { @@ -100,13 +103,21 @@ "tooltip-format-disconnected": "disconnected", "on-click": "swx -t -f iwctl" }, - "network#wg": { + "network#vpn": { "interface": "wg0", - "format": "󰯄", - "tooltip-format": "wg0: {ipaddr}/{cidr}", + "format": "󰌆", + "tooltip-format": "{ifname}: {ipaddr}/{cidr}", + "tooltip-format-disconnected": "disconnected", + "on-click": "doas wg-quick up wg0", + "on-click-right": "doas wg-quick down wg0" + }, + "network#tailscale": { + "interface": "tailscale0", + "format": "󰹻", // "󰈓", // "󰠳", + "tooltip-format": "{ifname}: {ipaddr}/{cidr}", "tooltip-format-disconnected": "disconnected", - "on-click": "doas wg-quick up wg0", - "on-click-right": "doas wg-quick down wg0" + "on-click": "doas rc-service tailscale start", + "on-click-right": "doas rc-service tailscale stop" }, "pulseaudio": { "format": "{icon} {volume}%", @@ -131,46 +142,46 @@ "return-type": "json", "max-length": 80, "escape": false, - "interval": 2, + "interval": 2, "exec": "$HOME/.config/waybar/modules/waybar-media spotify", - "exec-if": "pgrep spotify" + "exec-if": "pgrep spotify" }, "custom/mpd": { - "format": "󰴙 {}", + "format": "󰐹 {}", "return-type": "json", "max-length": 80, - "interval": 2, + "interval": 2, "exec": "$HOME/.config/waybar/modules/waybar-media mpd", - "exec-if": "pgrep mpd" + "exec-if": "pgrep mpd" }, "custom/mpv": { "format": "󰐍 {}", "return-type": "json", "max-length": 80, - "interval": 2, + "interval": 2, "exec": "$HOME/.config/waybar/modules/waybar-media mpv", - "exec-if": "pgrep mpv" + "exec-if": "pgrep mpv" }, "custom/toggl": { - "format": "󰔟 {}", + "format": "󰔟 {}", "exec": "$HOME/.config/waybar/modules/toggl.lua 2>/dev/null", "interval": 30 }, "custom/redshift": { - "format": "{icon}", - "format-icons": { + "format": "{icon}", + "format-icons": { "day": "󰱌", - "night": "󰱊" + "night": "󰱊" }, "exec-if": "pgrep redshift", "exec": "$HOME/.config/waybar/modules/waybar-redshift", - "return-type": "json", - "on-click": "pkill -x -USR1 redshift", - "on-click-right": "pkill -x -HUP waybar-redshift" + "return-type": "json", + "on-click": "pkill -x -USR1 redshift", + "on-click-right": "pkill -x -HUP waybar-redshift" }, "custom/weather": { - "format": "{icon} {percentage}℃", - "format-icons": { + "format": "{icon} {percentage}℃", + "format-icons": { "sunny": "󰖙", "partlycloudy": "󰖕", "cloudy": "󰖐", @@ -182,15 +193,15 @@ "thunder": "󰖓", "lightsnow": "󰖘", "heavysnow": "󰼶", - "snowrain": "󰙿", + "snowrain": "󰙿" }, - "exec": "$HOME/.config/waybar/modules/weather.sh Berlin", - "interval": 600, - "return-type": "json", - "tooltip": true, - "signal": 4, - "on-click-right": "pkill -SIGRTMIN+5 waybar", - "on-click": "swx -t env REPORT=1 $HOME/.config/waybar/modules/weather.sh Berlin" + "exec": "$HOME/.config/waybar/modules/weather.sh", + "interval": 600, + "return-type": "json", + "tooltip": true, + "signal": 4, + "on-click-right": "pkill -SIGRTMIN+5 waybar", + "on-click": "swx -t env REPORT=1 $HOME/.config/waybar/modules/weather.sh Berlin" }, "mpd": { "format": "{stateIcon} {artist} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S})", diff --git a/.config/waybar/modules/weather.sh b/.config/waybar/modules/weather.sh index 210c20a..0b83de1 100755 --- a/.config/waybar/modules/weather.sh +++ b/.config/waybar/modules/weather.sh @@ -3,6 +3,10 @@ set -e [ -n "$DEBUG" ] && set -x loc=$1 +if [ -z "${loc}" ]; then + # use /etc/localtime + loc=$(basename "$(readlink -f /etc/localtime)") +fi if [ -n "$REPORT" ]; then curl -s v2.wttr.in/"${loc}"?F | less diff --git a/.config/waybar/style.css b/.config/waybar/style.css index e3d6206..9e41694 100644 --- a/.config/waybar/style.css +++ b/.config/waybar/style.css @@ -143,14 +143,22 @@ label:focus { border-top: 2px solid @urgent; color: @dimmed; } -#network.wg.disconnected { +#network.vpn.disconnected { border-top: 2px solid @dimmeddarker; } -#network.wg:not(.disconnected) { +#network.vpn:not(.disconnected) { border-top: 2px solid #c476ff; /* background: #c476ff; */ /* color: @dimmeddarker; */ } +#network.tailscale.disconnected { + border-top: 2px solid @dimmeddarker; +} +#network.tailscale:not(.disconnected) { + border-top: 2px solid #497e7a; + /* background: #497e7a; */ + /* color: @dimmeddarker; */ +} #pulseaudio {} #pulseaudio.muted { border-top: 2px solid @urgent; @@ -169,6 +177,7 @@ label:focus { } #idle_inhibitor.activated { color: unset; + border-top: 2px solid #7a8530; } #custom-mpd, @@ -203,7 +212,7 @@ label:focus { } } #custom-redshift.night { - border-top: 2px solid #ffae42; + border-top: 2px solid #97822e; color: @foreground; animation-name: flash; animation-duration: 0.3s; -- cgit 1.4.1