1 changed files with 39 additions and 21 deletions
@ -1,22 +1,40 @@ |
|||||||
#!/usr/bin/env bash |
#!/bin/bash |
||||||
# |
## /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ ## |
||||||
while [[ true ]]; do |
# Clipboard Manager. This script uses cliphist, rofi, and wl-copy. |
||||||
|
|
||||||
|
# Actions: |
||||||
|
# CTRL Del to delete an entry |
||||||
|
# ALT Del to wipe clipboard contents |
||||||
|
|
||||||
|
while true; do |
||||||
result=$( |
result=$( |
||||||
cliphist list | rofi -dmenu \ |
rofi -dmenu \ |
||||||
-kb-custom-1 "Control-Delete" \ |
-kb-custom-1 "Control-Delete" \ |
||||||
-config ~/.config/rofi/config-long.rasi |
-kb-custom-2 "Alt-Delete" \ |
||||||
|
-config ~/.config/rofi/config-clipboard.rasi < <(cliphist list) |
||||||
) |
) |
||||||
exit_state=$? |
|
||||||
if [[ $exit_state -eq 1 ]]; then |
case "$?" in |
||||||
|
1) |
||||||
exit |
exit |
||||||
fi |
;; |
||||||
case "$exit_state" in |
|
||||||
0) |
0) |
||||||
cliphist decode <<<$result | wl-copy |
case "$result" in |
||||||
|
"") |
||||||
|
continue |
||||||
|
;; |
||||||
|
*) |
||||||
|
cliphist decode <<<"$result" | wl-copy |
||||||
exit |
exit |
||||||
;; |
;; |
||||||
|
esac |
||||||
|
;; |
||||||
10) |
10) |
||||||
cliphist delete <<<$result |
cliphist delete <<<"$result" |
||||||
|
;; |
||||||
|
11) |
||||||
|
cliphist wipe |
||||||
;; |
;; |
||||||
esac |
esac |
||||||
done |
done |
||||||
|
|
||||||
|
|||||||
Loading…
Reference in new issue