Merge branch 'master' of github.com:IvanMalison/dotfiles

This commit is contained in:
2019-06-06 00:39:05 -07:00
20 changed files with 135 additions and 116 deletions

View File

@@ -0,0 +1,6 @@
let
pkgs = import <nixpkgs> { overlays = [
(import ./taffybar/overlay.nix) (import ../xmonad/overlay.nix)
]; };
source = pkgs.lib.sourceByRegex ./. ["taffybar.hs" "imalison-taffybar.cabal"];
in pkgs.haskellPackages.callCabal2nix "imalison-taffybar" source { }

View File

@@ -30,7 +30,7 @@ executable imalison-taffybar
, hslogger
, process
, split
, taffybar
, taffybar>=3.2.0
, transformers
, xdg-basedir
, xmonad-contrib>=0.13

View File

@@ -5,7 +5,7 @@
@define-color active-window-color @white;
@define-color urgent-window-color @taffy-blue;
@define-color font-color @white;
@define-color font-color @black;
@define-color menu-background-color @white;
@define-color menu-font-color @black;

View File

@@ -80,9 +80,9 @@ cpuCallback = do
(_, systemLoad, totalLoad) <- cpuLoad
return [totalLoad, systemLoad]
getFullWorkspaceNames :: X11Property [(WorkspaceIdx, String)]
getFullWorkspaceNames :: X11Property [(WorkspaceId, String)]
getFullWorkspaceNames = go <$> readAsListOfString Nothing "_NET_DESKTOP_FULL_NAMES"
where go = zip [WSIdx i | i <- [0..]]
where go = zip [WorkspaceId i | i <- [0..]]
workspaceNamesLabelSetter workspace =
fromMaybe "" . lookup (workspaceIdx workspace) <$>
@@ -93,14 +93,16 @@ enableLogger logger level = do
saveGlobalLogger $ setLevel level logger
logDebug = do
global <- getLogger ""
saveGlobalLogger $ setLevel DEBUG global
logger3 <- getLogger "System.Taffybar"
saveGlobalLogger $ setLevel DEBUG logger3
logger <- getLogger "System.Taffybar.Widget.Generic.AutoSizeImage"
saveGlobalLogger $ setLevel DEBUG logger
logger2 <- getLogger "StatusNotifier.Tray"
saveGlobalLogger $ setLevel DEBUG logger2
workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces"
saveGlobalLogger $ setLevel WARNING workspacesLogger
-- workspacesLogger <- getLogger "System.Taffybar.Widget.Workspaces"
-- saveGlobalLogger $ setLevel WARNING workspacesLogger
-- logDebug
-- logM "What" WARNING "Why"
-- enableLogger "System.Taffybar.Widget.Util" DEBUG
@@ -111,10 +113,11 @@ logDebug = do
cssFileByHostname =
[ ("uber-loaner", "uber-loaner.css")
, ("imalison-home", "taffybar.css")
, ("ivanm-dfinity-razr", "ivanm-dfinity-razr.css")
, ("ivanm-dfinity-razer", "ivanm-dfinity-razer.css")
]
main = do
-- logDebug
hostName <- getHostName
homeDirectory <- getHomeDirectory
cssFilePath <-
@@ -140,9 +143,15 @@ main = do
, labelSetter = workspaceNamesLabelSetter
}
workspaces = workspacesNew myWorkspacesConfig
myClock =
textClockNewWith
defaultClockConfig
{ clockUpdateStrategy = RoundedTargetInterval 60 0.0
, clockFormatString = "%a %b %_d %I:%M %p"
}
fullEndWidgets =
map (>>= buildContentsBox)
[ textClockNewWith defaultClockConfig
[ myClock
, sniTrayNew
, cpuGraph
, memoryGraph
@@ -155,10 +164,11 @@ main = do
map (>>= buildContentsBox)
[ batteryIconNew
, textBatteryNew "$percentage$%"
, textClockNewWith defaultClockConfig
, myClock
, sniTrayNew
, mpris2New
]
longLaptopWidgets =
longLaptopEndWidgets =
map (>>= buildContentsBox)
[ batteryIconNew
, textBatteryNew "$percentage$%"
@@ -172,7 +182,7 @@ main = do
baseConfig =
defaultSimpleTaffyConfig
{ startWidgets =
workspaces : map (>>= buildContentsBox) [layout, windows]
workspaces : map (>>= buildContentsBox) [layout, windows]
, endWidgets = fullEndWidgets
, barPosition = Top
, barPadding = 0
@@ -187,8 +197,8 @@ main = do
, ( "imalison-home"
, baseConfig { endWidgets = fullEndWidgets, barHeight = 42 }
)
, ( "ivanm-dfinity-razr"
, baseConfig { endWidgets = longLaptopWidgets, barHeight = 42 }
, ( "ivanm-dfinity-razer"
, baseConfig { endWidgets = shortLaptopEndWidgets, barHeight = 42 }
)
]
simpleTaffyConfig = selectedConfig

View File

@@ -1,32 +1,11 @@
#!/usr/bin/env bash
function min {
[ $1 -le $2 ] && echo "$1" || echo "$2"
}
function get_exe_dir {
# XXX: This exists because calling in to stack is kind of slow with nix
# integration enabled, even when just using it to get a path.
if [ -e ./.cached-stack-install-path ]; then
cat .cached-stack-install-path
else
stack path --local-install-root
fi
}
SRC_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
EXE_NAME=imalison-xmonad
EXE_LOCATION=$(get_exe_dir)/bin/$EXE_NAME
output_file=$1; shift
if [ -e ./.cached-stack-install-path ]; then
last_built=$(stat -c '%Y' $EXE_LOCATION)
xmonad_modified=$(stat -c '%Y' ./xmonad.hs)
[ $last_built -lt $xmonad_modified ] && stack install
else
stack install
fi
cp -uf $EXE_LOCATION $output_file
cd "$SRC_DIR"
exe_location="$SRC_DIR/result/bin/imalison-xmonad"
nix-build
echo "$exe_location" "$output_file" > did_build
cp -f "$exe_location" "$output_file"

View File

@@ -0,0 +1,6 @@
let
pkgs = import <nixpkgs> { overlays = [ (import ./overlay.nix) ]; };
source = pkgs.lib.sourceByRegex ./. [
"xmonad.hs" "imalison-xmonad.cabal" "PagerHints.hs" "LICENSE"
];
in pkgs.haskellPackages.callCabal2nix "imalison-xmonad" source { }

View File

@@ -29,6 +29,5 @@ executable imalison-xmonad
, xmonad-contrib>=0.13
, xmonad>=0.13
hs-source-dirs: .
src
other-modules: PagerHints
other-modules: PagerHints
default-language: Haskell2010

View File

@@ -0,0 +1,12 @@
_: pkgs: rec {
haskellPackages = pkgs.haskellPackages.override (old: {
overrides = pkgs.lib.composeExtensions (old.overrides or (_: _: {})) (self: super: rec {
xmonad = super.xmonad.overrideAttrs (_: {
src = fetchGit ./xmonad;
});
xmonad-contrib = super.xmonad-contrib.overrideAttrs (_: {
src = fetchGit ./xmonad-contrib;
});
});
});
}

View File

@@ -1 +0,0 @@
../taffybar/taffybar

View File

@@ -213,7 +213,6 @@ emacsCommand = "emacsclient -c"
htopCommand = "termite -e htop -t htop"
transmissionCommand = "transmission-gtk"
volumeCommand = "pavucontrol"
taffybarCommand = "restart_taffybar.sh"
-- Startup hook
@@ -341,11 +340,13 @@ myTabConfig =
rename newName = RN.renamed [RN.Replace newName]
layoutsStart layout = (layout, [Layout layout])
(|||!) (joined, layouts) newLayout =
(joined ||| newLayout, layouts ++ [Layout newLayout])
layoutInfo =
layoutsStart (rename "Columns" $ multiCol [1, 1] 2 0.01 (-0.5)) |||!
layoutsStart (rename "4 Columns" $ (multiCol [1, 1, 1] 2 0.0 (-0.5))) |||!
rename "3 Columns" (multiCol [1, 1] 2 0.01 (-0.5)) |||!
rename "Large Main" (Tall 1 (3 / 100) (3 / 4)) |||!
rename "2 Columns" (Tall 1 (3 / 100) (1 / 2)) |||!
Accordion |||! simpleCross |||! myTabbed

View File

@@ -1210,21 +1210,7 @@ Disabling line numbers because they are slow as fuck.
#+END_SRC
*** Handle xrefs annoying dedicated window garbage
#+BEGIN_SRC emacs-lisp
(use-package xref
:config
(defun xref--show-pos-in-buf (pos buf select)
(let ((xref-buf (current-buffer))
win)
(with-selected-window
(display-buffer buf)
(xref--goto-char pos)
(run-hooks 'xref-after-jump-hook)
(let ((buf (current-buffer)))
(setq win (selected-window))
(with-current-buffer xref-buf
(setq-local other-window-scroll-buffer buf))))
(when select
(select-window win)))))
(use-package xref)
#+END_SRC
** Fill Setup
Get rid of nags about requiring setences to end with two spaces.
@@ -2121,6 +2107,11 @@ I don't use auto-complete at all, so I have set up a hook to automatically disab
(use-package unfill
:bind ("M-q" . unfill-toggle))
#+END_SRC
** format-all
#+begin_src emacs-lisp
(use-package format-all
:commands format-all-buffer)
#+end_src
** cliphist
#+BEGIN_SRC emacs-lisp
(use-package cliphist
@@ -2603,7 +2594,7 @@ eval-last-sexp.
:preface
(progn
(imalison:add-blacklist-to-major nix-mode)
(setq nix-mode-blacklist '("all-packages.nix")))
(setq nix-mode-blacklist '("all-packages.nix" "hackage-packages.nix")))
:config
(progn
(setq nix-indent-function 'nix-indent-line)))
@@ -2824,10 +2815,10 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
;; Better import handling
haskell-process-suggest-remove-import-lines t
haskell-process-auto-import-loaded-modules nil
;; Disable haskell-stylish-on-save, as it breaks flycheck highlighting.
;; NOTE: May not be true anymore - taksuyu 2015-10-06
haskell-stylish-on-save nil
haskell-tags-on-save nil
haskell-tags-on-save t
haskell-mode-stylish-haskell-path "brittany"
haskell-mode-stylish-haskell-args '("-")
haskell-indent-offset 2)
(require 'flycheck)
(delq 'haskell-stack-ghc flycheck-checkers)
@@ -2836,6 +2827,7 @@ 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))
#+END_SRC
@@ -2843,6 +2835,7 @@ The following is taken from [[https://github.com/syl20bnr/spacemacs/blob/a650877
Intero seems to be causing hangs, so it has been disabled
#+BEGIN_SRC emacs-lisp
(use-package intero
:disabled t
:after haskell-mode
:config
(progn
@@ -2852,6 +2845,7 @@ Intero seems to be causing hangs, so it has been disabled
**** hindent
#+BEGIN_SRC emacs-lisp
(use-package hindent
:disabled t
:after haskell-mode
:bind (:map hindent-mode-map
("C-c d" . hindent-reformat-decl))
@@ -3914,7 +3908,9 @@ I've disabled magithub because it causes magit to be super slow
:config
(progn
(setq github-search-get-target-directory-for-repo-function
'imalison:get-projects-directory-target-from-repo)))
'imalison:get-projects-directory-target-from-repo
;; See https://github.com/sigma/gh.el/issues/102
gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")))
#+END_SRC
*** github-clone
#+BEGIN_SRC emacs-lisp
@@ -4306,6 +4302,12 @@ I had to disable this mode because something that it does messes with coding set
(add-to-list 'editorconfig-exclude-modes '(org-mode))
(editorconfig-mode 1)))
#+END_SRC
** direnv
#+begin_src emacs-lisp
(use-package direnv
:config
(direnv-mode +1))
#+end_src
** dtrt-indent
#+BEGIN_SRC emacs-lisp
(use-package dtrt-indent

View File

@@ -6,7 +6,7 @@ random_paper() {
wallpaper() {
local target_paper=${1:-"$(random_paper)"}
feh --bg-center $target_paper --bg-scale "$WALLPAPER_DIR"transparent1x1.png --bg-center $target_paper
feh --bg-center $target_paper --bg-center $target_paper
}
wallpaper_timer() {