mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-05 18:38:26 +02:00
- Added KDE backup and restore hotkeys to uninstaller
This commit is contained in:
18
setup.py
18
setup.py
@@ -129,6 +129,8 @@ def setShortcuts():
|
|||||||
elif dename == "kde":
|
elif dename == "kde":
|
||||||
# cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "krunner.desktop" --key "_launch","Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner"')
|
# cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "krunner.desktop" --key "_launch","Alt+Space\tAlt+F2\tSearch,Alt+Space\tAlt+F2\tSearch,KRunner"')
|
||||||
# Remove Alt+F3 Operations Menu - Sublimetext Select-All
|
# Remove Alt+F3 Operations Menu - Sublimetext Select-All
|
||||||
|
cmdline('cp ~/.config/kwinrc ./kwinrc_`date +"%Y.%m.%d-%s"`')
|
||||||
|
cmdline('cp ~/.config/kglobalshortcutsrc ./kde_kglobalshortcutsrc_`date +"%Y.%m.%d-%s"`')
|
||||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"')
|
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Switch to Previous Desktop" "Meta+Left,Meta+Left,Switch to Previous Desktop"')
|
||||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Operations Menu" "none,Alt+F3,Window Operations Menu"')
|
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Window Operations Menu" "none,Alt+F3,Window Operations Menu"')
|
||||||
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows" "Ctrl+Shift+F13,Alt+Tab,Walk Through Windows"')
|
cmdline('kwriteconfig5 --file "$HOME/.config/kglobalshortcutsrc" --group "kwin" --key "Walk Through Windows" "Ctrl+Shift+F13,Alt+Tab,Walk Through Windows"')
|
||||||
@@ -193,9 +195,18 @@ def Uninstall():
|
|||||||
cmdline('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
|
cmdline('dconf load /org/gnome/mutter/keybindings/ < ' + mutterkeys)
|
||||||
if len(wmkeys) > 0 or len(mutterkeys) > 0:
|
if len(wmkeys) > 0 or len(mutterkeys) > 0:
|
||||||
print("Gnome hotkeys have been successfully restored.")
|
print("Gnome hotkeys have been successfully restored.")
|
||||||
|
elif dename == "kde":
|
||||||
|
print("Restoring DE hotkeys...")
|
||||||
|
kwinkeys = cmdline('ls | grep -m1 "kwinrc"')
|
||||||
|
kdekeys = cmdline('ls | grep -m1 "kglobalshortcutsrc"')
|
||||||
|
cmdline('cp ./' + kdekeys.strip() + ' ~/.config/kglobalshortcutsrc')
|
||||||
|
cmdline('cp ./' + kwinkeys.strip() + ' ~/.config/kwinrc')
|
||||||
|
if dename == "gnome" or dename == "kde":
|
||||||
print("./uninstall.sh\n")
|
print("./uninstall.sh\n")
|
||||||
cmdline("./uninstall.sh")
|
cmdline("./uninstall.sh")
|
||||||
print("Done.")
|
print("Done.")
|
||||||
|
if dename == "kde":
|
||||||
|
print("Please log off and back on for your original hotkeys to take effect.")
|
||||||
else:
|
else:
|
||||||
if dename == "gnome":
|
if dename == "gnome":
|
||||||
print("Resetting DE hotkeys...\n")
|
print("Resetting DE hotkeys...\n")
|
||||||
@@ -203,9 +214,16 @@ def Uninstall():
|
|||||||
cmdline("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
|
cmdline("gsettings reset-recursively org.gnome.desktop.wm.keybindings")
|
||||||
print("gsettings reset-recursively org.gnome.mutter.keybindings")
|
print("gsettings reset-recursively org.gnome.mutter.keybindings")
|
||||||
cmdline("gsettings reset-recursively org.gnome.mutter.keybindings")
|
cmdline("gsettings reset-recursively org.gnome.mutter.keybindings")
|
||||||
|
elif dename == "kde":
|
||||||
|
print("Resetting DE hotkeys...\n")
|
||||||
|
cmdline('mv ~/.config/kwinrc ~/.config/kwinrc.kinto')
|
||||||
|
cmdline('mv ~/.config/kglobalshortcutsrc ~/.config/kglobalshortcutsrc.kinto')
|
||||||
|
if dename == "gnome" or dename == "kde":
|
||||||
print("./uninstall.sh\n")
|
print("./uninstall.sh\n")
|
||||||
cmdline("./uninstall.sh")
|
cmdline("./uninstall.sh")
|
||||||
print("Done.")
|
print("Done.")
|
||||||
|
if dename == "kde":
|
||||||
|
print("Please log off and back on for your original DE hotkeys to take effect.")
|
||||||
|
|
||||||
# check_x11 = cmdline("env | grep -i x11").strip()
|
# check_x11 = cmdline("env | grep -i x11").strip()
|
||||||
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
|
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
|
||||||
|
Reference in New Issue
Block a user