diff options
author | luxagraf <sng@luxagraf.net> | 2020-02-16 13:23:56 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2020-02-16 13:23:56 -0500 |
commit | cd507c92f617d4a8a3f7bb0b43e425491ef7184d (patch) | |
tree | 42144ef0f35b91e7955f570c5ecc4bcec3c4d780 /.config/waybar |
initial commit of dotfiles
Diffstat (limited to '.config/waybar')
-rw-r--r-- | .config/waybar/config | 115 | ||||
-rw-r--r-- | .config/waybar/modules/storage.sh | 24 | ||||
-rw-r--r-- | .config/waybar/style.css | 71 | ||||
-rwxr-xr-x | .config/waybar/waybar.sh | 10 |
4 files changed, 220 insertions, 0 deletions
diff --git a/.config/waybar/config b/.config/waybar/config new file mode 100644 index 0000000..7fc5a76 --- /dev/null +++ b/.config/waybar/config @@ -0,0 +1,115 @@ +{ + "layer": "bottom", + "position": "bottom", + "height": 24, + "modules-left": ["sway/workspaces", "sway/mode"], + "modules-center": [""], + "modules-right": ["mpd", "network", "idle_inhibitor", "battery", "memory", "tray", "clock"], + "sway/mode": { + "format": " {}" + }, + "sway/workspaces": { + "format": "{name}", + "disable-scroll": true + }, + "clock": { + "format": "{:%a %b %d %H:%M}", + "tooltip": false, + "on-click": "~/./bin/cal.sh" + }, + "battery": { + "format": "{capacity}% {icon} | ", + "format-alt": "{time} {icon}", + "format-icons": ["", "", "", "", ""], + "format-charging": "{capacity}% CHR", + "interval": 30, + "states": { + "warning": 25, + "critical": 10 + }, + "tooltip": false + }, + "network": { + "interface": "wlp3s0", + "format": "{ifname}", + "format-wifi": "{essid} ({signalStrength}%) | ", + "format-ethernet": "{ifname} ", + "format-disconnected": "", //An empty format will hide the module. + "tooltip-format": "{ifname}", + "tooltip-format-wifi": "{essid} ({signalStrength}%) ", + "tooltip-format-ethernet": "{ifname} ", + "tooltip-format-disconnected": "Disconnected", + "max-length": 50, + "on-click": "alacritty -e nmtui", + "tooltip": false + }, + "pulseaudio": { + "format": "{icon}", + "format-alt": "{volume} {icon} | ", + "format-alt-click": "click-right", + "format-muted": "", + "format-icons": { + "phone": [" ", " ", " ", " "], + "default": ["", "", "", ""] + }, + "scroll-step": 10, + "on-click": "pavucontrol", + "tooltip": false + }, + "mpd": { + "format": "{stateIcon} {artist} - {album} - {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) | ", + "format-disconnected": "Disconnected ", + "format-stopped": "Stopped ", + "interval": 2, + "state-icons": { + "paused": "", + "playing": "" + }, + "tooltip": false, + "on-click": "mpc toggle", + "on-click-right": "mpc next" + }, + "custom/storage": { + "format": "{} ", + "format-alt": "{percentage}% ", + "format-alt-click": "click-right", + "return-type": "json", + "interval": 60, + "exec": "~/.config/waybar/modules/storage.sh" + }, + "backlight": { + "format": "{icon}", + "format-alt": "{percent}% {icon} | ", + "format-alt-click": "click-right", + "format-icons": ["", ""], + "on-scroll-down": "light -A 1", + "on-scroll-up": "light -U 1" + }, + "custom/weather": { + "format": "{}", + "format-alt": "{alt}: {}", + "format-alt-click": "click-right", + "interval": 1800, + "return-type": "json", + "exec": "~/.config/waybar/modules/weather.sh", + "exec-if": "ping wttr.in -c1" + }, + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + }, + "tooltip": false + }, + "cpu": { + "format": "{usage}% | ", + "tooltip": false + }, + "memory": { + "format": "{used:0.1f}G/{total:0.1f}G | " + }, + "tray": { + "icon-size": 16 + } +} diff --git a/.config/waybar/modules/storage.sh b/.config/waybar/modules/storage.sh new file mode 100644 index 0000000..d495da4 --- /dev/null +++ b/.config/waybar/modules/storage.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +mount="/" +warning=20 +critical=10 + +df -h -P -l "$mount" | awk -v warning=$warning -v critical=$critical ' +/\/.*/ { + text=$4 + tooltip="Filesystem: "$1"\rSize: "$2"\rUsed: "$3"\rAvail: "$4"\rUse%: "$5"\rMounted on: "$6 + use=$5 + exit 0 +} +END { + class="" + gsub(/%$/,"",use) + if ((100 - use) < critical) { + class="critical" + } else if ((100 - use) < warning) { + class="warning" + } + print "{\"text\":\""text"\", \"percentage\":"use",\"tooltip\":\""tooltip"\", \"class\":\""class"\"}" +} + ' diff --git a/.config/waybar/style.css b/.config/waybar/style.css new file mode 100644 index 0000000..d388c99 --- /dev/null +++ b/.config/waybar/style.css @@ -0,0 +1,71 @@ +* { + border: none; + border-radius: 0; + font-family: Sans; + font-size: 15px; + box-shadow: none; + text-shadow: none; + transition-duration: 0s; +} + +window { + color: rgba(217, 216, 216, 1); + background: rgba(35, 31, 32, 0.00); +} + +window#waybar.solo { + color: rgba(217, 216, 216, 1); + background: rgba(35, 31, 32, 0.85); +} + +#workspaces { + margin: 0 5px; +} + +#workspaces button { + padding: 0 5px; + color: rgba(217, 216, 216, 0.4); +} + +#workspaces button.visible { + color: rgba(217, 216, 216, 1); +} + +#workspaces button.focused { + border-top: 3px solid rgba(217, 216, 216, 1); + border-bottom: 3px solid rgba(217, 216, 216, 0); +} + +#workspaces button.urgent { + color: rgba(238, 46, 36, 1); +} + +#mode, #battery, #cpu, #memory, #network, #pulseaudio, #idle_inhibitor, #backlight, #custom-storage, #custom-spotify, #custom-weather, #custom-mail { + margin: 0px 6px 0px 10px; + min-width: 25px; +} + +#clock { + margin: 0px 16px 0px 10px; + min-width: 140px; +} + +#battery.warning { + color: rgba(255, 210, 4, 1); +} + +#battery.critical { + color: rgba(238, 46, 36, 1); +} + +#battery.charging { + color: rgba(217, 216, 216, 1); +} + +#custom-storage.warning { + color: rgba(255, 210, 4, 1); +} + +#custom-storage.critical { + color: rgba(238, 46, 36, 1); +} diff --git a/.config/waybar/waybar.sh b/.config/waybar/waybar.sh new file mode 100755 index 0000000..720620c --- /dev/null +++ b/.config/waybar/waybar.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q waybar + +# Wait until the processes have been shut down +while pgrep -x waybar >/dev/null; do sleep 1; done + +# Launch main +waybar |