summaryrefslogtreecommitdiffstats
path: root/extra
diff options
context:
space:
mode:
authorrabite <rabite@posteo.de>2019-05-28 00:50:15 +0200
committerrabite <rabite@posteo.de>2019-05-28 00:51:47 +0200
commitad4e3d573fffe2412c7840319c39ca4a64c02b56 (patch)
tree06a8e64a71859fbb448cc37e523b8bcc8ab606d2 /extra
parentfdc4eb52d0403e041fe77f403b0dbc5686789087 (diff)
add quick actions
Diffstat (limited to 'extra')
-rwxr-xr-xextra/actions/application/extract.sh10
-rwxr-xr-xextra/actions/compress?archive_name.sh3
-rwxr-xr-xextra/actions/synchtop!.sh3
-rwxr-xr-xextra/actions/text/firefox.sh3
-rwxr-xr-xextra/actions/text/nano!.sh3
-rwxr-xr-xextra/actions/video/mpv.sh3
-rwxr-xr-xextra/actions/youtube_music?url.sh15
7 files changed, 40 insertions, 0 deletions
diff --git a/extra/actions/application/extract.sh b/extra/actions/application/extract.sh
new file mode 100755
index 0000000..51c8c0f
--- /dev/null
+++ b/extra/actions/application/extract.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+which 7z >/dev/null && EXTRACTOR="7z x"
+# Prefer aunpack
+which aunpack >/dev/null && EXTRACTOR=aunpack
+
+
+for file in "$@"; do
+ echo $EXTRACTOR "$file";
+done
diff --git a/extra/actions/compress?archive_name.sh b/extra/actions/compress?archive_name.sh
new file mode 100755
index 0000000..17c0d6a
--- /dev/null
+++ b/extra/actions/compress?archive_name.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+7z a $archive_name "$@"
diff --git a/extra/actions/synchtop!.sh b/extra/actions/synchtop!.sh
new file mode 100755
index 0000000..5e1f9f7
--- /dev/null
+++ b/extra/actions/synchtop!.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec htop
diff --git a/extra/actions/text/firefox.sh b/extra/actions/text/firefox.sh
new file mode 100755
index 0000000..a03ee81
--- /dev/null
+++ b/extra/actions/text/firefox.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+firefox "$@"
diff --git a/extra/actions/text/nano!.sh b/extra/actions/text/nano!.sh
new file mode 100755
index 0000000..2b03d6c
--- /dev/null
+++ b/extra/actions/text/nano!.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+nano "$@"
diff --git a/extra/actions/video/mpv.sh b/extra/actions/video/mpv.sh
new file mode 100755
index 0000000..87da718
--- /dev/null
+++ b/extra/actions/video/mpv.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec mpv "$@"
diff --git a/extra/actions/youtube_music?url.sh b/extra/actions/youtube_music?url.sh
new file mode 100755
index 0000000..8881499
--- /dev/null
+++ b/extra/actions/youtube_music?url.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+FORMATS=`youtube-dl -F "$url"`
+
+echo $FORMATS
+
+echo $FORMATS | grep "251 " &&
+ youtube-dl -x -f 251 "$url" &&
+ exit 0
+
+echo $FORMATS | grep "171 " &&
+ youtube-dl -x -f 171 "$url" &&
+ exit 0
+
+exit 1