From c74365888889dacc403ec50a92180144a771bac4 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sun, 15 Oct 2017 17:29:31 +0200 Subject: Add i3blocks config --- Xresources/.Xresources/base | 3 +- bin/bin/mystatus | 9 ------ i3/.config/i3/config | 75 +++++++++++++++++++++++++++---------------- i3/.config/i3blocks/bin/email | 10 ++++++ i3/.config/i3blocks/bin/wifi | 7 ++++ i3/.config/i3blocks/config | 74 ++++++++++++++++++++++++++++++++++++++++++ mutt/.mutt/muttrc | 2 +- tmux/.tmux.conf | 2 +- vim/.vimrc | 2 +- 9 files changed, 143 insertions(+), 41 deletions(-) delete mode 100755 bin/bin/mystatus create mode 100755 i3/.config/i3blocks/bin/email create mode 100755 i3/.config/i3blocks/bin/wifi create mode 100644 i3/.config/i3blocks/config diff --git a/Xresources/.Xresources/base b/Xresources/.Xresources/base index c26105c..fa56375 100644 --- a/Xresources/.Xresources/base +++ b/Xresources/.Xresources/base @@ -24,13 +24,14 @@ URxvt.keysym.M-y: perl:clipboard:copy URxvt.keysym.M-p: perl:clipboard:paste URxvt.resize-font.smaller: C-minus URxvt.resize-font.bigger: C-plus -URxvt.fading: 35 ! Appearance /* URxvt*font: xft:DejaVu Sans Mono:size=12 */ URxvt*font: xft:monaco:size=11.5 URxvt*scrollBar: false URxvt*internalBorder: 0 +URxvt.fading: 35 + ! $TERM environment variable XTerm*termName: rxvt-256color diff --git a/bin/bin/mystatus b/bin/bin/mystatus deleted file mode 100755 index 00c9b9d..0000000 --- a/bin/bin/mystatus +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# shell script to prepend i3status with more stuff - -i3status | while : -do - read line - nmails=$(find $HOME/.mail -path '*/new/*' -type f -not -path '*/rss/*' | wc -l) - echo "Email: ${nmails} | $line" || exit 1 -done diff --git a/i3/.config/i3/config b/i3/.config/i3/config index 8aa5855..f47d2ee 100644 --- a/i3/.config/i3/config +++ b/i3/.config/i3/config @@ -62,10 +62,10 @@ bindsym $mod+v split h bindsym $mod+w split v # enter fullscreen mode for the focused container -bindsym $mod+z fullscreen +bindsym $mod+g fullscreen # change container layout (stacked, tabbed, toggle split) -bindsym $mod+g layout stacking +bindsym $mod+Shift+t layout stacking bindsym $mod+t layout tabbed bindsym $mod+s layout toggle split @@ -119,7 +119,7 @@ bindsym $mod+Shift+c reload bindsym $mod+Shift+r restart # exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'" +bindsym $mod+Shift+e exit # resize window (you can also use the mouse for that) mode "resize" { @@ -147,54 +147,73 @@ mode "resize" { bindsym $mod+r mode "resize" -# Start i3bar to display a workspace bar (plus the system information i3status -# finds out, if available) +for_window [class="^.*"] border pixel 2 + +# Green +set $color0 #112211 +set $color1 #223322 +set $color2 #225522 +set $color3 #337733 +set $color4 #11CC11 + +# Red +set $color0 #221111 +set $color1 #332222 +set $color2 #552222 +set $color3 #773333 +set $color4 #CC1111 + +# class border backgr. text indicator child_border +client.focused $color4 $color2 #ffffff $color3 $color4 +client.background #ffffff + bar { - status_command $HOME/bin/mystatus - mode hide + status_command i3blocks modifier none + + colors { + # border bg text + focused_workspace $color3 $color2 #ffffff + background $color1 + } } + bindsym $mod+m bar mode toggle # Workspaces -bindsym $mod+Tab workspace back_and_forth -bindsym $mod+comma workspace prev -bindsym $mod+period workspace next -bindsym $mod+Shift+comma exec $HOME/bin/move_workspace p -bindsym $mod+Shift+period exec $HOME/bin/move_workspace n -bindsym $mod+n exec $HOME/bin/workspace n -bindsym $mod+Shift+n exec $HOME/bin/workspace m +bindsym $mod+Tab workspace back_and_forth +bindsym $mod+comma workspace prev +bindsym $mod+period workspace next +bindsym $mod+Shift+comma exec $HOME/bin/move_workspace p +bindsym $mod+Shift+period exec $HOME/bin/move_workspace n +bindsym $mod+n exec $HOME/bin/workspace n +bindsym $mod+Shift+n exec $HOME/bin/workspace m # Programs shortcuts bindsym $mod+b exec --no-startup-id qutebrowser bindsym $mod+i exec $HOME/bin/vimin bindsym Print exec xfce4-screenshooter -# Pulse Audio controls -bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ -bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- -bindsym XF86AudioMute exec amixer -D pulse sset Master 0% - -# Sreen brightness controls -bindsym XF86MonBrightnessUp exec light -A 10 +bindsym XF86AudioRaiseVolume exec amixer -D pulse sset Master 5%+ +bindsym XF86AudioLowerVolume exec amixer -D pulse sset Master 5%- +bindsym XF86AudioMute exec amixer -D pulse sset Master 0% +bindsym XF86MonBrightnessUp exec light -A 10 bindsym XF86MonBrightnessDown exec light -U 10 # Change wallpaper bindsym F11 exec --no-startup-id feh --bg-fill --randomize /usr/share/backgrounds # Custom scripts -bindsym XF86AudioPlay exec $HOME/bin/touchpad +bindsym XF86AudioPlay exec --no-startup-id $HOME/bin/touchpad bindsym $mod+semicolon exec --no-startup-id $HOME/bin/run -bindsym $mod+e exec --no-startup-id $HOME/bin/tmux_attach -bindsym $mod+o exec --no-startup-id $HOME/bin/references -bindsym $mod+Escape exec --no-startup-id "i3lock -c 000000 && systemctl suspend" -bindsym $mod+x exec --no-startup-id "rofi -show window" +bindsym $mod+e exec --no-startup-id $HOME/bin/tmux_attach +bindsym $mod+o exec --no-startup-id $HOME/bin/references +bindsym $mod+Escape exec --no-startup-id "i3lock -c 000000 && systemctl suspend" +bindsym $mod+x exec --no-startup-id "rofi -show window" # bindsym $mod+y # bindsym $mod+z # bindsym $mod+' -# bindsym $mod+m exec --no-startup-id $HOME/bin/i3-shell -for_window [class="^.*"] border pixel 2 # Gaps # workspace 1 gaps inner 5 diff --git a/i3/.config/i3blocks/bin/email b/i3/.config/i3blocks/bin/email new file mode 100755 index 0000000..ab875e0 --- /dev/null +++ b/i3/.config/i3blocks/bin/email @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +nMails=$(find $HOME/.mail -path '*/new/*' -type f -not -path '*/rss/*' -not -path '*/lists/*' | wc -l) +echo -e "${nMails}\n${nMails}" + +if [[ ${nMails} -eq 0 ]]; then + echo \#FFFFFF +else + echo \#00FF00 +fi diff --git a/i3/.config/i3blocks/bin/wifi b/i3/.config/i3blocks/bin/wifi new file mode 100755 index 0000000..2e47da2 --- /dev/null +++ b/i3/.config/i3blocks/bin/wifi @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +quality=$(lspci | grep -i Wireless | sed 's/^.*(rev \(.*\))/\1/') +ssid=$(iwconfig wlp2s0 | grep -oP '(?<=ESSID:").*(?=")') +address=$(ip addr show wlp2s0 | grep -oP -m1 "(?<=inet ).*(?=/)") + +echo "(${quality}% at ${ssid}) ${address}" diff --git a/i3/.config/i3blocks/config b/i3/.config/i3blocks/config new file mode 100644 index 0000000..af4d658 --- /dev/null +++ b/i3/.config/i3blocks/config @@ -0,0 +1,74 @@ +# i3blocks config file +# +# Please see man i3blocks for a complete reference! +# The man page is also hosted at http://vivien.github.io/i3blocks +# +# List of valid properties: +# +# align +# color +# command +# full_text +# instance +# interval +# label +# min_width +# name +# separator +# separator_block_width +# short_text +# signal +# urgent + +# 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 +interval=5 + +[email] +label=W: +command=~/dotfiles/i3/.config/i3blocks/bin/wifi +separator=true +interval=5 + +[wifi] +label=Mail: +command=~/dotfiles/i3/.config/i3blocks/bin/email +separator=true +interval=5 + +[disk] +label=HOME +interval=30 + +[cpu_usage] +label=CPU +interval=10 +min_width=CPU: 100.00% + +[battery] +label=BAT +interval=30 + +[time] +command=date '+%Y-%m-%d %H:%M' +interval=5 + +[mediaplayer] +instance=spotify +interval=5 +signal=10 diff --git a/mutt/.mutt/muttrc b/mutt/.mutt/muttrc index 0616803..c7a051f 100644 --- a/mutt/.mutt/muttrc +++ b/mutt/.mutt/muttrc @@ -60,7 +60,7 @@ auto_view text/html alternative_order text/plain text/enriched text/html # Editor -set editor="$EDITOR" +set editor="nvim" set include=yes # Macros diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 1954f8d..f866605 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -12,7 +12,7 @@ bind r source-file ~/.tmux.conf set -sg escape-time 0 set-option -g allow-rename off -is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' +is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?|mutt)(diff)?$"' bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" diff --git a/vim/.vimrc b/vim/.vimrc index fe64d99..4806194 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -212,7 +212,7 @@ let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsListSnippets="" let g:UltiSnipsSnippetDirectories=['UltiSnips', 'mySnippets'] let g:UltiSnipsSnippetsDir="~/.vim/mySnippets" -let g:UltiSnipsUsePythonVersion=3 +" let g:UltiSnipsUsePythonVersion=3 " Vimtex let g:vimtex_fold_enabled=0 -- cgit v1.2.3