Browse Source

Various Waybar updates

Clean up stylesheet
Add mpd
etc.
master
John Mertz 5 months ago
parent
commit
d5b9fcfaa5
2 changed files with 169 additions and 137 deletions
  1. +73
    -86
      waybar/config.template
  2. +96
    -51
      waybar/style.css

+ 73
- 86
waybar/config.template View File

@@ -10,14 +10,19 @@
"height": 23, // Waybar height (to be removed for auto height)
"width": __WIDTH__, // Waybar width (optional; will use full width if not defined)
// Choose the order of the modules
"modules-left": ["custom/launcher", "sway/mode", "sway/workspaces"],
"modules-left": ["custom/launcher", "sway/workspaces", "sway/mode"],
"modules-center": ["sway/window"],
"modules-right": ["network", "network#wireguard", "network#openvpn", "cpu", "memory", "temperature", "backlight", "custom/disk", "pulseaudio", "battery", "custom/clock", "tray", "idle_inhibitor", "custom/power"],
"modules-right": ["mpd", "network", "network#wireguard", "cpu", "memory", "custom/disk", "temperature", "backlight", "custom/battery", "pulseaudio", "custom/clock", "tray", "idle_inhibitor", "custom/power"],
// Modules configuration
"custom/launcher": {
"format": "Start",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/drun.sh; fi"
},
"sway/workspaces": {
// "disable-scroll": true,
// "all-outputs": true,
// "disable-scroll": true,
// "all-outputs": true,
"format": "{icon}",
"numeric-first": true,
"format-icons": {
"0": "0 \uf073",
"1": "1 \uf27a",
@@ -40,102 +45,74 @@
"C8": "C8",
"C9": "C9",
"grave": "",
"urgent": "!"
// "focused": "",
"urgent": "!",
"focused": ""
// "default": ""
}
},
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"custom/clock": {
"interval": 60,
"on-click": "orage -t",
"exec": "date '+%H:%M'"
"mpd": {
"server": "10.10.0.66",
"port": "6600",
"interval": 10,
"timeout": 30,
"unknown-tag": "⚠",
"format": "▶️ {title} - {artist} ",
"format-paused": "⏸️ {title} - {artist}",
"format-stopped": "⏹️ mpd",
"format-disconnected": "⚠ mpd",
"on-click": "/home/jpm/scripts/waybar/waybar-ncmpcpp.sh"
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"activated": "",
"deactivated": ""
}
"network": {
// "interface": "wlp58s0", // (Optional) To force the use of this interface
"format-ethernet": " {ipaddr}",
"format-wifi": " {ipaddr}",
"format-disconnected": "⚠ Disconnected",
"on-click": "/home/jpm/scripts/waybar/waybar-nm.sh"
//"on-click": "if [ $(sudo pgrep -c nmtui) -gt 0 ]; then sudo pkill nmtui; else /usr/bin/uxterm -e 'sudo /usr/bin/nmtui'; fi"
},
"tray": {
// "icon-size": 21,
"spacing": 10
"network#wireguard": {
"interface": "wg0", // (Optional) To force the use of this interface
"format": "🔒 {ipaddr}",
"format-disconnected": "🔓",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/rofi-openvpn.sh; fi"
},
"cpu": {
"format": "{usage}%",
"tooltip": false,
"format": "{usage}%",
"tooltip": true,
"on-click": "/home/jpm/scripts/waybar/waybar-cpu.sh"
},
"memory": {
"format": "{}%",
"format": "{}%",
"on-click": "/home/jpm/scripts/waybar/waybar-mem.sh"
},
"custom/disk": {
"format": "\uf0a0{}",
"exec": "df / | tail -n 1 | awk {'print $5'}",
"on-click": "/home/jpm/scripts/waybar/waybar-disk.sh"
},
"temperature": {
// "thermal-zone": 2,
// "hwmon-path": "/sys/class/hwmon/hwmon2/temp1_input",
"critical-threshold": 80,
// "format-critical": "{temperatureC}°C ",
"format": "{temperatureC}°C "
"format": " {temperatureC}°C"
},
"backlight": {
// "device": "acpi_video1",
"format": "{percent}% {icon}",
"format-icons": ["", ""]
},
"battery": {
"states": {
// "good": 95,
"warning": 30,
"critical": 15
},
"format": "{capacity}% {icon}",
// "format-good": "", // An empty format will hide the module
// "format-full": "",
"format-icons": ["", "", "", "", ""],
"on-click": "if [[ $(pgrep -fc tlpui) -gt 1 ]]; then pkill -f tlpui; else tlpui; fi"
},
"battery#bat2": {
"bat": "BAT2"
},
"network": {
"interface": "wlp58s0", // (Optional) To force the use of this interface
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ifname}: {ipaddr} ",
"format-disconnected": " Disconnected ⚠ ",
"on-click": "if [ $(sudo pgrep -c nmtui) -gt 0 ]; then sudo pkill nmtui; else /usr/bin/uxterm -e 'sudo /usr/bin/nmtui'; fi"
"format": "{icon} {percent}%",
"format-icons": [ "•", "☼", "o", "", ""]
},
"network#wireguard": {
"interface": "wg0", // (Optional) To force the use of this interface
"format": "{ipaddr} ",
"format-disconnected": "",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/rofi-openvpn.sh; fi"
},
"network#openvpn": {
"interface": "tun0", // (Optional) To force the use of this interface
"format": "{ipaddr} ",
"format-disconnected": "",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/rofi-openvpn.sh; fi"
},
"custom/disk": {
"format": "{} \uf0a0",
"exec": "df / | tail -n 1 | awk {'print $5'}",
"on-click": "/home/jpm/scripts/waybar/waybar-disk.sh"
},
"custom/power": {
"format": "\u23FB",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/rofi-power-menu.sh; fi"
},
"custom/launcher": {
"format": "Start",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/drun.sh; fi"
"custom/battery": {
"format": "{}",
"return-type": "json",
"exec": "/home/jpm/scripts/thinkpad/pow.pl -b",
"interval": 5,
"on-click": "notify-send Power \"`/home/jpm/scripts/thinkpad/pow.pl -p`\""
},
"pulseaudio": {
//"scroll-step": 1,
"format": "{volume}% {icon}",
"format-bluetooth": "{volume}% {icon}",
"format": "{icon} {volume}%",
"format-bluetooth": "{icon} {volume}%",
"format-muted": "",
"format-icons": {
"headphones": "",
@@ -146,17 +123,27 @@
"car": "",
"default": ["", ""]
},
"on-click": "pavucontrol"
"on-click": "/home/jpm/scripts/waybar/waybar-audio.sh"
},
"custom/media": {
"format": "{icon} {}",
"return-type": "json",
"max-length": 40,
"custom/clock": {
"interval": 60,
"on-click": "orage -t",
"exec": "date '+%H:%M'"
},
"tray": {
// "icon-size": 21,
"spacing": 10
},
"idle_inhibitor": {
"format": "{icon}",
"format-icons": {
"spotify": "",
"default": "🎜"
"activated": "",
"deactivated": ""
},
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
}
"on-click": "echo {status} > .config/idle_inhibitor"
},
"custom/power": {
"format": "\u23FB",
"on-click": "if [ $(sudo pgrep -c rofi) -gt 0 ]; then pkill rofi; else /home/jpm/scripts/rofi/rofi-power-menu.sh; fi"
},
}]

