diff --git a/jekyll.sh b/jekyll.sh index cda25f6..2b35818 100755 --- a/jekyll.sh +++ b/jekyll.sh @@ -3,6 +3,7 @@ export JEKYLL_VERSION=4.2.0 docker run --rm \ --volume="$PWD:/srv/jekyll" \ + --volume="$HOME/Public/docs:/srv/docs" \ -p 127.0.0.1:4000:4000/tcp \ -it jekyll/jekyll:$JEKYLL_VERSION \ jekyll $@ diff --git a/switch_desktop.sh b/switch_desktop.sh new file mode 100755 index 0000000..fdc2d60 --- /dev/null +++ b/switch_desktop.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# name: switch_desktop.sh +# version: 0.1 +# author: david@socialnerds.org +# description: switch to next, previous, specific desktop. +# you can also toggle between first and second desktop. +# +# usage: ./switch_desktop.sh next|prev||toggle + +num=$(wmctrl -d | grep "*" | awk '{print $1}') +lockfile="/tmp/switch_desktop.lock" + +if [ ! -f $lockfile ]; then + echo "creating lockfile [$lockfile]" + touch $lockfile + + if [[ "$1" =~ ^[0-9]+$ ]]; then + echo "switching to specific desktop [$1]" + wmctrl -s $1 + elif [ "$1" == "next" ]; then + echo "switching to next desktop [$next]" + next=$((num+1)) + wmctrl -s $next + elif [ "$1" == "prev" ]; then + if [ $num -ne 0 ]; then + echo "switching to previous desktop [$prev]" + prev=$((num-1)) + wmctrl -s $prev + fi + elif [ "$1" == "toggle" ]; then + if [ $num -eq 0 ]; then + echo "switching to second desktop" + wmctrl -s 1 + else + echo "switching back to first desktop" + wmctrl -s 0 + fi + fi + echo "waiting for 0.5 seconds" + sleep 0.5 + echo "cleaning up lockfile [$lockfile]" + rm $lockfile +fi +