mirror of
https://github.com/DeeJanuz/frametop.git
synced 2026-10-06 05:00:08 +02:00
Launch apps floating, remember where they floated, and Launch as Standalone
ft-float launch APP / run COMMAND: ft-floatd starts the app and floats its first window (matched by process or desktop file name for 30 s) where that app last floated, or in front of you at the primary screen's density. Each app's place (pose relative to the primary screen, size in pixels, scale) is kept in ~/.config/frametop-float.json whenever one of its windows stops floating; the scale isn't applied yet, since rescaling can loop (written up in docs/floating-windows.md, Known problems). Launch as Standalone (float/ft_apps.py): the session writes copies of the apps' desktop files with that action and puts them first in XDG_DATA_DIRS, so it shows in the Application Launcher's and the taskbar's right-click menus in the Frametop desktop only. ft-floatd rewrites them when apps change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1aa88641ec
commit
38843a4717
7 files changed
+402
-12
No files matched your search
+6
-1
@@ -6,10 +6,14 @@
|
||||
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 run COMMAND [ARG...] the same for a command
|
||||
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
|
||||
@@ -20,7 +24,8 @@ s = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
|
||||
s.bind("")
|
||||
s.settimeout(5)
|
||||
try:
|
||||
s.sendto(" ".join(sys.argv[1:]).encode(), "\0" + os.environ.get("FT_FLOAT_SOCKET", "frametop_float"))
|
||||
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?")
|
||||
|
||||
Reference in new issue
Block a user