Конфиг:xbindkeys.scm

Материал из Linux Wiki
Перейти к навигацииПерейти к поиску
(define (aosd-echo text)
  (define osdcmd "aosd_cat -x 0 -y 0 -t 2 -p 1 -n Consolas\\ 22 -f 100 -u 2000 -o 200 -R white -l 5")
  (run-command (string-append "echo $@ " text "|" osdcmd)))

(define (run-and-osd keys cmd osd-text)
  (xbindkey-function keys
                     (lambda () 
                       (run-command cmd)
                       (aosd-echo osd-text))))


(xbindkey '(mod4 r) "/home/dk/bin/rundmenu")
(xbindkey '(mod4 w) "/home/dk/bin/windmenu")
(xbindkey '(mod4 f) "/home/dk/bin/dmenfm")
(xbindkey '(mod4 l) "xscreensaver-command -lock || (xscreensaver -no-splash & xscreensaver-command -lock)")
(xbindkey '(mod4 t) "urxvt")
;;(xbindkey 'XF86AudioNext "mocp -f")
;;(xbindkey 'XF86AudioPrev "mocp -r")
;;(xbindkey 'XF86AudioPlay "mocp -G")
;;(xbindkey 'XF86AudioStop "mocp -s")
;;(xbindkey 'XF86AudioStop "mocp -s")
;;(xbindkey 'XF86AudioMedia "urxvt -e mocp -y")
(run-and-osd '(mod4 g) "gvim" "Gvim")

;;переключение десктопов по Mod4(ака winkey)+цифра
(define (switch-to-desk number)
  (if (>= number 0)
    (begin
      (xbindkey (list 'mod4 (string-append "c:1" (number->string number))) (string-append "wmctrl -s " (number->string number)))
      (switch-to-desk (- number 1)))))
;;8—количество десктопов-1    
(switch-to-desk 8)
;;window controls
(xbindkey '(mod4 Up) "wmctrl -r :ACTIVE: -b toggle,maximized_vert")
(xbindkey '(mod4 Right) "wmctrl -r :ACTIVE: -b toggle,maximized_horz")
(xbindkey '(mod4 a) "wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz")
(xbindkey '(Mod4 x) "wmctrl -c :ACTIVE:")
(xbindkey '(Alt F4) "wmctrl -c :ACTIVE:")