summaryrefslogtreecommitdiffstats
path: root/wpos.sh
diff options
context:
space:
mode:
authorGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-21 13:46:45 +0100
committerGravatar Robin Obůrka <r.oburka@gmail.com> 2015-03-21 13:46:45 +0100
commitf51cdc3062444f11760bc25a7e8023864428d62a (patch)
tree3cd4b619341d0ea185bbdc4f411b2d8564627fea /wpos.sh
parentAdd command, that returns hash of current profile (diff)
downloaddisplay_autoset-f51cdc3062444f11760bc25a7e8023864428d62a.tar.xz
Provide better storage management for wpos
Diffstat (limited to 'wpos.sh')
-rwxr-xr-xwpos.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/wpos.sh b/wpos.sh
index 7770358..3099fa2 100755
--- a/wpos.sh
+++ b/wpos.sh
@@ -2,7 +2,13 @@
DEFAULT_PROFILE="auto"
SAVEPATH="/tmp/wpos"
-mkdir -p "$SAVEPATH"
+
+## Check and create main profile direcotry
+if [ ! -d "$SAVEPATH" ]; then
+ mkdir -p "$SAVEPATH"
+ chmod 700 "$SAVEPATH"
+fi
+
if [ "$1" = "save" ]; then
wmctrl -lxG > "$SAVEPATH/$DEFAULT_PROFILE"