Sfoglia il codice sorgente

Made stuff a little bit better

Samuel W. Flint 9 anni fa
parent
commit
c79763e315
1 ha cambiato i file con 8 aggiunte e 7 eliminazioni
  1. 8 7
      i3-layout

+ 8 - 7
i3-layout

@@ -11,23 +11,24 @@ WORKSPACE=$2
 case ${LAYOUT} in
     define)
         NAME=$3
-        i3-save-tree --workspace ${WORKSPACE} > ~/.config/i3/${NAME}.json
-        emacsclient --alternate-editor="" -n ~/.config/i3/${NAME}.json
+        i3-save-tree --workspace ${WORKSPACE} > ~/.config/i3/layouts/${NAME}.json
+        emacsclient --alternate-editor="" -n ~/.config/i3/layouts/${NAME}.json
         ;;
     edit)
         NAME=$3
-        emacsclient --alternate-editor="" -n ~/.config/i3/${NAME}.json
+        emacsclient --alternate-editor="" -n ~/.config/i3/layouts/${NAME}.json
         ;;
     list)
-        for layout in ~/.config/i3/*.json ;
+        for layout in ~/.config/i3/layouts/*.json ;
         do
             echo " - $(basename -- ${layout} .json)"
         done
         ;;
     *)
-        if [[ -e ~/.config/i3/${LAYOUT}.json ]] ; then
-            i3-msg "workspace ${WORKSPACE}; append_layout ~/.config/i3/${LAYOUT}.json"
+        if [[ -e ~/.config/i3/layouts/${LAYOUT}.json ]] ; then
+            i3-msg "workspace ${WORKSPACE}; append_layout ~/.config/i3/layouts/${LAYOUT}.json"
+            [[ -e ~/.config/i3/layouts/${LAYOUT}.after ]] && sh ~/.config/i3/layouts/${LAYOUT}.after
         else
-            echo "${LAYOUT} not available"
+            i3-nagbar -m "${LAYOUT} not available" -t error
         fi
 esac