mirror of
https://github.com/elkowar/dots-of-war.git
synced 2024-12-25 13:42:23 +00:00
add copy pasta
This commit is contained in:
parent
40de0424e7
commit
d8ab47d23a
2 changed files with 11 additions and 5 deletions
|
@ -365,7 +365,8 @@ myKeys = concat [ zoomRowBindings, tabbedBindings, multiMonitorBindings, program
|
||||||
, ("M-b", safeSpawnProg "google-chrome-stable")
|
, ("M-b", safeSpawnProg "google-chrome-stable")
|
||||||
, ("M-S-<Return>", spawn myTerminal)
|
, ("M-S-<Return>", spawn myTerminal)
|
||||||
--, ("M-S-<Return>", launchWithBackgroundInstance (className =? "Alacritty") "alacritty")
|
--, ("M-S-<Return>", launchWithBackgroundInstance (className =? "Alacritty") "alacritty")
|
||||||
, ("M-S-<", spawn "flameshot gui")
|
, ("M-S-<", spawn "flameshot gui")
|
||||||
|
, ("M-z", spawn $ scriptFile "copy-pasta.sh")
|
||||||
|
|
||||||
|
|
||||||
, ("M-S-h", fuckshit)
|
, ("M-S-h", fuckshit)
|
||||||
|
|
|
@ -1,11 +1,16 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GEN_SCRIPT_DATA_PATH="/home/leon/gen-script-data"
|
set -e
|
||||||
|
|
||||||
|
GEN_SCRIPT_DATA_PATH="/home/leon/copy-pasta"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
options=$(for x in $GEN_SCRIPT_DATA_PATH/*; do echo "$x" | sed "s|$GEN_SCRIPT_DATA_PATH/||g"; done)
|
#options=$(for x in $GEN_SCRIPT_DATA_PATH/*; do echo "$x" | sed "s|$GEN_SCRIPT_DATA_PATH/||g"; done)
|
||||||
|
options=$(find "$GEN_SCRIPT_DATA_PATH" -type f | grep --invert-match ".git" | sed "s|$GEN_SCRIPT_DATA_PATH/||g")
|
||||||
|
choice="$(echo "$options" | rofi -dmenu -matching glob)"
|
||||||
|
file="$GEN_SCRIPT_DATA_PATH/$choice"
|
||||||
|
|
||||||
|
mime_type="$(file --mime-type "$choice" | sed 's/.*:\s*//g')"
|
||||||
|
|
||||||
echo "$options" | rofi -dmenu
|
xclip -selection clipboard -in -t "$mime_type" -i "$file"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue