Advertisement
Guest User

.stumpwmrc

a guest
Apr 26th, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 1.90 KB | None | 0 0
  1. ;;;; stumpwm config file
  2.  
  3. (load "~/lib/stump-swank-setup.lisp")
  4.  
  5. (in-package :stumpwm)
  6.  
  7. ;; turn mode-line on/off for current head
  8.  
  9. (toggle-mode-line (stumpwm:current-screen)
  10.               (stumpwm:current-head))
  11.  
  12. (setf *screen-mode-line-format*
  13.       (list "%w |"
  14.         '(:eval (stumpwm:run-shell-command "date" t))))
  15.  
  16. ;; message box placement
  17.  
  18. (setf *message-window-gravity* :center)
  19. (setf *input-window-gravity* :center)
  20.  
  21. ;; Web-browsing
  22.  
  23. (define-key *root-map* (kbd "C-f") "exec firefox")
  24.  
  25. ;; custom commands
  26.  
  27. (defcommand smartgit () ()
  28.         "Launches SmartGit"
  29.         (run-shell-command "~/bin/smartgit/bin/smartgit.sh"))
  30.  
  31. ;; screenshots
  32.  
  33. (defun grab (grab-type)
  34.   "Grabs the selected portion of the screen"
  35.   (let ((result-string (case grab-type
  36.              (:window "xfce4-screenshooter -w -s ~/screenshots")
  37.              (:screen "xfce4-screenshooter -f -s ~/screenshots")
  38.              (otherwise "echo \"Unknown Region\""))))
  39.     (run-shell-command result-string)))
  40.  
  41. (defcommand grab-window () ()
  42.         "uses the built-in xfce4-screenshooter to grab the current window"
  43.         (grab :window))
  44.  
  45. (defcommand grab-screen () ()
  46.         "uses the built-in xfce4-screenshooter to grab the whole screen"
  47.         (grab :screen))
  48.  
  49. ;; quick editing
  50.  
  51. (defcommand editrc () ()
  52.         "quick way to open and edit the rc file"
  53.         (run-shell-command "emacs ~/.stumpwmrc"))
  54.  
  55. ;; shutting down
  56.  
  57. (defun shutdown-fn (type passwd)
  58.   "Calls the shutdown command with the specified halting operation and the password"
  59.   (let* ((shutdown-type (case type
  60.              (:halt "-h")
  61.              (:reboot "-r")))
  62.     (command (concatenate 'string "echo " passwd " | sudo -S shutdown " shutdown-type " now")))
  63.     (run-shell-command command)))
  64.  
  65.  
  66.  
  67. (defcommand shutdown (passwd) ((:string "please enter your password: "))
  68.         (shutdown-fn :halt passwd))
  69.  
  70. (defcommand reboot (passwd) ((:string "please enter your password: "))
  71.         (shutdown-fn :reboot passwd))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement