Browse Source

Switched to using sh instead of zsh

Samuel W. Flint 7 years ago
parent
commit
12f92c1db4
4 changed files with 30 additions and 30 deletions
  1. 1 1
      i3-emacs-dir-term
  2. 1 1
      i3-rename-workspace
  3. 11 11
      i3-screen-layout
  4. 17 17
      i3-workspace-layout

+ 1 - 1
i3-emacs-dir-term

@@ -1,4 +1,4 @@
-#!/bin/zsh -f
+#!/bin/sh
 
 DIRECTORY=$(emacsclient --eval "(with-current-buffer (other-buffer) default-directory)" | awk -F\" -e '{print $2}')
 

+ 1 - 1
i3-rename-workspace

@@ -1,4 +1,4 @@
-#!/bin/zsh -f
+#!/bin/sh
 
 if [[ $# -lt 1 ]] ; then
     echo "i3-rename-workspace new-name"

+ 11 - 11
i3-screen-layout

@@ -1,4 +1,4 @@
-#!/bin/zsh -f
+#!/bin/sh
 
 if [[ $# -eq 0 ]] ; then
     echo "i3-screen-layout [ name | list | dmenu | define ]"
@@ -7,14 +7,14 @@ fi
 
 LAYOUT=$1
 
-function list-layouts () {
+function list_layouts () {
     for layout in ~/.screenlayout/*.sh ;
     do
         echo "$(basename -- ${layout} .sh)"
     done
 }
 
-function apply-layout () {
+function apply_layout () {
     if [[ -e ~/.screenlayout/${LAYOUT}.sh ]] ; then
         sh ~/.screenlayout/${LAYOUT}.sh
         [[ -e ~/.screenlayout/${LAYOUT}.sh-after ]] && \
@@ -25,13 +25,13 @@ function apply-layout () {
     fi
 }
 
-function with-external-completion () {
+function with_external_completion () {
     if [[ -e `which rofi` ]] ; then
-        LAYOUT=`echo define | list-layouts | rofi -dmenu -p layout:`
-        [[ $LAYOUT != "" ]] && apply-layout
+        LAYOUT=`echo define | list_layouts | rofi -dmenu -p layout:`
+        [[ $LAYOUT != "" ]] && apply_layout
     else
-        LAYOUT=`echo define | list-layouts | dmenu -p layout:`
-        [[ $LAYOUT != "" ]] && apply-layout
+        LAYOUT=`echo define | list_layouts | dmenu -p layout:`
+        [[ $LAYOUT != "" ]] && apply_layout
     fi
 }
 
@@ -40,11 +40,11 @@ case ${LAYOUT} in
         arandr
         ;;
     list)
-        list-layouts
+        list_layouts
         ;;
     dmenu)
-        with-external-completion
+        with_external_completion
         ;;
     *)
-        apply-layout
+        apply_layout
 esac

+ 17 - 17
i3-workspace-layout

@@ -1,4 +1,4 @@
-#!/bin/zsh -f
+#!/bin/sh
 
 if [[ $# -eq 0 ]] ; then
     echo "i3-workspace-layout [ name workspace | list | define workspace name | edit name | dmenu ]"
@@ -8,23 +8,23 @@ fi
 LAYOUT=$1
 WORKSPACE=$2
 
-function define-workspace {
+function define_workspace {
     i3-save-tree --workspace ${WORKSPACE} > ~/.config/i3/layouts/${NAME}.json
     emacsclient --alternate-editor="" -n ~/.config/i3/layouts/${NAME}.json
 }
 
-function edit-workspace {
+function edit_workspace {
     emacsclient --alternate-editor="" -n ~/.config/i3/layouts/${WORKSPACE}.json
 }
 
-function list-workspaces {
+function list_workspaces {
     for layout in ~/.config/i3/layouts/*.json ;
     do
         echo "$(basename -- ${layout} .json)"
     done
 }
 
-function apply-workspace {
+function apply_workspace {
     if [[ -e ~/.config/i3/layouts/${LAYOUT}.json ]] ; then
         i3-msg "append_layout ~/.config/i3/layouts/${LAYOUT}.json"
         [[ -e ~/.config/i3/layouts/${LAYOUT}.after ]] && sh ~/.config/i3/layouts/${LAYOUT}.after
@@ -33,7 +33,7 @@ function apply-workspace {
     fi
 }
 
-function apply-workspace-number {
+function apply_workspace_number {
     # i3-msg "workspace number ${WORKSPACENUMBER}"
     if [[ -e ~/.config/i3/layouts/${LAYOUT}.json ]] ; then
         i3-msg "workspace number ${WORKSPACE}; append_layout ~/.config/i3/layouts/${LAYOUT}.json"
@@ -43,34 +43,34 @@ function apply-workspace-number {
     fi
 }
 
-function with-external-completion {
+function with_external_completion {
     if [[ -e `which rofi` ]] ; then
-        LAYOUT=`list-workspaces | rofi -dmenu -p "workspace layout:"`
-        [[ $LAYOUT != "" ]] && apply-workspace
+        LAYOUT=`list_workspaces | rofi -dmenu -p "workspace layout:"`
+        [[ $LAYOUT != "" ]] && apply_workspace
     else
-        LAYOUT=`list-workspaces | dmenu -p "workspace layout:"`
-        [[ $LAYOUT != "" ]] && apply-workspace
+        LAYOUT=`list_workspaces | dmenu -p "workspace layout:"`
+        [[ $LAYOUT != "" ]] && apply_workspace
     fi
 }
 
 case ${LAYOUT} in
     define)
         NAME=$3
-        define-workspace
+        define_workspace
         ;;
     edit)
-        edit-workspace
+        edit_workspace
         ;;
     list)
-        list-workspaces
+        list_workspaces
         ;;
     dmenu)
-        with-external-completion
+        with_external_completion
         ;;
     *)
         if [[ $WORKSPACE != "" ]] ; then
-            apply-workspace-number
+            apply_workspace_number
         else
-            apply-workspace
+            apply_workspace
         fi
 esac