diff --git a/scripts/.local/share/scripts/org-clock-status b/scripts/.local/share/scripts/org-clock-status new file mode 100755 index 0000000..41f04d0 --- /dev/null +++ b/scripts/.local/share/scripts/org-clock-status @@ -0,0 +1,12 @@ +#!/bin/sh + +emacs_pid=$(pidof emacs) + +if [ -z "$emacs_pid" ]; then + echo "" + exit 0 +fi + +CLOCK_STATUS=$(emacsclient --eval "(bergheim/org-clock-status)" 2>/dev/null) + +echo "${CLOCK_STATUS:1:-1}" diff --git a/waybar/.config/waybar/config b/waybar/.config/waybar/config index 108f8f5..079981e 100644 --- a/waybar/.config/waybar/config +++ b/waybar/.config/waybar/config @@ -1,7 +1,7 @@ { "layer": "top", // Waybar at top layer "height": 25, // Waybar height (to be removed for auto height) - "modules-left": ["sway/workspaces"], + "modules-left": ["sway/workspaces", "custom/org-pomodoro"], "modules-center": ["clock"], "modules-right": ["mpd", "network", "pulseaudio", "battery", "battery#bat2"], // Modules configuration @@ -115,5 +115,9 @@ "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/org-pomodoro": { + "format": " {}", + "exec": "$HOME/.local/share/scripts/org-clock-status", + "interval": 2 } } diff --git a/waybar/.config/waybar/style.css b/waybar/.config/waybar/style.css index a74e3aa..5ef21ce 100644 --- a/waybar/.config/waybar/style.css +++ b/waybar/.config/waybar/style.css @@ -73,6 +73,9 @@ window#waybar.chromium { padding: 0 10px; margin: 0 4px; } +#custom-org-pomodoro{ + padding: 0 10px; +} #clock { }