From 6fd35bc232cdbed0bf37cfaf337af170b4b17d10 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Tue, 12 Nov 2019 16:39:31 -0600 Subject: [PATCH 1/3] More handy scripts --- bin/devtunnel | 11 +++++++++++ bin/fsw | 5 +++++ bin/remote | 22 +++++++--------------- de/x/resources | 2 ++ 4 files changed, 25 insertions(+), 15 deletions(-) create mode 100755 bin/devtunnel diff --git a/bin/devtunnel b/bin/devtunnel new file mode 100755 index 0000000..7cb459e --- /dev/null +++ b/bin/devtunnel @@ -0,0 +1,11 @@ +#!/usr/bin/env moon +arg_spec = { + {"target", "REMOTE_MACHINE", "remote"} + {"fwd", "FORWARD_PORTS", "1313,3000,4800:8000,8080,1234,40080:80,40443:443"} + {"sargs", "SSH_ARGS", "-XY"} +} +args = {v[1], os.getenv(v[2]) or arg[i] or v[3] for i, v in ipairs(arg_spec)} +ports = {a, (if b == "" then a else b) for a, b in args.fwd\gmatch "(%d+):?(%d*),?"} +pargs = table.concat ["-L #{k}:localhost:#{v}" for k,v in pairs ports], " " +for k,v in pairs ports do print "Forwarding localhost:#{k} to #{args.target}:#{v}" +os.execute "ssh -N #{args.target} #{pargs} #{args.sargs}" diff --git a/bin/fsw b/bin/fsw index 73eb43d..ca0541b 100755 --- a/bin/fsw +++ b/bin/fsw @@ -49,6 +49,11 @@ FSW_EVENTS="${FSW_EVENTS:-close_write}" SHELL_COMMAND="${1}"; shift FILTER="${1}"; shift DIRS=("${1:-.}"); shift +if [[ -e $FILTER ]]; then + # TODO: this is a sad hack/workaround + echo "It looks like your filter is an actual file. I'll just watch that for you." + DIRS=("${FILTER}") +fi while [[ ! -z $1 ]]; do DIRS+=("$1"); shift done diff --git a/bin/remote b/bin/remote index 48cff38..8de7aef 100755 --- a/bin/remote +++ b/bin/remote @@ -1,17 +1,9 @@ #!/usr/bin/env moon - -require('fun')! - -garg = (v, i) -> os.getenv(v[1]) or arg[i] or v[2] -target, fwd, mpr, sargs, margs = unpack totable map garg, iter { - {"REMOTE_MACHINE", "remote"} - {"SSH_FORWARD_PORTS", "1313,3000,8000,8080,1234,40080:80,40443:443"} - {"MOSH_PORT_RANGE", "60000:61000"} - {"SSH_ARGS", "-XY"} - {"MOSH_ARGS", ""} +arg_spec = { + {"target", "REMOTE_MACHINE", "remote"} + {"mpr", "MOSH_PORT_RANGE", "60000:61000"} + {"sargs", "SSH_ARGS", "-XY"} + {"margs", "MOSH_ARGS", ""} } - -sfwd = fwd\gsub "(%d+):?(%d*),?", (p, mp) -> - "-L #{p}:localhost:#{if mp == "" then p else mp} " - -os.execute "mosh -p '#{mpr}' '#{target}' --ssh='ssh #{sfwd} #{sargs}' #{margs}" +args = {v[1], os.getenv(v[2]) or arg[i] or v[3] for i, v in ipairs(arg_spec)} +os.execute "mosh -p '#{args.mpr}' '#{args.target}' --ssh='ssh #{args.sargs}' #{args.margs}" diff --git a/de/x/resources b/de/x/resources index a0a0d48..7ac0b56 100755 --- a/de/x/resources +++ b/de/x/resources @@ -17,6 +17,8 @@ ## Set fonts in "$HOME/.Xresources.env" URxvt.font: xft:Iosevka Term:pixelsize=14,xft:Noto Emoji,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 URxvt.faceName: xft:Iosevka Term:pixelsize=14,xft:Font Awesome 5 Free:pixelsize=14,xft:FreeSans:pixelsize=14 +Emacs.font: Iosevka Term +Emacs.faceName: Iosevka Term # URxvt.transparent: true # URxvt.shading: 70 URxvt.letterSpace: 0 From 044f3167cd5b69e3a090c35b29ecada9097f3050 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 14 Nov 2019 14:11:36 -0600 Subject: [PATCH 2/3] Add libinput gestures --- de/libinput/gestures.conf | 9 ++++++--- de/x/profile | 6 +++++- scripts/arch-linux/provisioning/3-extras.bash | 1 + 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/de/libinput/gestures.conf b/de/libinput/gestures.conf index 5aa6560..ad3e1ca 100644 --- a/de/libinput/gestures.conf +++ b/de/libinput/gestures.conf @@ -1,9 +1,12 @@ -gesture swipe right 3 bspc desktop -f next -gesture swipe left 3 bspc desktop -f prev +gesture swipe left 3 bspc desktop -f next +gesture swipe right 3 bspc desktop -f prev gesture swipe up 3 xdotool key XF86AudioRaiseVolume gesture swipe down 3 xdotool key XF86AudioLowerVolume +gesture swipe left 4 xdotool key alt+Right +gesture swipe right 4 xdotool key alt+Left + # GNOME SHELL open/close overview (works for GNOME on Xorg only) #gesture pinch in xdotool key super+s #gesture pinch out xdotool key super+s @@ -21,7 +24,7 @@ gesture swipe down 3 xdotool key XF86AudioLowerVolume # are actioned using the swipe_threshold configuration command. # Specify this value in dots. The default is 0. # E.g. set it to 100 dots with "swipe_threshold 100". -swipe_threshold 50 +swipe_threshold 25 ############################################################################### # You can set a timeout on gestures from start to end. The default is diff --git a/de/x/profile b/de/x/profile index f9efd92..e439d42 100644 --- a/de/x/profile +++ b/de/x/profile @@ -44,10 +44,14 @@ if command -v xcape >/dev/null 2>&1; then xcape -e 'Control_L=Escape' & fi -if command -v autocutsel >/dev/null 2>&1; then +if command -v autocutsel &> /dev/null; then autocutsel -fork & fi +if command -v libinput-gestures-setup &> /dev/null; then + libinput-gestures-setup start +fi + if [ -f "$HOME/.env_xprofile" ]; then source "$HOME/.env_xprofile" fi diff --git a/scripts/arch-linux/provisioning/3-extras.bash b/scripts/arch-linux/provisioning/3-extras.bash index fd90db4..ac16b2a 100755 --- a/scripts/arch-linux/provisioning/3-extras.bash +++ b/scripts/arch-linux/provisioning/3-extras.bash @@ -45,4 +45,5 @@ pacaur --needed -S \ ncdu `# Disk Usage Analyzer` \ zathura zathura-pdf-mupdf `# Document Viewer` \ scrot `# Screenshot Tool` \ + libinput libinput-gestures `# Trackpad Control` \ --noconfirm --noedit From e960373df4fb5658024b22c27851e0485ea4b259 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sun, 17 Nov 2019 09:05:56 -0600 Subject: [PATCH 3/3] Caps lock is bad --- apps/neovim/settings.vim | 3 ++- de/x/modmap | 2 +- scripts/arch-linux/provisioning/3-extras.bash | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/neovim/settings.vim b/apps/neovim/settings.vim index afe5d57..349d8a7 100644 --- a/apps/neovim/settings.vim +++ b/apps/neovim/settings.vim @@ -77,7 +77,8 @@ set nobackup " sessions handle this quite nicely set nowritebackup " no but really they do set noswapfile " no seriously sessions are cool set timeout " key combo mapping timeout -set ttimeoutlen=200 " ms for key combo mapping timeout +set ttimeoutlen=100 " ms delay for tapping key combos +set timeoutlen=150 " ms for key combo mapping timeout set isfname+=32 " allow filenames to show them 32s " no freakin' bell diff --git a/de/x/modmap b/de/x/modmap index 83c89c2..bb412e3 100644 --- a/de/x/modmap +++ b/de/x/modmap @@ -4,4 +4,4 @@ keycode 66 = Control_L add Control = Control_L ! a fake keycode for xcape -keycode 999 = Escape +keycode 254 = Escape diff --git a/scripts/arch-linux/provisioning/3-extras.bash b/scripts/arch-linux/provisioning/3-extras.bash index ac16b2a..711c118 100755 --- a/scripts/arch-linux/provisioning/3-extras.bash +++ b/scripts/arch-linux/provisioning/3-extras.bash @@ -46,4 +46,5 @@ pacaur --needed -S \ zathura zathura-pdf-mupdf `# Document Viewer` \ scrot `# Screenshot Tool` \ libinput libinput-gestures `# Trackpad Control` \ + xcape `# Escape Better` \ --noconfirm --noedit