diff options
author | Robin Obůrka <r.oburka@gmail.com> | 2015-03-21 13:47:12 +0100 |
---|---|---|
committer | Robin Obůrka <r.oburka@gmail.com> | 2015-03-21 13:47:12 +0100 |
commit | f4e54113d780fa1a372c42c0a2b92f82127b6aa8 (patch) | |
tree | c51d266feb40bef4baffe0d3a61bfbebcbc9db20 | |
parent | Provide better storage management for wpos (diff) | |
download | display_autoset-f4e54113d780fa1a372c42c0a2b92f82127b6aa8.tar.xz |
Add support for profiles into wpos
-rwxr-xr-x | wpos.sh | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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 }')" |