Advertisement
Guest User

Untitled

a guest
May 22nd, 2023
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 4.10 KB | None | 0 0
  1.  
  2. ;; EXWM
  3.  
  4.  
  5. ;; FUNCTIONS FOR EXWM
  6. (defun rat-move-left ()
  7.   (interactive)
  8.   (shell-command "xdotool mousemove_relative -- -20 0"))
  9. (defun rat-move-right ()
  10.   (interactive)
  11.   (shell-command "xdotool mousemove_relative 20 0"))
  12. (defun rat-move-down ()
  13.   (interactive)
  14.   (shell-command "xdotool mousemove_relative 0 20"))
  15. (defun rat-move-up ()
  16.   (interactive)
  17.   (shell-command "xdotool mousemove_relative -- 0 -20"))
  18. (defun rat-button1 ()
  19.   (interactive)
  20.   (shell-command "xdotool click 1"))
  21. (defun rat-buton2 ()
  22.   (shell-command "xdotool click 3"))
  23.  
  24. (defun quieter ()
  25.   (interactive)
  26.   (shell-command "amixer -c 0 set PCM 6db- 2>&1 > /dev/null"))
  27. (defun louder ()
  28.   (interactive)
  29.   (shell-command "amixer -c 0 set PCM 6db+ 2>&1 > /dev/null"))
  30.  
  31. (defun exwm-rotate-vertical ()
  32.   (interactive)
  33.   (shell-command "xrandr --output VGA-1 --rotate left"))
  34. (defun exwm-rotate-normal ()
  35.   (interactive) ()
  36.   (shell-command "xrandr --output VGA-1 --rotate normal"))
  37.  
  38. (defun exwm-setinputmethod-pl ()
  39.   (interactive)
  40.   (set-input-method 'ucs))
  41. (defun exwm-setinputmethod-ru ()
  42.   (interactive)
  43.   (set-input-method 'cyrillic-yawerty))
  44.  
  45. (defun exwm-screenshot ()
  46.   (interactive)
  47.   (shell-command "cd ~/Pictures/screenshots && scrot"))
  48.  
  49. (setq exwm-manage-configurations
  50.       '(((member exwm-class-name '("Emacs" "Nyxt" "Gajim"))
  51.          char-mode t)))
  52.  
  53. ;; Clipboard
  54. (global-set-key (kbd "C-x s-y") 'clipboard-yank)
  55. (global-set-key (kbd "C-x s-w") 'clipboard-kill-region)
  56. (global-set-key (kbd "C-x H-w") 'clipboard-kill-ring-save)
  57.  
  58. (setq exwm-input-global-keys
  59.       `(
  60.         ;; EXWM-RATPOISON
  61.         ([?\s-b] . rat-move-left)
  62.         ([?\s-f] . rat-move-right)
  63.         ([?\s-p] . rat-move-up)
  64.         ([?\s-n] . rat-move-down)
  65.         ([?\s-i] . rat-button1)
  66.         ([?\s-o] . rat-button2)
  67.  
  68.         ([?\C-b] . [left])
  69.         ([?\C-f] . [right])
  70.         ([?\C-p] . [up])
  71.         ([?\C-n] . [down])
  72.         ([?\C-a] . [home])
  73.         ([?\C-e] . [end])
  74.         ([?\M-v] . [prior])
  75.         ([?\C-v] . [next])
  76.         ([?\C-d] . [delete])
  77.  
  78.        
  79.         ;; louder and quieter sound
  80.         ([?\H-f] . louder)
  81.         ([?\H-b] . quieter)
  82.         ;; switch char and line mode
  83.         ([?\s-q] . exwm-input-toggle-keyboard)
  84.         ;; Bind "s-r" to exit char-mode
  85.         ;; and fullscreen mode.
  86.         ([?\s-r] . exwm-reset)
  87.         ;; Bind "s-w" to switch workspace interactively.
  88.         ([?\s-w] . exwm-workspace-switch)
  89.         ;; Bind custom keymaps
  90.         ([?\s-!] . exwm-setinputmethod-pl)
  91.         ([?\s-#] . exwm-setinputmethod-ru)
  92.         ;; Make screenshots
  93.         ([?\s-h] . exwm-screenshot)
  94.         ;; Rotate screen
  95.         ([?\s-t] . exwm-rotate-vertical)
  96.         ([?\s-c] . exwm-rotate-normal)
  97.         ;; Bind "s-0" to "s-9" to switch
  98.         ;; to a workspace by its index.
  99.         ,@(mapcar (lambda (i)
  100.                     `(,(kbd (format "s-%d" i)) .
  101.                       (lambda ()
  102.                         (interactive)
  103.                         (exwm-workspace-switch-create
  104.                          ,i))))
  105.                   (number-sequence 0 9))
  106.         ;; Bind "s-&" to launch applications ('M-&'
  107.         ;; also works if the output
  108.         ;; buffer does not bother you).
  109.         ([?\s-&] . (lambda (command)
  110.                      (interactive
  111.                       (list (read-shell-command "$ ")))
  112.                      (start-process-shell-command
  113.                       command nil command)))
  114.         ;; Bind "s-<f2>" to "slock",
  115.         ;; a simple X display locker.
  116.         ([s-f2] . (lambda ()
  117.             (interactive)
  118.             (start-process "" nil "/usr/bin/slock")))))
  119.  
  120. (xclip-mode 1)
  121. (exwm-modeline-mode 1)
  122. (tab-bar-mode t)
  123.  
  124.  
  125. ;;=============
  126. ;; SHOULD BE  =
  127. ;; AT THE END =
  128. ;;=============
  129.  
  130. (require 'exwm)
  131. (require 'exwm-edit)
  132. (require 'exwm-config)
  133. (exwm-config-example)
  134. (require 'exwm-xim)
  135. (exwm-xim-enable)
  136. (require 'exwm-randr)
  137. (exwm-randr-enable)
  138.  
  139.  
  140. ;;(shell-command "pkill polybar")
  141. ;;(start-process-shell-command "polybar"
  142. ;;"polybar --config=~/.config/polybar;/config.ini")
  143.  
  144. (provide 'exwm-econf.el)
  145. ;;; exwm-econf.el ends here
  146.  
  147.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement