From f4e54113d780fa1a372c42c0a2b92f82127b6aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Ob=C5=AFrka?= Date: Sat, 21 Mar 2015 13:47:12 +0100 Subject: Add support for profiles into wpos --- wpos.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wpos.sh b/wpos.sh index 3099fa2..2695f15 100755 --- a/wpos.sh +++ b/wpos.sh @@ -9,13 +9,18 @@ if [ ! -d "$SAVEPATH" ]; then chmod 700 "$SAVEPATH" fi +## Choose profile +PROFILE="$DEFAULT_PROFILE" +if [ -n "$2" ]; then + PROFILE="$2" +fi if [ "$1" = "save" ]; then - wmctrl -lxG > "$SAVEPATH/$DEFAULT_PROFILE" + wmctrl -lxG > "$SAVEPATH/$PROFILE" exit 0 elif [ "$1" = "restore" ]; then - cat "$SAVEPATH/$DEFAULT_PROFILE" | while read LINE; do + cat "$SAVEPATH/$PROFILE" | while read LINE; do ## Parse records in savefile ID="$(echo "$LINE" | awk '{ print $1 }')" GRAVITY="$(echo "$LINE" | awk '{ print $2 }')" -- cgit v1.2.3