diff options
Diffstat (limited to '.emacs.d/lisp')
-rw-r--r-- | .emacs.d/lisp/init-exwm.el | 170 | ||||
-rw-r--r-- | .emacs.d/lisp/init-keys.el | 31 | ||||
-rw-r--r-- | .emacs.d/lisp/my-functions.el | 45 |
3 files changed, 0 insertions, 246 deletions
diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el deleted file mode 100644 index cce35df..0000000 --- a/.emacs.d/lisp/init-exwm.el +++ /dev/null @@ -1,170 +0,0 @@ -;;; package : EXWM configuration --- -;;; .* --- .* - -;;; Code: - -(use-package dmenu) - -(defun apollo/rofi-switch-window () - "Launch rofi. Cant get it to work with exwm as of now tho." - (interactive) - (start-process-shell-command - "rofi" nil "rofi -show window")) -;; (global-set-key (kbd "s-<tab>") 'apollo/run_rofi) - -(defun apollo/run-in-background (command) - "Run COMMAND in the background." - (let ((command-parts (split-string command "[ ]+"))) - (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) - -(defun rofi () - "Run Rofi." - (interactive) - (apollo/run-in-background "rofi -show drun")) - -(defun apollo/volume-increase () - "Increase Volume." - (interactive) - (start-process-shell-command - "amixer" nil "amixer sset Master 5%+")) - -(defun apollo/volume-decrease () - "Decrease Volume." - (interactive) - (start-process-shell-command - "amixer" nil "amixer sset Master 5%-")) - -(defun apollo/set-wallpaper () - "Restore wallpaper." - (interactive) - (start-process-shell-command - "nitrogen" nil "nitrogen --restore")) - -(defun apollo/emacs-keys () - "Swap caps with ctrl." - (interactive) - (start-process-shell-command - "setxkbmap" nil "setxkbmap us -option ctrl:swapcaps")) - -(defun apollo/greek-keyboard () - "Swap caps with ctrl." - (interactive) - (start-process-shell-command - "setxkbmap" nil "setxkbmap gr")) - -(defun apollo/exwm-init-hook () - "Do this upon start." - (display-battery-mode 0) ;;Change to 1 to display battery - - (setq display-time-day-and-date t) - (display-time-mode 1) - - ;;Launch apps that will run in the background -;; (apollo/run-in-background "blueman-applet") - (apollo/run-in-background "picom") -;; (apollo/run-in-background "nm-applet") - (apollo/emacs-keys) - (apollo/set-wallpaper) - ) - -(defun apollo/exwm-update-class () - (exwm-workspace-rename-buffer exwm-class-name)) - -(use-package exwm - :config - (setq exwm-workspace-number 6) - ;; When window "class" updates, use it to set the buffer name - (add-hook 'exwm-update-class-hook #'apollo/exwm-update-class) - - ;;When EXWM starts up, run this hook - (add-hook 'exwm-init-hook #'apollo/exwm-init-hook) - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal") - - ;; Set the screen resolution - - (require 'exwm-randr) - (setq exwm-randr-workspace-output-plist '(1 "DP-1" 2 "HDMI-A-0")) - (add-hook 'exwm-randr-screen-change-hook - (lambda () - (start-process-shell-command - "xrandr" nil "xrandr --output DisplayPort-2 --primary --mode 2560x1440 --pos 1920x0 --rotate normal --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate normal" ))) - (exwm-randr-enable) - - ;; (start-process-shell-command "xrandr" nil "xrandr --output Virtual-1 --primary --mode 2048x1152 --pos 0x0 --rotate normal") - - ;; Load the system tray before exwm-init - (require 'exwm-systemtray) - (exwm-systemtray-enable) - - ;; These keys should always pass through to Emacs - (setq exwm-input-prefix-keys - '(?\C-x - ?\C-u - ?\C-h - ?\C-w - ?\M-x - ?\M-` - ?\M-& - ?\M-: - ?\s-d - ?\C-\M-j ;; Buffer list - ?\C-\ )) ;; Ctrl+Space - - ;; Ctrl+Q will enable the next key to be sent directly - (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key) - - ;; Set up global key bindings. These always work, no matter the input state! - ;; Keep in mind that changing this list after EXWM initializes has no effect. - (setq exwm-input-global-keys - `( - ;; Reset to line-mode (C-c C-k switches to char-mode via exwm-input-release-keyboard) - ([?\s-r] . exwm-reset) - - ;; Move between windows - ([C-w C-p] . windmove-left) - ([C-w C-n] . windmove-right) -; ([s-up] . windmove-up) -; ([s-down] . windmove-down) - ([C-w C-v] . split-window-right) - - ;; Launch applications via shell command - ([?\s-&] . (lambda (command) - (interactive (list (read-shell-command "$ "))) - (start-process-shell-command command nil command))) - - ;; Switch workspace - ([?\s-e] . exwm-workspace-switch) - ([?\s-`] . (lambda () (interactive) (exwm-workspace-switch-create 0))) - ([?\s-1] . (lambda () (interactive) (exwm-workspace-switch-create 1))) - ([?\s-2] . (lambda () (interactive) (exwm-workspace-switch-create 2))) - ([?\s-3] . (lambda () (interactive) (exwm-workspace-switch-create 3))) - ([?\s-4] . (lambda () (interactive) (exwm-workspace-switch-create 4))) - - ;; 's-N': Switch to certain workspace with Super (Win) plus a number key (0 - 9) - ,@(mapcar (lambda (i) - `(,(kbd (format "s-%d" i)) . - (lambda () - (interactive) - (exwm-workspace-switch-create ,i)))) - (number-sequence 0 9)))) - - (exwm-input-set-key (kbd "C-c d") 'dmenu) - (exwm-input-set-key (kbd "s-<tab>") 'rofi) - (exwm-input-set-key (kbd "s-q") 'kill-emacs) - (exwm-input-set-key (kbd "<XF86AudioRaiseVolume>") 'apollo/volume-increase) - (exwm-input-set-key (kbd "<XF86AudioLowerVolume>") 'apollo/volume-decrease) - (exwm-input-set-key (kbd "s-0") 'apollo/emacs-keys) - (exwm-input-set-key (kbd "s-9") 'apollo/greek-keyboard) - (exwm-enable)) - -;;Transparency -(set-frame-parameter (selected-frame) 'alpha '(90 90)) -(add-to-list 'default-frame-alist '(alpha 90 90)) - -;;Follow focus using exwm-mff -(use-package exwm-mff - :init - (exwm-mff-mode)) - -;;; init-exwm.el ends here diff --git a/.emacs.d/lisp/init-keys.el b/.emacs.d/lisp/init-keys.el deleted file mode 100644 index 051a93a..0000000 --- a/.emacs.d/lisp/init-keys.el +++ /dev/null @@ -1,31 +0,0 @@ -;; init-keys.el -;;; Code: - -;;Ibuffer -(global-set-key (kbd "C-x C-b") 'ibuffer) - -;;Editing -(global-set-key (kbd "C-d") 'kill-region) -(global-set-key (kbd "C-k") 'copy-region-as-kill) - -;;Counsel -(global-set-key (kbd "M-;") 'counsel-M-x) - -;;Window control map -(define-prefix-command 'window-control-map) -(global-set-key (kbd "C-w") 'window-control-map) -(define-key window-control-map (kbd "C-v") 'split-window-right) -(define-key window-control-map (kbd "C-n") 'windmove-right) -(define-key window-control-map (kbd "C-p") 'windmove-left) -(define-key window-control-map (kbd "C-q") 'delete-window) - - -;;; God Mode -;; (use-package god-mode -;; :init -;; (god-mode) -;; :config -;; (global-set-key (kbd "C-f") #'god-mode-all)) - - -;;init-keys ends here diff --git a/.emacs.d/lisp/my-functions.el b/.emacs.d/lisp/my-functions.el deleted file mode 100644 index 85eb60a..0000000 --- a/.emacs.d/lisp/my-functions.el +++ /dev/null @@ -1,45 +0,0 @@ -;;; package --- Summary -;;; Commentary: -;;; useful snippets of code for my daily use. -;;; Code: - - -(defun apollo/html-boostrap-boilerplate () - "Insert html boilerplate with boostrap link." - (interactive) - (insert -"<!DOCTYPE html> -<html lang=\"en\"> - <head> - <meta charset=\"UTF-8\"> - <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> - <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\"> - <title>My Title</title> - <link rel=\"stylesheet\" href=\"./style.css\"> - <link href=\"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi\" crossorigin=\"anonymous\"> - </head> - <body> - <main> - <h1>Starting point</h1> - </main> - <script src=\"index.js\"></script> - </body> -</html>" )) - -(defun center-buffer () - "Center buffer." - (interactive) - (setq visual-fill-column-width 100 - visual-fill-column-center-text t) - (visual-fill-column-mode 1)) - -(defun center-buffer-undo () - "Undo center-buffer." - (interactive) - (setq visual-fill-column-width 2000 - visual-fill-column-center-text nil) - (visual-fill-column-mode 1)) - - -;;; my-functions.el ends here - |