This commit is contained in:
bullshar-k
2026-10-18 21:57:19 -04:00
parent b483b92c54
commit 0a88ca8787
193 changed files with 33 additions and 11 deletions

View File

@@ -107,7 +107,8 @@
"tooltip-format": "{desc}" "tooltip-format": "{desc}"
}, },
"clock": { "clock": {
"format": "{:%I:%M %p %a, %b %d}", "format": "{:%H:%M %a, %b %d}",
"timezone": "America/New_York",
"tooltip": true, "tooltip": true,
"tooltip-format": "<tt>{calendar}</tt>", "tooltip-format": "<tt>{calendar}</tt>",
"calendar": { "calendar": {
@@ -151,7 +152,8 @@
"sort-by-number": true "sort-by-number": true
}, },
"clock#portrait": { "clock#portrait": {
"format": "{:%I:%M %p}", "format": "{:%H:%M}",
"timezone": "America/New_York",
"tooltip": true, "tooltip": true,
"tooltip-format": "<tt>{calendar}</tt>", "tooltip-format": "<tt>{calendar}</tt>",
"calendar": { "calendar": {

View File

@@ -4,15 +4,34 @@ import shutil
import subprocess import subprocess
import sys import sys
def _shutdown_cmd() -> str:
"""Clean logout command for this session.
The session runs under UWSM (hyprland-uwsm). There, `hyprctl dispatch exit`
can leave SDDM on a black screen instead of logging out, while `uwsm stop`
tears the session down cleanly. Fall back to the compositor dispatcher when
UWSM is not in use.
"""
if shutil.which("uwsm"):
return "uwsm stop"
return "hyprctl dispatch exit"
ENTRIES = [ ENTRIES = [
("Lock", "command -v hyprlock >/dev/null 2>&1 && exec hyprlock"), ("Lock", "hyprlock"),
("Log out", "hyprctl dispatch exit"), ("Log out", _shutdown_cmd()),
("Suspend", "systemctl suspend"), ("Suspend", "systemctl suspend"),
("Reboot", "systemctl reboot"), ("Reboot", "systemctl reboot"),
("Shut down", "systemctl poweroff"), ("Shut down", "systemctl poweroff"),
] ]
def _notify(message: str) -> None:
if shutil.which("notify-send"):
subprocess.Popen(["notify-send", "Session menu", message])
def main() -> int: def main() -> int:
if not shutil.which("fuzzel"): if not shutil.which("fuzzel"):
print("fuzzel not found", file=sys.stderr) print("fuzzel not found", file=sys.stderr)
@@ -27,9 +46,14 @@ def main() -> int:
) )
choice = result.stdout.strip() choice = result.stdout.strip()
for name, command in ENTRIES: for name, command in ENTRIES:
if name == choice: if name != choice:
subprocess.Popen(["sh", "-c", command]) continue
break program = command.split()[0]
if not shutil.which(program):
_notify(f"{program} not found")
return 1
subprocess.Popen(["sh", "-c", command])
break
return 0 return 0

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More