diff --git a/dotfiles/config/gtk-3.0/gtk.css b/dotfiles/config/gtk-3.0/gtk.css index e0db194f..7c9d0cb2 100644 --- a/dotfiles/config/gtk-3.0/gtk.css +++ b/dotfiles/config/gtk-3.0/gtk.css @@ -21,9 +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) }; bind "space" { "delete-from-cursor" (whitespace, 1) "insert-at-cursor" (" ") }; diff --git a/dotfiles/config/systemd/user/git-sync@.service b/dotfiles/config/systemd/user/git-sync@.service new file mode 100644 index 00000000..0ce1a70d --- /dev/null +++ b/dotfiles/config/systemd/user/git-sync@.service @@ -0,0 +1,12 @@ +[Unit] +Description=git-sync %f %I %i + +[Service] +Type=simple +ExecStart=/usr/bin/env git_sync_directory.sh %f +ExecStop=/usr/bin/env pkill git_sync_directory.sh +Restart=always +RestartSec=3 + +[Install] +WantedBy=wm.target diff --git a/dotfiles/config/xmonad/.gitignore b/dotfiles/config/xmonad/.gitignore index c4c2ae98..e3382581 100644 --- a/dotfiles/config/xmonad/.gitignore +++ b/dotfiles/config/xmonad/.gitignore @@ -7,3 +7,4 @@ /xmonad.o /xmonad.state /prompt-history +/.cached-stack-install-path diff --git a/dotfiles/config/xmonad/imalison-xmonad.cabal b/dotfiles/config/xmonad/imalison-xmonad.cabal index 0850e817..4469c3c0 100644 --- a/dotfiles/config/xmonad/imalison-xmonad.cabal +++ b/dotfiles/config/xmonad/imalison-xmonad.cabal @@ -20,7 +20,6 @@ executable imalison-xmonad , directory>=1.2.6.2 , filepath>=1.4.1.0 , hostname>=1.0 - , mtl>=2.2.1 , multimap>=1.2.1 , process>=1.4.3.0 , split diff --git a/dotfiles/config/xmonad/xmonad.hs b/dotfiles/config/xmonad/xmonad.hs index 95468e81..3fa29662 100644 --- a/dotfiles/config/xmonad/xmonad.hs +++ b/dotfiles/config/xmonad/xmonad.hs @@ -6,7 +6,7 @@ module Main where import qualified Codec.Binary.UTF8.String as UTF8String (encode) import qualified Control.Arrow as A import Control.Monad -import Control.Monad.Trans +import Control.Monad.Trans.Class import Control.Monad.Trans.Maybe import Data.Aeson import qualified Data.ByteString.Lazy as B @@ -21,13 +21,12 @@ import Data.Tuple.Sequence (sequenceT) import Data.Typeable import Graphics.X11.ExtraTypes.XF86 import Network.HostName +import PagerHints import System.Directory import System.FilePath.Posix import System.Process -import PagerHints import Text.Printf import Unsafe.Coerce - import XMonad hiding ( (|||) ) import XMonad.Actions.CycleWS hiding (nextScreen) import XMonad.Actions.CycleWorkspaceByScreen diff --git a/dotfiles/emacs.d/README.org b/dotfiles/emacs.d/README.org index 648fe019..660a2253 100644 --- a/dotfiles/emacs.d/README.org +++ b/dotfiles/emacs.d/README.org @@ -1442,7 +1442,7 @@ The file server file for this emacs instance no longer exists.") (let ((server-dir (if server-use-tcp server-auth-dir server-socket-dir))) (expand-file-name server-name server-dir))) (setq server-use-tcp t) - (unless (equal nil (server-running-p)) (server-start)) + (when (equal nil (server-running-p)) (server-start)) (run-with-timer 0 60 'imalison:make-main-emacs-server))) #+END_SRC ** list-environment @@ -4380,7 +4380,7 @@ Not really sure what this is (setq deft-file-naming-rules '((noslash . "_") (nospace . "_") (case-fn . downcase))) - (setq deft-directory "~/SparkleShare/org/notes"))) + (setq deft-directory (imalison:join-paths imalison:org-dir "notes")))) #+END_SRC ** epg #+BEGIN_SRC emacs-lisp diff --git a/dotfiles/gitignore b/dotfiles/gitignore index 5223d35e..95e40732 100644 --- a/dotfiles/gitignore +++ b/dotfiles/gitignore @@ -1,4 +1,5 @@ # emacs +.#* .emacs.desktop .emacs* projectile.cache diff --git a/dotfiles/lib/bin/enable_git_sync.sh b/dotfiles/lib/bin/enable_git_sync.sh new file mode 100755 index 00000000..2e1ab9d1 --- /dev/null +++ b/dotfiles/lib/bin/enable_git_sync.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +git config --bool branch.master.sync true +git config --bool branch.master.syncNewFiles true +git branch --set-upstream-to=origin/master diff --git a/dotfiles/lib/bin/git_sync_directory.sh b/dotfiles/lib/bin/git_sync_directory.sh new file mode 100755 index 00000000..088a8a3d --- /dev/null +++ b/dotfiles/lib/bin/git_sync_directory.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env zsh + +echo "Syncing $1" +cd "$1" + +counter=0 +while true; do + changedFile=$(inotifywait ./ -r -e modify,move,create,delete --format "%w%f" --exclude '\.git' -t 20 2>/dev/null) + if [ -z "$changedFile" ] + then + counter=$((counter+1)) + if [ $counter -gt 4 ]; then + git-sync + counter=0 + else + git-sync > /dev/null + fi + else + echo "Syncing for: $changedFile" + { git check-ignore "$changedFile" > /dev/null; } || git-sync + fi +done diff --git a/dotfiles/lib/bin/pager.sh b/dotfiles/lib/bin/pager.sh index 9ecb528d..61643ab3 100755 --- a/dotfiles/lib/bin/pager.sh +++ b/dotfiles/lib/bin/pager.sh @@ -1,6 +1,6 @@ #!/usr/bin/env zsh if environment_variable_exists INSIDE_EMACS; then - emacs_pager "$@" + emacs_pager -a less "$@" else less -FXr fi diff --git a/dotfiles/lib/bin/rofi_systemd.sh b/dotfiles/lib/bin/rofi_systemd.sh index 5e1e0776..e92ac8ee 100755 --- a/dotfiles/lib/bin/rofi_systemd.sh +++ b/dotfiles/lib/bin/rofi_systemd.sh @@ -1,17 +1,23 @@ #!/usr/bin/env sh export SYSTEMD_COLORS=0 -term=${ROFI_SYSTEMD_TERM-termite -e} +term=${ROFI_SYSTEMD_TERM-urxvt -e} default_action=${ROFI_SYSTEMD_DEFAULT_ACTION-"list_actions"} -function user_units { - SYSTEMD_COLORS=0 systemctl --user list-unit-files | tail -n +2 | head -n -2 | - awk '{print $0 " user"}' +function unit_files { + systemctl "$1" list-unit-files --no-legend } -function system_units { - systemctl list-unit-files | tail -n +2 | head -n -2 | - awk '{print $0 " system"}' +# This is needed to list services started from template units +function running_units { + systemctl "$1" list-units --all --type=service --no-legend | + awk '{print $1 " " $3}' +} + + +function get_units { + { unit_files "--$1"; running_units "--$1"; } | sort -u -k1,1 | + awk -v unit_type="$1" '{print $0 " " unit_type}' } enable="Alt+e" @@ -68,7 +74,7 @@ function select_service_and_act { esac selection="$(echo $result | sed -n 's/ \+/ /gp')" - service_name="$(echo $selection | awk '{ print $1 }' | tr -d ' ')" + service_name=$(echo "$selection" | awk '{ print $1 }' | tr -d ' ') is_user="$(echo $selection | awk '{ print $3 }' )" case "$is_user" in @@ -86,22 +92,22 @@ function select_service_and_act { to_run="$(get_command_with_args)" echo "Running $to_run" - eval "$to_run" + eval "$term $to_run" } function get_command_with_args { case "$action" in "tail") - echo "$term 'journalctl $user_arg -u $service_name -f'" + echo "journalctl $user_arg -u '$service_name' -f" ;; "list_actions") action=$(echo "$all_actions" | rofi -dmenu -i -p "Select action: ") get_command_with_args ;; *) - echo "$command $action $service_name" + echo "$command $action '$service_name'" ;; esac } -{ user_units; system_units; } | column -tc 1 | select_service_and_act +{ get_units user; get_units system; } | column -tc 1 | select_service_and_act diff --git a/dotfiles/xprofile b/dotfiles/xprofile index ea51963e..82bcdf19 100644 --- a/dotfiles/xprofile +++ b/dotfiles/xprofile @@ -3,8 +3,8 @@ # If there are issues with path, check /etc/profile for hard overrides of PATH. . "$HOME/.lib/login.sh" # XXX: prevents https://github.com/xmonad/xmonad/issues/86 from affecting startup +rm -f ~/.xmonad -rm -f ~/.xmonad/xmonad.state load_xkb_map.sh run_if_exists systemctl --user import-environment XDG_DATA_DIRS diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 118502a6..aabb4f84 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -10,9 +10,26 @@ let pip ]; python-with-my-packages = pkgs.python3.withPackages my-python-packages; + udiskie-appindicator = pkgs.udiskie.overrideAttrs (oldAttrs: rec { + version = "1.7.5"; + src = pkgs.fetchFromGitHub { + owner = "coldfix"; + repo = "udiskie"; + rev = version; + sha256 = "1mcdn8ha5d5nsmrzk6xnnsqrmk94rdrzym9sqm38zk5r8gpyl1k4"; + }; + propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [pkgs.libappindicator-gtk3]; + }); + # clipit-master = pkgs.clipt.overrideAttrs (oldAttrs: rec { + # src = fetchFromGitHub { + # owner = "shantzu"; + # repo = "ClipIt"; + # rev = "eb9adaf2b5fd65aac1e83d6544b9076aae6af5b7"; + # sha256 = "01if8y93wa0mwbkzkzx2v1vqh47zlz4k1dysl6yh5rmppd1psknz"; + # }; + # }); in { - boot.loader.systemd-boot.enable = true; nixpkgs.config.allowUnfree = true; security.sudo.wheelNeedsPassword = false; networking.networkmanager.enable = true; @@ -76,12 +93,13 @@ in clipit compton feh - sddm-kcm networkmanagerapplet pinentry pommed_light rofi rofi-pass + sddm-kcm + udiskie-appindicator volnoti xclip xdotool @@ -107,6 +125,7 @@ in gnumake gnupg htop + inotify-tools ncdu pass python-with-my-packages @@ -118,10 +137,19 @@ in wmctrl zsh + # Nix + nix-prefetch-git + # Miscellaneous + android-udev-rules librsvg + transmission-gtk ]; + environment.variables = { + GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; + }; + # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; @@ -177,6 +205,9 @@ in sddm = { enable = true; }; + sessionCommands = '' + systemctl --user import-environment GDK_PIXBUF_MODULE_FILE + ''; }; }; diff --git a/nixos/machines/imalison-home.nix b/nixos/machines/imalison-home.nix index 53fd22b5..a3f78654 100644 --- a/nixos/machines/imalison-home.nix +++ b/nixos/machines/imalison-home.nix @@ -9,6 +9,7 @@ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; + boot.loader.systemd-boot.enable = true; fileSystems."/" = { device = "/dev/disk/by-uuid/110e3bf8-19b7-4a39-8e2a-b4c3c0d59d0e"; @@ -25,6 +26,11 @@ fsType = "ext4"; }; + # fileSystems."/shared" = { + # device = "/dev/disk/by-uuid/4b6f1ca8-6b68-4bdb-b92c-d2d7ba080928"; + # fsType = "ntfs"; + # }; + swapDevices = [ { device = "/dev/disk/by-uuid/a6933b22-c7f4-4c57-b330-1450f313922e"; } { device = "/dev/disk/by-uuid/dbd49a76-4b3e-4b5c-9a88-68a9e61f6210"; } diff --git a/rcm-link.sh b/rcm-link.sh index d17fe704..d4a7834f 100755 --- a/rcm-link.sh +++ b/rcm-link.sh @@ -5,4 +5,4 @@ export THIS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export DOTFILES_DIR="$(readlink -f $THIS_DIR/dotfiles)" echo $DOTFILES_DIR -rcup -d $DOTFILES_DIR -S "emacs.d" -S "config/taffybar" -S "config/xmonad" -S "config/xmonad/taffybar" -S "lib" +rcup -d $DOTFILES_DIR -S "emacs.d" -S "config/*" -S "lib" diff --git a/tasks/shell/enable_user_units.sh b/tasks/shell/enable_user_units.sh new file mode 100755 index 00000000..8c0fd8d4 --- /dev/null +++ b/tasks/shell/enable_user_units.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env sh + +enable_git_sync () { + unit_name=$(systemd-escape -p "$1" --template git-sync@.service) + echo $unit_name + systemctl --user enable "$unit_name" +} + + +cd "$HOME/.config/systemd/user/" +find * -type f | grep -v git-sync | grep -E "\.service$" | xargs -I unitname sh -c 'echo unitname && systemctl --user enable unitname' + +enable_git_sync "$HOME/org" +enable_git_sync "$HOME/config" +enable_git_sync "$HOME/.password-store"