Do the same for `exwm-input-global-keys'
This commit is contained in:
		
							parent
							
								
									ec108a61dc
								
							
						
					
					
						commit
						97b1fb7c13
					
				
					 1 changed files with 19 additions and 15 deletions
				
			
		| 
						 | 
					@ -37,21 +37,25 @@
 | 
				
			||||||
  (add-hook 'exwm-update-class-hook
 | 
					  (add-hook 'exwm-update-class-hook
 | 
				
			||||||
            (lambda ()
 | 
					            (lambda ()
 | 
				
			||||||
              (exwm-workspace-rename-buffer exwm-class-name)))
 | 
					              (exwm-workspace-rename-buffer exwm-class-name)))
 | 
				
			||||||
  ;; 's-r': Reset
 | 
					  ;; Global keybindings.
 | 
				
			||||||
  (exwm-input-set-key (kbd "s-r") #'exwm-reset)
 | 
					  (unless (get 'exwm-input-global-keys 'saved-value)
 | 
				
			||||||
  ;; 's-w': Switch workspace
 | 
					    (setq exwm-input-global-keys
 | 
				
			||||||
  (exwm-input-set-key (kbd "s-w") #'exwm-workspace-switch)
 | 
					          `(
 | 
				
			||||||
  ;; 's-N': Switch to certain workspace
 | 
					            ;; 's-r': Reset (to line-mode).
 | 
				
			||||||
  (dotimes (i 10)
 | 
					            ([?\s-r] . exwm-reset)
 | 
				
			||||||
    (exwm-input-set-key (kbd (format "s-%d" i))
 | 
					            ;; 's-w': Switch workspace.
 | 
				
			||||||
                        `(lambda ()
 | 
					            ([?\s-w] . exwm-workspace-switch)
 | 
				
			||||||
                           (interactive)
 | 
					            ;; 's-&': Launch application.
 | 
				
			||||||
                           (exwm-workspace-switch-create ,i))))
 | 
					            ([?\s-&] . (lambda (command)
 | 
				
			||||||
  ;; 's-&': Launch application
 | 
					 | 
				
			||||||
  (exwm-input-set-key (kbd "s-&")
 | 
					 | 
				
			||||||
                      (lambda (command)
 | 
					 | 
				
			||||||
		         (interactive (list (read-shell-command "$ ")))
 | 
							         (interactive (list (read-shell-command "$ ")))
 | 
				
			||||||
		         (start-process-shell-command command nil command)))
 | 
							         (start-process-shell-command command nil command)))
 | 
				
			||||||
 | 
					            ;; 's-N': Switch to certain workspace.
 | 
				
			||||||
 | 
					            ,@(mapcar (lambda (i)
 | 
				
			||||||
 | 
					                        `(,(kbd (format "s-%d" i)) .
 | 
				
			||||||
 | 
					                          (lambda ()
 | 
				
			||||||
 | 
					                            (interactive)
 | 
				
			||||||
 | 
					                            (exwm-workspace-switch-create ,i))))
 | 
				
			||||||
 | 
					                      (number-sequence 0 9)))))
 | 
				
			||||||
  ;; Line-editing shortcuts
 | 
					  ;; Line-editing shortcuts
 | 
				
			||||||
  (unless (get 'exwm-input-simulation-keys 'saved-value)
 | 
					  (unless (get 'exwm-input-simulation-keys 'saved-value)
 | 
				
			||||||
    (setq exwm-input-simulation-keys
 | 
					    (setq exwm-input-simulation-keys
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue