commit 304f883c1ea78addf81cade2d4f75fc8475dd673 Author: hoellen Date: Thu Mar 1 00:47:14 2018 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b9b2b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# nvim folders +/config/nvim/*/ +# tmux plugins +/rc/tmux/tmux + +#nextcloud stuff +/._sync* +/.owncloud* + +/tmp diff --git a/README.MD b/README.MD new file mode 100644 index 0000000..8401be7 --- /dev/null +++ b/README.MD @@ -0,0 +1,3 @@ +# hoellen/dotfiles + +This is not cleaned up. Still in development [WIP]. diff --git a/config/aliases b/config/aliases new file mode 100644 index 0000000..6a94556 --- /dev/null +++ b/config/aliases @@ -0,0 +1,58 @@ + +# +# aliases +# + +alias setclip='xclip -selection c' +alias getclip='xclip -selection clipboard -o' +alias open='xdg-open $1' +alias vi='nvim' +alias vim='nvim' + +alias l="ls -lFh" +alias la="ls -lAFh" +alias ll="ls -l" +alias ls='ls --color=auto' + +alias j="jump" + +# config files +alias zshrc="nvim ~/.zshrc" +alias bashrc="nvim ~/.bashrc" +alias aliases="nvim ~/.config/aliases" +alias nviminit="nvim ~/.config/nvim/init.vim" +alias i3conf="nvim ~/.i3/config" +alias bspwmconf="nvim ~/.config/bspwm/bspwmrc" +alias sxhkdconf="nvim ~/.config/sxhkd/sxhkdrc" +alias tmuxconf="nvim ~/.tmux.conf" + +# Git aliases +alias gs="git status" +alias gd="git diff" +alias gdh="git diff HEAD" +alias gc="git clone $1 $2" +alias gcm="git commit -m "$1"" +alias gaa="git add -A ." +alias gpo="git push origin $1" +alias glo="git log --oneline" +alias grhh="git reset --hard HEAD" +alias gcp="git cherry-pick $1" + +# npm aliases +#alias ni="npm install"; +#alias niS="npm i -S " +#alias niD="npm i -D " +#alias nrs="npm run start"; +#alias nrb="npm run build"; +#alias nrt="npm run test"; + +alias xres="xrdb ~/.Xresources" + +# Pacman +alias pacman="pacman --color=auto $@" +alias pm="pacman $@" +alias pms="pacman -Ss $@" +alias pmi="sudo pacman -S --color=auto $@" +alias pmu="sudo pacman -Syu $@" +alias cower="cower --color=auto $@" + diff --git a/config/bspwm/bspwmrc b/config/bspwm/bspwmrc new file mode 100755 index 0000000..a4f704b --- /dev/null +++ b/config/bspwm/bspwmrc @@ -0,0 +1,63 @@ +#! /bin/sh + +sxhkd & + +bspc monitor -d web term code IV V VI VII VIII IX music + +bspc config border_width 2 +bspc config window_gap 12 + +bspc config split_ratio 0.52 +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config click_to_focus true + +bspc rule -a Gimp desktop='^8' state=floating follow=on +#bspc rule -a Chromium desktop='^2' +#bspc rule -a mplayer2 state=floating +#bspc rule -a Kupfer.py focus=on +#bspc rule -a Screenkey manage=off +bspc rule -a Nautilus state=floating +bspc rule -a Gedit state=floating +bspc rule -a Gnome-system-monitor state=floating +bspc rule -a Nextcloud desktop='^9' state=floating + +# set wallpaper +feh --bg-scale ~/Bilder/Wallpapers/wallpaper.jpg + +# map CAPS LOCK to CTRL +xmodmap -e "remove Lock = Caps_Lock" +xmodmap -e "keysym Caps_Lock = Control_L" +#xmodmap -e "add Lock = Shift_L + Shift_R" + +# toggle keyboard language de, us with alt+shift +setxkbmap -option grp:alt_space_toggle de,us + +#xmodmap -e "add Control = Caps_Lock" +#xmodmap -e "add Lock = Shift_L+Shift_R" +#remove Control = Control_L +#keysym Control_L = Caps_Lock +#keysym Caps_Lock = Control_L +#add Lock = Caps_Lock + +# enable touchpad tap-to-click +#xinput set-prop 12 276 1 +$HOME/.dotfiles/scripts/touchpad_enable_tapping.sh +# set default mouse cursor (no X) +xsetroot -cursor_name left_ptr + +# move/resize window with alt + mouse +bspc config pointer_modifier mod1 + +# compton (effects) +compton --config ~/.config/bspwm/compton.conf -b & + +# autolock after 5 min +xautolock -time 5 -locker '~/.dotfiles/scripts/lock.sh' & + +# panel +polybar top & +polybar bottom & + +# autostart +$HOME/.dotfiles/scripts/autostart.sh & diff --git a/config/bspwm/compton.conf b/config/bspwm/compton.conf new file mode 100644 index 0000000..92a02db --- /dev/null +++ b/config/bspwm/compton.conf @@ -0,0 +1,71 @@ +backend = "glx"; +glx-no-stencil = true; +glx-copy-from-front = false; +glx-swap-method = 1; +##blur-background = true; +##blur-kern = "7x7box"; + +# Shadow +shadow = true; # Enabled client-side shadows on windows. +no-dock-shadow = true; # Avoid drawing shadows on dock/panel windows. +no-dnd-shadow = true; # Don't draw shadows on DND windows. +clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental). +shadow-radius = 2; # The blur radius for shadows. (default 12) +shadow-offset-x = 1; # The left offset for shadows. (default -15) +shadow-offset-y = 1; # The top offset for shadows. (default -15) +shadow-opacity = 0.6; +menu-opacity = 1; +shadow-exclude = [ + #"! name~=''", + "n:e:Notification", + "n:e:Dunst", + "n:e:dzen", + "name = 'dzen slave'", + "name = 'gnome-screenshot'", + #"n:e:Docky", + #"g:e:Synapse", + #"g:e:Kupfer", + "g:e:Conky", + #"n:w:Firefox", + "n:w:*Chrome*", + #"n:w:*Chromium*", + "class_g ?= 'dzen'", + "class_g ?= 'gnome-screenshot'", + "class_g ?= 'Notify-osd'" + #"class_g ?= 'Cairo-dock'", + #"class_g ?= 'Xfce4-notifyd'", + #"class_g ?= 'Xfce4-power-manager'" +]; + +blur-background-exclude = [ + "name = 'gnome-screenshot'", + "class_g ?= 'gnome-screenshot'" +]; + +#opacity-rule = ["85:class_g = 'gnome-terminal'"]; +opacity-rule = [ + "50:class_g = 'Bspwm' && class_i = 'presel_feedback'", + "75:class_g = 'URxvt'" +]; + +# The shadow exclude options are helpful if you have shadows enabled. Due to the way compton draws its shadows, certain applications will have visual glitches +# (most applications are fine, only apps that do weird things with xshapes or argb are affected). +# This list includes all the affected apps I found in my testing. The "! name~=''" part excludes shadows on any "Unknown" windows, this prevents a visual glitch with the XFWM alt tab switcher. + +# Fading +fading = true; # Fade windows during opacity changes. +fade-delta = 4; # The time between steps in a fade in milliseconds. (default 10). +fade-in-step = 0.03; # Opacity change between steps while fading in. (default 0.028). +fade-out-step = 0.03; # Opacity change between steps while fading out. (default 0.03). +no-fading-openclose = false; # Fade windows in/out when opening/closing + +detect-client-opacity = true; # This prevents opacity being ignored for some apps. For example without this enabled my xfce4-notifyd is 100% opacity no matter what. + +#Window type settings +wintypes: +{ + tooltip = { fade = true; shadow = false; }; + menu = { shadow = false; }; + dropdown_menu = { shadow = false; }; + popup_menu = { shadow = false; }; +}; diff --git a/config/i3/config b/config/i3/config new file mode 100644 index 0000000..37d731d --- /dev/null +++ b/config/i3/config @@ -0,0 +1,163 @@ +# This file has been auto-generated by i3-config-wizard(1). +# It will not be overwritten, so edit it as you like. +# +# Should you change your keyboard layout some time, delete +# this file and re-run i3-config-wizard(1). +# + +# i3 config file (v4) +# +# Please see http://i3wm.org/docs/userguide.html for a complete reference! + +set $mod Mod4 + +# Font for window titles. Will also be used by the bar unless a different font +# is used in the bar {} block below. +font pango:monospace 8 + +# This font is widely installed, provides lots of unicode glyphs, right-to-left +# text rendering and scalability on retina/hidpi displays (thanks to pango). +#font pango:DejaVu Sas Mono 8 +font pango:DejaVu Sas Mono 8 + +# Before i3 v4.8, we used to recommend this one as the default: +# font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1 +# The font above is very space-efficient, that is, it looks good, sharp and +# clear in small sizes. However, its unicode glyph coverage is limited, the old +# X core fonts rendering does not support right-to-left and this being a bitmap +# font, it doesn’t scale on retina/hidpi displays. + +# Use Mouse+$mod to drag floating windows to their wanted position +floating_modifier $mod + +# start a terminal +#bindsym $mod+Return exec i3-sensible-terminal +bindsym $mod+Return exec gnome-terminal + +# kill focused window +bindsym $mod+Shift+q kill + +# start dmenu (a program launcher) +###bindsym $mod+d exec dmenu_run +bindsym $mod+d exec rofi -show run +# There also is the (new) i3-dmenu-desktop which only displays applications +# shipping a .desktop file. It is a wrapper around dmenu, so you need that +# installed. +#bindsym $mod+d exec --no-startup-id i3-dmenu-desktop + +# change focus +#bindsym $mod+j focus left +#bindsym $mod+k focus down +#bindsym $mod+l focus up +#bindsym $mod+odiaeresis focus right +bindsym $mod+j focus down +bindsym $mod+k focus up +bindsym $mod+l focus right +bindsym $mod+h focus left + +# 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+j move down +bindsym $mod+Shift+k move up +bindsym $mod+Shift+l move right +bindsym $mod+Shift+h move left + +# 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+minus 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+d focus child + +# switch to workspace +bindsym $mod+1 workspace 1 +bindsym $mod+2 workspace 2 +bindsym $mod+3 workspace 3 +bindsym $mod+4 workspace 4 +bindsym $mod+5 workspace 5 +bindsym $mod+6 workspace 6 +bindsym $mod+7 workspace 7 +bindsym $mod+8 workspace 8 +bindsym $mod+9 workspace 9 +bindsym $mod+0 workspace 10 + +# move focused container to workspace +bindsym $mod+Shift+1 move container to workspace 1 +bindsym $mod+Shift+2 move container to workspace 2 +bindsym $mod+Shift+3 move container to workspace 3 +bindsym $mod+Shift+4 move container to workspace 4 +bindsym $mod+Shift+5 move container to workspace 5 +bindsym $mod+Shift+6 move container to workspace 6 +bindsym $mod+Shift+7 move container to workspace 7 +bindsym $mod+Shift+8 move container to workspace 8 +bindsym $mod+Shift+9 move container to workspace 9 +bindsym $mod+Shift+0 move container to workspace 10 + +# 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 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'" + +# 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 h resize shrink width 10 px or 10 ppt + bindsym j resize grow height 10 px or 10 ppt + bindsym k resize shrink height 10 px or 10 ppt + bindsym l 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" +} + +bindsym $mod+r mode "resize" + +# Start i3bar to display a workspace bar (plus the system information i3status +# finds out, if available) +bar { + status_command i3status +} diff --git a/config/lemonbar/i3_lemonbar.sh b/config/lemonbar/i3_lemonbar.sh new file mode 100755 index 0000000..7838bdf --- /dev/null +++ b/config/lemonbar/i3_lemonbar.sh @@ -0,0 +1,85 @@ +#! /bin/bash +# +# I3 bar with https://github.com/LemonBoy/bar + +. $(dirname $0)/i3_lemonbar_config + +if [ $(pgrep -cx $(basename $0)) -gt 1 ] ; then + printf "%s\n" "The status bar is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +[ -e "${panel_fifo}" ] && rm "${panel_fifo}" +mkfifo "${panel_fifo}" + +# echo "=== Starting up bar at $(date +%c)" >> bar.log + +### EVENTS METERS + +# Window title, "WIN" +xprop -spy -root _NET_ACTIVE_WINDOW | sed -un 's/.*\(0x.*\)/WIN\1/p' > "${panel_fifo}" & + +# i3 Workspaces, "WSP" +$(dirname $0)/i3_workspaces.py > ${panel_fifo} & + +# IRC, "IRC" +# only for init +# ~/bin/irc_warn & + +# Conky, "SYS" +conky -c $(dirname $0)/i3_lemonbar_conky > "${panel_fifo}" & + +### UPDATE INTERVAL METERS +cnt_vol=${upd_vol} +cnt_mail=${upd_mail} +cnt_mpd=${upd_mpd} +cnt_bat=${upd_bat} +cnt_win=${upd_win} + +while :; do + + # Volume, "VOL" + if [ $((cnt_vol++)) -ge ${upd_vol} ]; then + echo "VOL$(alsa-status)" > "${panel_fifo}" & + cnt_vol=0 + fi + + # GMAIL, "GMA" + # if [ $((cnt_mail++)) -ge ${upd_mail} ]; then + # printf "%s%s\n" "GMA" "$(~/bin/gmail.sh)" > "${panel_fifo}" + # cnt_mail=0 + # fi + + # MPD + if [ $((cnt_mpd++)) -ge ${upd_mpd} ]; then + #printf "%s%s\n" "MPD" "$(ncmpcpp --now-playing '{%a - %t}|{%f}' | head -c 60)" > "${panel_fifo}" + printf "%s%s\n" "MPD" "$(mpc current -f '[[%artist% - ]%title%]|[%file%]' 2>&1 | head -c 70)" > "${panel_fifo}" + cnt_mpd=0 + fi + + # Battey, "BAT" + if [ $((cnt_bat++)) -ge ${upd_bat} ]; then + echo "$(batstat)" > "${panel_fifo}" & + cnt_bat=0 + fi + + # Periodic Window title update (Ticket #1) + if [ $((cnt_win++)) -ge ${upd_win} ]; then + echo "WIN`mywin`" > "${panel_fifo}" & + cnt_win=0 + fi + + # Finally, wait 1 second + sleep 1s; + +done & + +#### LOOP FIFO + +cat "${panel_fifo}" | $(dirname $0)/i3_lemonbar_parser.sh \ + | bar -p -f "${font}" -f "${iconfont}" -f "${plfont}" -g "${geometry}" -B "${color_back}" -F "${color_fore}" & + +wait + diff --git a/config/lemonbar/i3_lemonbar_config b/config/lemonbar/i3_lemonbar_config new file mode 100644 index 0000000..1fb7f96 --- /dev/null +++ b/config/lemonbar/i3_lemonbar_config @@ -0,0 +1,132 @@ +#!\bin\bash +# i3 panel config. Powerline style. + +panel_fifo="/tmp/i3_lemonbar_${USER}" +geometry="x14" +#font="-xos4-terminesspowerline-medium-r-normal--12-120-72-72-c-60-iso10646-1" +#font="--powerlinesymbols-medium-----------" +iconfont="-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1" +res_w=$(xrandr | grep "current" | awk '{print $8a}') + +# Alarm settings +cpu_alert=75 # % cpu use +net_alert=5 # K net use + +# update setting, in seconds (conky update in i3_lemonbar_conky +upd_vol=3 # Volume update +upd_mail=300 # Mail check update +upd_mpd=5 # MPD song update +upd_bat=5 # Battey update +upd_win=1 # Window title (xprop -spy only updates on focus change) + +# --- APPLY XRES BEGIN +c_red_l="#ffCC6666" +c_green_l="#ffBDE077" +c_cyan_d="#ff72AD8C" +c_cursor="#fffff000" +c_yellow_d="#ffFEA63C" +c_green_d="#ffB7CE42" +c_yellow_l="#ffFFE863" +c_foreground="#ffddeedd" +c_blue_l="#ffAACCBB" +c_magenta_l="#ffff5879" +c_black_d="#ff25374A" +c_background="#ff131D24" +c_magenta_d="#ffF26B9E" +c_black_l="#ff3A526B" +c_blue_d="#ff66AABB" +c_white_l="#ffFFFFFF" +c_cyan_l="#ff9FE3BC" +c_red_d="#ffBD4A4A" +c_white_d="#ffDDEEDD" +# --- APPLY XRES END + +# color definitions +color_back="$c_background" # Default background +color_fore="$c_white_l" # Default foreground +color_head="$c_yellow_d" # Background for unselected workspaces +color_wsp="$c_yellow_l" # Background for selected workspace +color_sec_b1="$c_black_d" # Background for section 1 +color_sec_b2="$c_black_l" # Background for section 2 +color_sec_b3="$c_white_d" # Background for section 3 +color_icon="$c_white_d" # For icons +color_mail="$c_magenta_l" # Background color for mail alert +color_chat="$c_magenta_l" # Background color for chat alert +color_cpu="$c_magenta_l" # Background color for cpu alert +color_net="$c_white_l" # Background color for net alert +color_disable="$c_black_l" # Foreground for disable elements +color_clock="$c_yellow_d" # Color for clock +color_clock_edge="$c_yellow_l" # Color for clock + +color_success="$c_green_d" # Positive color for good times +color_warning="$c_yellow_l" # Yellow color for warnings (eg, low battery) +color_critical="$c_magenta_l" # Red color for critical meters + +#default space between sections +if [ ${res_w} -gt 1024 ]; then + stab=' ' +else + stab=' ' +fi + +# Char glyps for powerline fonts +sep_left="" # Powerline separator left +sep_right="" # Powerline separator right +sep_l_left="" # Powerline light separator left +sep_l_right="" # Powerline light sepatator right + +# Icon glyphs from Terminusicons2 +# icon_clock="Õ" # Clock icon +# icon_cpu="Ï" # CPU icon +# icon_mem="Þ" # MEM icon +# icon_dl="Ð" # Download icon +# icon_ul="Ñ" # Upload icon +# icon_vol="Ô" # Volume icon +# icon_hd="À" # HD / icon +# icon_home="Æ" # HD /home icon +# icon_mail="Ó" # Mail icon +# icon_chat="Ò" # IRC/Chat icon +# icon_music="Î" # Music icon +# icon_prog="Â" # Window icon +# icon_contact="Á" # Contact icon +# icon_wsp="Ç" # Workspace icon +# icon_battery="" # Battery icon +# icon_charging="+" # Charging icon + +# Icon glyphs from Siji +icon_clock="" # Clock icon +icon_cpu="" # CPU icon +icon_mem="" # MEM icon +icon_dl="" # Download icon +icon_ul="" # Upload icon +icon_vol="" # Volume icon +icon_mute="" +icon_hd="À" # HD / icon +icon_home="Æ" # HD /home icon +icon_mail="Ó" # Mail icon +icon_chat="Ò" # IRC/Chat icon +icon_music="" # Music icon +icon_music_playing="" +icon_music_paused="" +icon_prog="" # Window icon +icon_contact="Á" # Contact icon +icon_wsp="" # Workspace icon +icon_battery="         " +icon_charging="" + +# Ionicon glyphs +# icon_battery="" # Battery icon (half-ish full) +# icon_clock="" # Clock icon +# icon_cpu="?" # CPU icon +# icon_globe="" # Globe icon +# icon_home="" # Home icon (also linux) +# icon_laptop="" # Laptop icon +# icon_linux="" # Linux (Tux) icon +# icon_mail="" # Email icon +# icon_mem="?" # Memory icon +# icon_music="" # Music icon +# icon_paw="" # Paw icon +# icon_prog="" # Window icon +# icon_shell="" # Shell icon +# icon_vol="" # Volume icon +# icon_wsp="" # Workspace icon (paw duplicate for now) diff --git a/config/lemonbar/i3_lemonbar_conky b/config/lemonbar/i3_lemonbar_conky new file mode 100644 index 0000000..5981240 --- /dev/null +++ b/config/lemonbar/i3_lemonbar_conky @@ -0,0 +1,23 @@ +conky.config = { + background = false, + update_interval = 2, + total_run_times = 0, + override_utf8_locale = true, + short_units = true, + uppercase = false, + out_to_console = true, + out_to_x = false, + if_up_strictness = 'address', + format_human_readable = true +} + +conky.text = [[ +SYS\ +${time %a %d %b %I:%M%p} \ +${cpu} \ +${mem} \ +${fs_used_perc /} \ +${fs_used_perc /home} \ +${if_up wlp9s0}${downspeedf wlp2s0} ${upspeedf wlp2s0} \ +${else} down down ${endif}\ +]] diff --git a/config/lemonbar/i3_lemonbar_parser.sh b/config/lemonbar/i3_lemonbar_parser.sh new file mode 100755 index 0000000..133c2cd --- /dev/null +++ b/config/lemonbar/i3_lemonbar_parser.sh @@ -0,0 +1,219 @@ +#!/bin/bash +# +# Input parser for i3 bar +# 14 ago 2015 - Electro7 + +# config +. $(dirname $0)/i3_lemonbar_config + +# min init +irc_n_high=0 +title="%{F${color_head} B${color_sec_b2}}${sep_right}%{F${color_head} B${color_sec_b2}%{T2} ${icon_prog} %{F${color_sec_b2} B-}${sep_right}%{F- B- T1}" + +# parser +while read -r line ; do + case $line in + SYS*) + # conky=, 0 = wday, 1 = mday, 2 = month, 3 = time, 4 = cpu, 5 = mem, 6 = disk /, 7 = disk /home, 8-9 = up/down wlan, 10-11 = up/down eth, 12-13=speed + sys_arr=(${line#???}) + + # date + if [ ${res_w} -gt 1024 ]; then + date="${sys_arr[0]} ${sys_arr[1]} ${sys_arr[2]}" + else + date="${sys_arr[1]} ${sys_arr[2]}" + fi + date="%{F${color_sec_b1}}${sep_left}%{F${color_icon} B${color_sec_b1}} %{T2}${icon_clock}%{F- T1} ${date}" + + # time + time="%{F${color_clock_edge}}${sep_left}%{F${color_clock} B${color_clock_edge}}${sep_left}%{F${color_back} B${color_clock}} ${sys_arr[3]} %{F- B-}" + + # cpu + if [ ${sys_arr[4]} -gt ${cpu_alert} ]; then + cpu_cback=${color_cpu}; cpu_cicon=${color_back}; cpu_cfore=${color_back}; + else + cpu_cback=${color_sec_b2}; cpu_cicon=${color_icon}; cpu_cfore=${color_fore}; + fi + cpu="%{F${cpu_cback}}${sep_left}%{F${cpu_cicon} B${cpu_cback}} %{T2}${icon_cpu}%{F${cpu_cfore} T1} ${sys_arr[4]}%%" + + # mem + mem="%{F${cpu_cicon}}${sep_l_left} %{T2}${icon_mem}%{F${cpu_cfore} T1} ${sys_arr[5]}" + + # disk / + # diskr="%{F${color_sec_b1}}${sep_left}%{F${color_icon} B${color_sec_b1}} %{T2}${icon_hd}%{F- T1} ${sys_arr[6]}%%" + + # disk home + # diskh="%{F${color_icon}}${sep_l_left} %{T2}${icon_home}%{F- T1} ${sys_arr[7]}%%" + + # wlan + if [ "${sys_arr[8]}" == "down" ]; then + wland_v="×"; wlanu_v="×"; + wlan_cback=${color_sec_b2}; wlan_cicon=${color_sec_b3}; wlan_cfore=${color_sec_b3}; + else + wland_v=${sys_arr[8]}K; wlanu_v=${sys_arr[9]}K; + if [ ${wland_v:0:-3} -gt ${net_alert} ] || [ ${wlanu_v:0:-3} -gt ${net_alert} ]; then + wlan_cback=${color_net}; wlan_cicon=${color_back}; wlan_cfore=${color_back}; + else + wlan_cback=${color_sec_b2}; wlan_cicon=${color_icon}; wlan_cfore=${color_fore}; + fi + fi + wland="%{F${wlan_cback}}${sep_left}%{F${wlan_cicon} B${wlan_cback}} %{T2}${icon_dl}%{F${wlan_cfore} T1} ${wland_v}" + wlanu="%{F${wlan_cicon}}${sep_l_left} %{T2}${icon_ul}%{F${wlan_cfore} T1} ${wlanu_v}" + + # eth + # if [ "${sys_arr[10]}" == "down" ]; then + # ethd_v="×"; ethu_v="×"; + # eth_cback=${color_sec_b1}; eth_cicon=${color_disable}; eth_cfore=${color_disable}; + # else + # ethd_v=${sys_arr[10]}K; ethu_v=${sys_arr[11]}K; + # if [ ${ethd_v:0:-3} -gt ${net_alert} ] || [ ${ethu_v:0:-3} -gt ${net_alert} ]; then + # eth_cback=${color_net}; eth_cicon=${color_back}; eth_cfore=${color_back}; + # else + # eth_cback=${color_sec_b1}; eth_cicon=${color_icon}; eth_cfore=${color_fore}; + # fi + # fi + # ethd="%{F${eth_cback}}${sep_left}%{F${eth_cicon} B${eth_cback}} %{T2}${icon_dl}%{F${eth_cfore} T1} ${ethd_v}" + # ethu="%{F${eth_cicon}}${sep_l_left} %{T2}${icon_ul}%{F${eth_cfore} T1} ${ethu_v}" + ;; + + VOL*) + # Volume: + # [0] Muted indicator: (M=Muted / (anything else)=Unmuted) + # [1] On/off (muted) status (1=Unmuted / 0=Muted) + vol_arr=(${line#???}) + vol_bkg=$color_sec_b2 + vol_frg=$color_fore + vol_ico=$icon_vol + vol_txt=${vol_arr[1]} + if [[ ${vol_arr[0]} == "M" ]]; then + vol_bkg=$color_sec_b1 + vol_frg=$color_icon + vol_ico=$icon_mute + fi + vol="%{F${vol_bkg}}${sep_left}%{F${color_icon} B${vol_bkg}} %{T2}${vol_ico}%{F${vol_frg} T1} $vol_txt%{F${color_fore}}" + ;; + + GMA*) + # Gmail + gmail="${line#???}" + if [ "${gmail}" != "0" ]; then + mail_cback=${color_mail}; mail_cicon=${color_back}; mail_cfore=${color_back} + else + mail_cback=${color_sec_b1}; mail_cicon=${color_icon}; mail_cfore=${color_fore} + fi + gmail="%{F${mail_cback}}${sep_left}%{F${mail_cicon} B${mail_cback}} %{T2}${icon_mail}%{F${mail_cfore} T1} ${gmail}" + ;; + + IRC*) + # IRC highlight (script irc_warn) + if [ "${line#???}" != "0" ]; then + ((irc_n_high++)); irc_high="${line#???}"; + irc_cback=${color_chat}; irc_cicon=${color_back}; irc_cfore=${color_back} + else + irc_n_high=0; [ -z "${irc_high}" ] && irc_high="none"; + irc_cback=${color_sec_b2}; irc_cicon=${color_icon}; irc_cfore=${color_fore} + fi + irc="%{F${irc_cback}}${sep_left}%{F${irc_cicon} B${irc_cback}} %{T2}${icon_chat}%{F${irc_cfore} T1} ${irc_n_high} %{F${irc_cicon}}${sep_l_left} %{T2}${icon_contact}%{F${irc_cfore} T1} ${irc_high}" + ;; + + MPD*) + # Music + mpd_arr=(${line#???}) + if [ -z "${line#???}" ]; then + song="none"; + elif [ "${mpd_arr[1]}" == "error:" ]; then + song="mpd off"; + else + song="${line#???}"; + fi + mpd="%{F${color_sec_b2}}${sep_left}%{B${color_sec_b2}}%{F${color_sec_b1}}${sep_left}%{F${color_icon} B${color_sec_b1}} %{T2}${icon_music}%{F${color_fore} T1} ${song}" + # echo "Setting music display to ${song}" >> bar.log + ;; + + BAT*) + # Battery readout: + # [0] = integer part + # [1] = charging status (D(ischarging), C(harging)) + # [2] = power level (F(ull), N(ormal), L(ow), C(ritical)) + bat_arr=(${line#???}) + bat_icons=($icon_battery) + ico="${bat_icons[$(((${bat_arr[0]}*(${#bat_icons[@]}-1))/100))]}" + bkg="${color_sec_b1}" + frg="${color_fore}" + + if [[ ${bat_arr[2]} == "L" ]]; then + bkg="${color_warning}" + frg="${color_back}" + elif [[ ${bat_arr[2]} == "C" ]]; then + bkg="${color_critical}" + frg="${color_back}" + elif [[ ${bat_arr[2]} == "F" ]]; then + bkg="${c_green_d}" + frg="${c_white_l}" + fi + + batamt="%{F${bkg}}${sep_left}%{B${bkg}} %{F${frg}} ${ico} ${bat_arr[0]}%%" + + if [[ ${bat_arr[1]} == "C" ]]; then + batamt="%{F${color_fore}}${sep_left}%{F${color_back} B${color_fore}}${icon_charging}${batamt}" + fi + ;; + + WSP*) + # I3 Workspaces + wsp="%{F${color_back} B${color_head}} %{T2}${icon_wsp}%{T1} " + set -- ${line#???} + while [ $# -gt 0 ] ; do + case $1 in + FOC*) + wsp="${wsp}%{F${color_head} B${color_wsp}}${sep_right}%{F${color_back} B${color_wsp} T1} ${1##????} %{F${color_wsp} B${color_head}}${sep_right}" + ;; + INA*|URG*|ACT*) + wsp="${wsp}%{F${color_back} T1} ${1##????} " + ;; + esac + shift + done + ;; + + WIN*) + # window title + title=$(xprop -id ${line#???} | awk '/_NET_WM_NAME/{$1=$2="";print}' | cut -d'"' -f2) + title="%{F${color_head} B${color_sec_b2} T1}${sep_right}%{F${color_icon} B${color_sec_b2} T2} ${icon_prog} %{F${color_sec_b2} B- T1}${sep_right}%{F- B- T1} ${title}" + ;; + + WNM*) + # Window title (string) + title=$(echo ${line#???} | xargs) + title="%{F${color_head} B${color_sec_b2} T1}${sep_right}%{F${color_icon} B${color_sec_b2} T2} ${icon_prog} %{F${color_sec_b2} B- T1}${sep_right}%{F- B- T1} ${title}" + ;; + + VIS*) + # Visual effects + viscmds=(${line#???}) + ;; + + MSG*) + viscmds=(`echo "fill ${color_sec_b2} ${color_fore}"`) + msg=${line#???} + ;; + + WRN*) + viscmds=(`echo "fill ${color_warning} ${color_back}"`) + msg=${line#???} + ;; + + ALT*) + viscmds=(`echo "fill ${color_critical} ${color_back}"`) + msg=${line#???} + ;; + + esac + + # And finally, output + if [[ ${viscmds[0]} == "fill" ]]; then + printf "%s\n" "%{l}%{B${viscmds[2]}} %{B${viscmds[1]} F${viscmds[2]}}${sep_right} ${msg} %{r}%{B${viscmds[1]} F${viscmds[2]}}" + else + printf "%s\n" "%{l}${wsp}${title} %{r}${mpd}${stab}${wland}${stab}${wlanu}${stab}${vol}${stab}${cpu}${stab}${mem}${stab}${batamt}${stab}${date}${stab}${time}" + fi +done diff --git a/config/lemonbar/i3_workspaces.pl b/config/lemonbar/i3_workspaces.pl new file mode 100644 index 0000000..3c42d40 --- /dev/null +++ b/config/lemonbar/i3_workspaces.pl @@ -0,0 +1,138 @@ +#!/usr/bin/env perl +# vim:ts=4:sw=4:expandtab:ft=perl +# +# Print i3 workspaces on every change. +# +# Format: +# For every workspace (x = workspace name) +# - "FOCx" -> Focused workspace +# - "INAx" -> Inactive workspace +# - "ACTx" -> Ative workspace +# - "URGx" -> Urgent workspace +# +# Uses AnyEvent I3 0.8 -> https://metacpan.org/module/AnyEvent::I3 +# Based in i3-wsbar of Michael Stapelberg -> http://code.stapelberg.de/git/i3/tree/contrib/i3-wsbar +# +# 16 feb 2015 - Electro7 + +use strict; +use warnings; +use AnyEvent::I3; +use AnyEvent; +use v5.10; + +my $socket_path = undef; +my ($workspaces, $outputs) = ([], {}); +my $w = AnyEvent->timer( + after => 3, + cb => sub { + die "Connection to i3 timed out. Verify socket path ($socket_path)"; + exit 1; + } +); + + +my $i3 = i3($socket_path); + +# Disable buffering +$| = 1; +STDERR->autoflush; +STDOUT->autoflush; + +# Wait a short amount of time and try to connect to i3 again +sub reconnect { + print "reconecting\n"; + my $timer; + $i3 = i3($socket_path); + if (!defined($w)) { + $w = AnyEvent->timer( + after => 3, + cb => sub { + die "Connection to i3 timed out. Verify socket path ($socket_path)"; + exit 1; + } + ); + } + + my $c = sub { + $timer = AnyEvent->timer( + after => 0.01, + cb => sub { $i3->connect->cb(\&connected) } + ); + }; + $c->(); +} + +# Connection attempt succeeded or failed +sub connected { + my ($cv) = @_; + + if (!$cv->recv) { + reconnect(); + return; + } + + $w = undef; + + $i3->subscribe({ + workspace => \&ws_change, + output => \&output_change, + _error => sub { reconnect() } + }); + ws_change(); + output_change(); +} + +# Called when a ws changes +sub ws_change { + # Request the current workspaces and update the output afterwards + $i3->get_workspaces->cb( + sub { + my ($cv) = @_; + $workspaces = $cv->recv; + update_output(); + }); +} + +# Called when the reply to the GET_OUTPUTS message arrives +sub got_outputs { + my $reply = shift->recv; + my %new = map { ($_->{name}, $_) } grep { $_->{active} } @{$reply}; + + for my $name (keys %new) { + $outputs->{$name} = $new{$name}; + } + + update_output(); +} + +sub output_change { + $i3->get_outputs->cb(\&got_outputs) +} + +sub update_output { + my $out; + + for my $name (keys %{$outputs}) { + $out .= "WSP"; + + for my $ws (@{$workspaces}) { + my $state = "INA"; + $state = "ACT" if $ws->{visible}; + $state = "URG" if $ws->{urgent}; + $state = "FOC" if $ws->{focused}; + my $name = $ws->{name}; + $out .= qq|$state$name |; + } + + $out .= "\n"; + + print $out; + } +} + +$i3->connect->cb(\&connected); + +# let AnyEvent do the rest ("endless loop") +AnyEvent->condvar->recv + diff --git a/config/lemonbar/i3_workspaces.py b/config/lemonbar/i3_workspaces.py new file mode 100755 index 0000000..97db5fe --- /dev/null +++ b/config/lemonbar/i3_workspaces.py @@ -0,0 +1,102 @@ +#!/usr/bin/env python +# +# Print i3 workspaces on every change. +# +# Format: +# For every workspace (x = workspace name) +# - "FOCx" -> Focused workspace +# - "INAx" -> Inactive workspace +# - "ACTx" -> Ative workspace +# - "URGx" -> Urgent workspace +# +# Uses i3py.py -> https://github.com/ziberna/i3-py +# Based in wsbar.py en examples dir +# +# 16 feb 2015 - Electro7 + + +import sys +import time +import subprocess + +import i3 + +class State(object): + # workspace states + focused = 'FOC' + active = 'ACT' + inactive = 'INA' + urgent = 'URG' + + def get_state(self, workspace, output): + if workspace['focused']: + if output['current_workspace'] == workspace['name']: + return self.focused + else: + return self.active + if workspace['urgent']: + return self.urgent + else: + return self.inactive + + +class i3ws(object): + ws_format = '%s%s ' + end_format = 'WSP%s' + state = State() + + def __init__(self, state=None): + if state: + self.state = state + # socket + self.socket = i3.Socket() + # Output to console + workspaces = self.socket.get('get_workspaces') + outputs = self.socket.get('get_outputs') + self.display(self.format(workspaces, outputs)) + # Subscribe to an event + callback = lambda data, event, _: self.change(data, event) + self.subscription = i3.Subscription(callback, 'workspace') + + def change(self, event, workspaces): + # Receives event and workspace data + if 'change' in event: + outputs = self.socket.get('get_outputs') + text = self.format(workspaces, outputs) + self.display(text) + + def format(self, workspaces, outputs): + # Formats the text according to the workspace data given. + out = '' + for workspace in workspaces: + output = None + for output_ in outputs: + if output_['name'] == workspace['output']: + output = output_ + break + if not output: + continue + st = self.state.get_state(workspace, output) + name = workspace['name'] + item= self.ws_format % (st, name) + out += item + return self.end_format % out + + def display(self, text): + # Displays the text in stout + print(text) + sys.stdout.flush() + + def quit(self): + # Quits the i3ws; closes the subscription and terminates + self.subscription.close() + +if __name__ == '__main__': + ws = i3ws() + try: + while True: + time.sleep(1) + except KeyboardInterrupt: + print('') # force new line + finally: + ws.quit() diff --git a/config/lemonbar/lemonbar.sh b/config/lemonbar/lemonbar.sh new file mode 100755 index 0000000..a45662d --- /dev/null +++ b/config/lemonbar/lemonbar.sh @@ -0,0 +1,89 @@ +#! /bin/bash +# +# BSPWM bar with https://github.com/LemonBoy/bar + +. $(dirname $0)/i3_lemonbar_config + +if [ $(pgrep -cx $(basename $0)) -gt 1 ] ; then + printf "%s\n" "The status bar is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +[ -e "${panel_fifo}" ] && rm "${panel_fifo}" +mkfifo "${panel_fifo}" + +# echo "=== Starting up bar at $(date +%c)" >> bar.log + +### EVENTS METERS + +# Window title, "WIN" +xprop -spy -root _NET_ACTIVE_WINDOW | sed -un 's/.*\(0x.*\)/WIN\1/p' > "${panel_fifo}" & + +# i3 Workspaces, "WSP" +#$(dirname $0)/i3_workspaces.py > ${panel_fifo} & + +# IRC, "IRC" +# only for init +# ~/bin/irc_warn & + +# Conky, "SYS" +conky -c $(dirname $0)/i3_lemonbar_conky > "${panel_fifo}" & + +### UPDATE INTERVAL METERS +cnt_vol=${upd_vol} +cnt_mail=${upd_mail} +cnt_mpd=${upd_mpd} +cnt_bat=${upd_bat} +cnt_win=${upd_win} + +while :; do + + # Volume, "VOL" + if [ $((cnt_vol++)) -ge ${upd_vol} ]; then + #echo "VOL$(alsa-status)" > "${panel_fifo}" & + echo "VOL20" > "${panel_fifo}" & + cnt_vol=0 + fi + + # GMAIL, "GMA" + # if [ $((cnt_mail++)) -ge ${upd_mail} ]; then + # printf "%s%s\n" "GMA" "$(~/bin/gmail.sh)" > "${panel_fifo}" + # cnt_mail=0 + # fi + + # MPD + #if [ $((cnt_mpd++)) -ge ${upd_mpd} ]; then + ##printf "%s%s\n" "MPD" "$(ncmpcpp --now-playing '{%a - %t}|{%f}' | head -c 60)" > "${panel_fifo}" + #printf "%s%s\n" "MPD" "$(mpc current -f '[[%artist% - ]%title%]|[%file%]' 2>&1 | head -c 70)" > "${panel_fifo}" + #cnt_mpd=0 + #fi + + # Battery, "BAT" + if [ $((cnt_bat++)) -ge ${upd_bat} ]; then + #echo "$(batstat)" > "${panel_fifo}" & + echo "BAT99" > "${panel_fifo}" & + cnt_bat=0 + fi + + # Periodic Window title update (Ticket #1) + #if [ $((cnt_win++)) -ge ${upd_win} ]; then + #echo "WIN`mywin`" > "${panel_fifo}" & + #cnt_win=0 + #fi + + # Finally, wait 1 second + sleep 1s; + +done & + +#### LOOP FIFO + +#cat "${panel_fifo}" | $(dirname $0)/i3_lemonbar_parser.sh \ + #| bar -p -f "${font}" -f "${iconfont}" -f "${plfont}" -g "${geometry}" -B "${color_back}" -F "${color_fore}" & +cat "${panel_fifo}" | $(dirname $0)/i3_lemonbar_parser.sh \ + | lemonbar -p -f "${font}" -f "${iconfont}" -f "${plfont}" -g "${geometry}" -B "${color_back}" -F "${color_fore}" & + +wait + diff --git a/config/muttrc b/config/muttrc new file mode 100644 index 0000000..7c0a91d --- /dev/null +++ b/config/muttrc @@ -0,0 +1,32 @@ +set sidebar_visible +set sidebar_format = "%B%?F? [%F]?%* %?N?%N/?%S" +set mail_check_stats + + +set folder = imaps://url.com/ +set imap_user = roman@url.com +#set imap_pass = your-imap-password +set spoolfile = +INBOX +mailboxes = +INBOX + +# Store message headers locally to speed things up. +# If hcache is a folder, Mutt will create sub cache folders for each account which may speeds things up even more. +set header_cache = ~/.cache/mutt + +# Store messages locally to speed things up, like searching message bodies. +# Can be the same folder as header_cache. +# This will cost important disk usage according to your e-mail amount. +set message_cachedir = "~/.cache/mutt" + +# Specify where to save and/or look for postponed messages. +set postponed = +[url.com]/Drafts + +# Allow Mutt to open a new IMAP connection automatically. +unset imap_passive + +# Keep the IMAP connection alive by polling intermittently (time in seconds). +set imap_keepalive = 300 + +# How often to check for new mail (time in seconds). +set mail_check = 120 + diff --git a/config/nvim/init.vim b/config/nvim/init.vim new file mode 100644 index 0000000..19b38e3 --- /dev/null +++ b/config/nvim/init.vim @@ -0,0 +1,217 @@ +"Many ideas from https://github.com/nicknisi/dotfiles/blob/master/config/nvim/init.vim +"https://github.com/mhartington/dotfiles/blob/master/vimrc +"and https://dougblack.io/words/a-good-vimrc.html + +" Plugins +call plug#begin('~/.config/nvim/plugged') + +Plug 'vim-airline/vim-airline' " fancy statusline +Plug 'vim-airline/vim-airline-themes' " themes for vim-airline +Plug 'scrooloose/nerdtree' " file tree browser +Plug 'ctrlpvim/ctrlp.vim' " fuzzy file finder +Plug 'bronson/vim-trailing-whitespace' +Plug 'altercation/vim-colors-solarized' +Plug 'ryanoasis/vim-devicons' " awesome icons +Plug 'tiagofumo/vim-nerdtree-syntax-highlight' +Plug 'ashisha/image.vim' " Display images in vim +Plug 'Yggdroot/indentLine' " Display indent line +Plug 'neomake/neomake' " asynchronous make functionality :NeoMake! +Plug 'Shougo/deoplete.nvim' " autocomplete function +"Plug 'Shougo/neocomplcache.vim' +"Plug 'terryma/vim-multiple-cursors' "Sublime multiple cursor support +Plug 'Shougo/neosnippet.vim' " snippet manager +Plug 'Shougo/neosnippet-snippets' " default snippets +Plug 'Raimondi/delimitMate' " automatic closing of quotes, parenthesis, brackets, etc. +Plug 'tpope/vim-commentary' " comment stuff out +Plug 'tpope/vim-ragtag' " endings for html, xml, etc. - ehances surround +Plug 'tpope/vim-surround' " mappings to easily delete, change and add such +Plug 'tpope/vim-fugitive' " Git support +Plug 'airblade/vim-gitgutter' " show git diff in gutter + " surroundings in pairs, such as quotes, parens, etc. +Plug 'simnalamburt/vim-mundo' " undo tree visualizer DOESN'T WORK ATM +"Plug 'junegunn/limelight.vim', { 'on': 'Limelight' } " focus tool. Dim text. Good for presentating with vim + +"language-specific plugins +" html +Plug 'gregsexton/MatchTag' "highlight the current tag + +" latex +Plug 'lervag/vimtex' + +call plug#end() + +" Theme +syntax enable +"set background=dark +colorscheme solarized + +if has('gui_running') + set background=light +else + set background=dark +endif + + +" Enable snipMate compatibility feature. +"let g:neosnippet#enable_snipmate_compatibility = 1 +"let g:neosnippet#snippets_directory='~/.vim/bundle/vim-snippets/snippets' + +"deoplete settings +let g:deoplete#enable_at_startup = 1 +let g:deoplete#ignore_sources = {} +"let g:deoplete#ignore_sources._ = ["neosnippet"] + +" I want to use my tab more smarter. If we are inside a completion menu jump +" to the next item. Otherwise check if there is any snippet to expand, if yes +" expand it. Also if inside a snippet and we need to jump tab jumps. If none +" of the above matches we just call our usual 'tab'. +function! s:neosnippet_complete() + if pumvisible() + return "\" + else + if neosnippet#expandable_or_jumpable() + return "\(neosnippet_expand_or_jump)" + endif + return "\" + endif +endfunction +imap neosnippet_complete() + +:inoremap / + +" nerdtree setting +" start with vim if no file is specified +if has("autocmd") + autocmd StdinReadPre * let s:std_in=1 + "autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif + " close vim if only nerd tree is open + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +endif +map :NERDTreeToggle + +" Highlight full name (not only icons) +let g:NERDTreeFileExtensionHighlightFullName = 1 +let g:NERDTreeExactMatchHighlightFullName = 1 +let g:NERDTreePatternMatchHighlightFullName = 1 +" Disable uncommon file extensions highlighting (good idea if lag when scrolling) +let g:NERDTreeLimitedSyntax = 1 +" after a re-source, fix syntax matching issues (concealing brackets): +if exists('g:loaded_webdevicons') + call webdevicons#refresh() +endif + +" toggle gundo +nnoremap u :MundoToggle + +" Toggle number lines +map :set number!:set relativenumber! +set relativenumber +set number + +set history=200 "set Ex command history +set autoread " detect when a file is changed + +set cursorline + +" enable global undo +set undofile +set undodir=~/.config/nvim/undo + +" jump to the last position when reopening a file +if has("autocmd") + au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif +endif + +set shortmess=I "disable intro message + +" Tab control +set expandtab " insert spaces rather than tabs for [noexpandtab for invert] +set smarttab " tab respects 'tabstop', 'shiftwidth', and 'softtabstop' +set tabstop=2 " the visible width of tabs +set softtabstop=2 " edit as if the tabs are 4 characters wide +set shiftwidth=2 " number of spaces to use for indent and unindent +set shiftround " round indent to a multiple of 'shiftwidth' +set completeopt+=longest + +" Vim Splits +set splitbelow +set splitright + +" substitute live preview +set inccommand=nosplit + + +" Key Bindings + +"ReMap leader key +let mapleader = "," + +" for learning: disable arrow keys +" noremap +" noremap +" noremap +" noremap + +" better movement in Vim Splits +nnoremap +nnoremap +nnoremap +nnoremap + +" enable copy to clipboard +map y "+y +map p "*p + +" move vertically by visual line +" if there is a very long line that gets visually wrapped to two lines, wouldn't skip over the "fake" part of the visual line +nnoremap gk +nnoremap gj +nnoremap j gj +nnoremap k gk + +" fast movement +nnoremap J 5j +nnoremap K 5k + +" cursor to begin or end of line +nnoremap B ^ +nnoremap E $ + +" Align block of text and keep them selected +vmap < >gv + +" Faster delete. Doesnt work actually +inoremap db +inoremap dw + +" turn off last search highlight +map :noh + +" highlight last inserted text +nnoremap gV `[v`] + +" jk is escape +inoremap jk + +call togglebg#map("") "Toggle background dark/light +map :IndentLinesToggle + +" vim-airline + +let g:airline_theme='badwolf' +let g:airline_left_sep = '' +let g:airline_left_alt_sep = '' +let g:airline_right_sep = '' +let g:airline_right_alt_sep = '' +let g:airline_symbols_branch = '' +let g:airline_symbols_readonly = '' +let g:airline_symbols_linenr = '' +let g:airline_powerline_fonts = 1 "required for devicons +" Enable Airline Tabbar +let g:airline#extensions#tabline#enabled = 1 + +set encoding=utf8 +set guifont=DroidSansMonoForPowerline\ Nerd\ Font + +" EOF diff --git a/config/nvim/logo.png b/config/nvim/logo.png new file mode 100644 index 0000000..1dde98d Binary files /dev/null and b/config/nvim/logo.png differ diff --git a/config/nvim/neovim.desktop b/config/nvim/neovim.desktop new file mode 100644 index 0000000..571c1e8 --- /dev/null +++ b/config/nvim/neovim.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Categories=Utility;TextEditor; +Comment=Edit file in NeoVim +Exec=nvim %f +GenericName=Text Editor Vim +Hidden=false +Icon=/home/roman/.config/nvim/logo.png +Name=NeoVim +Terminal=true +Type=Application +Version=1.0 + diff --git a/config/polybar/config b/config/polybar/config new file mode 100644 index 0000000..b8fae23 --- /dev/null +++ b/config/polybar/config @@ -0,0 +1,356 @@ +[bar/top] +monitor = eDP-1 +width = 100% +height = 34 +;wm-restack = bspwm +background = #002292B8 +foreground = #ccf1e6F7 + +line-color = ${bar/top.background} +line-size = 2 + +spacing = 2 +padding-right = 5 +module-margin = 4 + +font-0 = NotoSans-Regular:size=10;2 +font-1 = MaterialIcons:size=14;4 +font-2 = Termsynu:size=8:antialias=false;-2 +font-3 = FontAwesome:size=12;2 +font-4 = NotoSans-Regular:size=12;2 + +modules-left = bspwm +modules-center = xwindow +modules-right = wireless-network wired-network battery date + +[bar/bottom] +monitor = eDP-1 +bottom = true +width = 100% +height = 27 + +background = #000c3944 +foreground = ${bar/top.foreground} + +line-color = ${bar/top.background} +line-size = 2 + +spacing = 3 +padding-right = 4 +padding-left = 4 +module-margin-left = 0 +module-margin-right = 6 + +font-0 = NotoSans-Regular:size=8;0 +font-1 = unifont:size=6;0 +font-2 = FontAwesome:size=8;2 +font-3 = NotoSans-Regular:size=8;-1 +font-4 = MaterialIcons:size=10;2 +font-5 = Termsynu:size=8:antialias=false;0 +font-6 = NotoSans-Regular:size=20;10 + + +modules-left = keyboard battery volume backlight +modules-right = cpu memory powermenu + +[module/xwindow] +type = internal/xwindow +label = %{T5}%title:0:60:...% + + +[module/keyboard] +type = internal/xkeyboard +blacklist-0 = num lock + + +[module/battery] +type = internal/battery +full-at = 98 +battery = BAT1 +adapter = ADP1 + +format-charging = +format-discharging = +format-full = + +ramp-capacity-0 =  +ramp-capacity-0-foreground = #f53c3c +ramp-capacity-1 =  +ramp-capacity-1-foreground = #ffa900 +ramp-capacity-2 =  +ramp-capacity-3 =  +ramp-capacity-4 =  + +bar-capacity-width = 10 +bar-capacity-format = %{+u}%{+o}%fill%%empty%%{-u}%{-o} +bar-capacity-fill = █ +bar-capacity-fill-foreground = #ddffffff +bar-capacity-fill-font = 3 +bar-capacity-empty = █ +bar-capacity-empty-font = 3 +bar-capacity-empty-foreground = #44ffffff + +animation-charging-0 =  +animation-charging-1 =  +animation-charging-2 =  +animation-charging-3 =  +animation-charging-4 =  +animation-charging-framerate = 750 + +[module/bspwm] +type = internal/bspwm + +ws-icon-0 = term; +ws-icon-1 = web; +ws-icon-2 = code; +ws-icon-3 = music; +ws-icon-4 = irssi; +ws-icon-default =  + +format = + +label-dimmed-underline = ${root.background} + +label-focused = %icon% +label-focused-foreground = #fff +label-focused-background = #773f3f3f +label-focused-underline = #ffffff +label-focused-font = 4 +label-focused-padding = 4 + +label-occupied = %icon% +label-occupied-foreground = #dd +label-occupied-underline = #f7ed91 +label-occupied-font = 4 +label-occupied-padding = 4 + +label-urgent = %icon% +label-urgent-foreground = #000000 +label-urgent-background = #bd2c40 +label-urgent-underline = #9b0a20 +label-urgent-font = 4 +label-urgent-padding = 4 + +label-empty = %icon% +label-empty-foreground = #55 +label-empty-font = 4 +label-empty-padding = 4 + +label-monocle =  +label-monocle-underline = ${module/bspwm.label-focused-underline} +label-monocle-background = #33ffffff +label-monocle-padding = 2 + +label-locked =  +label-locked-foreground = #bd2c40 +label-locked-underline = ${module/bspwm.label-monocle-underline} +label-locked-padding = ${module/bspwm.label-monocle-padding} + +label-sticky =  +label-sticky-foreground = #fba922 +label-sticky-underline = ${module/bspwm.label-monocle-underline} +label-sticky-padding = ${module/bspwm.label-monocle-padding} + +label-private =  +label-private-foreground = #bd2c40 +label-private-underline = ${module/bspwm.label-monocle-underline} +label-private-padding = ${module/bspwm.label-monocle-padding} + +[module/bspwm-tmp] +type = internal/bspwm +format = + +label-active =  +label-active-padding = 1 +label-occupied =  +label-occupied-padding = 1 +label-empty =  +label-empty-padding = 1 + +[module/cpu] +type = internal/cpu +format =