dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit a3ca536d1306d17f02f1370b6ec9f759e4eeec13
parent dbf38326cfd463df104d3d2f45fc92251dbf4d44
Author: Janis Pagel <janis.pagel@ims.uni-stuttgart.de>
Date:   Mon,  9 Jul 2018 02:17:21 +0200

Add initial dotfiles

Diffstat:
MREADME.md | 5+++--
AXresources | 29+++++++++++++++++++++++++++++
Aconky/conkyrc_dwm | 71+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconky/conkyrc_i3 | 70++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconky/conkyrc_tmux | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aconky/conkyrc_vim | 91+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adotfiles.sh | 27+++++++++++++++++++++++++++
Ai3/config | 224+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Ai3status/config | 72++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Amoc/config | 8++++++++
Ataskrc | 31+++++++++++++++++++++++++++++++
Atmux.conf | 129+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Axinitrc | 60++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Azsh/zprofile | 20++++++++++++++++++++
Azsh/zsh_aliases | 96+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Azsh/zsh_functions | 24++++++++++++++++++++++++
Azsh/zshrc | 220+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
17 files changed, 1230 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md @@ -1 +1,3 @@ -# dotfiles- \ No newline at end of file +# dotfiles + +This is a collection of different dotfiles I'm using on my Arch Linux machine. I mainly use the repo to keep track of and sync my dotfiles, but I decided to make it public, since perhaps someone might find some of my setups useful. If so, please feel free to take and change the files to your own liking. diff --git a/Xresources b/Xresources @@ -0,0 +1,29 @@ +!! Appearance +URxvt.termName: rxvt-unicode +URxvt.scrollBar: false +URxvt.scrollTtyOutput: false +URxvt.internalBorder: 20 +!! Font preferenes +URxvt.font: xft:Inconsolata:size=14 +!! Larger history limit +URxvt.saveLines: 1000000 +URxvt*urgentOnBell: true +!! Molokai color scheme +URxvt*background: #101010 +URxvt*foreground: #d0d0d0 +URxvt*color0: #101010 +URxvt*color1: #960050 +URxvt*color2: #66aa11 +URxvt*color3: #c47f2c +URxvt*color4: #30309b +URxvt*color5: #7e40a5 +URxvt*color6: #3579a8 +URxvt*color7: #9999aa +URxvt*color8: #303030 +URxvt*color9: #ff0090 +URxvt*color10: #80ff00 +URxvt*color11: #ffba68 +URxvt*color12: #5f5fee +URxvt*color13: #bb88dd +URxvt*color14: #4eb4fa +URxvt*color15: #d0d0d0 diff --git a/conky/conkyrc_dwm b/conky/conkyrc_dwm @@ -0,0 +1,71 @@ +conky.config = { + +background=true, +use_xft=true, +font='Inconsolata:size=9', +xftalpha=0.8, +update_interval=1.0, +total_run_times=0, +own_window=true, +own_window_class='Conky', +own_window_type='override', +own_window_transparent=true, +own_window_colour='black', +own_window_hints='undecorated,sticky,skip_taskbar,skip_pager', +own_window_argb_visual=true, +double_buffer=true, +text_buffer_size=2048, +-- minimum_size 260 5, +draw_shades=false, +draw_outline=false, +draw_borders=false, +draw_graph_borders=true, +stippled_borders=0, +border_width=1.0, +default_color='white', +default_shade_color='black', +default_outline_color='black', +alignment='top_right', +gap_x=60, +gap_y=30, +uppercase=false, +cpu_avg_samples=1, +net_avg_samples=1, +override_utf8_locale=false, +use_spacer='none', +mpd_host='localhost', +-- mpd_password, +} + +conky.text = [[ + +${font}${color}dwm-6.1 shortcuts ${color #009bf9}$hr + +${color lightgrey}[Shift]+[Alt]+[Enter]${alignr}Start default terminal +[Alt]+[Number]${alignr}Switch to tag [Number] +[Shift]+[Alt]+[Number]${alignr}Move active window +${alignr}...to tag [Number] +[Shift]+[Alt]+[v]${alignr}Paste from clipboard +[Alt]+[Enter]${alignr}Toggle master and stack +[Alt]+[l]|[h]${alignr}Rezise master area +[Alt]+[j]|[k]${alignr}Toogle windows +[Alt]+[d]|[i]${alignr}Switch between horizontal +${alignr}...and vertical view +[Shift]+[Alt]+[c]${alignr}Cancel active window +[Alt]+[t]${alignr}Activate tiled mode +[Alt]+[f]${alignr}Activate floating mode +[Alt]+[m]${alignr}Activate monocle mode +[Shift]+[Alt]+[q]${alignr}Quit dwm + +${font}${color}Floating mode options $stippled_hr + +${color lightgrey}[Alt]+[right mouse button]${alignr}Rezise window +[Alt]+[left mouse button]${alignr}Move window +[Shift]+[Alt]+[Space]${alignr}Let window float +${alignr}...in tiled mode + +${font}${color}${exec dmenu -v} options ${color #009bf9}$hr + +${color lightgrey}[Alt]+[p]${alignr}Search for application +[Alt]+[Insert]${alignr}Show clipboard +]] diff --git a/conky/conkyrc_i3 b/conky/conkyrc_i3 @@ -0,0 +1,70 @@ +conky.config = { + +background=true, +use_xft=true, +font='Inconsolata:size=9', +xftalpha=0.8, +update_interval=1.0, +total_run_times=0, +own_window=true, +own_window_class='Conky', +own_window_type='override', +own_window_transparent=true, +own_window_colour='black', +own_window_hints='undecorated,sticky,skip_taskbar,skip_pager', +own_window_argb_visual=true, +double_buffer=true, +text_buffer_size=2048, +-- minimum_size 260 5, +draw_shades=false, +draw_outline=false, +draw_borders=false, +draw_graph_borders=true, +stippled_borders=0, +border_width=1.0, +default_color='white', +default_shade_color='black', +default_outline_color='black', +alignment='top_right', +gap_x=60, +gap_y=30, +uppercase=false, +cpu_avg_samples=1, +net_avg_samples=1, +override_utf8_locale=false, +use_spacer='none', +mpd_host='localhost', +-- mpd_password, +} + +conky.text = [[ + +$font$color${exec i3 -v | cut -d ' ' -f1,2,3} shortcuts ${color #009bf9}$hr + +${color lightgrey}MOD=[Super] + +${color lightgrey}[MOD]+[Enter]${alignr}Start default terminal +[MOD]+[Number]${alignr}Switch to tag [Number] +[Shift]+[MOD]+[Number]${alignr}Move active window +${alignr}...to tag [Number] +[MOD]+[Arrow_Left]|[Arrow_Right]${alignr}Toogle windows +[MOD]+[h]|[v]${alignr}Open next window in horizontal +${alignr}...or vertical view +[Shift]+[MOD]+[q]${alignr}Cancel active window +[MOD]+[f]${alignr}Activate fullscreen +[MOD]+[s]${alignr}Activate stack mode +[MOD]+[e]${alignr}Activate splitting mode +[MOD]+[w]${alignr}Activate tabbed mode +[Shift]+[MOD]+[r]${alignr}Reload i3 +[Shift]+[MOD]+[e]${alignr}Exit i3 + +${font}${color}Floating mode options $stippled_hr + +${color lightgrey}[MOD]+[r]${alignr}Rezise window +[MOD]+[Mouse_Button_Left]${alignr}Move window + +$font$color${exec dmenu -v} options ${color #009bf9}$hr + +${color lightgrey}[MOD]+[d]${alignr}Search for application +[MOD]+[Insert]${alignr}Show clipboard +]] diff --git a/conky/conkyrc_tmux b/conky/conkyrc_tmux @@ -0,0 +1,55 @@ +conky.config = { + +background=true, +use_xft=true, +font='Inconsolata:size=9', +xftalpha=0.8, +update_interval=1.0, +total_run_times=0, +own_window=true, +own_window_class='Conky', +own_window_type='override', +own_window_transparent=true, +own_window_colour='black', +own_window_hints='undecorated,sticky,skip_taskbar,skip_pager', +own_window_argb_visual=true, +double_buffer=true, +text_buffer_size=2048, +-- minimum_size 260 5, +draw_shades=false, +draw_outline=false, +draw_borders=false, +draw_graph_borders=true, +stippled_borders=0, +border_width=1.0, +default_color='white', +default_shade_color='black', +default_outline_color='black', +alignment='bottom_right', +gap_x=60, +gap_y=10, +uppercase=false, +cpu_avg_samples=1, +net_avg_samples=1, +override_utf8_locale=false, +use_spacer='none', +mpd_host='localhost', +-- mpd_password, +} + +conky.text = [[ + +$font$color${exec tmux -V} options ${color #009bf9}$hr + +${color lightgrey}MOD=[Ctrl]+[a] + +${color lightgrey}[MOD] [|]${alignr}Split window vertically +${color lightgrey}[MOD] [-]${alignr}Split window horizontally +${color lightgrey}[MOD] [ArrowKeys]${alignr}Switch between panes +${color lightgrey}[MOD] [PageUp|PageDown]${alignr}Scroll history +${color lightgrey}[MOD] [d]${alignr}Detach current session +${color lightgrey}[MOD] [s]${alignr}List sessions +${color lightgrey}[MOD] [w]${alignr}List windows +${color lightgrey}[MOD] [Number]${alignr}Goto window [Number] + +]] diff --git a/conky/conkyrc_vim b/conky/conkyrc_vim @@ -0,0 +1,91 @@ +conky.config={ +background=true, +use_xft=true, +font='Inconsolata:size=9', +xftalpha=0.8, +update_interval=1.0, +total_run_times=0, +own_window=true, +own_window_class='Conky', +own_window_type='override', +own_window_transparent=true, +own_window_colour='black', +own_window_hints='undecorated,sticky,skip_taskbar,skip_pager', +own_window_argb_visual=true, +double_buffer=true, +text_buffer_size=2048, +-- minimum_size 260 5 +draw_shades=false, +draw_outline=false, +draw_borders=false, +draw_graph_borders=true, +stippled_borders=0, +border_width=1.0, +default_color='white', +default_shade_color='black', +default_outline_color='black', +alignment='top_left', +gap_x=60, +gap_y=30, +uppercase=false, +cpu_avg_samples=1, +net_avg_samples=1, +override_utf8_locale=false, +use_spacer='none', +mpd_host='localhost', +-- mpd_password, +} + +conky.text=[[ + + + +$font$color${exec vim --version | head -1 | cut -d' ' -f1,5} shortcuts ${color #009bf9}$hr + +${font}${color}Normal mode $stippled_hr + +${color lightgrey}[hjkl]${alignr}Move cursor +[w]${alignr}Jump by start of words +[W]${alignr}Jump by words +[0]${alignr}Jump to start of line +[$$]${alignr}Junp to end of line +[gg]${alignr}Jump to top of page +[G]${alignr}Jump to bottom of page +[:num] [Enter]${alignr}Jump to line 'num' +[/foobar]${alignr}Search for 'foobar' +[?foobar]${alignr}Search backward for 'foobar' +[:%s/foo/bar/g]${alignr}Replace 'foo' through 'bar' +${alignr}in the whole document +[n]${alignr}Repeat search +[N]${alignr}Repeat search in opposite direction +[u]${alignr}Undo +[Ctrl]+[r]${alignr}Redo +[:w]${alignr}Save file +[:wq]${alignr}Save and quit +[:q]${alignr}Quit +[:q!]${alignr}Force quit + +${font}${color}Insert mode $stippled_hr + +${color lightgrey}[i]${alignr}Start insert mode +[a]${alignr}Append after cursor +[A]${alignr}Append at end of line +[o]${alignr}Append blank line below current line +[O]${alignr}Append blank line above current line +[cc]${alignr}Replace entire line +[Esc]${alignr}Exit insert mode + +${font}${color}Visual mode $stippled_hr + +${color lightgrey}[v]${alignr}Start visual mode +[Ctrl]+[v]${alignr}Start visual block mode +[y]${alignr}Copy marked text +[d]${alignr}Delete marked text +[yy]${alignr}Copy line +[dd]${alignr}Delete line +[p]${alignr}Paste clipboard +[x]${alignr}Delete current character +[X]${alignr}Delete previous character +[Esc]${alignr}Exit visual mode + +]] diff --git a/dotfiles.sh b/dotfiles.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +# Link dotfiles from git repo to their respective locations using rsync +GIT_REPO=$HOME/repos/dotfiles/ # Change if local repo location changes + +rsync -ac --progress $GIT_REPO/zsh/zshrc ~/.zshrc +rsync -ac --progress $GIT_REPO/zsh/zsh_functions ~/.zsh_functions +rsync -ac --progress $GIT_REPO/zsh/zprofile ~/.zprofile +rsync -ac --progress $GIT_REPO/zsh/zsh_aliases ~/.zsh_aliases + +rsync -ac --progress $GIT_REPO/xinitrc ~/.xinitrc + +rsync -ac --progress $GIT_REPO/i3/config ~/.config/i3/config +rsync -ac --progress $GIT_REPO/i3status/config ~/.config/i3status/config + +rsync -ac --progress $GIT_REPO/Xresources ~/.Xresources + +rsync -ac --progress $GIT_REPO/moc/config ~/.moc/config + +rsync -ac --progress $GIT_REPO/conky/conkyrc_dwm ~/.conky/.conkyrc_dwm +rsync -ac --progress $GIT_REPO/conky/conkyrc_i3 ~/.conky/.conkyrc_i3 +rsync -ac --progress $GIT_REPO/conky/conkyrc_tmux ~/.conky/.conkyrc_tmux +rsync -ac --progress $GIT_REPO/conky/conkyrc_vim ~/.conky/.conkyrc_vim + +rsync -ac --progress $GIT_REPO/tmux.conf ~/.tmux.conf + +rsync -ac --progress $GIT_REPO/taskrc ~/.taskrc diff --git a/i3/config b/i3/config @@ -0,0 +1,224 @@ +# i3 config file +# +# Please see https://i3wm.org/docs/userguide.html for a complete reference + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:Inconsolata 10 + +# Set mod keys +set $MOD Mod4 +set $SECONDARYMOD Mod1 + +# use these keys for focus, movement, and resize directions when reaching for +# the arrows is not convenient +set $up l +set $down k +set $left j +set $right semicolon + +# use Mouse+$MOD to drag floating windows to their wanted position +floating_modifier $MOD + +# Define terminal to be used by i3 +set $TERM urxvt +# start a terminal +bindsym $MOD+Return exec $TERM +# kill focused window +bindsym $MOD+Shift+q kill + +# start dmenu +bindsym $MOD+d exec dmenu_run + +# change focus +bindsym $MOD+$left focus left +bindsym $MOD+$down focus down +bindsym $MOD+$up focus up +bindsym $MOD+$right focus right + +# alternatively, you can use the cursor keys: +bindsym $MOD+Left focus left +bindsym $MOD+Down focus down +bindsym $MOD+Up focus up +bindsym $MOD+Right focus right + +# move focused window +bindsym $MOD+Shift+$left move left +bindsym $MOD+Shift+$down move down +bindsym $MOD+Shift+$up move up +bindsym $MOD+Shift+$right move right + +# alternatively, you can use the cursor keys: +bindsym $MOD+Shift+Left move left +bindsym $MOD+Shift+Down move down +bindsym $MOD+Shift+Up move up +bindsym $MOD+Shift+Right move right + +# split in horizontal orientation +bindsym $MOD+h split h + +# split in vertical orientation +bindsym $MOD+v split v + +# enter fullscreen mode for the focused container +bindsym $MOD+f fullscreen toggle + +# change container layout (stacked, tabbed, toggle split) +bindsym $MOD+s layout stacking +bindsym $MOD+w layout tabbed +bindsym $MOD+e layout toggle split + +# toggle tiling / floating +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+x focus child + +# move the currently focused window to the scratchpad +bindsym $MOD+Shift+minus move scratchpad + +# Show the next scratchpad window or hide the focused scratchpad window. +# If there are multiple scratchpad windows, this command cycles through them. +bindsym $MOD+minus scratchpad show + +# define workspaces +set $WS1 1:desk +set $WS2 2:term +set $WS3 3 +set $WS4 4 +set $WS5 5 +set $WS6 6 +set $WS7 7 +set $WS8 8 +set $WS9 9 +set $WS0 0:misc +set $WSCODE c:code +set $WSMAIL m:mail +set $WSWEB b:web +set $WSYT y:yt +set $WSTOP t:htop + +# switch to workspace +bindsym $MOD+1 workspace $WS1 +bindsym $MOD+2 workspace $WS2 +bindsym $MOD+3 workspace $WS3 +bindsym $MOD+4 workspace $WS4 +bindsym $MOD+5 workspace $WS5 +bindsym $MOD+6 workspace $WS6 +bindsym $MOD+7 workspace $WS7 +bindsym $MOD+8 workspace $WS8 +bindsym $MOD+9 workspace $WS9 +bindsym $MOD+0 workspace $WS0 +bindsym $MOD+c workspace $WSCODE +bindsym $MOD+m workspace $WSMAIL +bindsym $MOD+b workspace $WSWEB +bindsym $MOD+y workspace $WSYT +bindsym $MOD+t workspace $WSTOP + +# move focused container to workspace +bindsym $MOD+Shift+1 move container to workspace $WS1 +bindsym $MOD+Shift+2 move container to workspace $WS2 +bindsym $MOD+Shift+3 move container to workspace $WS3 +bindsym $MOD+Shift+4 move container to workspace $WS4 +bindsym $MOD+Shift+5 move container to workspace $WS5 +bindsym $MOD+Shift+6 move container to workspace $WS6 +bindsym $MOD+Shift+7 move container to workspace $WS7 +bindsym $MOD+Shift+8 move container to workspace $WS8 +bindsym $MOD+Shift+9 move container to workspace $WS9 +bindsym $MOD+Shift+0 move container to workspace $WS0 +bindsym $MOD+Shift+c move container to workspace $WSCODE +bindsym $MOD+Shift+m move container to workspace $WSMAIL +bindsym $MOD+Shift+b move container to workspace $WSWEB +bindsym $MOD+Shift+y move container to workspace $WSYT + +# reload the configuration file +#bindsym $MOD+Shift+c reload +# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) +bindsym $MOD+Shift+r restart +# exit i3 (logs you out of your X session) +bindsym $MOD+Shift+e exit + +# resize window (you can also use the mouse for that) +mode "resize" { + # These bindings trigger as soon as you enter the resize mode + + # Pressing left will shrink the window’s width. + # Pressing right will grow the window’s width. + # Pressing up will shrink the window’s height. + # Pressing down will grow the window’s height. + bindsym $left resize shrink width 10 px or 10 ppt + bindsym $down resize grow height 10 px or 10 ppt + bindsym $up resize shrink height 10 px or 10 ppt + bindsym $right resize grow width 10 px or 10 ppt + + # same bindings, but for the arrow keys + bindsym Left resize shrink width 10 px or 10 ppt + bindsym Down resize grow height 10 px or 10 ppt + bindsym Up resize shrink height 10 px or 10 ppt + bindsym Right resize grow width 10 px or 10 ppt + + # back to normal: Enter or Escape + bindsym Return mode "default" + bindsym Escape mode "default" +} + +# Enter resize mode +bindsym $MOD+r mode "resize" + +# Use keybinding to call the dmenu based clipmenu (ARCH AUR) +bindsym $MOD+Insert exec clipmenu + +# b like browser +bindsym $SECONDARYMOD+b exec firefox-nightly +# m like mail +bindsym $SECONDARYMOD+m exec --no-startup-id "i3-msg 'workspace $WSMAIL; exec $TERM -e mutt'" +# y like youtube +bindsym $SECONDARYMOD+y exec --no-startup-id "i3-msg 'workspace $WSYT; layout tabbed; exec $TERM -e mpsyt'" +# c like code +bindsym $SECONDARYMOD+c exec geany + +# Autostart +exec --no-startup-id "i3-msg 'workspace $WSTOP; exec $TERM -e htop; workspace back_and_forth'" + +# Assigments +# Puts window classes on specific workspaces +assign [class="Firefox"] $WSWEB +assign [class="Nightly"] $WSWEB +assign [class="Thunderbird"] $WSMAIL +assign [class="Atom"] $WSCODE +assign [class="RStudio"] $WSCODE +assign [class="Eclipse"] $WSCODE +assign [class="Geany"] $WSCODE + +# Make i3 handle tab-less browsers +for_window [class="Surf"] focus child, layout stacking, focus + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + position top status_command i3status + + colors { + background #222222 + statusline #cccccc + } +} + +# Make config i3-gaps-compatible by disabling window title bar and setting new border +for_window [class="^.*"] border pixel 1 + +################################# +# Configuration for i3-gaps +# Comment, if not using i3-gaps +################################# + +smart_gaps on # only display gaps when there is more than one container +smart_borders no_gaps # only draw borders if container is not the only one and gap size to edge is 0 +gaps inner 15 # set gap size +gaps outer 0 # Additional gap to screen border diff --git a/i3status/config b/i3status/config @@ -0,0 +1,72 @@ +# i3status configuration file. +# see "man i3status" for documentation. + +# It is important that this file is edited as UTF-8. +# The following line should contain a sharp s: +# ß +# If the above line is not correctly displayed, fix your editor first! + +general { + output_format = "i3bar" + colors = true + interval = 1 +} + +order += "disk /" +order += "wireless _first_" +order += "path_exists VPN" +order += "battery all" +order += "volume master" +order += "cpu_temperature 0" +order += "cpu_usage" +order += "load" +#order += "tztime local" +order += "tztime berlin" + +wireless _first_ { + format_up = "WiFi: (%quality at %essid) %ip" + format_down = "WiFi: down" +} + +battery all { + format = "%status %percentage" +} + +tztime local { + format = "%Z: %Y-%m-%dW%V%a%H:%M:%S" +} + +tztime berlin { + format = "%Z: %Y-%m-%dW%V%a%H:%M:%S" + timezone = "Europe/Berlin" +} + +load { + format = "LOAD: %1min" +} + +disk "/" { + format = "/ FREE: %avail (%percentage_avail)" +} + +volume master { + format = "VOL: %volume" + format_muted = "VOL: muted (%volume)" + device = "default" + mixer = "Master" + mixer_idx = 0 +} + +cpu_temperature 0 { + format = "T: %degrees°C" + path = "/sys/class/hwmon/hwmon0/temp1_input" +} + +path_exists VPN { + # path exists when a VPN tunnel launched by nmcli/nm-applet is active + path = "/proc/sys/net/ipv4/conf/tun0" + } + +cpu_usage { + format = "CPU: %usage" +} diff --git a/moc/config b/moc/config @@ -0,0 +1,8 @@ +# Themes are by default in /usr/share/moc/themes/ +# but moc also searches in ~/.moc/themes/ +# Theme when X is not running +Theme = red_theme +# Theme when X is running +XTermTheme = black_theme +SoundDriver = pulseaudio +Keymap = keymap diff --git a/taskrc b/taskrc @@ -0,0 +1,31 @@ +# [Created by task 2.5.1 7/2/2018 15:14:45] +# Taskwarrior program configuration file. +# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color', +# 'man task-sync' or 'man taskrc' + +# Here is an example of entries that use the default, override and blank values +# variable=foo -- By specifying a value, this overrides the default +# variable= -- By specifying no value, this means no default +# #variable=foo -- By commenting out the line, or deleting it, this uses the default + +# Use the command 'task show' to see all defaults and overrides + +# Files +data.location=~/.task + +# Color theme (uncomment one to use) +#include /usr/share/doc/task/rc/light-16.theme +#include /usr/share/doc/task/rc/light-256.theme +#include /usr/share/doc/task/rc/dark-16.theme +include /usr/share/doc/task/rc/dark-256.theme +#include /usr/share/doc/task/rc/dark-red-256.theme +#include /usr/share/doc/task/rc/dark-green-256.theme +#include /usr/share/doc/task/rc/dark-blue-256.theme +#include /usr/share/doc/task/rc/dark-violets-256.theme +#include /usr/share/doc/task/rc/dark-yellow-green.theme +#include /usr/share/doc/task/rc/dark-gray-256.theme +#include /usr/share/doc/task/rc/dark-gray-blue-256.theme +#include /usr/share/doc/task/rc/solarized-dark-256.theme +#include /usr/share/doc/task/rc/solarized-light-256.theme +#include /usr/share/doc/task/rc/no-color.theme + diff --git a/tmux.conf b/tmux.conf @@ -0,0 +1,129 @@ +######################################################### +######################################################### +######################################################### + +############################################# +########## re-binding ####################### +############################################# + +# remap prefix from 'C-b' to 'C-a' +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# split panes using | and - +bind | split-window -h +bind - split-window -v +unbind '"' +unbind % + +# reload config file +bind r source-file ~/.tmux.conf + +# key for switching to last used window +bind-key C-a last-window +bind-key C-y last-pane + +# switch panes using Alt-arrow without prefix +bind -n M-Left select-pane -L +bind -n M-Right select-pane -R +bind -n M-Up select-pane -U +bind -n M-Down select-pane -D + +################################################################## +###################### status bar ################################ +################################################################## + +set-option -g status on +# for tmux version < 2.1 +#set -g status-utf8 on +set -g status-interval 1 # default 15 secs + +# visual notification of activity in other windows +setw -g monitor-activity on +set -g visual-activity on + +# show host name and IP address on left side of status bar +set -g status-left-length 70 +set -g status-left "#[fg=green]:::: #[fg=white]#(whoami)@#h #[fg=green]:: #[fg=white]s #S #[fg=green]:: #[fg=white]w #I:#P**#{pane_current_command}** #[fg=green]:: " + +# show current uptime, user number, session name, window & pane number, date and time on right side of status bar +# --> sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' <-- removes all leading and closing whitespaces of a string +set -g status-right-length 100 +set -g status-right "#[fg=green]:: #[fg=white]uptime #(uptime | cut -d' ' -f3-5 | cut -d',' -f 1 | cut -d' ' -f 2-3 | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #[fg=green]:: #[fg=white]#(users | tr ' ' '\n' | uniq | wc -l | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') users #[fg=green]:: #[fg=white]#(date -u | awk '{print $1}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #[fg=white]- #[fg=white]#(date -u | awk '{print $3}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #(date -u | awk '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #(date -u | awk '{print $6}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #[fg=white]- #[fg=white]#(date -u | awk '{print $4}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #(date -u | awk '{print $5}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') #[fg=green]::::" + +# set the window info in the middle of the status bar +set -g status-justify centre +setw -g window-status-format "#I:#W" +setw -g window-status-current-format "#I:#W" +setw -g window-status-current-bg colour235 +setw -g window-status-current-fg white + +# color the status bar +set -g status-bg colour235 +set -g status-fg white +#set-option -g status-attr dim + +################################################################# +########################### windows ############################# +################################################################# + +# disable automatically renaming of window names + +set-window-option -g automatic-rename off +set-option -g allow-rename off + +# start with window 1 (default 0) +set -g base-index 1 + +################################################################## +####################### panes #################################### +################################################################## + +# for nice coloring of active pane +set-window-option -g window-style 'bg=#1F1F1F' +set-window-option -g window-active-style 'bg=black' +set-window-option -g pane-active-border-style '' + +# start with pane 1 (default 0) +set -g pane-base-index 1 + +########################################################### +###################### misc ############################### +########################################################### + +# for emacs commands in tmux + +setw -g mode-keys emacs + +# mouse mode + +# only for tmux < v2.1 +#set -g mode-mouse on +#set -g mouse-select-pane on + +set -g mouse on + +# allows scrolling in a tmux panel without going into scroll mode +bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e; send-keys -M'" + +# allows to choose panes by scrolling down into them +bind -n WheelDownPane select-pane -t= \; send-keys -M + +# sets the scroll back limit on a certain value +set-option -g history-limit 50000 + +# sets the default coding to utf-8 for tmux version < 2.1 +#set -g status-utf8 on +#set -g utf8 on + +# set default color + +set -g default-terminal "screen-256color" + +# shorten command delay +set -sg escape-time 1 + +################################################################## +################################################################## +################################################################## diff --git a/xinitrc b/xinitrc @@ -0,0 +1,60 @@ +#!/bin/bash -x + +xset +fp /usr/share/fonts/local +xset fp rehash + +xset -b # disable system bell + +eval `/usr/bin/ssh-agent` +if test -f /usr/lib/openssh/x11-ssh-askpass +then + SSH_ASKPASS=/usr/lib/openssh/x11-ssh-askpass ssh-add < /dev/null +fi + +xrdb -merge ~/.Xresources +xmodmap ~/.Xmodmap +setxkbmap -layout de # Set keyboard layout +sh ~/.fehbg & # Set background image +xbindkeys # Use cumstomized keybindings + +# Autostart +xautolock -time 30 -locker slock & # Automatic screen lock +clipmenud & # Nice clipboard using dmenu +pgrep redshift &> /dev/null || redshift -l 48:9 &> /dev/null & # For dimmed display at night +compton -bCG & # start compton +nohup mons -a > /dev/null 2>&1 & # Re-establishs the display if it detects only one monitor +#if tmux info &> /dev/null; then # if tmux server already running, attach to current session +# hash st && st -e tmux a & +#else +# hash st && st -e tmux & +#fi + +# Set status line for dwm +while true +do + if [ $(amixer get Master | tail -1 | awk '{ print $6 " " }' | tr -d '[' | tr -d ']') = 'on' ] + then + VOL="Vol=$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')" + elif [ $(amixer get Master | tail -1 | awk '{ print $6 " " }' | tr -d '[' | tr -d ']') = 'off' ] + then + VOL="Vol=muted" + fi + LOCALTIME=$(TZ=Europe/Berlin date +%Z\=%Y-%m-%dW%V%a%H:%M:%S) + UTC="("$(TZ=UTC date +%Z\=%Y-%m-%dW%V%a%H:%M:%S)")" + IP="IP=$(for i in `ip r`; do echo $i; done | grep -A 1 src | tail -n1)" + TEMP="Temp=$(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000))°C" + VERSION=$(echo 'dwm-6.1') # dwm -v does not work :( + BAT="Bat=$(acpi -b | awk '{ print $4 " " }' | tr -d ',' | tr -d ' ')" + + xsetroot -name "$IP $VOL $BAT $TEMP $LOCALTIME $VERSION" + sleep 1s +done & + +# Call conky depending on window manager +conky -b -c ~/.conky/.conkyrc_i3 && conky -b -c ~/.conky/.conkyrc_tmux && conky -b -c ~/.conky/.conkyrc_vim & +#conky -b -c ~/.conky/.conkyrc_dwm && conky -b -c ~/.conky/.conkyrc_tmux && conky -b -c ~/.conky/.conkyrc_vim & + +# Set window/desktop manager +#exec dwm +exec i3 +#exec qtile diff --git a/zsh/zprofile b/zsh/zprofile @@ -0,0 +1,20 @@ +################## +#### Basics ###### +################## + +# Source ~/.zshrc +source ~/.zshrc + +# Set path +typeset -U path +# Add ~/bin to path +# Add ruby scripts to path +path=(~/bin $(ruby -e 'print Gem.user_dir')/bin $path[@]) + +################ +## Variables ### +################ + +# set EDITOR and VISUAL variable +export EDITOR="vim" +export VISUAL="vim" diff --git a/zsh/zsh_aliases b/zsh/zsh_aliases @@ -0,0 +1,96 @@ +############################## +# Defining aliases +############################## + +# sudo alias +alias sudo='sudo -H' + +# mupdf alias +function __mupdf_function { mupdf 2>/dev/null "$1" & } +alias mu='__mupdf_function' + +# evince alias +function __evince_function { evince 2>/dev/null "$1" & } +alias ev='__evince_function' + +# rm/cp/mv alias + +alias rm='rm -I' +alias cp='cp -i' +alias mv='mv -i' + +# shutdown alias +alias shut='sudo shutdown -P now' +alias restart='sudo shutdown -r now' + +# emacs alias + +function __emacs_function { emacs -mm "$@" & } +alias e='__emacs_function' +alias enox='emacs -nw' + +# some color aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto --group-directories-first' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' +alias myls='ls -lhav' + +# xfst alias +alias xfst='~/tools/xfsm_api/linux64/bin/xfst' + +# lexc alias +alias lexc='~/tools/xfsm_api/linux64/bin/lexc' + +# Clear screen +alias c='clear && printf "\033c" && echo $(uname -srm)' +# screen clear alias that works for tmux too +alias ct='clear && printf "\033c" && tmux clearhist && echo $(uname -srm)' + +# startx +alias x='startx' + +# apache2 aliases +#alias apache2start='/usr/local/apache2/bin/apachectl -k start' +#alias apache2stop='/usr/local/apache2/bin/apachectl -k stop' +#alias apache2restart='/usr/local/apache2/bin/apachectl -k restart' + +# aliases for tar +alias targz='tar -czf' +alias untargz='tar -xzf' +alias tarxz='tar -cJf' +alias untarxz='tar -xJf' +alias tarbz2='tar -cjf' +alias untarbz2='tar -xjf' + +# alias for suspending +alias suspend='systemctl suspend' + +# alias for wifi hotspot +alias hotspot='sudo sh ~/bin/start-hotspot.sh' + +# alias for restarting wicd daemon +alias wicd-restart='sudo wicd restart' + +# alias for connecting with projectors +alias projector-connect='mons -m' +alias projector-reset='mons -o' + +# update mirror list +alias updatemirrorlist='sudo reflector --verbose -l 5 --sort rate --save /etc/pacman.d/mirrorlist' + +# aliases for pacman +alias showaurpkgs='pacman -Qm' +alias del-orphans='sudo pacman -Rsn $(pacman -Qdtq)' + +# git aliases +alias g='git' diff --git a/zsh/zsh_functions b/zsh/zsh_functions @@ -0,0 +1,24 @@ +# Show all 256 colors with color number +function spectrum_ls() { + for code in {000..255}; do + print -P -- "$code: %F{$code}Text%{$reset_color%}" + done +} + +# Helper function, simply prints current cursor position +function get_cursor_pos() { + echo -ne "\033[6n" + read -s -d\[ garbage + read -s -d R pos +} + +# Function for getting the number of stripped dirs in the prompt +function get_stripped_dir_count() { + COUNT=$(echo $PWD | grep -o "/" | wc -l) + SUB=$1 + RES=$(($COUNT - $SUB)) + echo $RES + unset COUNT + unset SUB + unset RES +} diff --git a/zsh/zshrc b/zsh/zshrc @@ -0,0 +1,220 @@ +######################## +#### Autocomplete ###### +######################## + +# Perform some sanity checks on completion option +autoload -Uz compinit +compinit + +zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' +zstyle ':completion:*' list-colors "${(s.:.)LS_COLORS}" +zstyle ':completion:*' rehash true +# Speed up completion +zstyle ':completion:*' accept-exact '*(N)' +zstyle ':completion:*' use-cache on +zstyle ':completion:*' cache-path ~/.zsh/cache + +# Get completion for hostname if in ~/.ssh/config +_hosts() { compadd $(getent hosts | tr -s ' ' '\t' | cut -f2) } + +####################### +### Options ########### +####################### + +setopt CORRECT # Make suggestions for correcting spelling mistakes +setopt EXTENDED_GLOB # Inlude ~ in globbing +setopt CASE_GLOB # Case sensitive globbing +setopt GLOB_COMPLETE # Use pattern matching for wildcards and ~ +setopt NUMERIC_GLOB_SORT # Sort numerically if numbers are present in globbing +setopt RC_EXPAND_PARAM # Expand globbing arrays to full names +setopt NO_BEEP # Disable system beeps +setopt MARK_DIRS # Always append trailing / to dirs +setopt APPEND_HISTORY # Append to history file instead of overwriting +setopt HIST_IGNORE_DUPS # Ignore adjacent history dups +setopt AUTO_CD # No need to type 'cd' if standard input is a valid path +setopt PROMPT_SUBST # Enable command substitution in prompt + +########################## +######## Basics ########## +########################## + +# Set history options +HISTFILE=~/.zhistory +HISTSIZE=1000 +SAVEHIST=500 + +# Source aliases +if [ -f ~/.zsh_aliases ]; then + source ~/.zsh_aliases +fi + +# Source fish-like syntax highlighting +if [ -f /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ]; then + source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +fi + +# Use history substring search +if [ -f /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh ]; then + source /usr/share/zsh/plugins/zsh-history-substring-search/zsh-history-substring-search.zsh + # bind UP and DOWN arrow keys to history substring search + zmodload zsh/terminfo + bindkey "$terminfo[kcuu1]" history-substring-search-up + bindkey "$terminfo[kcud1]" history-substring-search-down + bindkey '^[[A' history-substring-search-up + bindkey '^[[B' history-substring-search-down +fi + +# Enable colors +autoload -U colors +colors + +###################### +####### Prompt ####### +###################### + +# set prompt, with the extra functionality to strip leading dirs in the path +NUMOFTAILDIRS=2 # Setting it to e.g. 2 will result in only maximally two trailing dirs showing in path +PROMPT='%B[%b%n@%m %($((NUMOFTAILDIRS+1))~|<$(get_stripped_dir_count $NUMOFTAILDIRS)>/%$NUMOFTAILDIRS~|%~)%B]%b%# %E' + +# Print greeting message +echo $(uname -srm) +c # Clear screen + +################# +### Functions ### +################# + +# Source functions +if [ -f ~/.zsh_functions ]; then + source ~/.zsh_functions +fi + +################# +##### Misc ###### +################# + +# If tmux is running +if [ -n "$TMUX" ]; then + # create a global per-pane variable that holds the pane's PWD + export PS1=$PS1'$( [ -n $TMUX ] && tmux setenv -g TMUX_PWD_$(tmux display -p "#D" | tr -d %) $PWD)' +fi + +###### +# This whole git prompt stuff was taken from Manjaro's zsh setup, slightly modified +###### + +# Modify the colors and symbols in these variables as desired. +GIT_PROMPT_SYMBOL="%{$fg[blue]%}±" # plus/minus - clean repo +GIT_PROMPT_PREFIX="%{$fg[green]%}[%{$reset_color%}" +GIT_PROMPT_SUFFIX="%{$fg[green]%}]%{$reset_color%}" +GIT_PROMPT_AHEAD="%{$fg[red]%}ANUM%{$reset_color%}" # A"NUM" - ahead by "NUM" commits +GIT_PROMPT_BEHIND="%{$fg[cyan]%}BNUM%{$reset_color%}" # B"NUM" - behind by "NUM" commits +GIT_PROMPT_MERGING="%{$fg_bold[magenta]%}⚡%{$reset_color%}" # lightning bolt - merge conflict +GIT_PROMPT_UNTRACKED="%{$fg_bold[red]%}●%{$reset_color%}" # red circle - untracked files +GIT_PROMPT_MODIFIED="%{$fg_bold[yellow]%}●%{$reset_color%}" # yellow circle - tracked files modified +GIT_PROMPT_STAGED="%{$fg_bold[green]%}●%{$reset_color%}" # green circle - staged changes present = ready for "git push" + +parse_git_branch() { +# Show Git branch/tag, or name-rev if on detached head +( git symbolic-ref -q HEAD || git name-rev --name-only --no-undefined --always HEAD ) 2> /dev/null +} + +parse_git_state() { + # Show different symbols as appropriate for various Git repository states + # Compose this value via multiple conditional appends. + local GIT_STATE="" + local NUM_AHEAD="$(git log --oneline @{u}.. 2> /dev/null | wc -l | tr -d ' ')" + if [ "$NUM_AHEAD" -gt 0 ]; then + GIT_STATE=$GIT_STATE${GIT_PROMPT_AHEAD//NUM/$NUM_AHEAD} + fi + local NUM_BEHIND="$(git log --oneline ..@{u} 2> /dev/null | wc -l | tr -d ' ')" + if [ "$NUM_BEHIND" -gt 0 ]; then + GIT_STATE=$GIT_STATE${GIT_PROMPT_BEHIND//NUM/$NUM_BEHIND} + fi + local GIT_DIR="$(git rev-parse --git-dir 2> /dev/null)" + if [ -n $GIT_DIR ] && test -r $GIT_DIR/MERGE_HEAD; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_MERGING + fi + if [[ -n $(git ls-files --other --exclude-standard 2> /dev/null) ]]; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_UNTRACKED + fi + if ! git diff --quiet 2> /dev/null; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_MODIFIED + fi + if ! git diff --cached --quiet 2> /dev/null; then + GIT_STATE=$GIT_STATE$GIT_PROMPT_STAGED + fi + if [[ -n $GIT_STATE ]]; then + echo "$GIT_PROMPT_PREFIX$GIT_STATE$GIT_PROMPT_SUFFIX" + fi +} + +git_prompt_string() { + local git_where="$(parse_git_branch)" + + # If inside a Git repository, print its branch and state + [ -n "$git_where" ] && echo "$GIT_PROMPT_SYMBOL$(parse_git_state)$GIT_PROMPT_PREFIX%{$fg[yellow]%}${git_where#(refs/heads/|tags/)}$GIT_PROMPT_SUFFIX" + + # If not inside the Git repo, print exit codes of last command (only if it failed) + [ ! -n "$git_where" ] && echo "%{$fg[red]%} %(?..[%?])" +} + +# Right prompt with exit status of previous command if not successful + #RPROMPT="%{$fg[red]%} %(?..[%?])" +# Right prompt with exit status of previous command marked with ✓ or ✗ + RPROMPT="%(?.%{$fg[green]%}✓ %{$reset_color%}.%{$fg[red]%}✗ %{$reset_color%})" + +case $(basename "$(cat "/proc/$PPID/comm")") in + login) + RPROMPT="%{$fg[red]%} %(?..[%?])" + ;; + urxvt) + RPROMPT='$(git_prompt_string)' + # Use autosuggestion + if [ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then + source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' + fi + ;; + konsole|qterminal) + RPROMPT='$(git_prompt_string)' + ;; + *) + if $(ps -p$PPID| grep -q -e konsole -e qterminal); then + RPROMPT='$(git_prompt_string)' + else + RPROMPT='$(git_prompt_string)' + ## Base16 Shell color themes. + #possible themes: 3024, apathy, ashes, atelierdune, atelierforest, atelierhearth, + #atelierseaside, bespin, brewer, chalk, codeschool, colors, default, eighties, + #embers, flat, google, grayscale, greenscreen, harmonic16, isotope, londontube, + #marrakesh, mocha, monokai, ocean, paraiso, pop (dark only), railscasts, shapesifter, + #solarized, summerfruit, tomorrow, twilight + theme="monokai" + #Possible variants: dark and light + shade="dark" + BASE16_SHELL="/usr/share/zsh/scripts/base16-shell/base16-$theme.$shade.sh" + [[ -s $BASE16_SHELL ]] && source $BASE16_SHELL + # Use autosuggestion + if [ -f /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh ]; then + source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh + ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8' + fi + fi + ;; +esac + +# Color man pages +export LESS_TERMCAP_mb=$'\E[01;32m' +export LESS_TERMCAP_md=$'\E[01;32m' +export LESS_TERMCAP_me=$'\E[0m' +export LESS_TERMCAP_se=$'\E[0m' +export LESS_TERMCAP_so=$'\E[01;47;34m' +export LESS_TERMCAP_ue=$'\E[0m' +export LESS_TERMCAP_us=$'\E[01;36m' +export LESS=-r + +# Add support for GnuPG +export GPG_TTY=$(tty)