summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/i3/config82
-rw-r--r--.config/polybar/config98
-rw-r--r--.vim/plugin/cscope_maps.vim165
-rw-r--r--.vimrc14
-rw-r--r--.zshrc2
5 files changed, 228 insertions, 133 deletions
diff --git a/.config/i3/config b/.config/i3/config
index 44edc4d..4d53a3e 100644
--- a/.config/i3/config
+++ b/.config/i3/config
@@ -1,69 +1,34 @@
-# 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!
+# Danny's i3 config
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 Sans 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.
-
-# My font
+# Default font
font pango:xos4 Terminus 12
# Use Mouse+$mod to drag floating windows to their wanted position
floating_modifier $mod
-# start a terminal
bindsym $mod+Return exec i3-sensible-terminal
-
-# kill focused window
bindsym $mod+Shift+q kill
+bindsym $mod+d exec --no-startup-id i3-dmenu-desktop
-# start dmenu (a program launcher)
-# bindsym $mod+d exec dmenu
-# 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
-
-# alternatively, you can use the cursor keys:
+# Focus windows
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:
+# Move windows
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
+# Split horizontal/vertical
bindsym $mod+h split h
-
-# split in vertical orientation
bindsym $mod+v split v
-# enter fullscreen mode for the focused container
+# Fullscreen toggle
bindsym $mod+f fullscreen toggle
# change container layout (stacked, tabbed, toggle split)
@@ -80,9 +45,6 @@ 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
@@ -111,8 +73,6 @@ bindsym $mod+Shift+0 move container to workspace 10
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" {
@@ -138,6 +98,7 @@ mode "resize" {
bindsym Escape mode "default"
}
+# logout, lock screen, etc.
set $mode_system System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown
mode "$mode_system" {
bindsym l exec --no-startup-id xautolock -locknow, mode "default"
@@ -161,35 +122,26 @@ bindsym XF86AudioLowerVolume exec --no-startup-id amixer sset Master 5%-
bindsym XF86AudioMute exec --no-startup-id amixer sset Master toggle
bindsym XF86MonBrightnessUp exec --no-startup-id xbacklight -inc 10%
bindsym XF86MonBrightnessDown exec --no-startup-id xbacklight -dec 10%
-bindsym $mod+Print exec --no-startup-id gnome-screenshot
-bindsym $mod+Shift+p exec --no-startup-id gnome-screenshot -w
+bindsym $mod+Print exec --no-startup-id scrot
bindsym $mod+Shift+s mode "$mode_system"
bindsym $mod+Tab workspace next
bindsym $mod+Shift+Tab workspace prev
-# Colors
-set $bg-color #2f343f
-set $inactive-bg-color #2f343f
-set $text-color #f3f3f5
-set $inactive-text-color #676e7d
-set $urgent-bg-color #e53935
-
# Gap stuff
-#hide_edge_borders both
-#new_window 1pixel
-#gaps inner 15
-#gaps outer 15
-
-# Make displays nice
-#exec --no-startup-id xrandr --output HDMI-0 --mode 1920x1080 --output DVI-I-0 --right-of HDMI-0
+hide_edge_borders both
+new_window 1pixel
+gaps inner 15
+gaps outer 15
# Start helpful programs
exec --no-startup-id wal -i "$HOME/Pictures/wal/"
-exec --no-startup-id polybar -r main0
exec --no-startup-id redshift
exec --no-startup-id xautolock -time 5 -locker "i3lock -c 000000"
-exec --no-startup-id nitrogen --restore
exec --no-startup-id compton
+exec --no-startup-id tilda
+exec --no-startup-id polybar -r main0
+exec --no-startup-id polybar -r main1
+exec --no-startup-id polybar -r main2
exec --no-startup-id dex -a
# Play nice with Steam windows
diff --git a/.config/polybar/config b/.config/polybar/config
index 22508b8..c4a3f26 100644
--- a/.config/polybar/config
+++ b/.config/polybar/config
@@ -1,4 +1,4 @@
-; Danny's polybar config
+; Danny's Polybar config
[colors]
peach = #FFCD98
@@ -34,8 +34,8 @@ margin-top = 5
margin-bottom = 5
[bar/main0]
-;monitor = ${env:MONITOR:HDMI-0}
-monitor = ${env:MONITOR:eDP1}
+monitor = ${env:MONITOR:HDMI-0}
+;monitor = ${env:MONITOR:eDP1}
width = 100%
height = 24
bottom = false
@@ -77,22 +77,22 @@ tray-transparent = false
tray-background = ${colors.xcolor1}
; Module layouts
-modules-left = RightArrow3 i3 RightArrow2 xwindow RightArrow1 RightStripe RightArrow1
+modules-left = RightArrow2 i3 xwindow RightArrow1 RightStripe RightArrow1
modules-center = RightStripe date LeftStripe
-modules-right = arrow1 LeftStripe arrow1 filesystem arrow2 xbacklight arrow3 battery arrow2 volume arrow3 cpu arrow2 memory arrow3 updates
+modules-right = arrow1 LeftStripe arrow1 filesystem arrow2 alsa arrow3 cpu arrow2 memory arrow3 updates
[bar/main1]
inherit = bar/main0
monitor = ${env:MONITOR:DVI-I-1}
tray-position = none
-modules-left = i3 RightArrow1 RightStripe RightArrow1
+modules-left = i3 xwindow RightArrow1 RightStripe RightArrow1
[bar/main2]
inherit = bar/main0
-monitor = ${env:MONITOR:HDMI-1-2}
+monitor = ${env:MONITOR:DP-0}
tray-position = none
-modules-left = i3 RightArrow1 RightStripe RightArrow1
+modules-left = i3 xwindow RightArrow1 RightStripe RightArrow1
; Modules
@@ -102,8 +102,7 @@ interval = 5
fixed-values = true
mount-0 = /
-mount-1 = /home
-;mount-2 = /boot
+mount-1 = /mnt/fileserver
format-mounted = <label-mounted>
format-mounted-foreground = ${colors.xcolor7}
@@ -113,12 +112,29 @@ format-unmounted-foreground = ${colors.xcolor7}
format-unmounted-background = ${colors.xcolor1}
label-mounted = "%mountpoint%: %percentage_used%%"
+; %free%% %percentage_used%% %used%
label-mounted-foreground = ${colors.xcolor7}
label-mounted-background = ${colors.xcolor1}
-label-unmounted = "%mountpoint% not mounted"
+label-unmounted = %mountpoint%
label-unmounted-foreground = ${colors.xcolor7}
label-unmounted-background = ${colors.xcolor1}
+[module/alsa]
+type = internal/alsa
+
+master-soundcard = default
+master-mixer = Master
+
+format-volume = <label-volume>
+format-muted = <label-muted>
+label-volume = VOL %percentage%%
+label-muted = MUTED
+
+format-volume-foreground = ${colors.xcolor1}
+format-volume-background = ${colors.xcolor7}
+format-muted-foreground = ${colors.xcolor1}
+format-muted-background = ${colors.xcolor7}
+
[module/i3]
type = internal/i3
format = <label-state><label-mode>
@@ -135,8 +151,8 @@ label-focused-padding = 2
label-focused-font = 3
label-unfocused = %index%
label-unfocused-padding = 2
-label-unfocused-foreground = ${colors.xcolor1}
-label-unfocused-background = ${colors.xcolor7}
+label-unfocused-foreground = ${colors.xcolor7}
+label-unfocused-background = ${colors.xcolor1}
label-occupied = %index%
label-occupied-foreground = ${colors.xcolor1}
label-occupied-background = ${colors.xcolor7}
@@ -156,8 +172,8 @@ label-visible = %index%
label-visible-background = ${self.label-focused-background}
label-visible-underline = ${self.label-focused-underline}
label-visible-padding = ${self.label-focused-padding}
-label-mode-foreground = ${self.label-focused-foreground}
-label-mode-background = ${self.label-focused-background}
+label-mode-foreground = ${colors.xcolor7}
+label-mode-background = ${colors.xcolor1}
[module/xwindow]
type = internal/xwindow
@@ -165,7 +181,6 @@ type = internal/xwindow
format-foreground = ${colors.xcolor7}
format-background = ${colors.xcolor1}
format-padding = 2
-
label = %title%
label-maxlen = 25
@@ -218,50 +233,6 @@ format-padding = 2
label = %date% %time%
-[module/volume]
-type = internal/volume
-
-master-soundcard = default
-speaker-soundcard = default
-headphone-soundcard = default
-mapping = true
-
-format-volume = <label-volume>
-
-label-volume = VOL %percentage%%
-label-volume-foreground = ${colors.xcolor1}
-label-volume-background = ${colors.xcolor7}
-label-muted = "Muted"
-label-muted-foreground = ${colors.xcolor1}
-label-muted-background = ${colors.xcolor7}
-
-ramp-volume-0 = "  "
-ramp-volume-0-foreground = ${colors.xcolor1}
-ramp-volume-0-background = ${colors.xcolor7}
-ramp-volume-1 = "  "
-ramp-volume-1-foreground = ${colors.xcolor1}
-ramp-volume-1-background = ${colors.xcolor7}
-ramp-volume-2 = "  "
-ramp-volume-2-foreground = ${colors.xcolor1}
-ramp-volume-2-background = ${colors.xcolor7}
-ramp-volume-3 = "  "
-ramp-volume-3-foreground = ${colors.xcolor1}
-ramp-volume-3-background = ${colors.xcolor7}
-
-bar-volume-width = 10
-bar-volume-background = #495858
-bar-volume-foreground-0 = #55aa55
-bar-volume-foreground-1 = #55aa55
-bar-volume-foreground-2 = #55aa55
-bar-volume-foreground-3 = #55aa55
-bar-volume-foreground-4 = #55aa55
-bar-volume-foreground-5 = #f5a70a
-bar-volume-foreground-6 = #ff5555
-bar-volume-gradient = true
-bar-volume-indicator = "|"
-bar-volume-fill = ─
-bar-volume-empty = ─
-
[module/battery]
type = internal/battery
; To list battery & adapter: $ ls -1 /sys/class/power_supply/
@@ -278,10 +249,9 @@ format-full = <label-full>
format-full-foreground = ${colors.xcolor7}
format-full-background = ${colors.xcolor1}
-label-charging = "Charging %percentage%%"
-label-discharging = "Battery %percentage%%"
+label-charging = "BAT %percentage%%"
+label-discharging = "BAT %percentage%%"
label-discharging-foreground = ${colors.xcolor7}
-label-discharging-background = ${colors.xcolor1}
label-full = "Battery Full"
; Powerline
@@ -360,7 +330,7 @@ format = <label>
format-foreground = ${colors.xcolor7}
format-background = ${colors.xcolor1}
format-padding = 1
-label = Upd: %output%
+label = Updates: %output%
interval = 90
[settings]
diff --git a/.vim/plugin/cscope_maps.vim b/.vim/plugin/cscope_maps.vim
new file mode 100644
index 0000000..9d30e75
--- /dev/null
+++ b/.vim/plugin/cscope_maps.vim
@@ -0,0 +1,165 @@
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" CSCOPE settings for vim
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+"
+" This file contains some boilerplate settings for vim's cscope interface,
+" plus some keyboard mappings that I've found useful.
+"
+" USAGE:
+" -- vim 6: Stick this file in your ~/.vim/plugin directory (or in a
+" 'plugin' directory in some other directory that is in your
+" 'runtimepath'.
+"
+" -- vim 5: Stick this file somewhere and 'source cscope.vim' it from
+" your ~/.vimrc file (or cut and paste it into your .vimrc).
+"
+" NOTE:
+" These key maps use multiple keystrokes (2 or 3 keys). If you find that vim
+" keeps timing you out before you can complete them, try changing your timeout
+" settings, as explained below.
+"
+" Happy cscoping,
+"
+" Jason Duell jduell@alumni.princeton.edu 2002/3/7
+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+
+" This tests to see if vim was configured with the '--enable-cscope' option
+" when it was compiled. If it wasn't, time to recompile vim...
+if has("cscope")
+
+ """"""""""""" Standard cscope/vim boilerplate
+
+ " use both cscope and ctag for 'ctrl-]', ':ta', and 'vim -t'
+ set cscopetag
+
+ " check cscope for definition of a symbol before checking ctags: set to 1
+ " if you want the reverse search order.
+ set csto=0
+
+ " add any cscope database in current directory
+ if filereadable("cscope.out")
+ cs add cscope.out
+ " else add the database pointed to by environment variable
+ elseif $CSCOPE_DB != ""
+ cs add $CSCOPE_DB
+ endif
+
+ " show msg when any other cscope db added
+ set cscopeverbose
+
+
+ """"""""""""" My cscope/vim key mappings
+ "
+ " The following maps all invoke one of the following cscope search types:
+ "
+ " 's' symbol: find all references to the token under cursor
+ " 'g' global: find global definition(s) of the token under cursor
+ " 'c' calls: find all calls to the function name under cursor
+ " 't' text: find all instances of the text under cursor
+ " 'e' egrep: egrep search for the word under cursor
+ " 'f' file: open the filename under cursor
+ " 'i' includes: find files that include the filename under cursor
+ " 'd' called: find functions that function under cursor calls
+ "
+ " Below are three sets of the maps: one set that just jumps to your
+ " search result, one that splits the existing vim window horizontally and
+ " diplays your search result in the new window, and one that does the same
+ " thing, but does a vertical split instead (vim 6 only).
+ "
+ " I've used CTRL-\ and CTRL-@ as the starting keys for these maps, as it's
+ " unlikely that you need their default mappings (CTRL-\'s default use is
+ " as part of CTRL-\ CTRL-N typemap, which basically just does the same
+ " thing as hitting 'escape': CTRL-@ doesn't seem to have any default use).
+ " If you don't like using 'CTRL-@' or CTRL-\, , you can change some or all
+ " of these maps to use other keys. One likely candidate is 'CTRL-_'
+ " (which also maps to CTRL-/, which is easier to type). By default it is
+ " used to switch between Hebrew and English keyboard mode.
+ "
+ " All of the maps involving the <cfile> macro use '^<cfile>$': this is so
+ " that searches over '#include <time.h>" return only references to
+ " 'time.h', and not 'sys/time.h', etc. (by default cscope will return all
+ " files that contain 'time.h' as part of their name).
+
+
+ " To do the first type of search, hit 'CTRL-\', followed by one of the
+ " cscope search types above (s,g,c,t,e,f,i,d). The result of your cscope
+ " search will be displayed in the current window. You can use CTRL-T to
+ " go back to where you were before the search.
+ "
+
+ nmap <C-\>s :cs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>g :cs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>c :cs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>t :cs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>e :cs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-\>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-\>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-\>d :cs find d <C-R>=expand("<cword>")<CR><CR>
+
+
+ " Using 'CTRL-spacebar' (intepreted as CTRL-@ by vim) then a search type
+ " makes the vim window split horizontally, with search result displayed in
+ " the new window.
+ "
+ " (Note: earlier versions of vim may not have the :scs command, but it
+ " can be simulated roughly via:
+ " nmap <C-@>s <C-W><C-S> :cs find s <C-R>=expand("<cword>")<CR><CR>
+
+ nmap <C-@>s :scs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>g :scs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>c :scs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>t :scs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>e :scs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-@>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-@>d :scs find d <C-R>=expand("<cword>")<CR><CR>
+
+
+ " Hitting CTRL-space *twice* before the search type does a vertical
+ " split instead of a horizontal one (vim 6 and up only)
+ "
+ " (Note: you may wish to put a 'set splitright' in your .vimrc
+ " if you prefer the new window on the right instead of the left
+
+ nmap <C-@><C-@>s :vert scs find s <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@><C-@>g :vert scs find g <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@><C-@>c :vert scs find c <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@><C-@>t :vert scs find t <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@><C-@>e :vert scs find e <C-R>=expand("<cword>")<CR><CR>
+ nmap <C-@><C-@>f :vert scs find f <C-R>=expand("<cfile>")<CR><CR>
+ nmap <C-@><C-@>i :vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
+ nmap <C-@><C-@>d :vert scs find d <C-R>=expand("<cword>")<CR><CR>
+
+
+ """"""""""""" key map timeouts
+ "
+ " By default Vim will only wait 1 second for each keystroke in a mapping.
+ " You may find that too short with the above typemaps. If so, you should
+ " either turn off mapping timeouts via 'notimeout'.
+ "
+ "set notimeout
+ "
+ " Or, you can keep timeouts, by uncommenting the timeoutlen line below,
+ " with your own personal favorite value (in milliseconds):
+ "
+ "set timeoutlen=4000
+ "
+ " Either way, since mapping timeout settings by default also set the
+ " timeouts for multicharacter 'keys codes' (like <F1>), you should also
+ " set ttimeout and ttimeoutlen: otherwise, you will experience strange
+ " delays as vim waits for a keystroke after you hit ESC (it will be
+ " waiting to see if the ESC is actually part of a key code like <F1>).
+ "
+ set ttimeout
+ "
+ " personally, I find a tenth of a second to work well for key code
+ " timeouts. If you experience problems and have a slow terminal or network
+ " connection, set it higher. If you don't set ttimeoutlen, the value for
+ " timeoutlent (default: 1000 = 1 second, which is sluggish) is used.
+ "
+ set ttimeoutlen=4000
+
+endif
+
+
diff --git a/.vimrc b/.vimrc
index 5476042..a89318f 100644
--- a/.vimrc
+++ b/.vimrc
@@ -34,6 +34,9 @@ vnoremap <C-c> "*y
map <silent><Leader>p :set paste<CR>o<esc>"*]p:set nopaste<cr>"
map <silent><Leader><S-p> :set paste<CR>O<esc>"*]p:set nopaste<cr>"
+" Disable folding
+set nofoldenable
+
" Turn off swap files
set noswapfile
set nobackup
@@ -47,12 +50,13 @@ set shiftwidth=8
set softtabstop=8
set tabstop=8
set expandtab
-
+filetype plugin on
+filetype indent on
noremap p p=`[<C-o>
noremap P P=`[<C-o>
-filetype plugin on
-filetype indent on
+" Per-project indentation
+au BufRead,BufEnter ~/repositories/linux/*.{c,h} set noexpandtab
set nowrap
set linebreak
@@ -82,20 +86,24 @@ no <Up> <Nop>
no <Down> <Nop>
no <Left> <Nop>
no <Right> <Nop>
+no <Delete> <Nop>
ino <Up> <Nop>
ino <Down> <Nop>
ino <Left> <Nop>
ino <Right> <Nop>
+ino <Delete> <Nop>
vno <Up> <Nop>
vno <Down> <Nop>
vno <Left> <Nop>
vno <Right> <Nop>
+vno <Delete> <Nop>
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
nmap <Leader>s :source ~/.vimrc
nmap <Leader>v :e ~/.vimrc
+nnoremap <silent> <Leader>a :LinuxCodingStyle<cr>
let mapleader = " "
" Email options
diff --git a/.zshrc b/.zshrc
index bff09f2..90478d2 100644
--- a/.zshrc
+++ b/.zshrc
@@ -35,7 +35,7 @@ alias ls="ls --color=auto"
alias pacin="sudo pacman -S"
alias pacr="sudo pacman -Rns"
alias pacup="sudo pacman -Syu;auracle sync"
-alias msfconsole="sudo msfconsole --quiet -x \"db_connect root@msf\""
+alias irssi="torsocks irssi"
# Powerline
if [ $(pgrep -c powerline) -eq 0 ]; then