| @@ -1,19 +1,31 @@ | |||||
| # Makefile is here to make it possible to use this whole shebang | # Makefile is here to make it possible to use this whole shebang | ||||
| # outside of emacs. | # outside of emacs. | ||||
| # | |||||
| # TODO: wrap this stuff into a script maybe? | |||||
| DEST:=$(HOME) | DEST:=$(HOME) | ||||
| LAST:=$(shell cat .last || echo 0) | |||||
| NEXT:=$(shell l=$(LAST); ((l=l+1)); echo $$l) | |||||
| LAST!=cat .last || echo 0 | |||||
| NEXT!=l=$(LAST); ((l=l+1)); echo $$l | |||||
| NEXTGEN:=$(PWD)/generation/$(NEXT) | NEXTGEN:=$(PWD)/generation/$(NEXT) | ||||
| LASTGEN:=$(PWD)/generation/$(LAST) | LASTGEN:=$(PWD)/generation/$(LAST) | ||||
| TANGLERS:=$(shell ls -d *.org) | |||||
| TANGLERS:=$(wildcard *.org) | |||||
| GEN:=$(LAST) | GEN:=$(LAST) | ||||
| OPTS:= | OPTS:= | ||||
| # OSX uses hostname -s for the "stable" hostname | |||||
| # uname -n can return dhcp addresses, which aren't | |||||
| # stable. | |||||
| HOST=$(shell echo "$$(hostname -s || uname -n)") | |||||
| # OSX uses scutil --get ComputerName | |||||
| # uname -n && hostname -s can return dhcp addresses | |||||
| # which aren't stable. | |||||
| HOST!=scutil --get ComputerName || uname -n | |||||
| USEROPTS:=$(OPTS):$(HOST) | USEROPTS:=$(OPTS):$(HOST) | ||||
| NAME:=default | |||||
| # Make it easier to check if a variable is defined or not | |||||
| # params: | |||||
| # variable name | |||||
| # optional message to print if variable is not set | |||||
| check_defined = \ | |||||
| $(strip $(foreach 1,$1, \ | |||||
| $(call __check_defined,$1,$(strip $(value 2))))) | |||||
| __check_defined = \ | |||||
| $(if $(value $1),, \ | |||||
| $(error Undefined variable $1$(if $2, ($2)))) | |||||
| INSTALLDIRS=tmp $(NEXTGEN) $(LASTGEN) generation/$(GEN) | INSTALLDIRS=tmp $(NEXTGEN) $(LASTGEN) generation/$(GEN) | ||||
| @@ -25,8 +37,6 @@ $(INSTALLDIRS): | |||||
| generation: $(NEXTGEN) $(LASTGEN) tmp | generation: $(NEXTGEN) $(LASTGEN) tmp | ||||
| cd tmp && cp -av . $(NEXTGEN) | cd tmp && cp -av . $(NEXTGEN) | ||||
| check: | |||||
| diff: generation/$(GEN) | diff: generation/$(GEN) | ||||
| ./ddiff $(PWD)/generation/$(GEN) $(DEST) | ./ddiff $(PWD)/generation/$(GEN) $(DEST) | ||||
| @@ -50,6 +60,15 @@ copy: | |||||
| tangle: tmp | tangle: tmp | ||||
| USEROPTS=$(USEROPTS) /usr/bin/env emacs --script ./etangle $(TANGLERS) | USEROPTS=$(USEROPTS) /usr/bin/env emacs --script ./etangle $(TANGLERS) | ||||
| # TODO: is this gnu diff output... only or not? note: wip until i've | |||||
| # tested on bsd make etc... | |||||
| .PHONY: removed | |||||
| removed: | |||||
| $(call check_defined, OLD, generation to compare removed files against) | |||||
| $(call check_defined, NEW, generation to compare removed files to) | |||||
| @diff -bur generation/$(OLD) generation/$(NEW) 2>&1 | grep 'Only in generation/'$(OLD) | sed -e 's|Only in ||' -e 's|.*[:] ||' | |||||
| clean: | clean: | ||||
| -rm -fr tmp | -rm -fr tmp | ||||
| @@ -58,5 +77,6 @@ nuke: clean | |||||
| .PHONY: option | .PHONY: option | ||||
| option: | option: | ||||
| $(call check_defined, NAME, predicate NAME to define in option files. Note: without -p i.e. NAME-p = t and no-NAME-p = nil) | |||||
| echo "(setq $(NAME)-p t)" > options/$(NAME).el | echo "(setq $(NAME)-p t)" > options/$(NAME).el | ||||
| echo "(setq $(NAME)-p nil)" > options/no-$(NAME).el | echo "(setq $(NAME)-p nil)" > options/no-$(NAME).el | ||||
| @@ -17,7 +17,7 @@ A stupid script I wrote ages ago to help me be lazy with cidr | |||||
| notation for stuff. Setup the wrong netmask a few times and | notation for stuff. Setup the wrong netmask a few times and | ||||
| you too, will wish for something similar. | you too, will wish for something similar. | ||||
| #+BEGIN_SRC perl :padline no :tangle tmp/bin/cidr:padline no | |||||
| #+BEGIN_SRC perl :padline no :tangle tmp/bin/cidr | |||||
| #!/usr/bin/env perl | #!/usr/bin/env perl | ||||
| # | # | ||||
| # Convert input ip/cidr|netmask|hexnetmask to useable network information. | # Convert input ip/cidr|netmask|hexnetmask to useable network information. | ||||
| @@ -1018,14 +1018,19 @@ More for nix on macos, but just merges NixOS/nipkgs origin/master to the current | |||||
| set -e | set -e | ||||
| session=nix | session=nix | ||||
| PKGS=${PKGS:-nixpkgs} | |||||
| cd ~/src/github.com/NixOS/nixpkgs | |||||
| if "${PKGS}" != "nixpkgs"; then | |||||
| cd ~/src/github.com/NixOS/nixpkgs/${PKGS} | |||||
| else | |||||
| cd ~/src/github.com/NixOS/nixpkgs | |||||
| fi | |||||
| if ! tmux has-session -t ${session}; then | if ! tmux has-session -t ${session}; then | ||||
| tmux new-session -d -s ${session} -n nix | tmux new-session -d -s ${session} -n nix | ||||
| tmux send-keys -t ${session}:0 'sleep 30 | tmux send-keys -t ${session}:0 'sleep 30 | ||||
| while true; do | while true; do | ||||
| blah=$(nix-env -iA --dry-run stdboth nixpkgs.default | grep /nix); echo "${blah}" | head -n $(echo "$LINES - 2" | bc); echo "${blah}" | grep -c /nix | ts | |||||
| blah=$(nix-env -f "<${PKGS}>" -iA --dry-run stdboth default | grep /nix); echo "${blah}" | head -n $(echo "$LINES - 2" | bc); echo "${blah}" | grep -c /nix | ts | |||||
| echo "${blah}" | grep /nix > /dev/null 2>&1 | echo "${blah}" | grep /nix > /dev/null 2>&1 | ||||
| if [ $? -eq 0 ]; then | if [ $? -eq 0 ]; then | ||||
| sleep 60 | sleep 60 | ||||
| @@ -1036,14 +1041,12 @@ More for nix on macos, but just merges NixOS/nipkgs origin/master to the current | |||||
| done | done | ||||
| ' C-m | ' C-m | ||||
| tmux split-window -v -t ${session}:0 | tmux split-window -v -t ${session}:0 | ||||
| tmux send-keys -t ${session}:0.1 'git fetch --all && git merge origin/master && | |||||
| time nix-env -iA nixpkgs.default && nix-env -u --leq && exit 0 | |||||
| tmux send-keys -t ${session}:0.1 'git fetch --all && git short HEAD > last-$(iso8601) && git rebase --autostash origin/staging && | |||||
| time nix-env -f "<${PKGS}>" -iA default && nix-env -f "<${PKGS}>" -u --leq && exit 0 | |||||
| ' C-m | ' C-m | ||||
| tmux select-window -t ${session}:0 | tmux select-window -t ${session}:0 | ||||
| fi | fi | ||||
| tmux attach -t ${session} | tmux attach -t ${session} | ||||
| #+END_SRC | #+END_SRC | ||||
| * ~/bin/notify | * ~/bin/notify | ||||
| @@ -262,7 +262,7 @@ nix_env_setup() | |||||
| # BAD INSTALLER NO COOKIE! | # BAD INSTALLER NO COOKIE! | ||||
| if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then | if [ -e ${HOME}/.nix-profile/etc/profile.d/nix.sh ]; then | ||||
| . ${HOME}/.nix-profile/etc/profile.d/nix.sh; | . ${HOME}/.nix-profile/etc/profile.d/nix.sh; | ||||
| export NIX_PATH=${HOME}/src/github.com/NixOS/nixpkgs:nixpkgs=${HOME}/src/github.com/NixOS/nixpkgs | |||||
| export NIX_PATH=nixpkgs=${HOME}/src/github.com/NixOS/nixpkgs:staging=${HOME}/src/github.com/NixOS/nixpkgs/staging | |||||
| export NIX_CFLAGS_COMPILE="-idirafter /usr/include" | export NIX_CFLAGS_COMPILE="-idirafter /usr/include" | ||||
| export NIX_CFLAGS_LINK="-L/usr/lib" | export NIX_CFLAGS_LINK="-L/usr/lib" | ||||
| export PKG_CONFIG_PATH="~/.nix-profile/lib/pkgconfig" | export PKG_CONFIG_PATH="~/.nix-profile/lib/pkgconfig" | ||||
| @@ -1257,7 +1257,6 @@ TODO: fixme | |||||
| (add-hook 'python-mode-hook | (add-hook 'python-mode-hook | ||||
| '(lambda () | '(lambda () | ||||
| (flycheck-select-checker 'python-flake8) | (flycheck-select-checker 'python-flake8) | ||||
| (flycheck-select-checker 'python-pylint) | |||||
| ) | ) | ||||
| ) | ) | ||||
| @@ -10,7 +10,8 @@ | |||||
| (if (getenv "USEROPTS") | (if (getenv "USEROPTS") | ||||
| (dolist (fnam (split-string (getenv "USEROPTS") ":")) | (dolist (fnam (split-string (getenv "USEROPTS") ":")) | ||||
| (if (not (member fnam '("" nil))) | (if (not (member fnam '("" nil))) | ||||
| (load-file (concat "./options/" fnam ".el")) | |||||
| (if (file-readable-p (concat "./options/" fnam ".el")) | |||||
| (load-file (concat "./options/" fnam ".el"))) | |||||
| )) | )) | ||||
| ) | ) | ||||
| @@ -19,18 +19,3 @@ Ghci setup, mostly just cosmetics. | |||||
| :set prompt "λ " | :set prompt "λ " | ||||
| :set +t | :set +t | ||||
| #+END_SRC | #+END_SRC | ||||
| * ~/.ghc.hs | |||||
| What to automatically have loaded into ghci sessions. | |||||
| #+BEGIN_SRC haskell :tangle tmp/.ghc.hs | |||||
| import Control.Applicative | |||||
| import Control.Monad | |||||
| import Data.Monoid | |||||
| import Data.Maybe | |||||
| import Data.List | |||||
| import Data.Bool | |||||
| import qualified Data.Set as S | |||||
| import qualified Data.Map as M | |||||
| #+END_SRC | |||||
| @@ -22,11 +22,10 @@ Nix user config.nix setup. | |||||
| name = "default"; | name = "default"; | ||||
| ignoreCollisions = true; | ignoreCollisions = true; | ||||
| paths = [ | paths = [ | ||||
| ack | |||||
| aria | aria | ||||
| aspell | aspell | ||||
| aspellDicts.en | aspellDicts.en | ||||
| bazaarTools | |||||
| cabal-install | |||||
| cacert | cacert | ||||
| clang | clang | ||||
| clang-analyzer | clang-analyzer | ||||
| @@ -41,7 +40,6 @@ Nix user config.nix setup. | |||||
| duply | duply | ||||
| emacs | emacs | ||||
| entr | entr | ||||
| gcc | |||||
| gdbm | gdbm | ||||
| ghostscript | ghostscript | ||||
| gist | gist | ||||
| @@ -55,12 +53,10 @@ Nix user config.nix setup. | |||||
| gnutls | gnutls | ||||
| graphviz-nox | graphviz-nox | ||||
| haskellPackages.ShellCheck | haskellPackages.ShellCheck | ||||
| haskellPackages.cabal-dependency-licenses | |||||
| haskellPackages.ghc-mod | haskellPackages.ghc-mod | ||||
| haskellPackages.hasktags | haskellPackages.hasktags | ||||
| haskellPackages.hindent | haskellPackages.hindent | ||||
| haskellPackages.hspec | haskellPackages.hspec | ||||
| haskellPackages.idris | |||||
| haskellPackages.pandoc | haskellPackages.pandoc | ||||
| htop | htop | ||||
| imagemagick | imagemagick | ||||
| @@ -74,11 +70,8 @@ Nix user config.nix setup. | |||||
| moreutils | moreutils | ||||
| mosh | mosh | ||||
| mr | mr | ||||
| multimarkdown | |||||
| multitail | multitail | ||||
| munge | munge | ||||
| mutt | |||||
| nox | |||||
| openssl | openssl | ||||
| p7zip | p7zip | ||||
| patchutils | patchutils | ||||
| @@ -98,7 +91,6 @@ Nix user config.nix setup. | |||||
| rtags | rtags | ||||
| silver-searcher | silver-searcher | ||||
| sloccount | sloccount | ||||
| sqlite | |||||
| sshpass | sshpass | ||||
| stack | stack | ||||
| texlive.combined.scheme-full | texlive.combined.scheme-full | ||||
| @@ -0,0 +1,14 @@ | |||||
| ;;-*-mode: emacs-lisp; coding: utf-8;-*- | |||||
| ;; File: default-macos.el | |||||
| ;; Copyright: 2017 Mitch Tishmack | |||||
| ;; Description: default options for macos | |||||
| (setq testing-p t) | |||||
| (setq macos-p t) | |||||
| (setq nix-p t) | |||||
| (setq tmux-p t) | |||||
| (setq git-p t) | |||||
| (setq emacs-p t) | |||||
| (setq zsh-p t) | |||||
| (setq mosh-p t) | |||||
| (setq haskell-p t) | |||||
| (setq perl-p t) | |||||
| @@ -0,0 +1 @@ | |||||
| (setq testing-p nil) | |||||
| @@ -0,0 +1 @@ | |||||
| (setq testing-p t) | |||||
| @@ -5,29 +5,26 @@ | |||||
| #+BABEL: :cache yes | #+BABEL: :cache yes | ||||
| #+PROPERTY: header-args :tangle yes :cache yes :comments no :padline no | #+PROPERTY: header-args :tangle yes :cache yes :comments no :padline no | ||||
| In the long long ago (2015), I used xstow and update-dotdee to construct my | |||||
| dotfiles from tiny pieces of files. | |||||
| In the third age of my dotfile setup (2015), I used xstow and update-dotdee to | |||||
| construct my dotfiles from tiny pieces of files as a sort of mini templating | |||||
| engine. | |||||
| I have since evolved to this setup. Originally the intention was to make it | |||||
| easy for me to compile dotfiles based on certain parameters. Aka, my dotfiles | |||||
| are the same for x, y, and z, whatever those are, but for certain cases z | |||||
| should have one section be different or added etc... as the case may be. | |||||
| I have since evolved to this setup. Originally the intention was to make it easy | |||||
| for me to compile dotfiles based on certain parameters. Aka, my dotfiles are the | |||||
| same for x, y, and z, whatever those are, but for certain cases z should have | |||||
| one section be different or added etc... as the case may be. | |||||
| Aka it was just a glorified program or templating system. | Aka it was just a glorified program or templating system. | ||||
| Since I already use org-mode to build my emacs configuration, | |||||
| why not just do the same for the dotfiles. Bonus, now I can have ALL | |||||
| my dotfiles in one logical file that can build itself. | |||||
| Since I already use org-mode to build my emacs configuration, why not just do | |||||
| the same for the dotfiles. | |||||
| So now if you want to look at my dotfiles, they're all in here. With one | |||||
| caveat that my emacs configuration is not. That is still separate. Mostly | |||||
| because it is large enough that it can stand on its own. | |||||
| So now if you want to look at my dotfiles, they're all here. | |||||
| * Use/Abuse | * Use/Abuse | ||||
| Use of this setup is somewhat simple or straightforward. | |||||
| There really is one step in general: | |||||
| Use of this setup is somewhat simple or straightforward. There really is one | |||||
| step in general: | |||||
| #+BEGIN_SRC sh :tangle no | #+BEGIN_SRC sh :tangle no | ||||
| make | make | ||||
| @@ -35,9 +32,9 @@ There really is one step in general: | |||||
| ** Emacs functions to add to init.el | ** Emacs functions to add to init.el | ||||
| For all this to work in emacs so you can edit source blocks you'll need | |||||
| add the following two functions otherwise you'll get an error every time | |||||
| you try to edit the source block. | |||||
| For all this to work in emacs so you can edit source blocks you'll need add the | |||||
| following two functions otherwise you'll get an error every time you try to edit | |||||
| the source block. | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | #+BEGIN_SRC emacs-lisp :tangle no | ||||
| (defun tangle/yn (p) (if (bound-and-true-p p) "yes" "no")) | (defun tangle/yn (p) (if (bound-and-true-p p) "yes" "no")) | ||||
| @@ -46,9 +43,9 @@ you try to edit the source block. | |||||
| This is also all the "magique" that this whole stupid repo entails. | This is also all the "magique" that this whole stupid repo entails. | ||||
| But how would you control how things get exported? Well that is done | |||||
| via files with simple *(setq predicate-p t)* lines inside them. These | |||||
| are all the *options/name.el* files comprise of. | |||||
| But how would you control how things get exported? Well that is done via files | |||||
| with simple *(setq predicate-p t)* lines inside them. These are all the | |||||
| *options/name.el* files comprise of. | |||||
| But lets say you want to export things to another directory than $HOME. No | But lets say you want to export things to another directory than $HOME. No | ||||
| worries, just specify DEST: | worries, just specify DEST: | ||||
| @@ -67,6 +64,12 @@ echo "(setq ${name}-p t)" > options/${name}.el | |||||
| echo "(setq ${name}-p nil)" > options/no-${name}.el | echo "(setq ${name}-p nil)" > options/no-${name}.el | ||||
| #+END_SRC | #+END_SRC | ||||
| Or, more easily/lazily using the option makefile target: | |||||
| #+BEGIN_SRC sh :tangle no | |||||
| make option NAME=predicate-name-without-p | |||||
| #+END_SRC | |||||
| And then provide the *name* (without the .el extension) to make via *OPTS*: | And then provide the *name* (without the .el extension) to make via *OPTS*: | ||||
| #+BEGIN_SRC sh :tangle no | #+BEGIN_SRC sh :tangle no | ||||
| @@ -83,12 +86,12 @@ Etc... | |||||
| I wouldn't do this exactly, while you could, thats just too much to need to | I wouldn't do this exactly, while you could, thats just too much to need to | ||||
| remember to type. The simplest way to do things is to just create an | remember to type. The simplest way to do things is to just create an | ||||
| *options/$(uname -n).el* file with all the options you need defined. Note that | |||||
| in the or *BEGIN_SRC* lines you can use elisp to control when/how something should or | |||||
| *options/$(uname -n).el* file with all the options you need defined. Note that in | |||||
| the or *BEGIN_SRC* lines you can use elisp to control when/how something should or | |||||
| should not get tangled. | should not get tangled. | ||||
| Example use of tangle/file, note the final option is just elisp and we just | |||||
| use *bound-and-true-p* to detect if we have a predicate or not. | |||||
| Example use of tangle/file, note the final option is just elisp and we just use | |||||
| *bound-and-true-p* to detect if we have a predicate or not. | |||||
| #+BEGIN_SRC emacs-lisp :tangle no | #+BEGIN_SRC emacs-lisp :tangle no | ||||
| (tangle/file "some/file/name" (bound-and-true-p macos-p)) | (tangle/file "some/file/name" (bound-and-true-p macos-p)) | ||||
| @@ -113,12 +116,12 @@ installing to some *DEST*, and want to copy that to *$HOME*? No worries: | |||||
| Where N is the generation you want to copy. | Where N is the generation you want to copy. | ||||
| Note, to ensure this doesn't by default overwrite hand edited files, a | |||||
| diff is run across the files that would be copied to and what the tangled | |||||
| version contains. | |||||
| Note, to ensure this doesn't by default overwrite hand edited files, a diff is | |||||
| run across the files that would be copied to and what the tangled version | |||||
| contains. | |||||
| Example, I've commented out some .gitignore lines in *~/.gitignore* manually | |||||
| and then tried to tangle a new generation over the top. | |||||
| Example, I've commented out some .gitignore lines in *~/.gitignore* manually and | |||||
| then tried to tangle a new generation over the top. | |||||
| #+BEGIN_SRC sh :tangle no | #+BEGIN_SRC sh :tangle no | ||||
| ./ddiff /Users/me/src/github.com/mitchty/dotfiles/generation/291 /Users/me | ./ddiff /Users/me/src/github.com/mitchty/dotfiles/generation/291 /Users/me | ||||
| @@ -138,28 +141,50 @@ differences between /Users/me/src/github.com/mitchty/dotfiles/generation/291 and | |||||
| #+END_SRC | #+END_SRC | ||||
| This is an attempt to ensure that we don't accidentally overwrite files that may | This is an attempt to ensure that we don't accidentally overwrite files that may | ||||
| have customizations on it. | |||||
| have manual customizations in them. | |||||
| To force it just run *make copy GEN=N* with *N* as the number to force a copy for. | |||||
| To forcibly overwrite the files just run *make copy GEN=N* with *N* as the number to | |||||
| force overwriting the destination files. | |||||
| ** How does it work? | ** How does it work? | ||||
| It is really rather simple, the [[file:Makefile][Makefile]] isn't that complex. Look at that | |||||
| for details. | |||||
| It is really rather simple, the [[file:Makefile][Makefile]] isn't that complex. Look at that for | |||||
| details. | |||||
| This isn't intended to cover everything. This could be considered a template for | |||||
| how you could setup your files in a similar way. Look at this org mode file for | |||||
| details. | |||||
| ** Removal of files between generations | |||||
| This isn't intended to cover everything. This could be considered a template | |||||
| for how you could setup your files in a similar way. Look at this org mode | |||||
| file for details. | |||||
| Removal of files is ultimately *YOUR* job. However... to make it possible to | |||||
| remove things if desired a bit easier you can run this makefile target with the | |||||
| *OLD* and *NEW* variables set: | |||||
| NOTE: Removal of files is YOUR job, not this tools. One could | |||||
| theoretically look at what changed between two generations and | |||||
| remove that way. BUT that sounds janky and error prone. Removal of | |||||
| files is the users job, not this setup. | |||||
| #+BEGIN_SRC sh :tangle no | |||||
| make removed OLD=generation NEW=generation | |||||
| #+END_SRC | |||||
| This will list all the files/directories recursively not in *OLD* compared to *NEW*. | |||||
| Example: | |||||
| #+BEGIN_SRC sh :tangle no | |||||
| $ make removed OLD=40 NEW=470 | |||||
| .Xdefaults | |||||
| .Xresources | |||||
| .ghc.hs | |||||
| escp | |||||
| essh | |||||
| flushdns | |||||
| tomod | |||||
| towip | |||||
| #+END_SRC | |||||
| ** Explanation of what is happening | ** Explanation of what is happening | ||||
| This allows me to tangle files that would be useful for linux/bsd/etc... | |||||
| without affecting the existing files. | |||||
| This allows me to tangle files that would be useful for linux/bsd/etc... without | |||||
| affecting the existing files. | |||||
| The general idea is this (look at Makefile for details): | The general idea is this (look at Makefile for details): | ||||
| - increment generation count from last generation | - increment generation count from last generation | ||||
| @@ -173,14 +198,14 @@ The general idea is this (look at Makefile for details): | |||||
| - Update last with current generation. | - Update last with current generation. | ||||
| Note, the destination can be anywhere, not just $HOME. This allows one to | Note, the destination can be anywhere, not just $HOME. This allows one to | ||||
| compile/tangle files that can then be trivially rsynced to remote machines, | |||||
| or to tar/xz the files as needed. The key here is emacs is only required | |||||
| to generate config files, not necessarily to use them. | |||||
| compile/tangle files that can then be trivially rsynced to remote machines, or | |||||
| to tar/xz the files as needed. The key here is emacs is only required to | |||||
| generate config files, not necessarily to use them. | |||||
| ** How would I use this? | ** How would I use this? | ||||
| Should be easy enough to either clone this repo or copy things to a new repo | |||||
| and hack in what you need. Your call. | |||||
| Should be easy enough to either clone this repo or copy things to a new repo and | |||||
| hack in what you need. Your call. | |||||
| But, say you have a heading, take .profile as an example, under an org mode | But, say you have a heading, take .profile as an example, under an org mode | ||||
| heading you would just add to your *BEGIN_SRC* definition like so: | heading you would just add to your *BEGIN_SRC* definition like so: | ||||
| @@ -196,8 +221,8 @@ that you put everything into *tmp*! This is used to generate things before a | |||||
| generation is built. It gives the Makefile a chance to know if the tangling | generation is built. It gives the Makefile a chance to know if the tangling | ||||
| worked or not. | worked or not. | ||||
| But lets say you don't need to have lots of sub headings, or even control | |||||
| a file in multiple subparts that have predicates to control things. | |||||
| But lets say you don't need to have lots of sub headings, or even control a file | |||||
| in multiple subparts that have predicates to control things. | |||||
| Pretty simple, just add a source block like normal: | Pretty simple, just add a source block like normal: | ||||
| #+BEGIN_SRC text :tangle no | #+BEGIN_SRC text :tangle no | ||||
| @@ -24,6 +24,9 @@ Tmux configuration. Pretty boring in most ways. | |||||
| set-window-option -g window-status-fg black | set-window-option -g window-status-fg black | ||||
| set-window-option -g window-status-current-bg white | set-window-option -g window-status-current-bg white | ||||
| # Selection highlight color | |||||
| set-window-option -g mode-style bg=red,fg=black | |||||
| # Status line options | # Status line options | ||||
| set-option -g status-bg black | set-option -g status-bg black | ||||
| set-option -g status-fg colour7 | set-option -g status-fg colour7 | ||||
| @@ -118,9 +121,6 @@ Tmux configuration. Pretty boring in most ways. | |||||
| # Non confirming kill pane plskthxbai | # Non confirming kill pane plskthxbai | ||||
| bind-key x kill-pane | bind-key x kill-pane | ||||
| # In case something I run exits straight away, i'd like to know about it. | |||||
| set-option -g set-remain-on-exit on | |||||
| # Lets change the prefix key so we don't clobber emacs back one char key | # Lets change the prefix key so we don't clobber emacs back one char key | ||||
| unbind-key C-b | unbind-key C-b | ||||
| @@ -151,3 +151,20 @@ Only set xclip for x setup. | |||||
| bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer" | bind C-p run "tmux set-buffer \"$(xclip -o)\"; tmux paste-buffer" | ||||
| bind C-y run "tmux save-buffer - | xclip -i" | bind C-y run "tmux save-buffer - | xclip -i" | ||||
| #+END_SRC | #+END_SRC | ||||
| Testing of battery stuff, defaults in general. | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p tmux-p) (bound-and-true-p testing-p))) | |||||
| set-option -g status-right-length 21 | |||||
| set-option -g status-right "#{battery_status_fg}#{battery_remain} #{battery_icon}#[fg=white] %a %H:%M:%S" | |||||
| set-option -g @batt_charged_icon "✓" | |||||
| run-shell ~/src/github.com/tmux-plugins/tmux-battery/battery.tmux | |||||
| #+END_SRC | |||||
| And for macos, differ in that the battery charged icon is utf-8 really. TODO: do I need this really? | |||||
| #+BEGIN_SRC conf :tangle (tangle/file ".tmux.conf" (and (bound-and-true-p testing-p) (bound-and-true-p tmux-p) (bound-and-true-p macos-p))) | |||||
| set-option -g status-right-length 20 | |||||
| set-option -g status-right "#{battery_remain} #{battery_icon} %a %H:%M:%S" | |||||
| run-shell ~/src/github.com/tmux-plugins/tmux-battery/battery.tmux | |||||
| #+END_SRC | |||||