-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug session for debugging with existing cosmic install
Add a new debug session that piggy-backs on an existing cosmic install so that input interactions can be debugged without replacing the install cosmic-comp. This only works when the configs can be shared between both versions.
- Loading branch information
1 parent
9b78a2d
commit 51ac632
Showing
6 changed files
with
233 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Debug Cosmic wayland compositor | ||
BindsTo=cosmic-session.target | ||
Wants=cosmic-session-pre.target | ||
After=cosmic-session-pre.target | ||
Before=cosmic-session.target | ||
|
||
[Service] | ||
Type=notify | ||
ExecStart=/usr/bin/debug-cosmic-comp | ||
Restart=never | ||
ExecStopPost=/usr/bin/systemctl --user unset-environment DISPLAY WAYLAND_DISPLAY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# From: https://people.debian.org/~mpitt/systemd.conf-2016-graphical-session.pdf | ||
|
||
if command -v systemctl >/dev/null; then | ||
# robustness: if the previous graphical session left some failed units, | ||
# reset them so that they don't break this startup | ||
for unit in $(systemctl --user --no-legend --state=failed --plain list-units | cut -f1 -d' '); do | ||
partof="$(systemctl --user show -p PartOf --value "$unit")" | ||
for target in cosmic-session.target graphical-session.target; do | ||
if [ "$partof" = "$target" ]; then | ||
systemctl --user reset-failed "$unit" | ||
break | ||
fi | ||
done | ||
done | ||
fi | ||
|
||
# use the user's preferred shell to acquire environment variables | ||
# see: https://github.com/pop-os/cosmic-session/issues/23 | ||
if [ -n "${SHELL}" ]; then | ||
# --in-login-shell: our flag to indicate that we don't need to recurse any further | ||
if [ "${1}" != "--in-login-shell" ]; then | ||
# `exec -l`: like `login`, prefixes $SHELL with a hyphen to start a login shell | ||
exec bash -c "exec -l '${SHELL}' -c '${0} --in-login-shell'" | ||
fi | ||
fi | ||
|
||
export XDG_CURRENT_DESKTOP="${XDG_CURRENT_DESKTOP:=COSMIC}" | ||
export XDG_SESSION_TYPE="${XDG_SESSION_TYPE:=wayland}" | ||
export XCURSOR_THEME="${XCURSOR_THEME:=Cosmic}" | ||
export _JAVA_AWT_WM_NONREPARENTING=1 | ||
export GDK_BACKEND=wayland,x11 | ||
export MOZ_ENABLE_WAYLAND=1 | ||
export QT_QPA_PLATFORM="wayland;xcb" | ||
export QT_AUTO_SCREEN_SCALE_FACTOR=1 | ||
export QT_ENABLE_HIGHDPI_SCALING=1 | ||
export DCONF_PROFILE=cosmic | ||
export RUST_LOG=debug | ||
|
||
if command -v systemctl >/dev/null; then | ||
# set environment variables for new units started by user service manager | ||
systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP | ||
fi | ||
# Run cosmic-session | ||
if [[ -z "${DBUS_SESSION_BUS_ADDRESS}" ]]; then | ||
exec /usr/bin/dbus-run-session -- /usr/bin/cosmic-session /usr/bin/debug-cosmic-comp | ||
else | ||
exec /usr/bin/cosmic-session /usr/bin/debug-cosmic-comp | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[Desktop Entry] | ||
Name=Debug Cosmic | ||
Commment=This session logs you into Cosmic | ||
Exec=/usr/bin/debug-cosmic-service | ||
Type=Application | ||
DesktopNames=pop:COSMIC | ||
X-GDM-SessionRegisters=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
(modifiers: [Super, Shift], key: "Escape"): Terminate, | ||
(modifiers: [Super, Ctrl], key: "Escape"): Debug, | ||
(modifiers: [Super], key: "Escape"): System(LockScreen), | ||
(modifiers: [Super], key: "q"): Close, | ||
|
||
(modifiers: [Super], key: "1"): Workspace(1), | ||
(modifiers: [Super], key: "2"): Workspace(2), | ||
(modifiers: [Super], key: "3"): Workspace(3), | ||
(modifiers: [Super], key: "4"): Workspace(4), | ||
(modifiers: [Super], key: "5"): Workspace(5), | ||
(modifiers: [Super], key: "6"): Workspace(6), | ||
(modifiers: [Super], key: "7"): Workspace(7), | ||
(modifiers: [Super], key: "8"): Workspace(8), | ||
(modifiers: [Super], key: "9"): Workspace(9), | ||
(modifiers: [Super], key: "0"): LastWorkspace, | ||
(modifiers: [Super, Shift], key: "1"): MoveToWorkspace(1), | ||
(modifiers: [Super, Shift], key: "2"): MoveToWorkspace(2), | ||
(modifiers: [Super, Shift], key: "3"): MoveToWorkspace(3), | ||
(modifiers: [Super, Shift], key: "4"): MoveToWorkspace(4), | ||
(modifiers: [Super, Shift], key: "5"): MoveToWorkspace(5), | ||
(modifiers: [Super, Shift], key: "6"): MoveToWorkspace(6), | ||
(modifiers: [Super, Shift], key: "7"): MoveToWorkspace(7), | ||
(modifiers: [Super, Shift], key: "8"): MoveToWorkspace(8), | ||
(modifiers: [Super, Shift], key: "9"): MoveToWorkspace(9), | ||
(modifiers: [Super, Shift], key: "0"): MoveToLastWorkspace, | ||
|
||
(modifiers: [Super, Ctrl, Alt], key: "Left"): MoveToOutput(Left), | ||
(modifiers: [Super, Ctrl, Alt], key: "Down"): MoveToOutput(Down), | ||
(modifiers: [Super, Ctrl, Alt], key: "Up"): MoveToOutput(Up), | ||
(modifiers: [Super, Ctrl, Alt], key: "Right"): MoveToOutput(Right), | ||
(modifiers: [Super, Ctrl, Alt], key: "h"): MoveToOutput(Left), | ||
(modifiers: [Super, Ctrl, Alt], key: "k"): MoveToOutput(Down), | ||
(modifiers: [Super, Ctrl, Alt], key: "j"): MoveToOutput(Up), | ||
(modifiers: [Super, Ctrl, Alt], key: "l"): MoveToOutput(Right), | ||
|
||
(modifiers: [Super], key: "Period"): NextOutput, | ||
(modifiers: [Super], key: "Comma"): PreviousOutput, | ||
(modifiers: [Super, Shift], key: "Period"): MoveToNextOutput, | ||
(modifiers: [Super, Shift], key: "Comma"): MoveToPreviousOutput, | ||
|
||
(modifiers: [Super], key: "Left"): Focus(Left), | ||
(modifiers: [Super], key: "Right"): Focus(Right), | ||
(modifiers: [Super], key: "Up"): Focus(Up), | ||
(modifiers: [Super], key: "Down"): Focus(Down), | ||
(modifiers: [Super], key: "h"): Focus(Left), | ||
(modifiers: [Super], key: "j"): Focus(Down), | ||
(modifiers: [Super], key: "k"): Focus(Up), | ||
(modifiers: [Super], key: "l"): Focus(Right), | ||
(modifiers: [Super], key: "u"): Focus(Out), | ||
(modifiers: [Super], key: "i"): Focus(In), | ||
|
||
(modifiers: [Super, Shift], key: "Left"): Move(Left), | ||
(modifiers: [Super, Shift], key: "Right"): Move(Right), | ||
(modifiers: [Super, Shift], key: "Up"): Move(Up), | ||
(modifiers: [Super, Shift], key: "Down"): Move(Down), | ||
(modifiers: [Super, Shift], key: "h"): Move(Left), | ||
(modifiers: [Super, Shift], key: "j"): Move(Down), | ||
(modifiers: [Super, Shift], key: "k"): Move(Up), | ||
(modifiers: [Super, Shift], key: "l"): Move(Right), | ||
|
||
(modifiers: [Super], key: "o"): ToggleOrientation, | ||
(modifiers: [Super], key: "s"): ToggleStacking, | ||
(modifiers: [Super], key: "y"): ToggleTiling, | ||
(modifiers: [Super], key: "g"): ToggleWindowFloating, | ||
(modifiers: [Super], key: "x"): SwapWindow, | ||
|
||
(modifiers: [Super], key: "m"): Maximize, | ||
(modifiers: [Super], key: "r"): Resizing(Outwards), | ||
(modifiers: [Super, Shift], key: "r"): Resizing(Inwards), | ||
|
||
(modifiers: [Super], key: "b"): System(WebBrowser), | ||
(modifiers: [Super], key: "f"): System(HomeFolder), | ||
(modifiers: [Super], key: "t"): System(Terminal), | ||
|
||
(modifiers: [Super], key: "a"): System(AppLibrary), | ||
(modifiers: [Super], key: "w"): System(WorkspaceOverview), | ||
(modifiers: [Super], key: "slash"): System(Launcher), | ||
(modifiers: [Super]): System(Launcher), | ||
(modifiers: [Alt], key: "Tab"): System(WindowSwitcher), | ||
(modifiers: [Alt, Shift], key: "Tab"): System(WindowSwitcherPrevious), | ||
(modifiers: [Super], key: "Tab"): System(WindowSwitcher), | ||
(modifiers: [Super, Shift], key: "Tab"): System(WindowSwitcherPrevious), | ||
|
||
(modifiers: [], key: "Print"): System(Screenshot), | ||
(modifiers: [], key: "XF86AudioRaiseVolume"): System(VolumeRaise), | ||
(modifiers: [], key: "XF86AudioLowerVolume"): System(VolumeLower), | ||
(modifiers: [], key: "XF86AudioMute"): System(Mute), | ||
(modifiers: [], key: "XF86AudioMicMute"): System(MuteMic), | ||
(modifiers: [], key: "XF86MonBrightnessUp"): System(BrightnessUp), | ||
(modifiers: [], key: "XF86MonBrightnessDown"): System(BrightnessDown), | ||
(modifiers: [], key: "XF86AudioPlay"): System(PlayPause), | ||
(modifiers: [], key: "XF86AudioPrev"): System(PlayPrev), | ||
(modifiers: [], key: "XF86AudioNext"): System(PlayNext), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
[ | ||
// Any appid title only matching | ||
( | ||
appid: ".*", | ||
titles: [ | ||
"Discord Updater", | ||
] | ||
), | ||
// Empty appid title only matches | ||
( | ||
appid: "", | ||
titles: [ | ||
"Steam", | ||
"wl-clipboard", | ||
] | ||
), | ||
|
||
|
||
// Appid matches | ||
(appid: "Authy Desktop", titles: [".*"]), | ||
(appid: "Com.github.amezin.ddterm", titles: [".*"]), | ||
(appid: "Com.github.donadigo.eddy", titles: [".*"]), | ||
(appid: "com.system76.CosmicFilesDialog", titles: [".*"]), | ||
(appid: "Enpass", titles: ["Enpass Assistant"]), | ||
(appid: "Gjs", titles: ["Settings"]), | ||
(appid: "Gnome-initial-setup", titles: [".*"]), | ||
(appid: "Gnome-terminal", titles: ["Preferences - General"]), | ||
(appid: "Guake", titles: [".*"]), | ||
(appid: "Io.elementary.sideload", titles: [".*"]), | ||
(appid: "KotatogramDesktop", titles: ["Media viewer"]), | ||
(appid: "Mozilla VPN", titles: [".*"]), | ||
(appid: "update-manager", titles: ["Software Updater"]), | ||
(appid: "Solaar", titles: [".*"]), | ||
(appid: "Steam", titles: ["^.*?(Guard|Login).*"]), | ||
(appid: "TelegramDesktop", titles: ["Media viewer"]), | ||
(appid: "Zotero", titles: ["Quick Format Citation"]), | ||
(appid: "gjs", titles: [".*"]), | ||
(appid: "gnome-screenshot", titles: [".*"]), | ||
(appid: "ibus-.*", titles: [".*"]), | ||
(appid: "jetbrains-toolbox", titles: [".*"]), | ||
(appid: "jetbrains-webstorm", titles: ["Customize WebStorm", "License Activation", "Welcome to WebStorm"]), | ||
(appid: "krunner", titles: [".*"]), | ||
(appid: "pritunl", titles: [".*"]), | ||
(appid: "re.sonny.Junction", titles: [".*"]), | ||
(appid: "system76-driver", titles: [".*"]), | ||
(appid: "tilda", titles: [".*"]), | ||
(appid: "zoom", titles: [".*"]), | ||
(appid: "^.*?action=join.*$", titles: [".*"]), | ||
|
||
] |