diff --git a/.gitignore b/.gitignore index 67f7fb5..d288c66 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ _desktop/qutebrowser/bookmarks/urls _desktop/qutebrowser/quickmarks +_desktop/clipboard/selection diff --git a/_desktop/clipboard/clipboard/run b/_desktop/clipboard/clipboard/run new file mode 100755 index 0000000..e737925 --- /dev/null +++ b/_desktop/clipboard/clipboard/run @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +exec 2>&1 + +SEL="../selection" + + +# "xsel --nodetach --input" with an empty input will still exit immediately, +# so we need to make sure the selection never is empty: +[ -s "$SEL" ] || echo >| "$SEL" + +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --input < "$SEL" + +# something else grabbed the selection. pull it over here: +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --output > "$SEL".new +# see above: +[ -s "$SEL" ] || echo >| "$SEL" +mv "$SEL".new "$SEL" +sv term ../primary ../secondary ../clipboard diff --git a/_desktop/clipboard/clipboard/supervise/lock b/_desktop/clipboard/clipboard/supervise/lock new file mode 100644 index 0000000..e69de29 diff --git a/_desktop/clipboard/clipboard/supervise/pid b/_desktop/clipboard/clipboard/supervise/pid new file mode 100644 index 0000000..6014170 --- /dev/null +++ b/_desktop/clipboard/clipboard/supervise/pid @@ -0,0 +1 @@ +23923 diff --git a/_desktop/clipboard/clipboard/supervise/stat b/_desktop/clipboard/clipboard/supervise/stat new file mode 100644 index 0000000..f5bdd21 --- /dev/null +++ b/_desktop/clipboard/clipboard/supervise/stat @@ -0,0 +1 @@ +run diff --git a/_desktop/clipboard/clipboard/supervise/status b/_desktop/clipboard/clipboard/supervise/status new file mode 100644 index 0000000..d09e691 Binary files /dev/null and b/_desktop/clipboard/clipboard/supervise/status differ diff --git a/_desktop/clipboard/primary/run b/_desktop/clipboard/primary/run new file mode 100755 index 0000000..e737925 --- /dev/null +++ b/_desktop/clipboard/primary/run @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +exec 2>&1 + +SEL="../selection" + + +# "xsel --nodetach --input" with an empty input will still exit immediately, +# so we need to make sure the selection never is empty: +[ -s "$SEL" ] || echo >| "$SEL" + +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --input < "$SEL" + +# something else grabbed the selection. pull it over here: +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --output > "$SEL".new +# see above: +[ -s "$SEL" ] || echo >| "$SEL" +mv "$SEL".new "$SEL" +sv term ../primary ../secondary ../clipboard diff --git a/_desktop/clipboard/primary/supervise/lock b/_desktop/clipboard/primary/supervise/lock new file mode 100644 index 0000000..e69de29 diff --git a/_desktop/clipboard/primary/supervise/pid b/_desktop/clipboard/primary/supervise/pid new file mode 100644 index 0000000..79c5b12 --- /dev/null +++ b/_desktop/clipboard/primary/supervise/pid @@ -0,0 +1 @@ +23922 diff --git a/_desktop/clipboard/primary/supervise/stat b/_desktop/clipboard/primary/supervise/stat new file mode 100644 index 0000000..f5bdd21 --- /dev/null +++ b/_desktop/clipboard/primary/supervise/stat @@ -0,0 +1 @@ +run diff --git a/_desktop/clipboard/primary/supervise/status b/_desktop/clipboard/primary/supervise/status new file mode 100644 index 0000000..8abe104 Binary files /dev/null and b/_desktop/clipboard/primary/supervise/status differ diff --git a/_desktop/clipboard/secondary/run b/_desktop/clipboard/secondary/run new file mode 100755 index 0000000..e737925 --- /dev/null +++ b/_desktop/clipboard/secondary/run @@ -0,0 +1,21 @@ +#!/bin/sh +set -e +exec 2>&1 + +SEL="../selection" + + +# "xsel --nodetach --input" with an empty input will still exit immediately, +# so we need to make sure the selection never is empty: +[ -s "$SEL" ] || echo >| "$SEL" + +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --input < "$SEL" + +# something else grabbed the selection. pull it over here: +xsel --nodetach --logfile /dev/stdout --"$(basename "`pwd`")" \ + --output > "$SEL".new +# see above: +[ -s "$SEL" ] || echo >| "$SEL" +mv "$SEL".new "$SEL" +sv term ../primary ../secondary ../clipboard diff --git a/_desktop/clipboard/secondary/supervise/lock b/_desktop/clipboard/secondary/supervise/lock new file mode 100644 index 0000000..e69de29 diff --git a/_desktop/clipboard/secondary/supervise/pid b/_desktop/clipboard/secondary/supervise/pid new file mode 100644 index 0000000..63c1721 --- /dev/null +++ b/_desktop/clipboard/secondary/supervise/pid @@ -0,0 +1 @@ +23921 diff --git a/_desktop/clipboard/secondary/supervise/stat b/_desktop/clipboard/secondary/supervise/stat new file mode 100644 index 0000000..f5bdd21 --- /dev/null +++ b/_desktop/clipboard/secondary/supervise/stat @@ -0,0 +1 @@ +run diff --git a/_desktop/clipboard/secondary/supervise/status b/_desktop/clipboard/secondary/supervise/status new file mode 100644 index 0000000..b495cde Binary files /dev/null and b/_desktop/clipboard/secondary/supervise/status differ diff --git a/_desktop/install-desktop.sh b/_desktop/install-desktop.sh index 1d812a7..5544faa 100644 --- a/_desktop/install-desktop.sh +++ b/_desktop/install-desktop.sh @@ -4,11 +4,15 @@ mkdir -p ~/.config ~/.local/bin ~/.local/settings # link config -for i in clipit dunst fontconfig rofi zathura; do +for i in dunst fontconfig rofi zathura; do rm -rf ~/.config/${i} ln -sf ~/.local/repos/dotfiles/_desktop/${i} ~/.config done +# link clibpoard hack +rm -rf ~/.local/bin/clipboard +ln -sf ~/.local/repos/dotfiles/_desktop/clipboard ~/.local/bin/clipboard + # copy firefox wrapper ln -sf ~/.local/repos/dotfiles/_desktop/firefox ~/.local/bin