Last active
October 19, 2019 20:22
-
-
Save jonathannerat/00996032fe6c41add8704c38d5b35174 to your computer and use it in GitHub Desktop.
Revisions
-
jonathannerat revised this gist
Oct 19, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -24,6 +24,6 @@ DOCKITEM=`dconf read $DCONF_KEY | grep -Po "^\[('[^']*', ){$1}'\K[^']*"` # only try to launch if an item was found if [ ! -z "$DOCKITEM" ]; then LAUNCHER=`grep -Po "Launcher=file://\K.*\.desktop" "$ITEMS_DIR/$DOCKITEM"` FILE="${LAUNCHER##*/}" gtk-launch ${FILE%.desktop} fi -
jonathannerat revised this gist
Oct 19, 2019 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,16 @@ #!/bin/bash # Launch Plank pinned items # # receives a number and launches the corresponding pinned item in your plank dock # # Relies on gtk-launch to launch the .desktop file, which needs to be located # in /usr/share/applications or $HOME/.local/share/applications # # You can use it to simulate the Meta+<Number> shortcut in Windows. To do this, # create a shortcut for Win+1, Win+2, ..., Win+9, Win+0, with each of them executing # ./plank_launch.sh <n - 1> (./plank_launch.sh 9 for Win+0) # This will try to start the n-th app in your dock, if it's present, and do nothing # if it isn't. ITEMS_DIR="$HOME/.config/plank/dock1/launchers" DCONF_KEY="/net/launchpad/plank/docks/dock1/dock-items" @@ -9,10 +21,9 @@ DCONF_KEY="/net/launchpad/plank/docks/dock1/dock-items" # selects $1-th dockitem from key DOCKITEM=`dconf read $DCONF_KEY | grep -Po "^\[('[^']*', ){$1}'\K[^']*"` # only try to launch if an item was found if [ ! -z "$DOCKITEM" ]; then LAUNCHER=`grep -Po "Launcher=file://\K.*\.desktop" "$ITEMS_DIR/$DOCKITEM"` FILE="${LAUNCHER%.desktop}" gtk-launch ${FILE##*/} fi -
jonathannerat created this gist
Oct 19, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/bin/bash ITEMS_DIR="$HOME/.config/plank/dock1/launchers" DCONF_KEY="/net/launchpad/plank/docks/dock1/dock-items" # $1: item number, starts at 0 [ -z "$1" ] && echo "Supply a number to launch plank item" && exit # selects $1-th dockitem from key DOCKITEM=`dconf read $DCONF_KEY | grep -Po "^\[('[^']*', ){$1}'\K[^']*"` if [ ! -z "$DOCKITEM" ]; then LAUNCHER=`grep -Po "Launcher=file://\K.*\.desktop" "$ITEMS_DIR/$DOCKITEM"` FILE="${LAUNCHER%.desktop}" gtk-launch ${FILE##*/} else echo "There is no $1th item pinned in plank dock" fi