Compare commits

...

2 Commits

Author SHA1 Message Date
d8f8d4425b fix notification spacing when no notifications 2025-10-10 00:57:56 -07:00
7f963a9a6c fix waybar config and some other stuff 2025-10-09 23:56:49 -07:00
4 changed files with 29 additions and 28 deletions

View File

@@ -42,6 +42,7 @@
"Sonarr - https://sonarr.suda.codes", "Sonarr - https://sonarr.suda.codes",
"Sonarr Anime - http://pve-main:6969", "Sonarr Anime - http://pve-main:6969",
"Sudacode - https://sudacode.com", "Sudacode - https://sudacode.com",
"Suwayomi - https://suwayomi.suda.codes",
"Tailscale - https://login.tailscale.com/admin/machines", "Tailscale - https://login.tailscale.com/admin/machines",
"Tranga - http://pve-main:9555", "Tranga - http://pve-main:9555",
"Truenas - https://truenas.unicorn-ilish.ts.net", "Truenas - https://truenas.unicorn-ilish.ts.net",

View File

@@ -20,7 +20,7 @@
// "modules-center": ["hyprland/window"], // "modules-center": ["hyprland/window"],
"modules-center": ["custom/notification"], "modules-center": ["custom/notification"],
"modules-right": [ "modules-right": [
"hyprland/scratchpad", // "hyprland/scratchpad",
// "idle_inhibitor", // "idle_inhibitor",
// "custom/notification", // "custom/notification",
"custom/updates", "custom/updates",
@@ -157,13 +157,13 @@
"format-disconnected": "Disconnected ⚠", "format-disconnected": "Disconnected ⚠",
"on-click": "$HOME/.config/rofi/scripts/rofi-wifi-menu.sh", "on-click": "$HOME/.config/rofi/scripts/rofi-wifi-menu.sh",
}, },
// "custom/weather": { "custom/weather": {
// "interval": 600, "interval": 600,
// "exec": "~/.config/waybar/scripts/wttr.sh Los_Angeles", "exec": "~/.config/waybar/scripts/wttr.sh Los_Angeles",
// "return-type": "json", "return-type": "json",
// "format": "{}", "format": "{}",
// "tooltip": true, "tooltip": true,
// }, },
"custom/kernel": { "custom/kernel": {
"exec": "uname -r | sed -E 's/^([0-9]+\\.[0-9]+\\.[0-9]+)-.*-([a-zA-Z0-9]+)/\\1-\\2/'", "exec": "uname -r | sed -E 's/^([0-9]+\\.[0-9]+\\.[0-9]+)-.*-([a-zA-Z0-9]+)/\\1-\\2/'",
"format": "{} ", "format": "{} ",
@@ -305,7 +305,7 @@
"exec": "$HOME/.config/waybar/scripts/scroll-mpv.sh", "exec": "$HOME/.config/waybar/scripts/scroll-mpv.sh",
"format": "<span color='#450241'> </span> {}", "format": "<span color='#450241'> </span> {}",
"max-length": 35, "max-length": 35,
"on-click": "playerctl -p firefox play-pause", "on-click": "playerctl -p mpv play-pause",
"hide-empty-text": true, "hide-empty-text": true,
}, },
"custom/notification": { "custom/notification": {
@@ -313,13 +313,13 @@
"format": "{icon}", "format": "{icon}",
"format-icons": { "format-icons": {
"notification": "<span foreground='red'><sup></sup></span>", "notification": "<span foreground='red'><sup></sup></span>",
"none": "", "none": "<span foreground='red'><sup> </sup></span>",
"dnd-notification": "<span foreground='red'><sup></sup></span>", "dnd-notification": "<span foreground='red'><sup></sup></span>",
"dnd-none": "", "dnd-none": "<span foreground='red'><sup> </sup></span>",
"inhibited-notification": "<span foreground='red'><sup></sup></span>", "inhibited-notification": "<span foreground='red'><sup></sup></span>",
"inhibited-none": "", "inhibited-none": "<span foreground='red'><sup> </sup></span>",
"dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>", "dnd-inhibited-notification": "<span foreground='red'><sup></sup></span>",
"dnd-inhibited-none": "", "dnd-inhibited-none": "<span foreground='red'><sup> </sup></span>",
}, },
"return-type": "json", "return-type": "json",
"exec-if": "which swaync-client", "exec-if": "which swaync-client",

View File

@@ -8,13 +8,13 @@ import logging
import os import os
import signal import signal
import sys import sys
from typing import List
import gi import gi
from gi.repository import GLib, Playerctl from gi.repository import GLib, Playerctl
from gi.repository.Playerctl import Player from gi.repository.Playerctl import Player
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
is_plain = False is_plain = False
@@ -66,7 +66,7 @@ class PlayerManager:
self.manager.manage_player(player) self.manager.manage_player(player)
self.on_metadata_changed(player, player.props.metadata) self.on_metadata_changed(player, player.props.metadata)
def get_players(self) -> List[Player]: def get_players(self) -> list[Player]:
return self.manager.props.players return self.manager.props.players
def write_output(self, text, player): def write_output(self, text, player):
@@ -234,5 +234,4 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
main() main()

View File

@@ -3,21 +3,22 @@
PLAYER="$1" PLAYER="$1"
if [ -z "$PLAYER" ]; then if [ -z "$PLAYER" ]; then
echo "Usage: $0 <player>" echo "Usage: $0 <player>"
exit 1 exit 1
fi fi
STATUS="$(playerctl -p "$PLAYER" status)" STATUS="$(playerctl -p "$PLAYER" status 2>/dev/null)"
if [ -z "$STATUS" ] || [ "$STATUS" = "Stopped" ]; then case "$STATUS" in "" | "Stopped")
exit 0 exit 0
elif [ "$STATUS" = "Paused" ]; then ;;
STATUS=" " "Paused")
elif [ "$STATUS" = "Playing" ]; then STATUS=" "
STATUS=" " ;;
else "Playing")
exit 0 STATUS=" "
fi ;;
esac
TITLE="$(playerctl -p "$PLAYER" metadata title)" TITLE="$(playerctl -p "$PLAYER" metadata title)"
ARTIST="$(playerctl -p "$PLAYER" metadata artist)" ARTIST="$(playerctl -p "$PLAYER" metadata artist)"