From 3f0f59bdb2da8c022ff19462fb0c947a3ed26ebc Mon Sep 17 00:00:00 2001 From: the_4n0nym0u53 Date: Wed, 22 Dec 2021 15:27:03 +0100 Subject: [PATCH] Add script to clear the clipboard (requires wl-clipboard) and add keybinding for it in sway config. --- README.md | 1 + install.sh | 2 ++ scripts/.local/bin/clear-clipboard.sh | 4 ++++ sway/.config/sway/config | 3 +++ 4 files changed, 10 insertions(+) create mode 100755 scripts/.local/bin/clear-clipboard.sh diff --git a/README.md b/README.md index 5e5d6c5..73f2f27 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ This configuration depends on the following packages: - `sway-launcher-desktop` - `waybar` - `wireplumber` +- `wl-clipboard` \* If you prefer `sudo`, then change all instances of `doas` to `sudo`. They're mainly in the sway config file and in my `autostart.sh` script. diff --git a/install.sh b/install.sh index f3f47a5..3c640d7 100755 --- a/install.sh +++ b/install.sh @@ -5,6 +5,7 @@ echo -e "Creating the symlinks with stow..." stow -t $HOME alacritty \ mako \ nvim \ + scripts \ sway \ swaylock \ waybar @@ -12,6 +13,7 @@ stow -t $HOME alacritty \ sleep 1 echo -e "Making scripts executable..." +chmod +x scripts/.local/bin/clear-clipboard.sh chmod +x sway/.config/sway/autostart.sh chmod +x waybar/.config/waybar/ivpn-status.sh chmod +x waybar/.config/waybar/ivpn-reconnect.sh diff --git a/scripts/.local/bin/clear-clipboard.sh b/scripts/.local/bin/clear-clipboard.sh new file mode 100755 index 0000000..ff78998 --- /dev/null +++ b/scripts/.local/bin/clear-clipboard.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +wl-copy -c +wl-copy -pc diff --git a/sway/.config/sway/config b/sway/.config/sway/config index 3a13d81..1076fec 100644 --- a/sway/.config/sway/config +++ b/sway/.config/sway/config @@ -71,6 +71,9 @@ exec swayidle -w \ # Start your launcher bindsym $mod+d exec $menu + # Clear the clipboard (make sure to have $HOME/.local/bin in your $PATH) + bindsym $mod+c exec clear-clipboard.sh + # Drag floating windows by holding down $mod and left mouse button. # Resize them with right mouse button + $mod. # Despite the name, also works for non-floating windows.