summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2019-05-14 22:13:09 +0200
committerJokler <jokler.contact@gmail.com>2019-05-14 22:13:09 +0200
commit64b3f5883e5523e5193ba1583790cc8cfafcfe6e (patch)
tree8c604f28ede436cb2f43bd0a1c3c70d4e12461e6 /scripts
downloaddotfiles-64b3f5883e5523e5193ba1583790cc8cfafcfe6e.tar.gz
dotfiles-64b3f5883e5523e5193ba1583790cc8cfafcfe6e.zip
Add scripts, polybar and i3 config files
Diffstat (limited to 'scripts')
-rw-r--r--scripts/README.md3
-rwxr-xr-xscripts/autoscript19
-rwxr-xr-xscripts/current-term18
-rwxr-xr-xscripts/firefox-private5
-rwxr-xr-xscripts/mpv-gui3
-rwxr-xr-xscripts/rofi-kvmap20
-rwxr-xr-xscripts/rofi-passmenu28
-rwxr-xr-xscripts/rofi-workspaces30
-rwxr-xr-xscripts/scava5
-rwxr-xr-xscripts/steam-oldchat5
-rwxr-xr-xscripts/stranger5
-rwxr-xr-xscripts/svimpc5
-rwxr-xr-xscripts/sweechat5
13 files changed, 151 insertions, 0 deletions
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644
index 0000000..a5f8e1f
--- /dev/null
+++ b/scripts/README.md
@@ -0,0 +1,3 @@
+# Scripts
+
+Some of these are basically just aliases for programs outside of Zsh.
diff --git a/scripts/autoscript b/scripts/autoscript
new file mode 100755
index 0000000..c29bcc9
--- /dev/null
+++ b/scripts/autoscript
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+if [ "$#" -ne 1 ]; then
+ echo "Exactly 1 argument is required"
+ exit
+fi
+
+SCRIPT_FOLDER="$HOME/scripts"
+SCRIPT_FILE="$SCRIPT_FOLDER/$1"
+
+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 &
+fi
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/current-term b/scripts/current-term
new file mode 100755
index 0000000..1917293
--- /dev/null
+++ b/scripts/current-term
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+set_class=0
+if [[ $1 == "--class" ]]; then
+ set_class=1
+ class=$2
+ shift
+ shift
+fi
+
+if [[ $set_class -eq 1 ]]; then
+ #termite --name=$class $@
+ alacritty --class $class $@
+else
+ termite $@
+fi
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/firefox-private b/scripts/firefox-private
new file mode 100755
index 0000000..26a29d5
--- /dev/null
+++ b/scripts/firefox-private
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+firefox --private-window $@
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/mpv-gui b/scripts/mpv-gui
new file mode 100755
index 0000000..714e455
--- /dev/null
+++ b/scripts/mpv-gui
@@ -0,0 +1,3 @@
+#!/bin/bash
+mpv --player-operation-mode=pseudo-gui
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/rofi-kvmap b/scripts/rofi-kvmap
new file mode 100755
index 0000000..2ea33cc
--- /dev/null
+++ b/scripts/rofi-kvmap
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+character_list="kvmap_list.txt"
+sep=":"
+
+cd "$(dirname "$0")" || exit 1
+
+
+selected_string=$(cat "$character_list" | rofi -dmenu -i -sync -p "key" $@)
+
+selected_symbol=$(cut -d "$sep" -f 2- <<< "$selected_string")
+#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"
+done
+(
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/rofi-passmenu b/scripts/rofi-passmenu
new file mode 100755
index 0000000..1423685
--- /dev/null
+++ b/scripts/rofi-passmenu
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+shopt -s nullglob globstar
+
+typeit=0
+if [[ $1 == "--type" ]]; then
+ typeit=1
+ shift
+fi
+
+prefix=${PASSWORD_STORE_DIR-~/.password-store}
+password_files=( "$prefix"/**/*.gpg )
+password_files=( "${password_files[@]#"$prefix"/}" )
+password_files=( "${password_files[@]%.gpg}" )
+
+password=$(printf '%s\n' "${password_files[@]}" | rofi -dmenu -p "Service" "$@")
+
+[[ -n $password ]] || exit
+
+if [[ $typeit -eq 0 ]]; then
+ if pass show -c "$password" 2>&1 | grep "is not in the password store"; then
+ length=$(rofi -dmenu -p "Length" "$@")
+ pass generate -c "$password" "$length"
+ fi
+else
+ pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
+ xdotool type --clearmodifiers --file -
+fi
diff --git a/scripts/rofi-workspaces b/scripts/rofi-workspaces
new file mode 100755
index 0000000..a93190f
--- /dev/null
+++ b/scripts/rofi-workspaces
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+moveto=0
+if [[ "$1" == "--move" ]]; then
+ moveto=1
+ shift
+fi
+
+function get_workspaces () {
+ workspace_json="$(i3-msg -t get_workspaces)"
+ IFS=','
+ read -ra split <<< "$workspace_json"
+
+ for entry in "${split[@]}"; do
+ if [[ "$entry" == *"name"* ]]; then
+ IFS='"'
+ read -ra split <<< "$entry"
+ echo "${split[3]}"
+ fi
+ done
+}
+
+selection=$(echo "$(get_workspaces)" | rofi -dmenu "$@")
+if [[ $moveto -eq 0 ]]; then
+ i3-msg workspace "$selection"
+else
+ i3-msg move container to workspace "$selection"
+fi
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/scava b/scripts/scava
new file mode 100755
index 0000000..01684af
--- /dev/null
+++ b/scripts/scava
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+current-term --class cava -e cava
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/steam-oldchat b/scripts/steam-oldchat
new file mode 100755
index 0000000..1f3df12
--- /dev/null
+++ b/scripts/steam-oldchat
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+steam-native -no-browser $@
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/stranger b/scripts/stranger
new file mode 100755
index 0000000..08d5180
--- /dev/null
+++ b/scripts/stranger
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+current-term --class ranger -e ranger
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/svimpc b/scripts/svimpc
new file mode 100755
index 0000000..9cd2d3f
--- /dev/null
+++ b/scripts/svimpc
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+current-term --class vimpc -e vimpc
+
+# vim: expandtab sw=2 ts=2
diff --git a/scripts/sweechat b/scripts/sweechat
new file mode 100755
index 0000000..349faa2
--- /dev/null
+++ b/scripts/sweechat
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+termite --name=weechat -e weechat
+
+# vim: expandtab sw=2 ts=2