 
 (use-package almost-mono-themes)
 
+(defun get-frame-name (&optional frame)
+  (interactive)
+  "Return the string that names FRAME (a frame).  Default is selected frame."
+  (unless frame (setq frame (selected-frame)))
+  (if (framep frame)
+      (cdr (assq 'name (frame-parameters frame)))
+    (error "Function `get-frame-name': Argument not a frame: `%s'" frame)))
+
+;; from https://nicolas.petton.fr/blog/emacs-dark-window-decoration.html
+(defun set-selected-frame-dark-window-decoration ()
+  (interactive)
+  (let ((frame-name (get-frame-name (selected-frame))))
+    (call-process-shell-command (concat "xprop -f _GTK_THEME_VARIANT 8u -set _GTK_THEME_VARIANT \"dark\" -name \"" frame-name "\""))))
+
 (defun hrs/apply-theme ()
   (interactive)
   (load-theme 'almost-mono-black t)
+  (if (window-system)
+      (set-selected-frame-dark-window-decoration))
   (transparency 100))
 
 (if (daemonp)

;; (use-package dumb-jump
;;   :config
;;   (global-set-key (kbd "M-.") 'dumb-jump-go))

(defun get-frame-name (&optional frame)
  (interactive)
  "Return the string that names FRAME (a frame).  Default is selected frame."
  (unless frame (setq frame (selected-frame)))
  (if (framep frame)
      (cdr (assq 'name (frame-parameters frame)))
    (error "Function `get-frame-name': Argument not a frame: `%s'" frame)))

(defun visit-dir-as-root (hostname)
  (interactive "shost: ")

  (setq frame-background-mode 'dark)
  (mapc 'frame-set-background-mode (list (selected-frame))))

(use-package auto-compile
  :config (auto-compile-on-load-mode))

