-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
xbindkeys: Add support for space mode bindings
- Loading branch information
1 parent
fc282cb
commit 3a6b9f7
Showing
1 changed file
with
31 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,35 @@ | ||
; space | ||
(xbindkey '(Alt space) "zsh -l -i -c 'dev rofi launcher'") | ||
;(xbindkey '(control space) "") | ||
; switch current set of bindings to a new one | ||
(define (switch-mode bindings) | ||
; clear bindings | ||
(ungrab-all-keys) | ||
(remove-all-keys) | ||
|
||
; print screen | ||
(xbindkey '(Print) "zsh -l -i -c 'dev screenshot'") | ||
(xbindkey '(control Print) "zsh -l -i -c 'dev ai explain-screen'") | ||
; setup new bindings | ||
(bindings) | ||
|
||
; ctrl+shift | ||
(xbindkey '(control shift e) "zsh -l -i -c 'rofi -modi emoji -show emoji'") | ||
; grab keys again | ||
(grab-all-keys)) | ||
|
||
; programs | ||
(xbindkey '(control KP_1) "vivaldi") | ||
(define (normal-mode-bindings) | ||
; launcher | ||
(xbindkey '(Alt space) "zsh -l -i -c 'dev rofi launcher'") | ||
|
||
; print screen | ||
(xbindkey '(Print) "zsh -l -i -c 'dev screenshot'") | ||
(xbindkey '(control Print) "zsh -l -i -c 'dev ai explain-screen'") | ||
|
||
; ctrl+shift | ||
(xbindkey '(control shift e) "zsh -l -i -c 'rofi -modi emoji -show emoji'") | ||
|
||
; programs | ||
(xbindkey '(control KP_1) "vivaldi") | ||
|
||
; switch to space mode | ||
(xbindkey-function '(control space) (lambda () (switch-mode space-mode-bindings)))) | ||
|
||
(define (space-mode-bindings) | ||
; switch to normal mode | ||
(xbindkey-function '(Escape) (lambda () (switch-mode normal-mode-bindings)))) | ||
|
||
; start in normal mode | ||
(switch-mode normal-mode-bindings) |