waybar: update config, optimize spacings

This commit is contained in:
Konstantin Koslowski 2021-07-24 08:25:43 +02:00
parent 6baf09b068
commit 93bf3cd7ea
4 changed files with 138 additions and 100 deletions

View file

@ -49,11 +49,11 @@ for i in range(len(title)):
## ongoing
if ts_start < ts_now:
if ts_start < ts_now and ts_now < ts_end:
text = f"{t_start[1]} - {t_end[1]} {t}"
text = f"{t_start[1]}-{t_end[1]} {t}"
alt = "now"
## upcoming
elif text == "-":
text = f"{t_start[1]} - {t_end[1]} {t}"
text = f"{t_start[1]}-{t_end[1]} {t}"
alt = "today"
line = f"{t_start[1]} - {t_end[1]}: {t}"
tooltip += f"\n{line}"

View file

@ -8,24 +8,26 @@
"height": 25,
"modules-left": [
"sway/workspaces",
"custom/separator#left"
"custom/separator#left",
"custom/separator#space"
],
"modules-center": [
"custom/separator#right",
"custom/media",
"custom/separator#center",
"pulseaudio",
"custom/separator#left"
"custom/separator#center",
"custom/card",
"custom/separator#center",
"custom/mail",
"custom/separator#left",
"custom/separator#space"
],
"modules-right": [
"custom/separator#right",
"custom/card",
"custom/separator#right",
"custom/mail",
"custom/separator#right",
"network#wl0",
"network#en0",
"network#vpn0",
// "network#en0",
// "network#vpn0",
"custom/separator#right",
"cpu",
"memory",
@ -37,25 +39,30 @@
"tray"
],
"custom/separator#left": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/separator#space": {
"format": " "
},
"custom/separator#center": {
// "format": " <span foreground='#268bd2'></span> "
"format": " <span foreground='#268bd2'>|</span> "
// "format": "<span foreground='#268bd2'></span>"
"format": "<span foreground='#268bd2'>|</span>"
},
"custom/separator#right": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/calendar": {
"format": "{icon} {}",
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 25,
"max-length": 40,
"interval": 300,
"format-icons": {
"now": "<span foreground='#fb4934'></span> ",
"today": "<span foreground='#b8bb26'></span> ",
"idle": " "
"now": "<span foreground='#fb4934'></span>",
"today": "<span foreground='#b8bb26'></span>",
"idle": ""
},
"escape": false,
"exec": "$HOME/.config/sway/bin/waybar_khal.py 2> /dev/null",
@ -85,8 +92,8 @@
"max-length": 6,
"interval": 30,
"format-icons": {
"unread": " ",
"read": " "
"unread": "",
"read": ""
},
"escape": true,
"exec": "$HOME/.config/sway/bin/waybar_mail.py 2> /dev/null"
@ -96,8 +103,8 @@
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 30,
"max-length": 40,
"min-length": 10,
"max-length": 30,
"format-icons": {
"chromium": " ",
"firefox": " ",
@ -108,11 +115,13 @@
"exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{: %a, %b %d, %H:%M}",
"format": "<span foreground='#ebdbb2'></span>{: %b %d, %H:%M}",
"on-click": "foot -T float khal interactive"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage:3}%",
"format": "<span foreground='#ebdbb2'></span>{usage:3}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -120,7 +129,9 @@
"on-click": "foot -T float bashtop"
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"format": "<span foreground='#ebdbb2'></span>{}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -134,19 +145,20 @@
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span> {capacity:3}%",
"format": "<span foreground='#ebdbb2'>{icon}</span>{capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span>{capacity:3}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength:3}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-disconnected": "<span foreground='#606060'></span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"min-length": 8,
"max-length": 30,
"tooltip-format": "{ifname} {essid} ({signalStrength:3}%)\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
@ -179,11 +191,11 @@
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#b8bb26'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon}</span> {volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'>{icon}</span>{format_source}",
"format-source": "<span foreground='#b8bb26'></span>",
"format-source-muted": "<span foreground='#fb4934'></span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
@ -193,11 +205,11 @@
"car": "",
"default": ["", "", ""]
},
"min-length": 9,
"max-length": 20,
"min-length": 7,
"max-length": 12,
"on-click": "$HOME/.config/sway/bin/sway_volume mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume gui",
"on-click-right": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-right": "$HOME/.config/sway/bin/sway_volume gui",
"on-scroll-up": "$HOME/.config/sway/bin/sway_volume increase",
"on-scroll-down": "$HOME/.config/sway/bin/sway_volume decrease-mute"
},

