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

This commit is contained in:
Ivan Malison 2018-06-16 19:18:32 -07:00
commit 8c62a65c1c
16 changed files with 120 additions and 25 deletions

View File

@ -21,9 +21,7 @@
bind "<ctrl>d" { "delete-from-cursor" (chars, 1) };
bind "<alt>d" { "delete-from-cursor" (word-ends, 1) };
bind "<alt>BackSpace" { "delete-from-cursor" (word-ends, -1) };
bind "<alt>backspace" { "delete-from-cursor" (word-ends, -1) };
bind "<ctrl>k" { "delete-from-cursor" (paragraph-ends, 1) };
bind "<alt>backslash" { "delete-from-cursor" (whitespace, 1) };
bind "<alt>space" { "delete-from-cursor" (whitespace, 1)
"insert-at-cursor" (" ") };

View File

@ -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

View File

@ -7,3 +7,4 @@
/xmonad.o
/xmonad.state
/prompt-history
/.cached-stack-install-path

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,5 @@
# emacs
.#*
.emacs.desktop
.emacs*
projectile.cache

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
'';
};
};

View File

@ -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"; }

View File

@ -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"

View File

@ -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"