diff options
Diffstat (limited to 'dot')
-rw-r--r-- | dot/local/bin/cutbuffer | 34 | ||||
-rwxr-xr-x | dot/local/bin/cutbuffer_pop | 18 | ||||
-rwxr-xr-x | dot/local/bin/cutbuffer_push | 15 | ||||
-rw-r--r-- | dot/xbindkeysrc | 4 |
4 files changed, 36 insertions, 35 deletions
diff --git a/dot/local/bin/cutbuffer b/dot/local/bin/cutbuffer new file mode 100644 index 0000000..423d974 --- /dev/null +++ b/dot/local/bin/cutbuffer | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/bin/sh | ||
2 | dest_basename=cutbuffer_grab | ||
3 | dest_extension=txt | ||
4 | date_format=+%F_%H%M%S | ||
5 | |||
6 | destdir=$HOME/$dest_basename | ||
7 | |||
8 | cutbuffer_push() | ||
9 | { | ||
10 | now=$(date "$date_format") | ||
11 | dest=$dest_basename.$now.$dest_extension | ||
12 | xcb -p 0 > "$dest" | ||
13 | } | ||
14 | |||
15 | cutbuffer_pop() | ||
16 | { | ||
17 | nameglob=$dest_basename.*.$dest_extension | ||
18 | f=$(find . -maxdepth 1 -type f -name "$nameglob" -print0 | sort -z -V -r | head -z -n 1 | xargs -0) | ||
19 | |||
20 | xcb -s 0 < "$f" | ||
21 | xsel --input < "$f" | ||
22 | |||
23 | mkdir -p .popped | ||
24 | mv "$f" -t .popped | ||
25 | } | ||
26 | |||
27 | set -e | ||
28 | mkdir -p "$destdir" | ||
29 | cd "$destdir" | ||
30 | case "$*" in | ||
31 | pop) cutbuffer_pop ;; | ||
32 | push) cutbuffer_push ;; | ||
33 | esac | ||
34 | |||
diff --git a/dot/local/bin/cutbuffer_pop b/dot/local/bin/cutbuffer_pop deleted file mode 100755 index e994342..0000000 --- a/dot/local/bin/cutbuffer_pop +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | dest_basename=cutbuffer_grab | ||
3 | dest_extension=txt | ||
4 | destdir=$HOME/$dest_basename | ||
5 | |||
6 | set -e | ||
7 | mkdir -p "$destdir" | ||
8 | cd "$destdir" | ||
9 | |||
10 | nameglob=$dest_basename.*.$dest_extension | ||
11 | f=$(find . -maxdepth 1 -type f -name "$nameglob" -print0 | sort -z -V -r | head -z -n 1 | xargs -0) | ||
12 | |||
13 | xcb -s 0 < "$f" | ||
14 | xsel --input < "$f" | ||
15 | |||
16 | mkdir -p .popped | ||
17 | mv "$f" -t .popped | ||
18 | |||
diff --git a/dot/local/bin/cutbuffer_push b/dot/local/bin/cutbuffer_push deleted file mode 100755 index ab3ca98..0000000 --- a/dot/local/bin/cutbuffer_push +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | dest_basename=cutbuffer_grab | ||
3 | dest_extension=txt | ||
4 | date_format=+%F_%H%M%S | ||
5 | |||
6 | destdir=$HOME/$dest_basename | ||
7 | |||
8 | set -e | ||
9 | |||
10 | mkdir -p "$destdir" | ||
11 | cd "$destdir" | ||
12 | now=$(date "$date_format") | ||
13 | dest=$dest_basename.$now.$dest_extension | ||
14 | xcb -p 0 > "$dest" | ||
15 | |||
diff --git a/dot/xbindkeysrc b/dot/xbindkeysrc index ec4eb9d..62bc5d7 100644 --- a/dot/xbindkeysrc +++ b/dot/xbindkeysrc | |||
@@ -78,10 +78,10 @@ control + XF86AudioLowerVolume | |||
78 | "im" | 78 | "im" |
79 | 79 | ||
80 | 80 | ||
81 | "cutbuffer_push" | 81 | "cutbuffer push" |
82 | control + Print | 82 | control + Print |
83 | 83 | ||
84 | "cutbuffer_pop" | 84 | "cutbuffer pop" |
85 | alt + Print | 85 | alt + Print |
86 | 86 | ||
87 | "scrolltoggle" | 87 | "scrolltoggle" |