View file

@ -8,7 +8,8 @@
"height": 25,
"modules-left": [
"sway/workspaces",
"custom/separator#left"
"custom/separator#left",
"custom/separator#space"
],
"modules-center": [
"custom/separator#right",
@ -37,25 +38,30 @@
"tray"
],
"custom/separator#left": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/separator#space": {
"format": " "
},
"custom/separator#center": {
// "format": " <span foreground='#268bd2'></span> "
"format": " <span foreground='#268bd2'>|</span> "
// "format": "<span foreground='#268bd2'></span>"
"format": "<span foreground='#268bd2'>|</span>"
},
"custom/separator#right": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/calendar": {
"format": "{icon} {}",
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 25,
"max-length": 40,
"interval": 300,
"format-icons": {
"now": "<span foreground='#fb4934'></span> ",
"today": "<span foreground='#b8bb26'></span> ",
"idle": " "
"now": "<span foreground='#fb4934'></span>",
"today": "<span foreground='#b8bb26'></span>",
"idle": ""
},
"escape": false,
"exec": "$HOME/.config/sway/bin/waybar_khal.py 2> /dev/null",
@ -85,8 +91,8 @@
"max-length": 6,
"interval": 30,
"format-icons": {
"unread": " ",
"read": " "
"unread": "",
"read": ""
},
"escape": true,
"exec": "$HOME/.config/sway/bin/waybar_mail.py 2> /dev/null"
@ -96,8 +102,8 @@
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 30,
"max-length": 40,
"min-length": 10,
"max-length": 30,
"format-icons": {
"chromium": " ",
"firefox": " ",
@ -108,11 +114,13 @@
"exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{: %a, %b %d, %H:%M}",
"format": "<span foreground='#ebdbb2'></span>{: %b %d, %H:%M}",
"on-click": "foot -T float khal interactive"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage:3}%",
"format": "<span foreground='#ebdbb2'></span>{usage:3}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -120,7 +128,9 @@
"on-click": "foot -T float bashtop"
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"format": "<span foreground='#ebdbb2'></span>{}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -134,19 +144,20 @@
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span> {capacity:3}%",
"format": "<span foreground='#ebdbb2'>{icon}</span>{capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span>{capacity:3}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength:3}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-disconnected": "<span foreground='#606060'></span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"min-length": 8,
"max-length": 30,
"tooltip-format": "{ifname} {essid} ({signalStrength:3}%)\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
@ -179,11 +190,11 @@
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#b8bb26'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon}</span> {volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'>{icon}</span>{format_source}",
"format-source": "<span foreground='#b8bb26'></span>",
"format-source-muted": "<span foreground='#fb4934'></span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
@ -193,11 +204,11 @@
"car": "",
"default": ["", "", ""]
},
"min-length": 9,
"max-length": 20,
"min-length": 7,
"max-length": 12,
"on-click": "$HOME/.config/sway/bin/sway_volume mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume gui",
"on-click-right": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-right": "$HOME/.config/sway/bin/sway_volume gui",
"on-scroll-up": "$HOME/.config/sway/bin/sway_volume increase",
"on-scroll-down": "$HOME/.config/sway/bin/sway_volume decrease-mute"
},

View file

