Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; EXWM
- ;; FUNCTIONS FOR EXWM
- (defun rat-move-left ()
- (interactive)
- (shell-command "xdotool mousemove_relative -- -20 0"))
- (defun rat-move-right ()
- (interactive)
- (shell-command "xdotool mousemove_relative 20 0"))
- (defun rat-move-down ()
- (interactive)
- (shell-command "xdotool mousemove_relative 0 20"))
- (defun rat-move-up ()
- (interactive)
- (shell-command "xdotool mousemove_relative -- 0 -20"))
- (defun rat-button1 ()
- (interactive)
- (shell-command "xdotool click 1"))
- (defun rat-buton2 ()
- (shell-command "xdotool click 3"))
- (defun quieter ()
- (interactive)
- (shell-command "amixer -c 0 set PCM 6db- 2>&1 > /dev/null"))
- (defun louder ()
- (interactive)
- (shell-command "amixer -c 0 set PCM 6db+ 2>&1 > /dev/null"))
- (defun exwm-rotate-vertical ()
- (interactive)
- (shell-command "xrandr --output VGA-1 --rotate left"))
- (defun exwm-rotate-normal ()
- (interactive) ()
- (shell-command "xrandr --output VGA-1 --rotate normal"))
- (defun exwm-setinputmethod-pl ()
- (interactive)
- (set-input-method 'ucs))
- (defun exwm-setinputmethod-ru ()
- (interactive)
- (set-input-method 'cyrillic-yawerty))
- (defun exwm-screenshot ()
- (interactive)
- (shell-command "cd ~/Pictures/screenshots && scrot"))
- (setq exwm-manage-configurations
- '(((member exwm-class-name '("Emacs" "Nyxt" "Gajim"))
- char-mode t)))
- ;; Clipboard
- (global-set-key (kbd "C-x s-y") 'clipboard-yank)
- (global-set-key (kbd "C-x s-w") 'clipboard-kill-region)
- (global-set-key (kbd "C-x H-w") 'clipboard-kill-ring-save)
- (setq exwm-input-global-keys
- `(
- ;; EXWM-RATPOISON
- ([?\s-b] . rat-move-left)
- ([?\s-f] . rat-move-right)
- ([?\s-p] . rat-move-up)
- ([?\s-n] . rat-move-down)
- ([?\s-i] . rat-button1)
- ([?\s-o] . rat-button2)
- ([?\C-b] . [left])
- ([?\C-f] . [right])
- ([?\C-p] . [up])
- ([?\C-n] . [down])
- ([?\C-a] . [home])
- ([?\C-e] . [end])
- ([?\M-v] . [prior])
- ([?\C-v] . [next])
- ([?\C-d] . [delete])
- ;; louder and quieter sound
- ([?\H-f] . louder)
- ([?\H-b] . quieter)
- ;; switch char and line mode
- ([?\s-q] . exwm-input-toggle-keyboard)
- ;; Bind "s-r" to exit char-mode
- ;; and fullscreen mode.
- ([?\s-r] . exwm-reset)
- ;; Bind "s-w" to switch workspace interactively.
- ([?\s-w] . exwm-workspace-switch)
- ;; Bind custom keymaps
- ([?\s-!] . exwm-setinputmethod-pl)
- ([?\s-#] . exwm-setinputmethod-ru)
- ;; Make screenshots
- ([?\s-h] . exwm-screenshot)
- ;; Rotate screen
- ([?\s-t] . exwm-rotate-vertical)
- ([?\s-c] . exwm-rotate-normal)
- ;; Bind "s-0" to "s-9" to switch
- ;; to a workspace by its index.
- ,@(mapcar (lambda (i)
- `(,(kbd (format "s-%d" i)) .
- (lambda ()
- (interactive)
- (exwm-workspace-switch-create
- ,i))))
- (number-sequence 0 9))
- ;; Bind "s-&" to launch applications ('M-&'
- ;; also works if the output
- ;; buffer does not bother you).
- ([?\s-&] . (lambda (command)
- (interactive
- (list (read-shell-command "$ ")))
- (start-process-shell-command
- command nil command)))
- ;; Bind "s-<f2>" to "slock",
- ;; a simple X display locker.
- ([s-f2] . (lambda ()
- (interactive)
- (start-process "" nil "/usr/bin/slock")))))
- (xclip-mode 1)
- (exwm-modeline-mode 1)
- (tab-bar-mode t)
- ;;=============
- ;; SHOULD BE =
- ;; AT THE END =
- ;;=============
- (require 'exwm)
- (require 'exwm-edit)
- (require 'exwm-config)
- (exwm-config-example)
- (require 'exwm-xim)
- (exwm-xim-enable)
- (require 'exwm-randr)
- (exwm-randr-enable)
- ;;(shell-command "pkill polybar")
- ;;(start-process-shell-command "polybar"
- ;;"polybar --config=~/.config/polybar;/config.ini")
- (provide 'exwm-econf.el)
- ;;; exwm-econf.el ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement