Advertisement
cirrus

scrotup

Dec 29th, 2013
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defun wlshot (&optional name-shot-p)
  2.    "Takes a screen shot and then uploads it to wlair.us.to.
  3.  If `universal-argument' is called, it asks for a filename.
  4. Requires TRAMP, scp, and ImageMagick."
  5.    (interactive "P")
  6.    (if (eq window-system 'x)
  7.        (when (yes-or-no-p "Take a screen shot? ")
  8.          (let (filename url)
  9.            (if (equal name-shot-p nil)
  10.               (setq filename (concat (format-time-string "%s") ".png"))
  11.              (setq filename (read-from-minibuffer "Filename: ")))
  12.           (shell-command (concat "import -window root ~/img/shots/" filename))
  13.           (copy-file
  14.             (concat "~/img/shots/" filename)
  15.             "/scp:turtil.net:/srv/vhosts/wlair.us.to/public/remote/img/shots/")
  16.            (setq url (concat "http://wlair.us.to/remote/img/shots/" filename))
  17.            (kill-new url)
  18.            (message url)))
  19.      (message "This is not X.  You cannot take a screen shot here.")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement