summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/autoscript18
-rwxr-xr-xscripts/current-term10
-rwxr-xr-xscripts/firefox-private4
-rwxr-xr-xscripts/mpv-gui6
-rwxr-xr-xscripts/rofi-kvmap9
-rwxr-xr-xscripts/rofi-workspaces6
-rwxr-xr-xscripts/scava2
-rwxr-xr-xscripts/steam-oldchat4
-rwxr-xr-xscripts/stranger2
-rwxr-xr-xscripts/svimpc2
-rwxr-xr-xscripts/sweechat2
11 files changed, 36 insertions, 29 deletions
diff --git a/scripts/autoscript b/scripts/autoscript
index c29bcc9..4358e8c 100755
--- a/scripts/autoscript
+++ b/scripts/autoscript
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
if [ "$#" -ne 1 ]; then
echo "Exactly 1 argument is required"
@@ -8,12 +8,18 @@ fi
SCRIPT_FOLDER="$HOME/scripts"
SCRIPT_FILE="$SCRIPT_FOLDER/$1"
-if [[ -f $SCRIPT_FILE ]]; then
- gvim $SCRIPT_FILE
+if [ -f "$SCRIPT_FILE" ]; then
+ gvim "$SCRIPT_FILE" &
else
- echo -e '#!/bin/bash\n\n# vim: expandtab sw=2 ts=2' > $SCRIPT_FILE
- chmod +x $SCRIPT_FILE
- gvim $SCRIPT_FILE &
+
+cat >> "$SCRIPT_FILE" <<EOF
+#!/bin/sh
+
+# vim: expandtab sw=2 ts=2
+EOF
+
+ chmod +x "$SCRIPT_FILE"
+ gvim "$SCRIPT_FILE" &
fi
# vim: expandtab sw=2 ts=2
diff --git a/scripts/current-term b/scripts/current-term
index 1917293..21f9383 100755
--- a/scripts/current-term
+++ b/scripts/current-term
@@ -1,18 +1,18 @@
-#!/bin/bash
+#!/bin/sh
set_class=0
-if [[ $1 == "--class" ]]; then
+if [ "$1" = "--class" ]; then
set_class=1
class=$2
shift
shift
fi
-if [[ $set_class -eq 1 ]]; then
+if [ $set_class -eq 1 ]; then
#termite --name=$class $@
- alacritty --class $class $@
+ alacritty --class "$class" "$@"
else
- termite $@
+ termite "$@"
fi
# vim: expandtab sw=2 ts=2
diff --git a/scripts/firefox-private b/scripts/firefox-private
index 26a29d5..6a2657c 100755
--- a/scripts/firefox-private
+++ b/scripts/firefox-private
@@ -1,5 +1,5 @@
-#!/bin/bash
+#!/bin/sh
-firefox --private-window $@
+firefox --private-window "$@"
# vim: expandtab sw=2 ts=2
diff --git a/scripts/mpv-gui b/scripts/mpv-gui
index 714e455..9882e10 100755
--- a/scripts/mpv-gui
+++ b/scripts/mpv-gui
@@ -1,3 +1,5 @@
-#!/bin/bash
-mpv --player-operation-mode=pseudo-gui
+#!/bin/sh
+
+mpv --player-operation-mode=pseudo-gui "$@"
+
# vim: expandtab sw=2 ts=2
diff --git a/scripts/rofi-kvmap b/scripts/rofi-kvmap
index 2ea33cc..2436e78 100755
--- a/scripts/rofi-kvmap
+++ b/scripts/rofi-kvmap
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
character_list="kvmap_list.txt"
sep=":"
@@ -6,15 +6,14 @@ sep=":"
cd "$(dirname "$0")" || exit 1
-selected_string=$(cat "$character_list" | rofi -dmenu -i -sync -p "key" $@)
+selected_string=$(rofi -dmenu -i -sync -p "key" "$@" < "$character_list")
-selected_symbol=$(cut -d "$sep" -f 2- <<< "$selected_string")
+selected_symbol=$(printf '%s' "$selected_string" | cut -d "$sep" -f 2-)
#trim whitespace
#selected_symbol=${selected_symbol// }
for selection in clipboard primary; do
- echo -n "$selected_symbol" | tr -d '\n' | xsel --logfile /dev/null -i --"$selection"
+ printf '%s' "$selected_symbol" | tr -d '\n' | xsel --logfile /dev/null -i --"$selection"
done
-(
# vim: expandtab sw=2 ts=2
diff --git a/scripts/rofi-workspaces b/scripts/rofi-workspaces
index a93190f..e59f4f5 100755
--- a/scripts/rofi-workspaces
+++ b/scripts/rofi-workspaces
@@ -1,12 +1,12 @@
#!/bin/bash
moveto=0
-if [[ "$1" == "--move" ]]; then
+if [ "$1" = "--move" ]; then
moveto=1
shift
fi
-function get_workspaces () {
+get_workspaces() {
workspace_json="$(i3-msg -t get_workspaces)"
IFS=','
read -ra split <<< "$workspace_json"
@@ -20,7 +20,7 @@ function get_workspaces () {
done
}
-selection=$(echo "$(get_workspaces)" | rofi -dmenu "$@")
+selection=$(get_workspaces | rofi -dmenu "$@")
if [[ $moveto -eq 0 ]]; then
i3-msg workspace "$selection"
else
diff --git a/scripts/scava b/scripts/scava
index 01684af..b5e32f1 100755
--- a/scripts/scava
+++ b/scripts/scava
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
current-term --class cava -e cava
diff --git a/scripts/steam-oldchat b/scripts/steam-oldchat
index 1f3df12..4b2b0cb 100755
--- a/scripts/steam-oldchat
+++ b/scripts/steam-oldchat
@@ -1,5 +1,5 @@
-#!/bin/bash
+#!/bin/sh
-steam-native -no-browser $@
+steam-native -no-browser "$@"
# vim: expandtab sw=2 ts=2
diff --git a/scripts/stranger b/scripts/stranger
index 08d5180..1db9840 100755
--- a/scripts/stranger
+++ b/scripts/stranger
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
current-term --class ranger -e ranger
diff --git a/scripts/svimpc b/scripts/svimpc
index 9cd2d3f..57c0c92 100755
--- a/scripts/svimpc
+++ b/scripts/svimpc
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
current-term --class vimpc -e vimpc
diff --git a/scripts/sweechat b/scripts/sweechat
index 349faa2..a2f0a70 100755
--- a/scripts/sweechat
+++ b/scripts/sweechat
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
termite --name=weechat -e weechat