add notifications and emacs-status widget

This commit is contained in:
cho 2023-06-18 20:55:44 +07:00
parent 5523e74082
commit 264eec4c48
4 changed files with 31 additions and 6 deletions

View File

@ -6,7 +6,7 @@
// Choose the order of the modules
"modules-left": ["sway/workspaces", "sway/mode", "custom/media"],
"modules-center": [],
"modules-right": ["idle_inhibitor", "mpd", "pulseaudio", "bluetooth", "network", "cpu", "memory", "temperature", "battery", "clock", "tray"],
"modules-right": ["idle_inhibitor", "mpd", "pulseaudio", "network", "cpu", "memory", "temperature", "battery", "tray", "clock", "custom/swaync", "custom/emacsstatus"],
"sway/workspaces": {
"disable-scroll-wraparound": true
},
@ -52,7 +52,8 @@
"clock": {
// "timezone": "America/New_York",
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
"format": "{:%Y-%m-%d %I:%M:%S %p}",
"format": "{:%Y-%m-%d %H:%M:%S}",
//"format": "{:%Y-%m-%d %I:%M:%S %p}",
"interval": 1
},
"cpu": {
@ -103,9 +104,9 @@
"on-click": "pavucontrol"
},
"mpd": {
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {artist} | {title} | {elapsedTime:%M:%S}/{totalTime:%M:%S}",
"format": "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon} {artist} - {title} | {elapsedTime:%M:%S}/{totalTime:%M:%S}",
// "max-length": 200,
"format-disconnected": "Disconnected",
"format-disconnected": "-",
"format-stopped": "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped",
"interval": 2,
"consume-icons": {
@ -139,6 +140,15 @@
"escape": true,
"exec": "$HOME/.config/waybar/mediaplayer.py 2> /dev/null" // Script in resources folder
// "exec": "$HOME/.config/waybar/mediaplayer.py --player spotify 2> /dev/null" // Filter player based on name
},
"custom/swaync": {
"exec": "~/.config/waybar/scripts/notifications.sh",
"on-click": "swaync-client -t",
"restart-interval": 1
},
"custom/emacsstatus": {
"exec": "~/.config/waybar/scripts/emacs-status.sh",
"on-click": "emacsclient -c || emacs",
"restart-interval": 3
}
}

View File

@ -0,0 +1,7 @@
pgrep emacs >/dev/null
if [ $? -eq 1 ]
then
echo 'X'
else
echo 'e+'
fi

View File

@ -0,0 +1,6 @@
#!/bin/sh
#
count="$(swaync-client -c)"
none="-"
if [ "$count" == "0" ]; then echo "$none" ; fi
if [ "$count" != "0" ]; then echo "$count" ; fi

View File

@ -71,6 +71,8 @@ window#waybar.chromium {
#mode,
#idle_inhibitor,
#bluetooth,
#custom-swaync,
#custom-emacsstatus,
#mpd {
padding: 0 6px;
border-right: 2px solid #424242;
@ -208,7 +210,7 @@ label:focus {
}
#mpd.disconnected {
background-color: #f53c3c;
/*background-color: #f53c3c;*/
}
#mpd.stopped {