Конфиг:xbindkeys.scm: различия между версиями

Материал из Linux Wiki
Перейти к навигацииПерейти к поиску
м
 
(не показаны 3 промежуточные версии этого же участника)
Строка 1: Строка 1:
<source lang="scheme">
<source lang="lisp">
(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)
(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)))
  (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)
(define (run-and-osd keys cmd osd-text)
Строка 9: Строка 13:
                       (run-command cmd)
                       (run-command cmd)
                       (aosd-echo osd-text))))
                       (aosd-echo osd-text))))
 
 
(xbindkey '(mod4 r) "/home/dk/bin/rundmenu")
(xbindkey '(mod4 r) "/home/dk/bin/rundmenu")
(xbindkey '(mod4 w) "/home/dk/bin/windmenu")
(xbindkey '(mod4 w) "/home/dk/bin/windmenu")
Строка 22: Строка 26:
;;(xbindkey 'XF86AudioStop "mocp -s")
;;(xbindkey 'XF86AudioStop "mocp -s")
;;(xbindkey 'XF86AudioMedia "urxvt -e mocp -y")
;;(xbindkey 'XF86AudioMedia "urxvt -e mocp -y")
(run-and-osd '(mod4 g) "gvim" "Gvim")
(run-and-osd '(mod4 g) "gvim" "GVIM")
 
 
(define (switch-to-desk number)
(define (switch-to-desk number)
   (if (>= number 0)
   (if (>= number 0)
     (begin
     (let ((s-number (number->string number)))
       (xbindkey (list 'mod4 (string-append "c:1" (number->string number))) (string-append "wmctrl -s " (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 (- number 1)))))
   
 
(switch-to-desk 8)
(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:")
</source>
</source>


[[Category:Конфиг-файл]]
[[Category:Конфиг-файл]]

Текущая версия на 10:03, 28 декабря 2011

(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:")