 	xsel-output )))
   ;; Attach callbacks to hooks
   (setq interprogram-cut-function 'xsel-cut-function)
+  (setq interprogram-paste-function 'xsel-paste-function)
 
   ;; Idea from
   ;; http://shreevatsa.wordpress.com/2006/10/22/emacs-copypaste-and-x/

(use-package zoom-window
  :ensure t
  :commands zoom-window-zoom
  :config
  (progn
    (custom-set-variables '(zoom-window-use-persp t)


;;;============================================================================
; Additional Hacks

;;-----------------------------------------------------------------------------
;; copy file path
(defun clip-file-path-from-project-root ()
  "Put the current file name on the clipboard"
  (interactive)
  (let ((filename (if (equal major-mode 'dired-mode)
                      (file-name-directory default-directory)
                    (buffer-file-name)))
        (root (condition-case nil
                  (projectile-project-root)
                (error ""))))
    (when filename
      (kill-new (replace-regexp-in-string (concat "^" (regexp-quote root)) "" filename)))))

(defun clip-file-path-full ()
  "Put the current file name on the clipboard"
  (interactive)
  (let ((filename (if (equal major-mode 'dired-mode)
                      (file-name-directory default-directory)
                    (buffer-file-name))))
    (when filename
      (kill-new filename))))

;;;----------------------------------------------------------------------------
;;; Enable copy-paste with X clipboard (need xsel)
