Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;; stumpwm config file
- (load "~/lib/stump-swank-setup.lisp")
- (in-package :stumpwm)
- ;; turn mode-line on/off for current head
- (toggle-mode-line (stumpwm:current-screen)
- (stumpwm:current-head))
- (setf *screen-mode-line-format*
- (list "%w |"
- '(:eval (stumpwm:run-shell-command "date" t))))
- ;; message box placement
- (setf *message-window-gravity* :center)
- (setf *input-window-gravity* :center)
- ;; Web-browsing
- (define-key *root-map* (kbd "C-f") "exec firefox")
- ;; custom commands
- (defcommand smartgit () ()
- "Launches SmartGit"
- (run-shell-command "~/bin/smartgit/bin/smartgit.sh"))
- ;; screenshots
- (defun grab (grab-type)
- "Grabs the selected portion of the screen"
- (let ((result-string (case grab-type
- (:window "xfce4-screenshooter -w -s ~/screenshots")
- (:screen "xfce4-screenshooter -f -s ~/screenshots")
- (otherwise "echo \"Unknown Region\""))))
- (run-shell-command result-string)))
- (defcommand grab-window () ()
- "uses the built-in xfce4-screenshooter to grab the current window"
- (grab :window))
- (defcommand grab-screen () ()
- "uses the built-in xfce4-screenshooter to grab the whole screen"
- (grab :screen))
- ;; quick editing
- (defcommand editrc () ()
- "quick way to open and edit the rc file"
- (run-shell-command "emacs ~/.stumpwmrc"))
- ;; shutting down
- (defun shutdown-fn (type passwd)
- "Calls the shutdown command with the specified halting operation and the password"
- (let* ((shutdown-type (case type
- (:halt "-h")
- (:reboot "-r")))
- (command (concatenate 'string "echo " passwd " | sudo -S shutdown " shutdown-type " now")))
- (run-shell-command command)))
- (defcommand shutdown (passwd) ((:string "please enter your password: "))
- (shutdown-fn :halt passwd))
- (defcommand reboot (passwd) ((:string "please enter your password: "))
- (shutdown-fn :reboot passwd))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement