Skip to content

Commit

Permalink
xbindkeys: Add support for space mode bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
juanibiapina committed Mar 30, 2024
1 parent fc282cb commit 3a6b9f7
Showing 1 changed file with 31 additions and 10 deletions.
41 changes: 31 additions & 10 deletions dotfiles/xbindkeys/.xbindkeysrc.scm
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)

0 comments on commit 3a6b9f7

Please sign in to comment.