+ 96
- 51
waybar/style.css View File

@@ -28,120 +28,133 @@
}

window#waybar {
background: #1D2021;
background-color: #1D2021;
color: #A89984;
}

#custom-state, #custom-clock, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-disk, #tray, #mode, #idle_inhibitor, #custom-launcher {
#custom-launcher, #workspaces, #mode, #window, #mpd, #network, #cpu, #memory, #custom-disk, #temperature, #backlight, #custom-battery, #pulseaudio, #custom-clock, #tray, #idle_inhibitor, #custom-power {
padding: 0 5px;
margin: 0px;
}

#custom-state, #battery, #cpu, #memory, #temperature, #backlight, #network, #pulseaudio, #custom-disk, #tray, #mode {
/* color: #EBDBB2; */
color: #FFFFFF;
}

#custom-clock, #idle_inhibitor, #custom-state, #workspaces, #window {
background: #1D2021;
color: #FFFFFF;
}

/* Start Launcher */

#custom-launcher {
background: #458588;
color: #FFFFFF;
background-color: #458588;
}

/* Workspaces */

#workspaces button.focused {
background: #928374;
#workspaces button.visible {
background-color: #928374;
color: #FFFFFF;
}

#workspaces button.focused {
background-color: #FFFFFF;
color: #928374;
}

