Created
October 4, 2015 04:55
-
-
Save gcoda/5b553203ba708b76c550 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
DMENU="rofi -p LoadLayout: -bg #222222 -dmenu" | |
if ! command -v "jshon" >/dev/null 2>&1; then | |
printf "%s\\n" "you need to install 'jshon' to run this program" >&2 | |
exit 1 | |
fi | |
if ! command -v "rofi" >/dev/null 2>&1; then | |
printf "%s\\n" "you need to install 'rofi' to run this program" >&2 | |
exit 1 | |
fi | |
LNAME="$(ls ~/.i3/layouts | ${DMENU})" | |
if [ -z "$LNAME" ]; then | |
exit 1 | |
else | |
WORKSPACE="$(i3-msg -t get_workspaces | jshon -a -e focused -u -p -e name -u | awk 'f{print;f=0} /true/{f=1}')" | |
i3-msg "workspace ${WORKSPACE}; append_layout ~/.i3/layouts/${LNAME}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment