From cfa2861f3e1f20a6144d800c8b70f8ae4a1404e5 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 1 Jan 2019 09:33:38 -0800 Subject: [PATCH 1/8] [Linux] Use env pkill instead of pkill for systemd service commands --- dotfiles/config/systemd/user/alarm-clock.service | 2 +- dotfiles/config/systemd/user/chromix-too.service | 2 +- dotfiles/config/systemd/user/github-notifications.service | 2 +- dotfiles/config/systemd/user/kdeconnect.service | 2 +- dotfiles/config/systemd/user/mopidy.service | 2 +- dotfiles/config/systemd/user/skippy-xd.service | 2 +- dotfiles/config/systemd/user/status-notifier-watcher.service | 2 +- dotfiles/config/systemd/user/volnoti.service | 2 +- dotfiles/config/systemd/user/xsettingsd.service | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dotfiles/config/systemd/user/alarm-clock.service b/dotfiles/config/systemd/user/alarm-clock.service index b4024f67..d7868bd6 100644 --- a/dotfiles/config/systemd/user/alarm-clock.service +++ b/dotfiles/config/systemd/user/alarm-clock.service @@ -6,7 +6,7 @@ After=status-notifier-watcher.service [Service] Type=simple ExecStart=/usr/bin/env alarm-clock-applet -ExecStop=/usr/bin/pkill alarm-clock-applet +ExecStop=/usr/bin/env pkill alarm-clock-applet [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/chromix-too.service b/dotfiles/config/systemd/user/chromix-too.service index b4f734bd..a38380b7 100644 --- a/dotfiles/config/systemd/user/chromix-too.service +++ b/dotfiles/config/systemd/user/chromix-too.service @@ -6,7 +6,7 @@ After=taffybar.service [Service] Type=simple ExecStart=/usr/bin/env chromix-too-server -ExecStop=/usr/bin/pkill chromix-too +ExecStop=/usr/bin/env pkill chromix-too [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/github-notifications.service b/dotfiles/config/systemd/user/github-notifications.service index 3f26ee3a..bbf3da89 100644 --- a/dotfiles/config/systemd/user/github-notifications.service +++ b/dotfiles/config/systemd/user/github-notifications.service @@ -6,7 +6,7 @@ After=taffybar.service [Service] Type=simple ExecStart=/usr/bin/env notifications-tray-icon --github-token-pass github-token -ExecStop=/usr/bin/pkill 'notifications-tray-icon --github-token-pass github-token' +ExecStop=/usr/bin/env pkill 'notifications-tray-icon --github-token-pass github-token' [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/kdeconnect.service b/dotfiles/config/systemd/user/kdeconnect.service index 952e1228..4f84894e 100644 --- a/dotfiles/config/systemd/user/kdeconnect.service +++ b/dotfiles/config/systemd/user/kdeconnect.service @@ -6,7 +6,7 @@ After=taffybar.service [Service] Type=simple ExecStart=/usr/bin/env kdeconnect-indicator -ExecStop=/usr/bin/pkill kdeconnect-indicator +ExecStop=/usr/bin/env pkill kdeconnect-indicator [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/mopidy.service b/dotfiles/config/systemd/user/mopidy.service index 90889c17..fddfda4d 100644 --- a/dotfiles/config/systemd/user/mopidy.service +++ b/dotfiles/config/systemd/user/mopidy.service @@ -4,7 +4,7 @@ Description=mopidy [Service] Type=simple ExecStart=/usr/bin/env mopidy -ExecStop=/usr/bin/pkill mopidy +ExecStop=/usr/bin/env pkill mopidy [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/skippy-xd.service b/dotfiles/config/systemd/user/skippy-xd.service index 756216ca..0c7c6cb5 100644 --- a/dotfiles/config/systemd/user/skippy-xd.service +++ b/dotfiles/config/systemd/user/skippy-xd.service @@ -6,7 +6,7 @@ After=taffybar.service [Service] Type=simple ExecStart=/usr/bin/env skippy-xd --start-daemon -ExecStop=/usr/bin/pkill skippy-xd +ExecStop=/usr/bin/env pkill skippy-xd [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/status-notifier-watcher.service b/dotfiles/config/systemd/user/status-notifier-watcher.service index 82f55017..7a6d6d8f 100644 --- a/dotfiles/config/systemd/user/status-notifier-watcher.service +++ b/dotfiles/config/systemd/user/status-notifier-watcher.service @@ -4,7 +4,7 @@ Description=status-notifier-watcher [Service] Type=simple ExecStart=/usr/bin/env status-notifier-watcher -ExecStop=/usr/bin/pkill status-notifier-watcher +ExecStop=/usr/bin/env pkill status-notifier-watcher [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/volnoti.service b/dotfiles/config/systemd/user/volnoti.service index 19fb8c40..99fa49e4 100644 --- a/dotfiles/config/systemd/user/volnoti.service +++ b/dotfiles/config/systemd/user/volnoti.service @@ -4,7 +4,7 @@ Description=volnoti [Service] Type=simple ExecStart=/usr/bin/env volnoti -n -v -ExecStop=/usr/bin/pkill volnoti +ExecStop=/usr/bin/env pkill volnoti [Install] WantedBy=wm.target diff --git a/dotfiles/config/systemd/user/xsettingsd.service b/dotfiles/config/systemd/user/xsettingsd.service index 51880449..edb48588 100644 --- a/dotfiles/config/systemd/user/xsettingsd.service +++ b/dotfiles/config/systemd/user/xsettingsd.service @@ -3,7 +3,7 @@ Description=X Settings Daemon [Service] ExecStart=/usr/bin/env xsettingsd-setup -ExecStop=/usr/bin/pkill xsettingsd +ExecStop=/usr/bin/env pkill xsettingsd [Install] WantedBy=wm.target From a5120dc759f53663c7807c1dc0720fc76dd967b1 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 2 Jan 2019 12:37:40 -0800 Subject: [PATCH 2/8] [Emacs] Disable forking for projectile speed up trick --- dotfiles/emacs.d/README.org | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 4f318716..2b878085 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -286,13 +286,16 @@ This had to be disabled because it was causing a bunch of issues with projectile This solution only applies it to projectile-find-file #+BEGIN_SRC emacs-lisp - (defun imalison:call-with-quick-shell-command (fn &rest args) - (noflet ((shell-command-to-string (&rest args) - (or (apply 'imalison:try-call-process args) (apply this-fn args)))) + (noflet + ((shell-command-to-string (&rest args) + (condition-case _e + (or (apply 'imalison:try-call-process args) (apply this-fn args)) + (error (apply this-fn args))))) (apply fn args))) -(advice-add 'projectile-find-file :around 'imalison:call-with-quick-shell-command) +;; I've had to disable this becuase newer versions of projectile use a ton of shell commands +;; (advice-add 'projectile-files-via-ext-command :around 'imalison:call-with-quick-shell-command) #+END_SRC ** Set EMACS environment variable Emacs cask seems to depend on the EMACS environment variable being set to the From dc616e0d6e908344a86f747854fc719bc10646c8 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 2 Jan 2019 12:38:48 -0800 Subject: [PATCH 3/8] [Emacs] Misc tweaks --- dotfiles/emacs.d/.mc-lists.el | 1 + dotfiles/emacs.d/README.org | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dotfiles/emacs.d/.mc-lists.el b/dotfiles/emacs.d/.mc-lists.el index a172c731..0408e50b 100644 --- a/dotfiles/emacs.d/.mc-lists.el +++ b/dotfiles/emacs.d/.mc-lists.el @@ -5,6 +5,7 @@ '( TeX-insert-backslash backward-sexp + beginning-of-buffer beginning-of-visual-line c-electric-delete-forward c-electric-semi&comma diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 2b878085..1323e616 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1588,6 +1588,7 @@ custom-set-faces in your custom file. #+BEGIN_SRC emacs-lisp (use-package highlight-indent-guides :commands highlight-indent-guides-mode + :diminish highlight-indent-guides-mode :preface (progn (add-hook 'prog-mode-hook 'highlight-indent-guides-mode)) @@ -1766,7 +1767,6 @@ bind-key and global-set-key forms. I use helm for almost all emacs completion #+BEGIN_SRC emacs-lisp -n -r (use-package helm-config - :demand t :diminish helm-mode :straight helm :bind (("M-y" . helm-show-kill-ring) @@ -1774,11 +1774,11 @@ I use helm for almost all emacs completion ("C-x C-i" . helm-imenu) ("C-h a" . helm-apropos) ("C-c ;" . helm-recentf)) - :diminish helm-mode :config (progn (setq helm-split-window-default-side 'same helm-exit-idle-delay 0) + (use-package helm-org :straight nil :defer 10 @@ -4295,6 +4295,7 @@ I had to disable this mode because something that it does messes with coding set ** dtrt-indent #+BEGIN_SRC emacs-lisp (use-package dtrt-indent + :diminish 'dtrt-indent-mode :commands 'dtrt-indent-mode :init (add-hook 'prog-mode-hook 'dtrt-indent-mode) :config From a33382da614ca1a16ccda8f96dd4510d941109bf Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 2 Jan 2019 12:40:44 -0800 Subject: [PATCH 4/8] [Emacs] LSP updates, activate for haskell-mode --- dotfiles/emacs.d/README.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 1323e616..90d57ee3 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -2825,8 +2825,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 #+BEGIN_SRC emacs-lisp (use-package lsp-haskell :config - (when (executable-find "hie") - (add-hook 'haskell-mode-hook 'lsp-haskell-enable))) + (add-hook 'haskell-mode-hook 'lsp)) #+END_SRC **** intero Intero seems to be causing hangs, so it has been disabled @@ -3975,9 +3974,12 @@ emr (emacs refactor) provides support for refactoring in many programming langua ** language-server-protocol (lsp) #+BEGIN_SRC emacs-lisp (use-package lsp-mode - :commands lsp-mode :config (progn + (setq lsp-prefer-flymake nil) + (use-package lsp-ui + :config + (add-hook 'lsp-mode-hook 'lsp-ui-mode)) (require 'lsp-clients) (add-hook 'programming-mode-hook 'lsp))) #+END_SRC From 93ee4866b893c2068d5c6acf253473d20458ae93 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 2 Jan 2019 12:41:19 -0800 Subject: [PATCH 5/8] [NixOS] Add adb support --- nixos/configuration.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index b3fddd09..401acb54 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -174,6 +174,7 @@ in patchelf plasma-workspace powertop + pscircle python-with-my-packages qt5.qttools rcm @@ -214,6 +215,7 @@ in programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; + programs.adb.enable = true; services.openssh.enable = true; services.avahi = { enable = true; @@ -270,7 +272,13 @@ in # Define a user account. Don't forget to set a password with ‘passwd’. users.extraUsers = let extraGroups = [ - "wheel" "disk" "audio" "video" "networkmanager" "systemd-journal" + "audio" + "adbusers" + "disk" + "networkmanager" + "systemd-journal" + "video" + "wheel" ]; userDefaults = { inherit extraGroups; @@ -294,5 +302,5 @@ in }; }; - system.nixos.stateVersion = "18.03"; + system.stateVersion = "18.03"; } From 3d791966bd581a6b0cfc0fa2da506658eb5157e0 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 2 Jan 2019 12:41:57 -0800 Subject: [PATCH 6/8] [NixOS] Add cachix for hie --- nixos/cachix.nix | 12 ++++++++++++ nixos/machines/imalison-home.nix | 1 + 2 files changed, 13 insertions(+) create mode 100644 nixos/cachix.nix diff --git a/nixos/cachix.nix b/nixos/cachix.nix new file mode 100644 index 00000000..40775b1a --- /dev/null +++ b/nixos/cachix.nix @@ -0,0 +1,12 @@ +{ + nix = { + binaryCaches = [ + "https://cache.nixos.org/" + "https://hie-nix.cachix.org" + ]; + binaryCachePublicKeys = [ + "hie-nix.cachix.org-1:EjBSHzF6VmDnzqlldGXbi0RM3HdjfTU3yDRi9Pd0jTY=" + ]; + trustedUsers = [ "root" "imalison" "kat" ]; + }; +} diff --git a/nixos/machines/imalison-home.nix b/nixos/machines/imalison-home.nix index 08daadfa..7fb10313 100644 --- a/nixos/machines/imalison-home.nix +++ b/nixos/machines/imalison-home.nix @@ -5,6 +5,7 @@ ../configuration.nix ../games.nix + ../cachix.nix ../extra.nix ]; From 7bf9b088e916fa7be5a4f4d858e0694e26564da3 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 5 Jan 2019 18:31:19 -0800 Subject: [PATCH 7/8] [taffybar] Update taffybar version, add chrome favicon support --- dotfiles/config/taffybar/taffybar | 2 +- dotfiles/config/taffybar/taffybar.hs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dotfiles/config/taffybar/taffybar b/dotfiles/config/taffybar/taffybar index 307c17bc..d49e8dfa 160000 --- a/dotfiles/config/taffybar/taffybar +++ b/dotfiles/config/taffybar/taffybar @@ -1 +1 @@ -Subproject commit 307c17bc9cac041c8a3dffc00e89139d2ada7fbd +Subproject commit d49e8dfa229b42e654bc18f4801aff061919c751 diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 79353ce4..65b7f29c 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -125,6 +125,7 @@ main = do Just "gmail.png" | otherwise = Nothing myIcons = scaledWindowIconPixbufGetter $ + getWindowIconPixbufFromChrome <|||> unscaledDefaultGetWindowIconPixbuf <|||> (\size _ -> lift $ loadPixbufByName size "application-default-icon") cpu = pollingGraphNew cpuCfg 0.5 cpuCallback From 4763811bbb9b5513603ab9892012def353777a57 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 5 Jan 2019 18:42:16 -0800 Subject: [PATCH 8/8] [taffybar] Config cleanup --- .../config/taffybar/imalison-taffybar.cabal | 4 ++-- dotfiles/config/taffybar/taffybar.hs | 23 ++++--------------- 2 files changed, 7 insertions(+), 20 deletions(-) diff --git a/dotfiles/config/taffybar/imalison-taffybar.cabal b/dotfiles/config/taffybar/imalison-taffybar.cabal index e580e5b2..cb7b1342 100644 --- a/dotfiles/config/taffybar/imalison-taffybar.cabal +++ b/dotfiles/config/taffybar/imalison-taffybar.cabal @@ -14,8 +14,8 @@ executable imalison-taffybar hs-source-dirs: . main-is: taffybar.hs ghc-options: -threaded -rtsopts -with-rtsopts=-N - -- ghc-options: -threaded -debug -g - -- cpp-options: +RTS -DS + -- ghc-options: -threaded -g -rtsopts + ghc-prof-options: -fprof-auto build-depends: base , X11>=1.8 , bytestring diff --git a/dotfiles/config/taffybar/taffybar.hs b/dotfiles/config/taffybar/taffybar.hs index 65b7f29c..6ecdc799 100644 --- a/dotfiles/config/taffybar/taffybar.hs +++ b/dotfiles/config/taffybar/taffybar.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE PackageImports #-} {-# LANGUAGE OverloadedStrings #-} module Main where @@ -100,10 +99,6 @@ logDebug = do workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces" saveGlobalLogger $ setLevel WARNING workspacesLogger --- github = do --- Right (token, _) <- passGet "github-token" --- githubNotificationsNew $ defaultGithubConfig $ Auth.OAuth $ BS.pack token - main = do homeDirectory <- getHomeDirectory -- logDebug @@ -116,14 +111,6 @@ main = do highContrastDirectory = "/" "usr" "share" "icons" "HighContrast" "256x256" inHighContrastDirectory file = highContrastDirectory file - getIconFileName w@WindowData {windowTitle = title, windowClass = klass} - -- | "URxvt" `isInfixOf` klass = Just "urxvt.png" - -- | "Termite" `isInfixOf` klass = Just "urxvt.png" - -- | "Kodi" `isInfixOf` klass = Just "kodi.png" - | "@gmail.com" `isInfixOf` title && - "chrome" `isInfixOf` klass && "Gmail" `isInfixOf` title = - Just "gmail.png" - | otherwise = Nothing myIcons = scaledWindowIconPixbufGetter $ getWindowIconPixbufFromChrome <|||> unscaledDefaultGetWindowIconPixbuf <|||> @@ -157,12 +144,11 @@ main = do , batteryIconNew , textClockNew Nothing "%a %b %_d %r" 1 , sniTrayNew - -- , github , cpu , mem , networkGraphNew netCfg Nothing - -- , networkMonitorNew defaultNetFormat Nothing >>= setMinWidth 200 - -- , fsMonitorNew 60 ["/dev/sdd2"] + -- , networkMonitorNew defaultNetFormat Nothing >>= setMinWidth 200 + -- , fsMonitorNew 60 ["/dev/sdd2"] , mpris2New ] , barPosition = Top @@ -170,9 +156,10 @@ main = do , barHeight = 45 } simpleTaffyConfig = baseConfig - -- { endWidgets = [] + { centerWidgets = map (>>= buildContentsBox) [] + -- , endWidgets = map (>>= buildContentsBox) [ sniTrayNew, mpris2New ] -- , startWidgets = [flip widgetSetClass "Workspaces" =<< workspaces] - -- } + } startTaffybar $ appendHook notifySystemD $ appendHook (void $ getHost False) $