Конфиг:xbindkeys.scm

Материал из Linux Wiki
Перейти к: навигация, поиск
(define osdcmd "aosd_cat -x 0 -y 0 -t 2 -p 7 -n Consolas\\ 22 -f 100 -u 2000 -o 200 -R white -l 5")
 
(define (aosd-echo text)
  (run-command (string-append "echo " text "|" osdcmd)))
 
;;(define (aosd-echo-cmd cmd)
;;  (run-command (string-append "echo `" cmd "`|" 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")
 
(define (switch-to-desk number)
  (if (>= number 0)
    (let ((s-number (number->string number)))
      (xbindkey-function (list 'mod4 (string-append "c:1" s-number))
                         (lambda ()
                           (run-command (string-append "wmctrl -s " s-number))
                           (aosd-echo (string-append "`wmctrl -d | grep ^" s-number "|cut -d \" \" -f 14-`"))))
      (switch-to-desk (- number 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:")