diff --git a/pkg-files/gnome.txt b/pkg-files/gnome.txt index 4e26977..3490b91 100644 --- a/pkg-files/gnome.txt +++ b/pkg-files/gnome.txt @@ -6,5 +6,5 @@ gnome-chess gnome-todo gnome-sound-recorder # email: -gnome-evolution -geary +#gnome-evolution +#geary diff --git a/scripts/2-user.sh b/scripts/2-user.sh index c14721e..e698e78 100755 --- a/scripts/2-user.sh +++ b/scripts/2-user.sh @@ -89,7 +89,7 @@ echo -ne " ./dotfiles-openbox/install-titus.sh elif [[ $DESKTOP_ENV == "gnome" ]]; then echo "Setting up my gnome things: " - bash ~/ArchTitus/scripts/my_gnome_setup.sh + # bash ~/ArchTitus/scripts/my_gnome_setup.sh fi # fi diff --git a/scripts/add_gnome_shortcut.py b/scripts/add_gnome_shortcut.py new file mode 100644 index 0000000..7ed806e --- /dev/null +++ b/scripts/add_gnome_shortcut.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python3 +# taken from: https://askubuntu.com/questions/597395/how-to-set-custom-keyboard-shortcuts-from-terminal +# how to use: python3 /path/to/script.py '' '' '' +# An example: python3 /path/to/script.py 'open gedit' 'gedit' '7' +# +# Super key: +# Control key: or +# Alt key: +# Shift key: +# numbers: 1 (just the number) +# Spacebar: space +# Slash key: slash +# Asterisk key: asterisk(so it would need `` as well) +# Ampersand key: ampersand(so it would need as well) +# a few numpad keys: +# Numpad divide key(`/`): KP_Divide +# Numpad multiply(Asterisk): KP_Multiply +# Numpad number key(s): KP_1 +# Numpad `-`: KP_Subtract + +import subprocess +import sys + +# defining keys & strings to be used +key = "org.gnome.settings-daemon.plugins.media-keys custom-keybindings" +subkey1 = key.replace(" ", ".")[:-1]+":" +item_s = "/"+key.replace(" ", "/").replace(".", "/")+"/" +firstname = "custom" +# get the current list of custom shortcuts + + +def get(cmd): return subprocess.check_output( + ["/bin/bash", "-c", cmd]).decode("utf-8") + + +array_str = get("gsettings get "+key) +# in case the array was empty, remove the annotation hints +command_result = array_str.lstrip("@as") +current = eval(command_result) +# make sure the additional keybinding mention is no duplicate +n = 1 +while True: + new = item_s+firstname+str(n)+"/" + if new in current: + n = n+1 + else: + break +# add the new keybinding to the list +current.append(new) +# create the shortcut, set the name, command and shortcut key +cmd0 = 'gsettings set '+key+' "'+str(current)+'"' +cmd1 = 'gsettings set '+subkey1+new+" name '"+sys.argv[1]+"'" +cmd2 = 'gsettings set '+subkey1+new+" command '"+sys.argv[2]+"'" +cmd3 = 'gsettings set '+subkey1+new+" binding '"+sys.argv[3]+"'" + +for cmd in [cmd0, cmd1, cmd2, cmd3]: + subprocess.call(["/bin/bash", "-c", cmd]) diff --git a/scripts/my_gnome_setup.sh b/scripts/my_gnome_setup.sh index 6e0a7aa..340adc3 100755 --- a/scripts/my_gnome_setup.sh +++ b/scripts/my_gnome_setup.sh @@ -12,10 +12,8 @@ gsettings reset org.gnome.desktop.input-sources sources gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'de+nodeadkeys')]" # SHORTCUTS -# TEMP="/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings" -# gsettings set org.gnome.settings-daemon.plugins.media-keys custom-keybindings "['$TEMP/custom0/', '$TEMP/custom1/', '$TEMP/custom2/', '$TEMP/custom3/']" -# gsettings set org.gnome.settings-daemon.plugins.media-keys.custom-keybinding:$TEMP/custom0 ...................................... -# .......................... to complete ...^ +python3 ~/ArchTitus/scripts/add_gnome_shortcuts.py 'open guake' 'guake' 'e' + ####################################### ### EXTENSIONS @@ -37,3 +35,15 @@ printf "$GNOME_VERSION\nq" | gnome-shell-extension-installer 3088 # Extension li printf "$GNOME_VERSION\nq" | gnome-shell-extension-installer 906 # Sound output chooser killall -HUP gnome-shell # kill (hopfully restart) gnome-shell +enable-extension () { + gnome-extensions enable $1 || echo "could not enable $1" +} +enable-extension clipboard-indicator@tudmotu.com +enable-extension impatience@gfxmonk.net +enable-extension material-shell@papyelgringo +enable-extension Vitals@CoreCoding.com +enable-extension unite@hardpixel.eu +enable-extension extension-list@tu.berry +enable-extension sound-output-device-chooser@kgshank.net +enable-extension gnome-shell-screenshot@ttll.de +