Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
anderspapitto committed Aug 11, 2018
1 parent 278f025 commit 657894a
Show file tree
Hide file tree
Showing 11 changed files with 94 additions and 158 deletions.
3 changes: 2 additions & 1 deletion base.nix
Expand Up @@ -12,6 +12,8 @@
];
};

documentation.man.enable = true;

environment.variables = { EDITOR = "editor"; };

networking = {
Expand All @@ -32,7 +34,6 @@
shellAliases = { ssh = "TERM=xterm-256color ssh"; };
};
ssh.startAgent = false;
man.enable = true;
};

services = {
Expand Down
32 changes: 14 additions & 18 deletions config/i3
Expand Up @@ -28,7 +28,7 @@ set $mod Mod4
bindsym $mod+Return exec anders-terminal
bindsym $mod+Shift+Return exec i3-sensible-terminal

bindsym $mod+s exec rofi -show run
bindsym $mod+d exec rofi -show run

bindsym F1 exec anders-handle-keybind F1
bindsym F2 exec anders-handle-keybind F2
Expand All @@ -39,34 +39,30 @@ bindsym F10 exec anders-handle-keybind F10
bindsym F11 exec anders-handle-keybind F11
bindsym F12 exec anders-handle-keybind F12

bindsym $mod+grave exec toggle-invert
bindsym $mod+Shift+grave exec global-toggle-invert

bindsym $mod+Shift+q kill

bindsym $mod+comma workspace prev
bindsym $mod+period workspace next

bindsym $mod+n exec i3-focus down
bindsym $mod+p exec i3-focus up
bindsym $mod+b exec i3-focus left
bindsym $mod+f exec i3-focus right
bindsym $mod+j exec i3-focus down
bindsym $mod+k exec i3-focus up
bindsym $mod+h exec i3-focus left
bindsym $mod+l exec i3-focus right

bindsym $mod+Shift+Tab focus left
bindsym $mod+Tab focus right
bindsym $mod+grave focus left

bindsym $mod+Shift+n move down
bindsym $mod+Shift+p move up
bindsym $mod+Shift+b move left
bindsym $mod+Shift+f move right

bindsym $mod+h split h
bindsym $mod+v split v
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+h move left
bindsym $mod+Shift+l move right

bindsym $mod+t fullscreen
bindsym $mod+s split h
bindsym $mod+v split v

bindsym $mod+u focus parent
bindsym $mod+d focus child
bindsym $mod+p focus parent
bindsym $mod+c focus child

# switch to workspace
bindsym $mod+1 workspace 1
Expand Down
2 changes: 1 addition & 1 deletion config/init.el
Expand Up @@ -108,7 +108,7 @@ and overlay is highlighted between MK and END-MK."
:init
(setq ivy-initial-inputs-alist '())
:config
(ivy-mode 1))
(ivy-mode 0))

