summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-21 13:47:12 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-21 13:47:12 +0100
commitf4e54113d780fa1a372c42c0a2b92f82127b6aa8 (patch)
treec51d266feb40bef4baffe0d3a61bfbebcbc9db20
parentProvide better storage management for wpos (diff)
downloaddisplay_autoset-f4e54113d780fa1a372c42c0a2b92f82127b6aa8.tar.xz
Add support for profiles into wpos
-rwxr-xr-xwpos.sh9
1 files 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 }')"