mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-14 06:00:41 +02:00
A Spotlight-like search pill (docs/spotwatch.md). Meta+Space (the input
relay's new spotwatch action, bindable to mouse and controller buttons
too) opens a faux-glass pill straight ahead of the head. Typing finds
apps and remote displays ({host} - {display}). Enter brings a running
app's most recent window to the front with the lazy susan, launches an
app that isn't running as a floating window, or connects and spins to a
remote display. Shift+Enter or a right click opens the item's menu: the
app's desktop actions, Open new window, Open docked on this screen, and
its windows; a display's Go to and Disconnect.
- spotwatch/ft-spotwatch (Python, in the Plasma session's autostart):
the index, ranking (spotsearch.py), keys via libxkbcommon, usage.
- spotwatch/ft-spotpanel.cpp (SteamVR overlay, built by
screens/build.sh): the pill, drawn on the CPU; --render for a look
without a headset.
- ft-screens: "spin to N", "front N", and "spotwatch on|off", which
routes every key to the search while it's open (a lease, renewed
every second) and dismisses it on a click elsewhere or a pause.
- ft-floatd: "spotlist", "activate ID", and launch action=/screen=;
the KWin script tracks when each window was last active.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.7 KiB
Python
Executable File
37 lines
1.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""ft-float: talk to ft-floatd (floating windows in the Frametop desktop).
|
|
|
|
ft-float float [ID|active] float a window (default: the active one; for it, a toggle)
|
|
ft-float float pointer the float key: float the window under the pointer (else the
|
|
active one), or put it back if it floats
|
|
ft-float dock [ID|active] put a floating window back on the desktop
|
|
ft-float dock all put every floating window back
|
|
ft-float launch APP start an app (its desktop file name, e.g. org.kde.dolphin) and
|
|
float its first window where that app last floated
|
|
ft-float launch APP action=ACTION ...one of its desktop file's actions (a private window)
|
|
ft-float launch APP screen=N ...its first window docked on screen N instead
|
|
ft-float run COMMAND [ARG...] the same for a command
|
|
ft-float activate ID make a window KWin's active one, unminimized
|
|
ft-float close ID close a window
|
|
ft-float list the spare outputs and what floats on them
|
|
FT_FLOAT_SOCKET names ft-floatd's socket (default frametop_float).
|
|
"""
|
|
import json
|
|
import os
|
|
import socket
|
|
import sys
|
|
|
|
if len(sys.argv) < 2 or sys.argv[1] in ("-h", "--help"):
|
|
sys.exit(__doc__)
|
|
s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
|
s.bind("")
|
|
s.settimeout(5)
|
|
try:
|
|
text = "run " + json.dumps(sys.argv[2:]) if sys.argv[1] == "run" else " ".join(sys.argv[1:])
|
|
s.sendto(text.encode(), "\0" + os.environ.get("FT_FLOAT_SOCKET", "frametop_float"))
|
|
reply = s.recv(8192).decode()
|
|
except OSError as e:
|
|
sys.exit(f"ft-floatd didn't answer ({e}); is the Frametop desktop running?")
|
|
print(reply)
|
|
sys.exit(0 if reply.startswith("ok") else 1)
|