diff options
author | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-10-12 10:04:07 -0400 |
---|---|---|
committer | Kjetil Orbekk <kjetil.orbekk@gmail.com> | 2015-10-12 10:04:07 -0400 |
commit | f1ac8e846ce94e04339517a90ffd297bd901b44a (patch) | |
tree | 91f92f9d8e35c01b96ae40645cd7fce1db9b14e6 | |
parent | 59b0b39e30804a653d04866a1b3f9784610006fc (diff) | |
parent | 404e60caa500606d324a4021fb42321d118a5223 (diff) |
Merge branch 'master' of tesuji.6.orbekk.com:/storage/projects/dotfiles
-rwxr-xr-x | bin/brightness.sh | 22 | ||||
-rwxr-xr-x | bin/kj-setup.sh (renamed from bin/setup.sh) | 7 | ||||
-rwxr-xr-x | bin/kj-sync-keys.sh (renamed from bin/kj_sync_authorized_keys.sh) | 0 | ||||
-rw-r--r-- | i3/config | 10 | ||||
-rw-r--r-- | i3blocks.conf | 110 | ||||
-rw-r--r-- | spacemacs | 39 | ||||
-rw-r--r-- | xbindkeysrc-pincer | 14 | ||||
-rwxr-xr-x | zshrc | 2 |
8 files changed, 177 insertions, 27 deletions
diff --git a/bin/brightness.sh b/bin/brightness.sh new file mode 100755 index 0000000..7a2107d --- /dev/null +++ b/bin/brightness.sh @@ -0,0 +1,22 @@ +#!/bin/bash +readonly XBACKLIGHT=xbacklight + +current_level=$($XBACKLIGHT) +current_level=$((${current_level%.*})) + +if (( "$current_level" < 8 )); then + diff=1 +elif (( "$current_level" < 24 )); then + diff=6 +else + diff=10 +fi + +if [[ $1 == "+" ]]; then + $XBACKLIGHT -inc $diff +elif [[ $1 == "-" ]]; then + $XBACKLIGHT -dec $diff +else + echo "Usage: $0 +|-" + exit 1 +fi diff --git a/bin/setup.sh b/bin/kj-setup.sh index c054646..5058bb5 100755 --- a/bin/setup.sh +++ b/bin/kj-setup.sh @@ -7,7 +7,7 @@ none='\e[0m' cd # Check that things are in their right places. -if [[ ! -f dotfiles/bin/setup.sh ]]; then +if [[ ! -f dotfiles/bin/kj-setup.sh ]]; then printf "${red}[FAIL]${none} expected to find myself\n" exit 1 fi @@ -68,6 +68,7 @@ if which i3 >/dev/null; then mkdir -p .i3 create_symlink ../dotfiles/i3/config .i3/config create_symlink dotfiles/i3status.conf .i3status.conf + create_symlink dotfiles/i3blocks.conf .i3blocks.conf else printf "${orange}[SKIPPED]${none} i3 not installed.\n" fi @@ -87,3 +88,7 @@ if [[ "$success" == "1" ]]; then else printf "${red}[WARNING]${none} failed to install vim plugins\n" fi + +if which emacs >/dev/null && [[ ! -d .emacs.d ]]; then + git clone https://github.com/syl20bnr/spacemacs ~/.emacs.d +fi diff --git a/bin/kj_sync_authorized_keys.sh b/bin/kj-sync-keys.sh index b8be72d..b8be72d 100755 --- a/bin/kj_sync_authorized_keys.sh +++ b/bin/kj-sync-keys.sh @@ -74,12 +74,6 @@ bindsym $mod+Shift+space floating toggle # change focus between tiling / floating windows bindsym $mod+space focus mode_toggle -# focus the parent container -bindsym $mod+a focus parent - -# focus the child container -#bindsym $mod+d focus child - # switch to workspace bindsym $mod+1 workspace 1 bindsym $mod+2 workspace 2 @@ -161,12 +155,12 @@ mode "resize" { # Start i3bar to display a workspace bar (plus the system information i3status # finds out, if available) bar { - status_command i3status + status_command i3blocks || i3status font xft:Droid Sans Mono 8 } exec xrdb -merge $HOME/.Xresources -setxkbmap us -variant dvorak -option compose:ralt -option caps:ctrl_modifier +exec setxkbmap us -variant dvorak -option compose:ralt -option caps:ctrl_modifier exec $HOME/bin/keyboard_setup.sh exec xbindkeys exec xset -b diff --git a/i3blocks.conf b/i3blocks.conf new file mode 100644 index 0000000..24b0d10 --- /dev/null +++ b/i3blocks.conf @@ -0,0 +1,110 @@ +# i3blocks config file +# Global properties +# +# The top properties below are applied to every block, but can be overridden. +# Each block command defaults to the script name to avoid boilerplate. +command=/usr/lib/i3blocks/$BLOCK_NAME +separator_block_width=15 +markup=none + +# Volume indicator +# +# The first parameter sets the step (and units to display) +# The second parameter overrides the mixer selection +# See the script for details. +[volume] +label=♪ +instance=Master +#instance=PCM +interval=once +signal=10 + +[brightness] +label=☼ +command=xbacklight | awk -F. '{print $1}' +interval=once +signal=10 + +[disk] +label=/ +instance=/ +interval=300 + +# Network interface monitoring +# +# If the instance is not specified, use the interface used for default route. +# The address can be forced to IPv4 or IPv6 with -4 or -6 switches. +[iface] +label= +interval=20 +separator=false +signal=11 + +[wifi] +instance=wlp4s0 +label=W: +interval=20 +separator=false +signal=11 + +[ipv6] +label= +command=ip -6 a show scope global | grep -q global && echo -e "ipv6\nipv6\n#A8FF00" || echo -e "ipv4\nipv4\n#cc0000" +interval=20 +signal=11 + +[bandwidth] +#instance=eth0 +interval=30 +signal=11 + +[load_average] +interval=20 + +# Battery indicator +# +# The battery instance defaults to 0. +[battery] +#label=bat +label=⚡ +#instance=1 +interval=30 +separator=false + +[power] +label= +command=zsh -c '[[ $(cat /sys/class/power_supply/BAT0/status) == "Discharging" ]] && printf "%.2f W" $(( $(cat /sys/class/power_supply/BAT0/power_now) / 1000000.0 )) || echo ""' +color=77bb33 +interval=30 +signal=10 + +# Date Time +# +[time] +command=date '+%Y-%m-%d %H:%M' +interval=60 + +# Temperature +# +# Support multiple chips, though lm-sensors. +# The script may be called with -w and -c switches to specify thresholds, +# see the script for details. +[temperature] +label= +interval=60 + +# Key indicators +# +# Add the following bindings to i3 config file: +# +# bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks +# bindsym --release Num_Lock exec pkill -SIGRTMIN+11 i3blocks +#[keyindicator] +#instance=CAPS +#interval=once +#signal=11 + +#[keyindicator] +#instance=NUM +#interval=once +#signal=11 @@ -26,23 +26,31 @@ values." ;; auto-completion ;; better-defaults emacs-lisp - ;; git - ;; markdown - ;; org + shell + c-c++ + semantic + haskell + html + javascript + markdown + haskell + git + markdown + org ;; (shell :variables ;; shell-default-height 30 ;; shell-default-position 'bottom) ;; spell-checking - ;; syntax-checking + syntax-checking ;; version-control ) ;; List of additional packages that will be installed without being ;; wrapped in a layer. If you need some configuration for these ;; packages then consider to create a layer, you can also put the ;; configuration in `dotspacemacs/config'. - dotspacemacs-additional-packages '(haskell-mode) + dotspacemacs-additional-packages '(nyan-mode) ;; A list of packages and/or extensions that will not be install and loaded. - dotspacemacs-excluded-packages '() + dotspacemacs-excluded-packages '(smartparens) ;; If non-nil spacemacs will delete any orphan packages, i.e. packages that ;; are declared in a layer which is not a member of ;; the list `dotspacemacs-configuration-layers'. (default t) @@ -78,7 +86,7 @@ values." ;; List of themes, the first of the list is loaded when spacemacs starts. ;; Press <SPC> T n to cycle to the next theme in the list (works great ;; with 2 themes variants, one dark and one light) - dotspacemacs-themes '(base16-tomorrow-dark + dotspacemacs-themes '(base16-bright-dark spacemacs-dark spacemacs-light solarized-light @@ -94,7 +102,7 @@ values." :size 20 :weight normal :width normal - :powerline-scale 1.0) + :powerline-scale 1.1) ;; The leader key dotspacemacs-leader-key "SPC" ;; The leader key accessible in `emacs state' and `insert state' @@ -135,7 +143,7 @@ values." dotspacemacs-enable-paste-micro-state nil ;; Which-key delay in seconds. The which-key buffer is the popup listing ;; the commands bound to the current keystroke sequence. (default 0.4) - dotspacemacs-which-key-delay 0.4 + dotspacemacs-which-key-delay 0.2 ;; Which-key frame position. Possible values are `right', `bottom' and ;; `right-then-bottom'. right-then-bottom tries to display the frame to the ;; right; if there is insufficient space it displays it at the bottom. @@ -193,6 +201,14 @@ values." "Initialization function for user code. It is called immediately after `dotspacemacs/init'. You are free to put any user code." + ;; bind ctrl-w to backwards-kill-word when no region is selected + (global-set-key (kbd "C-w") 'backward-kill-word-or-kill-region) + + (defun backward-kill-word-or-kill-region (&optional arg) + (interactive "p") + (if (region-active-p) + (kill-region (region-beginning) (region-end)) + (backward-kill-word arg))) ) (defun dotspacemacs/user-config () @@ -200,7 +216,10 @@ user code." This function is called at the very end of Spacemacs initialization after layers configuration. You are free to put any user code." (add-hook 'haskell-mode-hook 'turn-on-haskell-indent) + (setq-default + vc-follow-symlinks nil + web-mode-code-indent-offset 2) + (nyan-mode) ) - ;; Do not write anything past this comment. This is where Emacs will ;; auto-generate custom variable definitions. diff --git a/xbindkeysrc-pincer b/xbindkeysrc-pincer index b1eccf0..a72b809 100644 --- a/xbindkeysrc-pincer +++ b/xbindkeysrc-pincer @@ -1,20 +1,20 @@ -"xbacklight -inc 10 && pkill -SIGUSR1 i3status" +"/home/orbekk/bin/brightness.sh + && pkill -RTMIN+10 i3blocks" XF86MonBrightnessUp -"xbacklight -dec 10 && pkill -SIGUSR1 i3status" +"/home/orbekk/bin/brightness.sh - && pkill -RTMIN+10 i3blocks" XF86MonBrightnessDown -"amixer -c 1 set Master 1dB- && pkill -SIGUSR1 i3status" +"amixer -c 1 set Master 1dB- && pkill -RTMIN+10 i3blocks" XF86AudioLowerVolume -"amixer -c 1 set Master 1dB+ && pkill -SIGUSR1 i3status" +"amixer -c 1 set Master 1dB+ && pkill -RTMIN+10 i3blocks" XF86AudioRaiseVolume -"amixer -c 1 set Master toggle && pkill -SIGUSR1 i3status" +"amixer -c 1 set Master toggle && pkill -RTMIN+10 i3blocks" XF86AudioMute -"amixer -c 1 set Mic toggle && pkill -SIGUSR1 i3status" +"amixer -c 1 set Mic toggle && pkill -RTMIN+10 i3blocks" XF86AudioMicMute -"i3lock -c 2A3462 && pkill -SIGUSR1 i3status" +"i3lock -c 2A3462" XF86Tools @@ -52,7 +52,7 @@ setopt DVORAK # alias ls="ls --color" if which gvim >/dev/null; then alias vi="gvim --remote" - alias e="gvim --remote" + alias e="emacsclient -n" fi alias ff="fileutil --gfs_user=gfp-reporting" alias diff=colordiff |