sxhkd-rc

[fork] simple X hotkey daemon (but for the rc shell)
Log | Files | Refs | README | LICENSE

commit c89293da997a0989e1625f50e1e6bb5dbb4856c2
parent 736cf7e7e4caca004659e155e410bbbe46d7fac1
Author: hhvn <dev@hhvn.uk>
Date:   Sat, 15 Jan 2022 11:04:55 +0000

README.md doc/* contrib/sxhkd-vim-rc.diff: update docs

Diffstat:
MREADME.md | 41+++++++++++++++++++++--------------------
Acontrib/sxhkd-vim-rc.diff | 38++++++++++++++++++++++++++++++++++++++
Mdoc/sxhkd.1 | 8++++----
Mdoc/sxhkd.1.asciidoc | 2+-
4 files changed, 64 insertions(+), 25 deletions(-)

diff --git a/README.md b/README.md @@ -8,8 +8,8 @@ The format of the configuration file supports a simple notation for mapping mult ## Example Bindings - XF86Audio{Prev,Next} - mpc -q {prev,next} + XF86Audio[Prev,Next] + mpc -q [prev,next] @XF86LaunchA scrot -s -e 'image_viewer $f' @@ -20,39 +20,39 @@ The format of the configuration file supports a simple notation for mapping mult XF86LaunchB xdotool selectwindow | xsel -bi - super + {h,j,k,l} - bspc node -f {west,south,north,east} + super + [h,j,k,l] + bspc node -f [west,south,north,east] - super + alt + {0-9} - mpc -q seek {0-9}0% + super + alt + [0-9] + mpc -q seek [0-9]0% - super + {alt,ctrl,alt + ctrl} + XF86Eject - sudo systemctl {suspend,reboot,poweroff} + super + [alt,ctrl,alt + ctrl] + XF86Eject + sudo systemctl [suspend,reboot,poweroff] - super + {_,shift + }{h,j,k,l} - bspc node -{f,s} {west,south,north,east} + super + [_,shift + ][h,j,k,l] + bspc node -[f,s] [west,south,north,east] - {_,shift + ,super + }XF86MonBrightness{Down,Up} - bright {-1,-10,min,+1,+10,max} + [_,shift + ,super + ]XF86MonBrightness[Down,Up] + bright [-1,-10,min,+1,+10,max] - super + o ; {e,w,m} - {gvim,firefox,thunderbird} + super + o ; [e,w,m] + [gvim,firefox,thunderbird] - super + alt + control + {h,j,k,l} ; {0-9} - bspc node @{west,south,north,east} -r 0.{0-9} + super + alt + control + [h,j,k,l] ; [0-9] + bspc node @[west,south,north,east] -r 0.[0-9] super + alt + p - bspc config focus_follows_pointer {true,false} + bspc config focus_follows_pointer [true,false] # Smart resize, will grow or shrink depending on location. # Will always grow for floating nodes. - super + ctrl + alt + {Left,Down,Up,Right} + super + ctrl + alt + [Left,Down,Up,Right] n=10; \ - { d1=left; d2=right; dx=-$n; dy=0; \ + [ d1=left; d2=right; dx=-$n; dy=0; \ , d1=bottom; d2=top; dx=0; dy=$n; \ , d1=top; d2=bottom; dx=0; dy=-$n; \ , d1=right; d2=left; dx=$n; dy=0; \ - } \ + ] \ bspc node --resize $d1 $dx $dy || bspc node --resize $d2 $dx $dy ## Editor Plugins @@ -61,6 +61,7 @@ The format of the configuration file supports a simple notation for mapping mult - [vim-sxhkdrc](https://github.com/baskerville/vim-sxhkdrc). - [sxhkd-vim](https://github.com/kovetskiy/sxhkd-vim). + (See contrib/sxhkd-vim-rc.diff) ---- diff --git a/contrib/sxhkd-vim-rc.diff b/contrib/sxhkd-vim-rc.diff @@ -0,0 +1,38 @@ +--- a/syntax/sxhkd.vim 2022-01-15 10:51:58.142679809 +0000 ++++ b/syntax/sxhkd.vim 2022-01-15 11:01:41.486029000 +0000 +@@ -2,25 +2,24 @@ + finish + endif + +-let b:current_syntax = "sxhkd" + +-syntax match sxhkd_binding "\v^.*$" contains=sxhkd_on_release,sxhkd_binding_pass ++syntax match sxhkd_binding "\v^.*$" contains=sxhkd_on_release,sxhkd_binding_pass,sxhkd_brace + syntax match sxhkd_on_release "\v^\@" contained + syntax match sxhkd_binding_pass "\v^\~" contained +-syntax match sxhkd_exec "\v^\s+.*" contains=@sxhkd_shell ++syntax match sxhkd_exec "\v^\s+.*" contains=@sxhkd_rc,sxhkd_brace + syntax match sxhkd_comment "\v#.*$" ++syntax match sxhkd_brace "\[[^\]]*\]" contained + + highlight link sxhkd_comment Comment + highlight link sxhkd_binding Identifier + highlight link sxhkd_binding_on_release Conditional + highlight link sxhkd_binding_pass Constant +-highlight link sxhkd_exec Macro +- +-" match shell command +-let s:current_syntax = b:current_syntax +-unlet b:current_syntax ++highlight link sxhkd_brace Macro + +-syntax include @sxhkd_shell syntax/sh.vim +-let b:current_syntax = s:current_syntax ++" match rc ++" - https://github.com/weakish/rcshell.vim ++" - gopher://hhvn.uk/1/git/o/rcshell.vim ++syntax include @sxhkd_rc syntax/rcshell.vim ++syntax region rcLine matchgroup=sxhkd_exec start=/\v^\s+\s/ end=/\v$/ contains=@sxhkd_rc + +-syntax region shLine matchgroup=sxhkd_exec start=/\v^\s+\s/ end=/\v$/ contains=@sxhkd_shell ++let b:current_syntax = "sxhkd" diff --git a/doc/sxhkd.1 b/doc/sxhkd.1 @@ -2,12 +2,12 @@ .\" Title: sxhkd .\" Author: [see the "Author" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> -.\" Date: 08/02/2020 +.\" Date: 01/15/2022 .\" Manual: Sxhkd Manual -.\" Source: Sxhkd 0.6.2 +.\" Source: Sxhkd 0.6.2-2-g736cf7e .\" Language: English .\" -.TH "SXHKD" "1" "08/02/2020" "Sxhkd 0\&.6\&.2" "Sxhkd Manual" +.TH "SXHKD" "1" "01/15/2022" "Sxhkd 0\&.6\&.2\-2\-g736cf7e" "Sxhkd Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -168,7 +168,7 @@ If \fB~\fR is added at the beginning of the keysym, the captured event will be r .sp Pointer hotkeys can be defined by using one of the following special keysym names: \fIbutton1\fR, \fIbutton2\fR, \fIbutton3\fR, \&..., \fIbutton24\fR\&. .sp -The hotkey and the command may contain sequences of the form \fI{STRING_1,\&...,STRING_N}\fR\&. +The hotkey and the command may contain sequences of the form \fI[STRING_1,\&...,STRING_N]\fR\&. .sp In addition, the sequences can contain ranges of the form \fIA\fR\-\fIZ\fR where \fIA\fR and \fIZ\fR are alphanumeric characters\&. .sp diff --git a/doc/sxhkd.1.asciidoc b/doc/sxhkd.1.asciidoc @@ -107,7 +107,7 @@ If *~* is added at the beginning of the keysym, the captured event will be repla Pointer hotkeys can be defined by using one of the following special keysym names: _button1_, _button2_, _button3_, …, _button24_. -The hotkey and the command may contain sequences of the form '{STRING_1,…,STRING_N}'. +The hotkey and the command may contain sequences of the form '[STRING_1,…,STRING_N]'. In addition, the sequences can contain ranges of the form _A_-_Z_ where _A_ and _Z_ are alphanumeric characters.