diff options
Diffstat (limited to '')
| -rw-r--r-- | .Xresources | 5 | ||||
| -rw-r--r-- | .bashrc | 21 | ||||
| -rw-r--r-- | des/i3/config | 19 | ||||
| -rw-r--r-- | des/i3/i3blocks/config | 17 | ||||
| -rwxr-xr-x | des/i3/i3blocks/scripts/applefan (renamed from des/i3/i3blocks/scripts/fan) | 0 | ||||
| -rwxr-xr-x | des/i3/i3blocks/scripts/archupdates | 2 | ||||
| -rwxr-xr-x | des/i3/i3blocks/scripts/genfan | 14 | ||||
| -rwxr-xr-x | des/i3/i3blocks/scripts/memory | 4 | ||||
| -rwxr-xr-x | des/i3/i3blocks/scripts/temperature | 2 | ||||
| -rwxr-xr-x | des/i3/lockscreen.sh | 8 |
10 files changed, 68 insertions, 24 deletions
diff --git a/.Xresources b/.Xresources index c523790..f70b7ba 100644 --- a/.Xresources +++ b/.Xresources @@ -69,6 +69,11 @@ Xft.dpi: 185 URxvt*font: xft:Source Code Pro Medium:size=9 URxvt*italicFont: xft:Source Code Pro Medium:size=9:italic:autohint=true:pixelsize=9 URxvt*scrollBar: false +URxvt.letterSpace: -1 + +URxvt*scrollTtyOutput: false +URxvt*scrollWithBuffer: true +URxvt*scrollTtyKeypress: true URxvt.keysym.Shift-Control-V: eval:paste_clipboard URxvt.keysym.Shift-Control-C: eval:selection_to_clipboard @@ -5,26 +5,33 @@ # If not running interactively, don't do anything [[ $- != *i* ]] && return -# History size -HISTSIZE=1000000 +export HISTSIZE=-1 # generic setup function parse_git_branch () { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } +function show_opam_switch () { + current_switch="$(opam switch show)" + if [ ! -z "$current_switch" ] && [ "$current_switch" != "default" ]; then + echo $(echo $current_switch | rev | cut -d'/' -f1 | rev) "← " + fi +} + # mkdir and follow into dir function mkdirf () { mkdir -p $1 && cd $1 } # Customize prompt -if [ -n "$SSH_CLIENT" ]; then ssh_text="ssh" +if [ -n "$SSH_CLIENT" ]; then + ssh_text="ssh" fi if [ -z $STY ]; then - export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " + export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " else - export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " + export PS1="\[\033[0;34m\]\$(show_opam_switch)\[\033[36m\]\u\[\033[m\]@\[\033[32m\]$STY\[\033[36;1m\]#$ssh_text\[\033[32m\]:\[\033[33;1m\]\W\[\033[m\]\[\033[34;1m\]\$(parse_git_branch)\[\033[m\]$ " fi # Alias @@ -95,10 +102,10 @@ if [ -f "/etc/arch-release" ]; then fi source ~/.setup/.git-completion.bash -#source /usr/local/arcanist/resources/shell/bash-completion source ~/.setup/.bashrc.local +complete -cf sudo complete -C /usr/bin/vault vault complete -C /usr/bin/aws_completer aws complete -C /usr/bin/terraform terraform -alias please='python ~/workspace/imagine/infrastructure/scripts/please/please.py' +complete -C /usr/bin/packer packer diff --git a/des/i3/config b/des/i3/config index 085f814..c2f7209 100644 --- a/des/i3/config +++ b/des/i3/config @@ -19,6 +19,9 @@ font pango:monospace 8 # font pango:DejaVu Sans Mono 8 font pango:Source Code Pro 8 +# Order monitors +exec --no-startup-id xrandr --output DVI-D-0 --auto --output HDMI-0 --auto --left-of DVI-D-0 + # Background exec --no-startup-id feh --bg-fill ~/.setup/des/i3/assets/wallpaper/yosemite_color_block.png @@ -44,6 +47,12 @@ bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ to bindsym XF86MonBrightnessUp exec --no-startup-id brightnessctl set +5% && pkill -SIGRTMIN+9 i3blocks bindsym XF86MonBrightnessDown exec --no-startup-id brightnessctl set 5%- && pkill -SIGRTMIN+9 i3blocks +# Take a screenshot +bindsym --release $mod+F3 exec --no-startup-id "/usr/bin/import ~/scratch/screenshots/ss.png && cp ~/scratch/screenshots/latest.png ~/scratch/screenshots/$(date +%F_%T.%N).png" + +# Use change_fan (int .setup dir) to adjust fan speeds +# TBD + # Use format_displays (in .setup dir) to configure external displays bindsym XF86LaunchA exec --no-startup-id format_displays @@ -131,6 +140,16 @@ set $ws8 "8" set $ws9 "9" set $ws10 "10" +## AD2 Specific +# workspace $ws1 output HDMI-0 +# workspace $ws2 output DVI-D-0 + +# # switch to monitor +# bindsym $mod+Mod1+1 focus output eDP-1 +# bindsym $mod+Mod1+2 focus output DP-1 +# bindsym $mod+Mod1+3 focus output DP-2 +# bindsym $mod+Mod1+4 focus output HDMI-1 + # switch to workspace bindsym $mod+1 workspace $ws1 bindsym $mod+2 workspace $ws2 diff --git a/des/i3/i3blocks/config b/des/i3/i3blocks/config index 1866bb9..7ea5984 100644 --- a/des/i3/i3blocks/config +++ b/des/i3/i3blocks/config @@ -3,37 +3,28 @@ separator=false separator_block_width=15 markup=pango -[battery] -interval=1 -color=#a8afb0 - -[brightness] -interval=once -signal=9 -color=#ffff33 - [volume] instance=Master interval=once signal=10 color=#4ca2df -[fan] +[genfan] interval=1 color=#a8afb0 [bandwidth] -instance=wlp114s0 +instance=wlp114s0 #wlp11420 for laptop interval=1 # color=#859900 [memory] -label= +label= interval=1 color=#e6ccff [temperature] -label= +label= interval=10 color=#cb4b16 diff --git a/des/i3/i3blocks/scripts/fan b/des/i3/i3blocks/scripts/applefan index 84f1725..84f1725 100755 --- a/des/i3/i3blocks/scripts/fan +++ b/des/i3/i3blocks/scripts/applefan diff --git a/des/i3/i3blocks/scripts/archupdates b/des/i3/i3blocks/scripts/archupdates index 52538b0..b74f872 100755 --- a/des/i3/i3blocks/scripts/archupdates +++ b/des/i3/i3blocks/scripts/archupdates @@ -7,4 +7,4 @@ if [[ $PAC_UPDATES -gt 0 || $AUR_UPDATES -gt 0 ]]; then echo " [$PAC_UPDATES .. $AUR_UPDATES]" else echo "<span color=\"#586e75\"> 0</span>" -fi
\ No newline at end of file +fi diff --git a/des/i3/i3blocks/scripts/genfan b/des/i3/i3blocks/scripts/genfan new file mode 100755 index 0000000..7a52e8b --- /dev/null +++ b/des/i3/i3blocks/scripts/genfan @@ -0,0 +1,14 @@ +#!/usr/bin/bash + +FAN_RPMS=() +ICON_FAN="" + +IFS=$'\n' +for i in $(sensors | grep RPM); do + RPM=$(echo $i | awk '{print $2}') + if [ "$RPM" -ne "0" ]; then + FAN_RPMS+="$ICON_FAN $RPM " + fi +done + +echo "${FAN_RPMS[@]}" diff --git a/des/i3/i3blocks/scripts/memory b/des/i3/i3blocks/scripts/memory index e28af4e..20cebdd 100755 --- a/des/i3/i3blocks/scripts/memory +++ b/des/i3/i3blocks/scripts/memory @@ -38,9 +38,9 @@ awk -v type=$TYPE ' END { # full text if (type == "swap") - printf("%.1fG\n", (swap_total-swap_free)/1024/1024) + printf(" %.1fG\n", (swap_total-swap_free)/1024/1024) else - printf("%.1fG\n", mem_free/1024/1024) + printf(" %.1fG\n", mem_free/1024/1024) # TODO: short text diff --git a/des/i3/i3blocks/scripts/temperature b/des/i3/i3blocks/scripts/temperature index ad745c3..c47247e 100755 --- a/des/i3/i3blocks/scripts/temperature +++ b/des/i3/i3blocks/scripts/temperature @@ -56,7 +56,7 @@ close(SENSORS); $temperature eq -9999 and die 'Cannot find temperature'; # Print short_text, full_text -print "$temperature°C\n" x2; +print " $temperature°C\n" x2; # Print color, if needed if ($temperature >= $t_crit) { diff --git a/des/i3/lockscreen.sh b/des/i3/lockscreen.sh new file mode 100755 index 0000000..31e1451 --- /dev/null +++ b/des/i3/lockscreen.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +IMG=/tmp/screen_locked.png +scrot $IMG +mogrify -scale 10% -scale 1000% $IMG +i3lock -i $IMG + +xautolock -time 1 -locker "i3lock -i $IMG" -notify 20 -notifier 'xset dpms force off' & |