#workspaces button.urgent {
background: #FB4934;
background-color: #FB4934;
color: #FFFFFF;
}

/* Mode */

#mode {
background: #928374;
background-color: #928374;
color: #1D2021;
}

/* Window title */

#window {
padding-right: 10px;
color: #FFFFFF;
}

/* Pulseaudio */

#pulseaudio {
background: #68986A;
}
/* MPD */

#pulseaudio.muted {
background: #928374;
#mpd {
background-color: #EBDBB2;
color: #1D2021;
}

/* Networks */

#network {
background: #458588;
background-color: #458588;
color: #FFFFFF;
}

#network.disconnected {
background: #800;
background-color: #458588;
color: #F04;
padding: 0px;
}

/* Resources */

#custom-disk {
background: #B16286;
#network.wifi {
background-color: #458588;
color: #FFFFFF;
}

/* CPU */

#cpu {
background: #080;
background-color: #080;
color: #FFFFFF;
}

/* Memory */

#memory {
background: #D3869B;
background-color: #D3869B;
color: #FFFFFF;
}

/* Power */
/* Disk */

#temperature.critical {
background: #CC241D;
#custom-disk {
background-color: #B16286;
color: #FFFFFF;
}

/* Temperature */

#temperature {
background: #98971A;
background-color: #98971A;
color: #FFFFFF;
}

#temperature.critical {
background-color: #CC241D;
}

/* Backlight */

#backlight {
background: #B8BB26;
background-color: #B8BB26;
color: #FFFFFF;
}

#battery {
background: #D79921;
/* Battery */

#custom-battery {
background-color: #D79921;
color: #FFFFFF;
}

#battery.charging {
background: #68986A;
#custom-battery.charging {
background-color: #080;
}

@keyframes blink {
to {
background: #CC241D;
}
#custom-battery.discharging {
background-color: #98971A;
}

#battery.critical:not(.charging) {
background: #D79921;
#custom-battery.critical {
background-color: #D79921;
animation-name: blink;
animation-duration: 0.5s;
animation-timing-function: linear;
@@ -149,13 +162,45 @@ window#waybar {
animation-direction: alternate;
}

/* Pulseaudio */

#pulseaudio {
background-color: #68986A;
color: #FFFFFF;
}

#pulseaudio.muted {
background-color: #928374;
}

/* Clock */

#custom-clock {
color: #FFFFFF;
}

/* Tray/Dock */

#tray {
background: #83a598;
background-color: #83A598;
color: #FFFFFF;
}

/* Idle Inhibitor */

#idle_inhibitor {
color: #FFFFFF;
}

#idle_inhibitor.activated {
background-color: #fff;
color: #444;
background-color: #FFFFFF;
color: #1D2021;
}

/* Power button */

#custom-power {
background-color: #CC241D;
color: #FFFFFF;
}


Loading…
Cancel
Save