diff options
-rw-r--r-- | config | 184 | ||||
-rw-r--r-- | style.css | 32 | ||||
-rwxr-xr-x | waybar-dwl.sh | 10 |
3 files changed, 182 insertions, 44 deletions
@@ -1,72 +1,200 @@ +[{ + // "layer": "top", // Waybar at top layer + // "position": "bottom", // Waybar position (top|bottom|left|right) + "height": 30, // Waybar height (to be removed for auto height) + // "width": 1280, // Waybar width + "spacing": 0, // Gaps between modules (4px) + // Choose the order of the modules + "modules-left": [ "custom/dwl_tag#0", "custom/dwl_tag#1", "custom/dwl_tag#2", "custom/dwl_tag#3", "custom/dwl_tag#4", "custom/dwl_tag#5", "custom/dwl_tag#6", "custom/dwl_tag#7", "custom/dwl_tag#8", "custom/dwl_layout", "custom/dwl_title" ], + "modules-center": [], + "modules-right": [ "pulseaudio", "network", "temperature", "battery", "clock", "tray" ], + "output": "eDP-1", + // Modules configuration + "custom/dwl_tag#0": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 0", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#1": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 1", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#2": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 2", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#3": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 3", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#4": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 4", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#5": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 5", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#6": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 6", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#7": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 7", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#8": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 8", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_tag#9": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' 9", + "format": "{}", + "return-type": "json" + }, + "custom/dwl_layout": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' layout", + "format": "{}", + "escape": true, + "return-type": "json" + }, + "custom/dwl_title": { + "exec": "~/.config/waybar/waybar-dwl.sh 'eDP-1' title", + "format": "{}", + "escape": true, + "return-type": "json" + }, + "tray": { + // "icon-size": 21, + "spacing": 10 + }, + "clock": { + // "timezone": "America/New_York", + }, + "temperature": { + // "thermal-zone": 2, + // "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input", + // "critical-threshold": 80, + // "format-critical": "{temperatureC}°C {icon}", + "format": "{icon} {temperatureC}°C", + "format-icons": ["糖"] + }, + "battery": { + "states": { + // "good": 95, + "warning": 30, + "critical": 15 + }, + "format": "{icon} {capacity}%", + "format-charging": " {capacity}%", + "format-plugged": " {capacity}%", + "format-icons": ["", "", "", "", ""] + }, + "network": { + // "interface": "wlp2*", // (Optional) To force the use of this interface + "states": { + "warning": 30, + "critical": 15 + }, + "format-wifi": "直 {essid} ({signalStrength}%)", + "format-ethernet": " {ipaddr}/{cidr}", + "tooltip-format": " {ifname} via {gwaddr}", + "format-linked": " {ifname} (No IP)", + "format-disconnected": " Disconnected" + }, + "pulseaudio": { + // "scroll-step": 1, // %, can be a float + "format": "{icon} {volume}%", + "format-muted": "婢 {volume}%", + "format-icons": { + //"headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["奄", "奔", "墳"] + }, + }, +}, { // "layer": "top", // Waybar at top layer // "position": "bottom", // Waybar position (top|bottom|left|right) - "height": 40, // Waybar height (to be removed for auto height) + "height": 30, // Waybar height (to be removed for auto height) // "width": 1280, // Waybar width - "spacing": 4, // Gaps between modules (4px) + "spacing": 0, // Gaps between modules (4px) // Choose the order of the modules - "modules-left": ["custom/dwl_tag#0", "custom/dwl_tag#1", "custom/dwl_tag#2", "custom/dwl_tag#3", "custom/dwl_tag#4", "custom/dwl_tag#5", "custom/dwl_tag#6", "custom/dwl_tag#7", "custom/dwl_tag#8", "custom/dwl_layout" ], - "modules-center": [ "custom/dwl_title" ], + "modules-left": [ "custom/dwl_tag#0", "custom/dwl_tag#1", "custom/dwl_tag#2", "custom/dwl_tag#3", "custom/dwl_tag#4", "custom/dwl_tag#5", "custom/dwl_tag#6", "custom/dwl_tag#7", "custom/dwl_tag#8", "custom/dwl_layout", "custom/dwl_title" ], + "modules-center": [], "modules-right": [ "pulseaudio", "network", "temperature", "battery", "clock", "tray" ], - // Modules configuration + "output": "DP-2", + // Modules configuration "custom/dwl_tag#0": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 0", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 0", "format": "{}", "return-type": "json" }, "custom/dwl_tag#1": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 1", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 1", "format": "{}", "return-type": "json" }, "custom/dwl_tag#2": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 2", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 2", "format": "{}", "return-type": "json" }, "custom/dwl_tag#3": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 3", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 3", "format": "{}", "return-type": "json" }, "custom/dwl_tag#4": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 4", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 4", "format": "{}", "return-type": "json" }, "custom/dwl_tag#5": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 5", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 5", "format": "{}", "return-type": "json" }, "custom/dwl_tag#6": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 6", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 6", "format": "{}", "return-type": "json" }, "custom/dwl_tag#7": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 7", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 7", "format": "{}", "return-type": "json" }, "custom/dwl_tag#8": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 8", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 8", "format": "{}", "return-type": "json" }, "custom/dwl_tag#9": { - "exec": "~/.config/waybar/waybar-dwl.sh '' 9", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' 9", "format": "{}", "return-type": "json" }, "custom/dwl_layout": { - "exec": "~/.config/waybar/waybar-dwl.sh '' layout", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' layout", "format": "{}", "escape": true, "return-type": "json" }, "custom/dwl_title": { - "exec": "~/.config/waybar/waybar-dwl.sh '' title", + "exec": "~/.config/waybar/waybar-dwl.sh 'DP-2' title", "format": "{}", "escape": true, "return-type": "json" @@ -77,7 +205,6 @@ }, "clock": { // "timezone": "America/New_York", - "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>", }, "temperature": { // "thermal-zone": 2, @@ -85,7 +212,7 @@ // "critical-threshold": 80, // "format-critical": "{temperatureC}°C {icon}", "format": "{icon} {temperatureC}°C", - "format-icons": [""] + "format-icons": ["糖"] }, "battery": { "states": { @@ -100,25 +227,28 @@ }, "network": { // "interface": "wlp2*", // (Optional) To force the use of this interface - "format-wifi": " {essid} ({signalStrength}%)", + "states": { + "warning": 30, + "critical": 15 + }, + "format-wifi": "直 {essid} ({signalStrength}%)", "format-ethernet": " {ipaddr}/{cidr}", "tooltip-format": " {ifname} via {gwaddr}", "format-linked": " {ifname} (No IP)", - "format-disconnected": "⚠ Disconnected", + "format-disconnected": " Disconnected" }, "pulseaudio": { // "scroll-step": 1, // %, can be a float - "format": " {volume}%", - "format-muted": " {volume}%", + "format": "{icon} {volume}%", + "format-muted": "婢 {volume}%", "format-icons": { - "headphone": "", + //"headphone": "", "hands-free": "", "headset": "", "phone": "", "portable": "", "car": "", - "default": ["", "", ""] + "default": ["奄", "奔", "墳"] }, }, -} - +}] @@ -4,8 +4,8 @@ window#waybar { border: none; border-radius: 0; - font-family: "JetBrains Mono Nerd Font Mono"; - font-size: 12pt; + font-family: "Iosevka Nerd Font"; + font-size: 13pt; min-height: 0; background: @background; color: @foreground; @@ -17,36 +17,42 @@ window#waybar { } #custom-dwl_tag { - margin: 3px; - font-size: 18pt; + margin: 0; + padding: 0 3px 0 3px; + color: @foreground; } #custom-dwl_tag.urgent { background-color: @color10; + color: @foreground; } #custom-dwl_tag.active { - color: @color4; + color: @foreground; } -#custom-dwl_tag.selected { - color: @background; - background: @foreground; +#custom-dwl_tag.selected, #custom-dwl_title { + color: @color4; + /*background-color: @color4;*/ } #custom-dwl_title { - margin: 3px; - color: @background; - background: @foreground; - padding-left: 10px; - padding-right: 10px; + padding: 0 10px 0 10px; } #pulseaudio, #network, #temperature, #backlight, #battery, #clock { padding: 0 10px 0 10px; + color: @background; } +#pulseaudio { background-color: @color1; } +#network { background-color: @color2; } +#temperature { background-color: @color3; } +#backlight { background-color: @color6; } +#battery { background-color: @color8; } +#clock { color: @foreground; } + /*#pulseaudio { color: @color6; } #network { color: @color10; } #temperature { color: @color6; } diff --git a/waybar-dwl.sh b/waybar-dwl.sh index 08e36fe..e698bcd 100755 --- a/waybar-dwl.sh +++ b/waybar-dwl.sh @@ -115,7 +115,8 @@ declare -a tags name readonly fname="$HOME"/.cache/dwltags tags=( "1" "2" "3" "4" "5" "6" "7" "8" "9" ) -name=( "" "" "" "ﴬ" "" "" "" "" "ﳁ" ) # Array of labels for tags +# name=( "" "" "" "ﴬ" "" "" "" "" "ﳁ" ) # Array of labels for tags +name=( "1" "2" "3" "4" "5" "6" "7" "8" "9" ) # Array of labels for tags monitor="${1}" component="${2}" @@ -155,8 +156,9 @@ while [[ -n "$(pgrep waybar)" ]] ; do "You need to redirect dwl stdout to ~/.cache/dwltags" >&2 # Get info from the file - output="$(grep "${monitor}" "${fname}" | tail -n6)" - title="$(echo "${output}" | grep '^[[:graph:]]* title' | cut -d ' ' -f 3- | sed s/\"/“/g )" # Replace quotes - prevent waybar crash + #output="$(grep "${monitor}" "${fname}" | tail -n6)" + output="$(grep "${monitor}" "${fname}" | tail -n6)" + title="$(echo "${output}" | grep '^[[:graph:]]* title' | cut -d ' ' -f 3- | sed s/\"/“/g )" # Replace quotes - prevent waybar crash layout="$(echo "${output}" | grep '^[[:graph:]]* layout' | cut -d ' ' -f 3- )" #selmon="$(echo "${output}" | grep 'selmon')" @@ -168,7 +170,7 @@ while [[ -n "$(pgrep waybar)" ]] ; do _cycle # 60-second timeout keeps this from becoming a zombified process when waybar is no longer running - inotifywait -t 60 -qq --event modify "${fname}" + inotifywait -t 1 -qq --event modify "${fname}" done |