From 21b4f8c613c45a2694129f5bba37b2ebc934633b Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 18 Nov 2018 20:31:24 -0500 Subject: [PATCH] showclip and qrcode show binds --- .config/i3/config | 3 ++- .scripts/i3cmds/showclip | 16 ++++++++++++++++ .scripts/i3cmds/xcqr | 9 +++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) create mode 100755 .scripts/i3cmds/showclip create mode 100755 .scripts/i3cmds/xcqr diff --git a/.config/i3/config b/.config/i3/config index c842ce0..3db8e69 100644 --- a/.config/i3/config +++ b/.config/i3/config @@ -129,7 +129,8 @@ bindsym $mod+grave exec --no-startup-id dmenuunicode bindsym $mod+Shift+Delete exec --no-startup-id lmc truemute ; exec $truepause ; exec --no-startup-id pauseallmpv; workspace 0; exec $term -e htop ; exec $term -e ranger # Show selection: -bindsym $mod+Shift+Insert exec --no-startup-id showclip +bindsym $mod+Insert exec --no-startup-id showclip +bindsym $mod+Pause exec --no-startup-id xcqr # #---Letter Key Bindings---# # bindsym $mod+q [con_id="__focused__" instance="^(?!dropdowncalc|tmuxdd).*$"] kill diff --git a/.scripts/i3cmds/showclip b/.scripts/i3cmds/showclip new file mode 100755 index 0000000..f34addc --- /dev/null +++ b/.scripts/i3cmds/showclip @@ -0,0 +1,16 @@ +#!/bin/sh + +# Display contents of selection via dunst if running. +# Separate script for i3. + +! pgrep -x dunst >/dev/null && echo "dunst not running." && exit + +clip=$(xclip -o -selection clipboard) + + +prim=$(xclip -o -selection primary) + +[ "$prim" != "" ] && notify-send "Clipboard: +$prim" +[ "$clip" != "" ] && notify-send "Primary: +$clip" diff --git a/.scripts/i3cmds/xcqr b/.scripts/i3cmds/xcqr new file mode 100755 index 0000000..5e7b5f0 --- /dev/null +++ b/.scripts/i3cmds/xcqr @@ -0,0 +1,9 @@ +#!/bin/sh +# Credit to Maddison Hellstrom (@b0o on Github) +qrencode -o - -s 1 \ + "$(xclip -out -selection clipboard)" | + feh --zoom max \ + -F \ + --force-aliasing \ + --image-bg white \ + -