@ -8,51 +8,61 @@
"height": 25,
"modules-left": [
"sway/workspaces",
"custom/separator#left"
"custom/separator#left",
"custom/separator#space"
],
"modules-center": [
"custom/separator#right",
"custom/media",
"custom/separator#center",
"pulseaudio",
"custom/separator#left"
"custom/separator#center",
"custom/card",
"custom/separator#center",
"custom/mail",
"custom/separator#left",
"custom/separator#space"
],
"modules-right": [
"custom/separator#right",
"custom/card",
"custom/separator#right",
"custom/mail",
"custom/separator#right",
// "network#wl0",
"network#en0",
"network#vpn0",
// "network#vpn0",
"custom/separator#right",
"cpu",
"memory",
"custom/separator#right",
// "battery",
// "custom/separator#right",
"custom/calendar",
"clock",
"tray"
],
"custom/separator#left": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/separator#space": {
"format": " "
},
"custom/separator#center": {
// "format": " <span foreground='#268bd2'></span> "
"format": " <span foreground='#268bd2'>|</span> "
// "format": "<span foreground='#268bd2'></span>"
"format": "<span foreground='#268bd2'>|</span>"
},
"custom/separator#right": {
"format": " <span foreground='#268bd2'></span> "
"format": "<span foreground='#268bd2'></span>"
},
"custom/calendar": {
"format": "{icon} {}",
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 25,
"max-length": 40,
"interval": 300,
"format-icons": {
"now": "<span foreground='#fb4934'></span> ",
"today": "<span foreground='#b8bb26'></span> ",
"idle": " "
"now": "<span foreground='#fb4934'></span>",
"today": "<span foreground='#b8bb26'></span>",
"idle": ""
},
"escape": false,
"exec": "$HOME/.config/sway/bin/waybar_khal.py 2> /dev/null",
@ -82,8 +92,8 @@
"max-length": 6,
"interval": 30,
"format-icons": {
"unread": " ",
"read": " "
"unread": "",
"read": ""
},
"escape": true,
"exec": "$HOME/.config/sway/bin/waybar_mail.py 2> /dev/null"
@ -93,8 +103,8 @@
"tooltip-format": "{}",
"tooltip": true,
"return-type": "json",
"min-length": 30,
"max-length": 40,
"min-length": 10,
"max-length": 30,
"format-icons": {
"chromium": " ",
"firefox": " ",
@ -105,11 +115,13 @@
"exec": "$HOME/.config/sway/bin/waybar_mediaplayer.py 2> /dev/null"
},
"clock": {
"format": "<span foreground='#ebdbb2'> </span>{: %a, %b %d, %H:%M}",
"format": "<span foreground='#ebdbb2'></span>{: %b %d, %H:%M}",
"on-click": "foot -T float khal interactive"
},
"cpu": {
"format": "<span foreground='#ebdbb2'></span> {usage:3}%",
"format": "<span foreground='#ebdbb2'></span>{usage:3}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -117,7 +129,9 @@
"on-click": "foot -T float bashtop"
},
"memory": {
"format": "<span foreground='#ebdbb2'></span> {}%",
"format": "<span foreground='#ebdbb2'></span>{}%",
"min-length": 6,
"max-length": 10,
"states": {
"warning": 70,
"critical": 90
@ -131,19 +145,20 @@
"warning": 30,
"critical": 15
},
"format": "<span foreground='#ebdbb2'>{icon}</span> {capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span> {capacity:3}%",
"format": "<span foreground='#ebdbb2'>{icon}</span>{capacity:3}%",
"format-charging": "<span foreground='#268bd2'></span>{capacity:3}%",
"format-icons": ["", "", "", "", ""]
},
"network#wl0": {
"interval": 2,
"interface": "wl0",
"format": "{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname} {essid} ({signalStrength:3}%)",
"format-ethernet": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-wifi": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-linked": "<span foreground='#ebdbb2'> </span>{ifname}",
"format-disconnected": "<span foreground='#606060'></span>{ifname}",
"tooltip-format": "{ifname}\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"min-length": 8,
"max-length": 30,
"tooltip-format": "{ifname} {essid} ({signalStrength:3}%)\n\t{ipaddr}/{cidr}\n  \t{bandwidthDownBits}\n  \t{bandwidthUpBits}",
"tooltip-format-linked": "{ifname} linked",
"tooltip-format-disconnected": "{ifname} disconnected",
"on-click": "foot -T float nmtui"
@ -176,11 +191,11 @@
},
"pulseaudio": {
"format": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon} </span>{volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'> {icon} </span>{format_source}",
"format-muted": "<span foreground='#fb4934'> </span>{format_source}",
"format-source": "<span foreground='#b8bb26'> </span>{volume}%",
"format-source-muted": "<span foreground='#fb4934'> </span>",
"format-bluetooth": "<span foreground='#ebdbb2'>{icon}</span> {volume}% {format_source}",
"format-bluetooth-muted": "<span foreground='#fb4934'>{icon}</span>{format_source}",
"format-source": "<span foreground='#b8bb26'></span>",
"format-source-muted": "<span foreground='#fb4934'></span>",
"format-icons": {
"headphone": "🎧",
"hands-free": "",
@ -188,13 +203,13 @@
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
"default": ["", "", ""]
},
"min-length": 9,
"max-length": 20,
"min-length": 7,
"max-length": 12,
"on-click": "$HOME/.config/sway/bin/sway_volume mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume gui",
"on-click-right": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-middle": "$HOME/.config/sway/bin/sway_volume source-mute",
"on-click-right": "$HOME/.config/sway/bin/sway_volume gui",
"on-scroll-up": "$HOME/.config/sway/bin/sway_volume increase",
"on-scroll-down": "$HOME/.config/sway/bin/sway_volume decrease-mute"
},