Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support cosmic desktop for app specific remapping #813

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions scripts/keyd-application-mapper
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,28 @@ class Wlroots():
if event == 4 and payload[0] > 0 and payload[4] == 2:
self.on_window_change(windows[obj].get('appid', ''), windows[obj].get('title', ''))

class Cosmic():
def __init__(self, on_window_change):
self.wl = Wayland('zcosmic_toplevel_info_v1')
self.on_window_change = on_window_change

def init(self):
pass

def run(self):
windows = {}
while True:
(obj, event, payload) = self.wl.recv_msg()
if obj not in windows:
windows[obj]={}

if event == 2:
windows[obj]['title'] = self.wl.read_string(payload)
if event == 3:
windows[obj]['appid'] = self.wl.read_string(payload)
if event == 8 and payload[0] > 0 and payload[4] == 2:
self.on_window_change(windows[obj].get('appid', ''), windows[obj].get('title', ''))

class XMonitor():
def __init__(self, on_window_change):
assert_env('DISPLAY')
Expand Down Expand Up @@ -413,6 +435,7 @@ def get_monitor(on_window_change):
monitors = [
('kde', KDE),
('wlroots', Wlroots),
('cosmic', Cosmic),
('Gnome', GnomeMonitor),
('X', XMonitor),
]
Expand Down