From b6148a913261cafe224f41558437ed6ed06a98db Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 31 May 2018 17:26:41 -0700 Subject: [PATCH 01/10] Revert "[taffybar] Use stack run instead of your own thing" This reverts commit d626da4796250a288252b101f8e9f6176f7866df. --- dotfiles/lib/bin/taffybar | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dotfiles/lib/bin/taffybar b/dotfiles/lib/bin/taffybar index c3b3e0bd..3d838f78 100755 --- a/dotfiles/lib/bin/taffybar +++ b/dotfiles/lib/bin/taffybar @@ -2,4 +2,12 @@ # -*- mode:sh cd "$HOME/.config/taffybar" -stack run +stack install + +if command_exists "imalison-taffybar"; then + imalison-taffybar "$@" +else + # Move .lib/bin to the end of PATH so that this script is not called again + add_to_path "$HOME/.lib/bin" --after + taffybar "$@" +fi From e08eea87bce24916421ebddfec7988413af96cbc Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 1 Jun 2018 15:49:40 -0700 Subject: [PATCH 02/10] [Emacs] Support using ob-shell instead of ob-sh --- dotfiles/emacs.d/README.org | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 0049c23b..51d57fa6 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -3056,14 +3056,19 @@ Intero seems to be causing hangs, so it has been disabled (add-hook 'org-mode-hook 'imalison:load-babel-languages) (defun imalison:load-babel-languages () - (org-babel-do-load-languages - 'org-babel-load-languages - '((sh . t) - (python . t) - (ruby . t) - (octave . t) - (sqlite . t) - (plantuml . t)))) + (let* ((loaded-ob (or (require 'ob-sh nil t) (require 'ob-shell nil t))) + (ob-shell-name + (when loaded-ob + (intern (substring-no-properties (imalison:maybe-symbol-name loaded-ob) 3)))) + (added-modes (when ob-shell-name `((,ob-shell-name . t))))) + (org-babel-do-load-languages + 'org-babel-load-languages + `((python . t) + (ruby . t) + (octave . t) + (sqlite . t) + (plantuml . t) + ,@added-modes)))) (setq org-log-into-drawer t org-log-reschedule t From caea87d274fbe9abf0bfb43c980b0a297721c842 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 1 Jun 2018 16:35:23 -0700 Subject: [PATCH 03/10] Print board in boggle --- dotfiles/lib/python/boggle.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/dotfiles/lib/python/boggle.py b/dotfiles/lib/python/boggle.py index a021bf2b..e3292201 100644 --- a/dotfiles/lib/python/boggle.py +++ b/dotfiles/lib/python/boggle.py @@ -42,6 +42,15 @@ def build_board(size=4): ] +def board_string(board_to_draw): + border_line = "+{0}+".format((len(board_to_draw[0]) * 2 - 1) * "-") + return "{border_line}\n{contents}\n{border_line}".format( + contents="\n".join("|{0}|".format(" ".join(letter_line)) + for letter_line in board_to_draw), + border_line=border_line, + ) + + def build_trie(): node = TrieNode() with open('/usr/share/dict/words') as the_file: @@ -57,7 +66,7 @@ class Boggle(object): @classmethod def new_random(cls, trie): - return cls(build_board(), trie) + return cls(build_Board(), trie) def __init__(self, board, trie): self.height = len(board) @@ -154,5 +163,5 @@ def build_board_from_dice_roll(dice=None, row_size=4): if __name__ == '__main__': dict_trie = build_trie() board = build_board_from_dice_roll() - print(board) + print(board_string(board)) print(list(Boggle(board, dict_trie).run())) From 39fe010f222db777294562c710f2dd5d7520ed6b Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 2 Jun 2018 14:44:21 -0700 Subject: [PATCH 04/10] [Linux] Get rid of custom key theme and replace it with gtk.css --- .../gtk-keys.css => config/gtk-3.0/gtk.css} | 33 +------------------ dotfiles/config/gtk-3.0/settings.ini | 10 +++--- 2 files changed, 6 insertions(+), 37 deletions(-) rename dotfiles/{local/share/themes/MyEmacs/gtk-3.0/gtk-keys.css => config/gtk-3.0/gtk.css} (72%) diff --git a/dotfiles/local/share/themes/MyEmacs/gtk-3.0/gtk-keys.css b/dotfiles/config/gtk-3.0/gtk.css similarity index 72% rename from dotfiles/local/share/themes/MyEmacs/gtk-3.0/gtk-keys.css rename to dotfiles/config/gtk-3.0/gtk.css index a3ee5a5c..e0db194f 100644 --- a/dotfiles/local/share/themes/MyEmacs/gtk-3.0/gtk-keys.css +++ b/dotfiles/config/gtk-3.0/gtk.css @@ -1,35 +1,3 @@ -/* - * GTK - The GIMP Toolkit - * Copyright (C) 2002 Owen Taylor - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -/* - * A keybinding set implementing Emacs-like keybindings - */ - -/* - * Bindings for GtkTextView and GtkEntry - */ @binding-set gtk-emacs-text-entry { bind "b" { "move-cursor" (logical-positions, -1, 0) }; @@ -53,6 +21,7 @@ bind "d" { "delete-from-cursor" (chars, 1) }; bind "d" { "delete-from-cursor" (word-ends, 1) }; bind "BackSpace" { "delete-from-cursor" (word-ends, -1) }; + bind "backspace" { "delete-from-cursor" (word-ends, -1) }; bind "k" { "delete-from-cursor" (paragraph-ends, 1) }; bind "backslash" { "delete-from-cursor" (whitespace, 1) }; diff --git a/dotfiles/config/gtk-3.0/settings.ini b/dotfiles/config/gtk-3.0/settings.ini index aafa871c..b80bbc3e 100644 --- a/dotfiles/config/gtk-3.0/settings.ini +++ b/dotfiles/config/gtk-3.0/settings.ini @@ -1,11 +1,11 @@ [Settings] -gtk-key-theme-name=MyEmacs +gtk-key-theme-name=Emacs gtk-application-prefer-dark-theme=false -gtk-theme-name=Adwaita-dark +gtk-theme-name=Arc gtk-fallback-icon-theme=gnome -gtk-icon-theme-name=Paper +gtk-icon-theme-name=Numix-Circle gtk-font-name=Roboto 11 -gtk-cursor-theme-name=Paper +gtk-cursor-theme-name=Breeze_Snow gtk-cursor-theme-size=0 gtk-toolbar-style=GTK_TOOLBAR_BOTH gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR @@ -15,5 +15,5 @@ gtk-enable-event-sounds=1 gtk-enable-input-feedback-sounds=1 gtk-xft-antialias=1 gtk-xft-hinting=1 -gtk-xft-hintstyle=hintfull +gtk-xft-hintstyle=hintslight gtk-xft-rgba=rgb From f4703aad17e3c5b22253b04ccec99db586646bd0 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 2 Jun 2018 16:42:47 -0700 Subject: [PATCH 05/10] [Emacs] Enable lsp-haskell again --- dotfiles/emacs.d/README.org | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 51d57fa6..90b3f6e3 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1153,7 +1153,7 @@ Disabling line numbers because they are slow as fuck. #+END_SRC *** frame-mode #+BEGIN_SRC emacs-lisp -(defvar imalison:use-frame-mode t) +(defvar imalison:use-frame-mode nil) (use-package frame-mode :if imalison:use-frame-mode :demand t @@ -2757,7 +2757,6 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877 **** haskell-ide-engine #+BEGIN_SRC emacs-lisp (use-package lsp-haskell - :disabled t :config (add-hook 'haskell-mode-hook 'lsp-haskell-enable)) #+END_SRC From ccb5306c416bbcb82ab5b3d435b32b5eb959a1ae Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sat, 2 Jun 2018 16:43:12 -0700 Subject: [PATCH 06/10] [Emacs] Add org-pomodoro --- dotfiles/emacs.d/README.org | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 90b3f6e3..3c6712a9 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -3204,6 +3204,7 @@ Intero seems to be causing hangs, so it has been disabled (add-to-list 'org-capture-templates `("c" "Calendar entry" entry + (file ,imalison:org-calendar-file) ,(format "%s\n%s\n%s" "* %?" imalison:created-property-string "%^T"))) (add-to-list 'org-capture-templates @@ -3487,6 +3488,11 @@ alphanumeric characters only." :after org-projectile :bind (("C-c n p" . org-projectile-helm-template-or-project))) #+END_SRC +**** org-pomodoro +#+BEGIN_SRC emacs-lisp +(use-package org-pomodoro + :after org) +#+END_SRC **** org-super-agenda #+BEGIN_SRC emacs-lisp (use-package org-super-agenda @@ -4509,23 +4515,7 @@ This is useful with server mode when editing gmail messages. I think that it is :defer t :config (progn - (defun alert-notifier-notify (info) - (if alert-notifier-command - (let ((args - (list "-title" (alert-encode-string (plist-get info :title)) - "-activate" "org.gnu.Emacs" - "-message" (alert-encode-string (plist-get info :message)) - "-execute" (format "\"%s\"" (switch-to-buffer-command (plist-get info :buffer)))))) - (apply #'call-process alert-notifier-command nil nil nil args)) - (alert-message-notify info))) - - (defun switch-to-buffer-command (buffer-name) - (emacsclient-command (format "(switch-to-buffer \\\"%s\\\")" buffer-name))) - - (defun emacsclient-command (command) - (format "emacsclient --server-file='%s' -e '%s'" server-name command)) - - (setq alert-default-style 'notifier))) + (setq alert-default-style 'libnotify))) #+END_SRC ** sauron #+BEGIN_SRC emacs-lisp @@ -4862,7 +4852,8 @@ Ensure all themes that I use are installed: (spaceline-helm-mode) ;; 'spaceline-gh-notifier and 'imalison:muni disabled for now - (spaceline-spacemacs-theme))) + (spaceline-spacemacs-theme) + (spaceline-toggle-org-pomodoro-on))) #+END_SRC ** page-break-lines #+BEGIN_SRC emacs-lisp From 4ac0c457cfe038a4d50690b110ff45beb9128423 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 3 Jun 2018 14:18:54 -0700 Subject: [PATCH 07/10] [Emacs] Add imalison:fontify-man-page-buffer --- dotfiles/emacs.d/README.org | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 3c6712a9..700ac00c 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1042,6 +1042,20 @@ I keep it around just in case I need it. (fset 'extract-and-name-use-package-block [?\C-a return ?\C-p ?# ?+ ?E ?N ?D ?_ ?S ?R ?C return ?# ?+ ?B ?E ?G ?I ?N ?_ ?S ?R ?C ? ?e ?m ?a ?c ?s ?- ?l ?i ?s ?p ?\C-a ?\C-p ?\C- ?\C-n ?\C-e ?\M-w ?\C-n ?\C-a ?\C-\M-f return ?\C-y ?\C-p ?\C-p ?\C-c ?\' ?\M-< ?\C-s ?u ?s ?e ?- ?p ?a ?c ?k return ?\C-\M-f ?\C-f ?\C- ?\C-\M-f ?\M-w ?\C-c ?\' ?\C-r ?B ?E ?G ?I ?N return ?\C-a ?\C-p ?\C-e return ?* ? ?\C-y]) #+END_SRC +* Man-mode +Man page escape sequences aren't properly handled by emacs pager. This function +fixes that, but for now, it needs to be run manually, since I haven't figured +out how to detect that a buffer is a man mode buffer. +#+BEGIN_SRC emacs-lisp +(use-package man + :config + (progn + (defun imalison:fontify-man-page-buffer () + (interactive) + (read-only-mode -1) + (Man-fontify-manpage) + (read-only-mode +1)))) +#+END_SRC * General ** User Info #+BEGIN_SRC emacs-lisp From 62c156200017cebc0a6bce0a84e67fa8f3288c76 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 3 Jun 2018 14:25:55 -0700 Subject: [PATCH 08/10] [autorandr] Update home_tv config for only 2 monitors --- dotfiles/config/autorandr/home_tv/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dotfiles/config/autorandr/home_tv/config b/dotfiles/config/autorandr/home_tv/config index cd55f623..e32fd517 100644 --- a/dotfiles/config/autorandr/home_tv/config +++ b/dotfiles/config/autorandr/home_tv/config @@ -14,6 +14,6 @@ pos 0x0 rate 60.00 output DVI-D-0 mode 2560x1440 -pos 3840x0 +pos 0x2160 primary rate 59.95 From 2faab19c2815fec605a8880455f1e4cb99808879 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 3 Jun 2018 14:28:15 -0700 Subject: [PATCH 09/10] [XMonad] Don't do weird chrome kill by default --- dotfiles/config/xmonad/xmonad.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index faca85c5..f41efd79 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -436,7 +436,8 @@ chromeTabAction doSplit action selected = -- done with the existing window bringer interface myWindowAct c@WindowBringerConfig {menuCommand = cmd, menuArgs = args} action = do visible <- visibleWindows - ws <- windowMap' c {windowFilter = not . flip elem visible} + -- Uncomment filter to remove windows that are visible + ws <- windowMap' c -- {windowFilter = not . flip elem visible} -- chromeTabs <- liftIO getChromeTabInfo let options = M.union (M.map Left ws) (M.map Right M.empty) selection <- DM.menuMapArgs cmd args options @@ -704,7 +705,7 @@ getWindowWS a = withWindowSet $ \ws -> return $ listToMaybe replaceWindow original replacement = W.delete original . swapWindows original replacement -myKill = +chromeReplaceKill = withFocused $ \w -> do vClass <- getClass w if vClass == "Chrome" then @@ -906,7 +907,7 @@ addKeys conf@XConfig { modMask = modm } = , ((modalt, xK_Return), deactivateFullAnd restoreAllMinimized) , ((modm .|. controlMask, xK_t), setReplaceTarget >> spawn "chromix-too open chrome://newtab") - , ((modm .|. shiftMask, xK_c), myKill) + , ((mod .|. controlMask, xK_c), chromeReplaceKill) , ((hyper, xK_g), gatherThisClass) -- Directional navigation From 09550d4c1f094cba8c2fd01299cdcee867798d75 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 3 Jun 2018 14:28:32 -0700 Subject: [PATCH 10/10] [Linux] Use normal chrome (not unstable) in mimetypes --- dotfiles/config/mimeapps.list | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dotfiles/config/mimeapps.list b/dotfiles/config/mimeapps.list index 6be41579..a25ad93d 100644 --- a/dotfiles/config/mimeapps.list +++ b/dotfiles/config/mimeapps.list @@ -10,8 +10,8 @@ image/png=okularApplication_kimgio.desktop; video/mp4=vlc.desktop;org.gnome.Totem.desktop; [Default Applications] -text/html=google-chrome-unstable.desktop -x-scheme-handler/http=google-chrome-unstable.desktop -x-scheme-handler/https=google-chrome-unstable.desktop -x-scheme-handler/about=google-chrome-unstable.desktop -x-scheme-handler/unknown=google-chrome-unstable.desktop +text/html=google-chrome.desktop +x-scheme-handler/http=google-chrome.desktop +x-scheme-handler/https=google-chrome.desktop +x-scheme-handler/about=google-chrome.desktop +x-scheme-handler/unknown=google-chrome.desktop