diff --git a/layout_manager.sh b/layout_manager.sh index ab8c670..a460f64 100755 --- a/layout_manager.sh +++ b/layout_manager.sh @@ -56,6 +56,8 @@ mkdir -p $LAYOUT_PATH > /dev/null 2>&1 # logs LOG_FILE=/tmp/i3_layout_manager.txt +# #{ asking for the action + # if operating using dmenu if [ -z $1 ]; then @@ -85,11 +87,15 @@ if [ -z "$LAYOUT_NAME" ]; then exit fi +# #} + LAYOUT_FILE=$LAYOUT_PATH/layout-"$LAYOUT_NAME".json # get current workspace ID WORKSPACE_ID=$(i3-msg -t get_workspaces | jq '.[] | select(.focused==true).num' | cut -d"\"" -f2) +# #{ LOADING + if [[ "$ACTION" = "LOAD LAYOUT" ]]; then # updating the workspace to the new layout is tricky @@ -136,6 +142,10 @@ if [[ "$ACTION" = "LOAD LAYOUT" ]]; then fi +# #} + +# #{ SAVING + if [[ "$ACTION" = "SAVE LAYOUT" ]]; then ACTION=$(echo "DEFAULT (INSTANCE) @@ -322,6 +332,12 @@ MATCH ANY" | rofi -i -dmenu -p "How to identify windows? (xprop style)") fi +# #} + +# #{ DELETING + if [[ "$ACTION" = "DELETE LAYOUT" ]]; then rm "$LAYOUT_FILE" fi + +# #}