;; Magit is awesome.
(use-package magit
Expand Down
2 changes: 1 addition & 1 deletion entrypoints/gurney.nix
Expand Up @@ -7,6 +7,7 @@
./dev-tools.nix
./emacs.nix
./fonts.nix
./games.nix
./gui-tools.nix
./hardware-configuration.nix
./inl-tools.nix
Expand All @@ -16,7 +17,6 @@
./nixpkgs.nix
./printing.nix
./redis.nix
./rulemak.nix
./syncthing.nix
./sysadmin.nix
./uefi.nix
Expand Down
2 changes: 1 addition & 1 deletion fonts.nix
Expand Up @@ -2,7 +2,7 @@

{ i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "colemak/en-latin9";
# consoleKeyMap = "colemak/en-latin9";
defaultLocale = "en_US.UTF-8";
};

Expand Down
1 change: 1 addition & 0 deletions gui-tools.nix
Expand Up @@ -26,6 +26,7 @@
pianobar
rofi
rxvt_unicode_with-plugins
signal-desktop
spotify
tuxguitar
vlc
Expand Down
132 changes: 69 additions & 63 deletions inl-tools.nix
@@ -1,6 +1,71 @@
{ config, pkgs, ... }:

{ environment.systemPackages = with pkgs; [
with pkgs;

let bluetoothScript = scriptName: regexPattern:
(writeScriptBin scriptName ''
#! ${bash}/bin/bash
set -x
export XDG_RUNTIME_DIR=/run/user/$UID
TRIES=0
until (bluetoothctl <<< show | grep -q 'Powered: yes')
do
bluetoothctl <<< 'power on'
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$DEVICE" ]
do
DEVICE=$(bluetoothctl <<< devices | egrep '^Device.*${regexPattern}' | awk '{ print $2 }')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until bluetoothctl <<< "connect $DEVICE"
do
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$TARGET_CARD" ]
do
TARGET_CARD=$(pacmd list-cards | grep 'name:' | egrep -o 'bluez.*[^>]')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until pacmd list-cards | egrep -q 'active profile: <a2dp_sink>'
do
pacmd set-card-profile $TARGET_CARD a2dp_sink
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$TARGET_SINK" ]
do
TARGET_SINK=$(pacmd list-sinks | grep 'name:' | egrep -o 'bluez.*[^>]')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
pactl set-sink-volume $TARGET_SINK 50%
pacmd set-default-sink $TARGET_SINK
for index in $(pacmd list-sink-inputs $TARGET_SINK | grep index | awk '{ print $2 }')
do
pacmd move-sink-input $index $TARGET_SINK
done
'');
in
{ environment.systemPackages = [
(writeScriptBin "anders-handle-keybind" ''
#! ${bash}/bin/bash
Expand Down Expand Up @@ -136,72 +201,13 @@
bluetoothctl <<< 'power off'
'')
(writeScriptBin "audio-bluetooth" ''
#! ${bash}/bin/bash
set -x
export XDG_RUNTIME_DIR=/run/user/$UID
TRIES=0
until (bluetoothctl <<< show | grep -q 'Powered: yes')
do
bluetoothctl <<< 'power on'
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$DEVICE" ]
do
DEVICE=$(bluetoothctl <<< devices | egrep '^Device.*OontZ' | awk '{ print $2 }')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until bluetoothctl <<< "connect $DEVICE"
do
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$TARGET_CARD" ]
do
TARGET_CARD=$(pacmd list-cards | grep 'name:' | egrep -o 'bluez.*[^>]')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until pacmd list-cards | egrep -q 'active profile: <a2dp_sink>'
do
pacmd set-card-profile $TARGET_CARD a2dp_sink
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
TRIES=0
until [ -n "$TARGET_SINK" ]
do
TARGET_SINK=$(pacmd list-sinks | grep 'name:' | egrep -o 'bluez.*[^>]')
[[ $((TRIES++)) -eq 20 ]] && exit 1
sleep 0.1
done
pactl set-sink-volume $TARGET_SINK 50%
pacmd set-default-sink $TARGET_SINK
for index in $(pacmd list-sink-inputs $TARGET_SINK | grep index | awk '{ print $2 }')
do
pacmd move-sink-input $index $TARGET_SINK
done
'')
(writeScriptBin "bluetooth-off" ''
#! ${bash}/bin/bash
set -x
bluetoothctl <<< 'power off'
'')
(bluetoothScript "bluetooth-tranya" "T1-L")
(bluetoothScript "bluetooth-oontz" "OontZ")
(writeScriptBin "dark-mode" ''
#! ${bash}/bin/bash
set -x
Expand All @@ -214,7 +220,7 @@
${redshift}/bin/redshift -O 2500
/run/wrappers/bin/sudo ${coreutils}/bin/tee /sys/class/backlight/intel_backlight/brightness <<< 500
'')
(writeScriptBin "light-mode" ''
(writeScriptBin "bright-mode" ''
#! ${bash}/bin/bash
set -x
${redshift}/bin/redshift -x
Expand Down
2 changes: 1 addition & 1 deletion nix.nix
Expand Up @@ -19,5 +19,5 @@
# [ "ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=" ];
};

system.stateVersion = "16.09";
system.nixos.stateVersion = "16.09";
}
59 changes: 0 additions & 59 deletions rulemak.nix

This file was deleted.

4 changes: 2 additions & 2 deletions sysadmin.nix
Expand Up @@ -2,7 +2,7 @@

{
boot = {
extraModulePackages = with config.boot.kernelPackages; [ sysdig ];
# extraModulePackages = with config.boot.kernelPackages; [ sysdig ];
};

environment.systemPackages = with pkgs; [
Expand All @@ -29,7 +29,7 @@
pciutils
psmisc
ripgrep
sysdig
# sysdig
tcpdump
tmux
tree
Expand Down
13 changes: 2 additions & 11 deletions x.nix
Expand Up @@ -71,8 +71,8 @@ in {
layout = "us";
# note typo in base.lst, where it says 'ctrl:ctrl_ralt' when it
# means 'ctrl:ralt_rctrl'
xkbOptions = "ctrl:ralt_rctrl, lv3:caps_switch, shift:both_capslock";
xkbVariant = "colemak";
xkbOptions = "ctrl:ralt_rctrl, lv3:caps_switch";
xkbVariant = "altgr-intl";
};
};

Expand Down Expand Up @@ -115,14 +115,5 @@ in {
${pkgs.xorg.xrdb}/bin/xrdb /etc/X11/xresources
exec sleep infinity
'';
breaktime = simpleXService "breaktime"
"reminder to take break"
''
while true
do
${pkgs.libnotify}/bin/notify-send "take a break"
sleep $((60 * 30))
done
'';
};
}

0 comments on commit 657894a

Please sign in to comment.