summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common/whenpkgs30
-rwxr-xr-xbin/guiscripts/dmcalc12
-rwxr-xr-xbin/guiscripts/dmvol10
-rwxr-xr-xbin/guiscripts/slmpd6
-rwxr-xr-xbin/guiscripts/stdir9
-rwxr-xr-xbin/guiscripts/stextsig4
6 files changed, 71 insertions, 0 deletions
diff --git a/bin/common/whenpkgs b/bin/common/whenpkgs
new file mode 100755
index 0000000..96c45d0
--- /dev/null
+++ b/bin/common/whenpkgs
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+m="$(date +%m)"
+d="$(date +%d)"
+y="$(date +%y)"
+
+# Trying to make a regex that will match expac's date format
+
+# 1. create ranges based on command line arguments
+# 2. change this to \(n-2\|n-1\|n\)
+# I. generate sequence
+# II. remove trailing space
+# III.translate space to '\|'
+# IV. wrap everything in '\( ... \)'
+# V. shift command line arguments
+# repeat 2. for month and year
+# 3. seq outputs a newline, translate this to slash
+# 4. remove trailing slash
+regex="$(for var in m d y
+do
+ seq -w -s ' ' $((${!var} - ${1:-0})) ${!var} |
+ sed 's/ /\\|/g;s/.*/\\(&\\)/'
+ shift 2>/dev/null
+done |
+ tr '\n' '/' |
+ sed 's/.$//')"
+
+expac -t %D '%l %n' |
+ grep "$regex" |
+ sort -k 2 -t '/' -n
diff --git a/bin/guiscripts/dmcalc b/bin/guiscripts/dmcalc
new file mode 100755
index 0000000..46c35c6
--- /dev/null
+++ b/bin/guiscripts/dmcalc
@@ -0,0 +1,12 @@
+#!/bin/sh
+dmenu -p Calculate: < /dev/null |
+ xargs echo |
+ bc 2>&1 |
+ xargs -I {} echo -e "{}\n" |
+ dmenu -p Answer: -l 1 -g 1 |
+ xclipp
+# TODO
+# ask for calculation
+# shows answer
+# if esc -> quit
+# if enter, continue with answer
diff --git a/bin/guiscripts/dmvol b/bin/guiscripts/dmvol
new file mode 100755
index 0000000..ccbf46b
--- /dev/null
+++ b/bin/guiscripts/dmvol
@@ -0,0 +1,10 @@
+#!/bin/sh
+volume=0
+while true
+do
+ volume="$(dmenu -p "$(mpc volume)" < /dev/null)"
+ test -z "$volume" && break
+ mpc volume "$(echo -e "plus\nmin" |
+ dmenu -g 2 -l 1 |
+ sed 's/plus/+/;s/min/-/')$volume"
+done
diff --git a/bin/guiscripts/slmpd b/bin/guiscripts/slmpd
new file mode 100755
index 0000000..1e573ac
--- /dev/null
+++ b/bin/guiscripts/slmpd
@@ -0,0 +1,6 @@
+#!/bin/sh
+if mpc > /dev/null 2>&1
+then
+ test "`mpc status %totaltime%`" = "0:00" ||
+ echo -n "$(mpc status "%currenttime%/%totaltime%") $(mpc current)"
+fi
diff --git a/bin/guiscripts/stdir b/bin/guiscripts/stdir
new file mode 100755
index 0000000..7a32981
--- /dev/null
+++ b/bin/guiscripts/stdir
@@ -0,0 +1,9 @@
+#!/bin/sh
+# Opens a terminal from another terminal's working directory
+# we look for the cwd of it's child process
+cd $(pwdx $(pstree -p $(xdotool getwindowpid $(xdotool getwindowfocus)) \
+ | head -1 \
+ | cut -f3 -d'(' \
+ | cut -f1 -d')') \
+ | awk '{print $2}')
+setsid ${TERMINAL:-st}
diff --git a/bin/guiscripts/stextsig b/bin/guiscripts/stextsig
new file mode 100755
index 0000000..7de1a5b
--- /dev/null
+++ b/bin/guiscripts/stextsig
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+dunstify "" "got called"
+cat | dmenu -g 1 -l 20