aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlène <julianaito@posteo.jp>2019-06-23 22:55:40 +0200
committerCharlène <julianaito@posteo.jp>2019-06-23 22:55:40 +0200
commit351f7fd529271b6238a313c44336d71b6cf2dab7 (patch)
tree31c9189587e739472bef5090e4dbe0383efa1b95
downloaddotfiles-351f7fd529271b6238a313c44336d71b6cf2dab7.tar.gz
First commit on my own server.
-rw-r--r--.Xresources143
-rw-r--r--.env40
-rw-r--r--.ksh_completion40
-rw-r--r--.kshrc58
-rw-r--r--.profile2
-rw-r--r--.spectrwm.conf88
-rw-r--r--.spectrwm_fr.conf35
-rw-r--r--.tmux.conf11
-rw-r--r--.tmux.conf.dwm44
-rwxr-xr-x.vimrc27
-rwxr-xr-x.xsession54
-rw-r--r--LICENSE.md13
-rw-r--r--README3
-rwxr-xr-xbin/genmon77
-rwxr-xr-xbin/spwd44
-rwxr-xr-xbin/vga16
16 files changed, 695 insertions, 0 deletions
diff --git a/.Xresources b/.Xresources
new file mode 100644
index 0000000..30c5708
--- /dev/null
+++ b/.Xresources
@@ -0,0 +1,143 @@
+XTerm*loginShell:true
+
+Xcursor.size: 32
+
+! URXVT
+! =====
+
+URxvt.perl-ext-common: default,selection-to-clipboard,matcher
+!,tabbed
+URxvt.keysym.M-u: perl:url-select:select_next
+URxvt.url-launcher: /usr/local/bin/iridium
+URxvt.underlineURLs: True
+URxvt.matcher.button: 1
+URxvt.keysym.M-Escape:perl:keyboard-select:activate
+! Comment this if you don't want copy when text is selected
+URxvt.clipboard.autocopy: true
+
+
+URxvt.scrollBar: false
+!URxvt*font:-*-terminus-bold-*-*-*-*-*-*-*-*-*-iso10646-1
+URxvt*font:xft:Fantasque Sans Mono:style=Bold:pixelsize=20:hintstyle=hintsfull
+
+!urxvt*transparent: true
+!urxvt*shading: 40
+urxvt*background: #150A14
+urxvt*foreground: lightpink
+*colorBD: paleturquoise3
+!URxvt.tabbed.tabbar-fg: 247
+!URxvt.tabbed.tabbar-bg: 117
+!URxvt.tabbed.tab-fg: 16
+!URxvt.tabbed.tab-bg: 117
+
+! ROFI
+! ====
+
+
+! State: ´bg´, ´fg´, ´bgalt´, ´hlbg´, ´hlfg´
+rofi.color-normal: #150A14, lightpink, #150A14, lightpink, darkslateblue
+!rofi.color-urgent: #fdf6e3, #dc322f, #eee8d5, #dc322f, #fdf6e3
+rofi.color-active: lightpink, darkslateblue, lightpink, darkslateblue, #150A14
+! ´background´, ´border´, ´separator´
+rofi.color-window: #150A14, lightpink, #150A14
+rofi.font: Terminus Bold 14
+
+
+! GLOBAL COLORSCHEME
+! ==================
+
+! black
+*color0: #2E3436
+*color8: #555753
+! red
+*color1: #a40000
+*color9: #EF2929
+! green
+*color2: #4E9A06
+*color10: #8AE234
+! yellow
+*color11: #ffff00
+*color3: #CA6924
+! blue
+*color4: #3465A4
+*color12: #729FCF
+! purple
+*color5: #5B3256
+*color13: #AD7FA8
+! cyan
+*color6: #00AAAA
+*color14: #00FFFF
+! white
+*color7: #babdb9
+*color15: #EEEEEC
+
+! XMESSAGE
+! ========
+
+Xmessage*font: -*-terminus-bold-*-*-*-*-*-*-*-*-*-iso10646-1
+Xmessage*background: lightpink
+Xmessage*foreground: #150A14
+Xmessage*form.*.shapeStyle: rectangle
+Xmessage*Scrollbar.width: 1
+Xmessage*Scrollbar.borderWidth: 0
+!Xmessage.form.message.Scroll: WhenNeeded
+!Xmessage*Buttons: Quit
+!Xmessage*defaultButton: Quit
+!Xmessage*geometry: 400x200+1300+870
+Xmessage*center: FALSE
+Xmessage*NearMouse: FALSE
+Xmessage*Command.borderColor: #150A14
+Xmessage*Text.borderColor: #150A14
+Xmessage*Form.borderColor: #150A14
+
+
+
+! XCALC
+! =====
+
+xcalc*ti.button1.vertDistance: 4
+xcalc*ti.button2.vertDistance: 4
+xcalc*ti.button3.vertDistance: 4
+xcalc*ti.button4.vertDistance: 4
+xcalc*ti.button5.vertDistance: 4
+
+xcalc*ti.background: gray90
+
+xcalc*ti.bevel.borderColor: gray65
+xcalc*ti.bevel.borderWidth: 1
+xcalc*ti.bevel.vertDistance: 4
+xcalc*ti.bevel.defaultDistance: 0
+xcalc*ti.bevel.background: rgb:b/c/b
+xcalc*ti.bevel.screen*background: rgb:b/c/b
+xcalc*ti.bevel.screen.borderColor: rgb:b/c/b
+xcalc*ti.bevel.screen.vertDistance: 10
+xcalc*ti.bevel.screen.horizDistance: 10
+xcalc*ti.bevel.screen*left: chainLeft
+xcalc*ti.bevel.screen*right: chainRight
+xcalc*ti.bevel.screen*top: chainTop
+xcalc*ti.bevel.screen*bottom: chainBottom
+xcalc*ti.bevel.screen*LCD.foreground: gray10
+xcalc*ti.bevel.screen*INV.vertDistance: 0
+
+xcalc*ti.Command.borderColor: gray65
+xcalc*ti.Command.background: gray85
+xcalc*ti.Command.foreground: gray30
+
+xcalc*ti.button5.background: rgb:e/b/b
+xcalc*ti.button20.background: rgb:e/d/c
+xcalc*ti.button25.background: rgb:e/d/c
+xcalc*ti.button30.background: rgb:e/d/c
+xcalc*ti.button35.background: rgb:e/d/c
+xcalc*ti.button40.background: rgb:b/b/e
+xcalc*ti.button22.background: gray95
+xcalc*ti.button23.background: gray95
+xcalc*ti.button24.background: gray95
+xcalc*ti.button27.background: gray95
+xcalc*ti.button28.background: gray95
+xcalc*ti.button29.background: gray95
+xcalc*ti.button32.background: gray95
+xcalc*ti.button33.background: gray95
+xcalc*ti.button34.background: gray95
+xcalc*ti.button37.background: gray95
+xcalc*ti.button38.background: gray95
+xcalc*ti.button39.background: gray95
diff --git a/.env b/.env
new file mode 100644
index 0000000..2ae9ebf
--- /dev/null
+++ b/.env
@@ -0,0 +1,40 @@
+#!/bin/ksh
+
+# overkill
+export LANG=fr_FR.UTF-8
+export LC_COLLATE=fr_FR.UTF-8
+export LC_CTYPE=fr_FR.UTF-8
+export LC_MONETARY=fr_FR.UTF-8
+export LC_NUMERIC=fr_FR.UTF-8
+export LC_TIME=fr_FR.UTF-8
+export LC_MESSAGES=fr_FR.UTF-8
+export LC_ALL=fr_FR.UTF-8
+
+#export PAGER=/usr/local/bin/w3m
+export FCEDIT=/usr/local/bin/vim
+export EDITOR=/usr/local/bin/vim
+export VISUAL=/usr/local/bin/vim
+
+# set PS1 with colors - even in tmux sessions.
+local curterm="${TERM}"
+export TERM=rxvt-unicode-256color
+export PS1="\[\e]0;\u@\h \w\a\]"\
+"\[$(tput setaf 81)\]\u"\
+"\[$(tput setaf 244)\]@"\
+"\[$(tput setaf 231)\]\h"\
+"\[$(tput setaf 244)\]:"\
+"\[$(tput setaf 219)\]\$(awk -f "${HOME}/bin/spwd" -- "\${PWD}")"\
+"\[$(tput setaf 244)\]> "\
+"\[$(tput sgr0)\]"
+
+export PS2="\[$(tput setaf 231)\]> \[$(tput sgr0)\]"
+export PS3="\[$(tput setaf 231)\]\#? \[$(tput sgr0)\]"
+export PS4="\[$(tput setaf 231)\]+ \[$(tput sgr0)\]"
+export TERM="${curterm}"
+
+# Yes i use GNU ls.
+LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:';
+export LS_COLORS
+
+export PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin:/usr/games
+
diff --git a/.ksh_completion b/.ksh_completion
new file mode 100644
index 0000000..177f3fa
--- /dev/null
+++ b/.ksh_completion
@@ -0,0 +1,40 @@
+#!/bin/ksh
+
+# XXX doesn't deal with sections. Slow when added to completion.
+#complete_available_manpages="$(
+# makewhatis -QDn |\
+# awk '
+# {
+# # Remove all sections and whatis content
+# sub(/\(.+$/, "");
+# # Expand multiple call manpages to several lines
+# gsub(/, /, "\n"); print
+# }
+# '
+#)"
+#set -A complete_apropos -- ${complete_available_manpages}
+#set -A complete_man -- ${complete_available_manpages}
+
+complete_installed_packages="$(find /var/db/pkg/ -type d | awk -F '/' '{print $NF}')"
+
+set -A complete_ifconfig_1 -- $(ifconfig | awk -F: '/^[a-z]/{print $1}')
+set -A complete_lftp -- $(awk '{print $1}' ${HOME}/.lftp/bookmarks)
+set -A complete_pkg_delete -- ${complete_installed_packages}
+set -A complete_pkg_info -- ${complete_installed_packages}
+# Auto complete show-reverse-deps with portspath
+function showrdeps {
+ show-reverse-deps $@
+}
+set -A complete_showrdeps -- $(cat /usr/local/share/sqlports.list)
+# Complete hosts
+set -A complete_ssh -- $(
+ awk -F '(,| )' '
+ $1 !~ /^\|/ {
+ gsub(/(\[|\])/, "", $1)
+ print($1)
+ }
+ ' ${HOME}/.ssh/known_hosts
+)
+
+
+# vim: ft=sh ts=4 sw=4 et
diff --git a/.kshrc b/.kshrc
new file mode 100644
index 0000000..703cd5b
--- /dev/null
+++ b/.kshrc
@@ -0,0 +1,58 @@
+#!/bin/ksh
+
+. $HOME/.env
+. $HOME/.ksh_completion
+# I have stuff to hide.
+. $HOME/.ksh_private
+
+# Yes, GNU ls.
+alias ls="gls --color=auto -F"
+alias ll="ls -lh"
+alias la="ls -ah"
+
+alias deleteorig="find . -name '*.orig' -delete"
+alias net="doas sh /etc/netstart"
+# Search for a perl module version, try "pmodver File::Temp"
+alias pmodver='perl -e"eval qq{use \$ARGV[0];\\\$v=\\\$\${ARGV[0]}::VERSION;};\ print\$@?qq{No module found\n}:\$v?qq{Version \$v\n}:qq{Found.\n};"$1'
+# My ports helper script
+alias portmode=". /usr/ports/mystuff/portmode; set -o emacs"
+alias poweroff="doas shutdown -p now"
+# I used to be a Debian user...
+alias see="xdg-open"
+alias signify_sign="signify -S -s ${HOME}/.signify/julianaito.sec -m"
+alias signify_verify="signify -V -p ${HOME}/.signify/julianaito.pub -m"
+# OpenBSD snapshot update, see https://github.com/qbit/snap
+alias snap="cd ~/codes/shell/snap/; git pull origin master; doas ./snap -W"
+alias www="w3m -no-cookie https://duckduckgo.com"
+
+# Quick search for a given port
+function greports {
+ grep -i $@ /usr/local/share/sqlports.list
+}
+# Too lazy to explain
+function vultr {
+ local userhost="$(cat "${HOME}/vultr.ip")"
+ ssh ${userhost} $@
+}
+# Pastebin stuff:
+# 0x0 < somefile
+# command | 0x0
+# 0x0 somefile # useful to keep extension in the pastebin url
+function 0x0 {
+ local toupload="-"
+ test ! -z "${1}" && toupload="${1}"
+ curl -F"file=@${toupload}" http://0x0.st
+}
+# You can use -Dsnap indefinitely actually
+for c in add delete check; do
+ alias pkg_${c}="doas /usr/sbin/pkg_${c} -Dsnap"
+done
+for c in reboot dhclient usbdevs pcidump newshm testports sysupgrade; do
+ alias ${c}="doas $(which ${c})"
+done
+# Use cups lp-related binaries
+for i in lpq lpr lprm; do
+ alias $i=/usr/local/bin/$i
+done
+
+set -o emacs
diff --git a/.profile b/.profile
new file mode 100644
index 0000000..7930cb1
--- /dev/null
+++ b/.profile
@@ -0,0 +1,2 @@
+export ENV=$HOME/.kshrc
+ulimit -c 0
diff --git a/.spectrwm.conf b/.spectrwm.conf
new file mode 100644
index 0000000..939c19e
--- /dev/null
+++ b/.spectrwm.conf
@@ -0,0 +1,88 @@
+
+workspace_limit =4
+focus_mode = follow
+
+# Window Decoration
+border_width = 1
+color_focus = lightpink
+color_focus_maximized = lightpink
+color_unfocus = rgb:15/01/14
+color_unfocus_maximized = rgb:15/01/14
+tile_gap = 0
+
+# Remove window border when bar is disabled and there is only one window in workspace
+disable_border = 1
+
+# Bar Settings
+bar_enabled = 1
+bar_border_width = 0
+bar_color = rgb:15/01/14,lightpink
+bar_color_selected = lightpink
+bar_font_color = lightpink,rgb:15/01/14
+bar_font_color_selected = rgb:15/01/14
+bar_font = Terminus,Noto,Noto Emoji
+bar_action = /home/charlene/bin/genmon
+bar_justify = right
+bar_format = +L +| +@bg1+@fg1 +_120_W +@bg0+@fg0 +| +A
+bar_layout = T|3C|T
+workspace_indicator = listall, printnames, markcurrent, markurgent
+maximize_hide_bar = 0
+window_class_enabled = 0
+window_instance_enabled = 0
+window_name_enabled = 0
+verbose_layout = 1
+urgent_enabled = 1
+
+# Dialog box size ratio when using TRANSSZ quirk; 0.3 < dialog_ratio <= 1.0
+dialog_ratio = 0.6
+
+# Set workspace name at start
+name = ws[1]:term
+name = ws[2]:www
+name = ws[3]:misc
+name = ws[4]:buf
+
+# Mod key, (Windows key is Mod4) (Apple key on OSX is Mod2)
+modkey = Mod4
+
+# This allows you to include pre-defined key bindings for your keyboard layout.
+keyboard_mapping = ~/.spectrwm_fr.conf
+
+# PROGRAMS
+
+# Validated default programs:
+program[menu] = rofi -show run
+program[term] = urxvt
+program[lock] = xlock
+program[screenshot] = screenshot
+
+
+bind[lock] = MOD+Shift+Delete
+bind[term] = MOD+Shift+Return
+bind[menu] = MOD+p
+bind[screenshot] = Mod+Menu
+
+# Optional default programs that will only be validated if you override:
+
+program[unmnt] = urxvt -e "unmnt"
+bind[unmnt] = MOD+u
+program[mntsd] = urxvt -e "mntsd"
+bind[mntsd] = MOD+s
+
+
+# Quirks
+quirk[.*] = NONE
+quirk[Sylpheed] = WS[3]
+# Allows gvim to be opened alongside sylpheed when sylpheed is launched
+# from another workspace and i open an attachment, and other cases.
+quirk[.*:.*:.*] = IGNORESPAWNWS
+quirk[chromium-browser] = WS[2]
+quirk[.*:chromium-browser] = WS[2]
+# Gimp can be used in single window mode
+quirk[Gimp:gimp] = NONE
+quirk[Xmessage] = FLOAT ANYWHERE
+
+# Autorun
+
+autorun ws[2]:iridium
+autorun ws[3]:sylpheed
diff --git a/.spectrwm_fr.conf b/.spectrwm_fr.conf
new file mode 100644
index 0000000..2a35fea
--- /dev/null
+++ b/.spectrwm_fr.conf
@@ -0,0 +1,35 @@
+# Key bindings for French (fr) keyboards
+# unbind with: bind[] = <keys>
+bind[bar_toggle] = MOD+b
+bind[bar_toggle_ws] = MOD+Shift+b
+bind[button2] = MOD+v
+bind[cycle_layout] = MOD+space
+bind[float_toggle] = MOD+f
+bind[focus_next] = MOD+j
+bind[focus_prev] = MOD+k
+bind[layout_horizontal] = MOD+S+t
+bind[master_add] = MOD+i
+bind[master_del] = MOD+d
+bind[master_grow] = MOD+l
+bind[master_shrink] = MOD+h
+bind[maximize_toggle] = MOD+m
+bind[menu] = MOD+p
+bind[move_down] = MOD+Shift+asterisk
+bind[move_left] = MOD+ugrave
+bind[move_right] = MOD+asterisk
+bind[move_up] = MOD+Shift+ugrave
+bind[mvws_1] = MOD+Shift+a
+bind[mvws_2] = MOD+Shift+z
+bind[mvws_3] = MOD+Shift+e
+bind[mvws_4] = MOD+Shift+r
+bind[quit] = MOD+Shift+q
+bind[restart] = MOD+q
+bind[stack_dec] = MOD+Shift+d
+bind[stack_inc] = MOD+Shift+i
+bind[stack_reset] = MOD+Shift+space
+bind[swap_main] = MOD+Return
+bind[wind_del] = MOD+Shift+c
+bind[ws_1] = MOD+a
+bind[ws_2] = MOD+z
+bind[ws_3] = MOD+e
+bind[ws_4] = MOD+r
diff --git a/.tmux.conf b/.tmux.conf
new file mode 100644
index 0000000..d3e4e8c
--- /dev/null
+++ b/.tmux.conf
@@ -0,0 +1,11 @@
+set -g default-terminal "tmux-256color"
+set -g mouse on
+set -g status-bg colour5
+set -g status-fg colour219
+set -g pane-active-border-style fg=colour5
+
+source-file ~/.tmux.conf.dwm
+
+# Bring back ssh agent from a detached tmux
+set -g update-environment -r
+setenv -g SSH_AUTH_SOCK $HOME/.ssh/ssh_auth_sock
diff --git a/.tmux.conf.dwm b/.tmux.conf.dwm
new file mode 100644
index 0000000..e739c16
--- /dev/null
+++ b/.tmux.conf.dwm
@@ -0,0 +1,44 @@
+# dwm like tiling for tmux
+# From https://github.com/saysjonathan/dwm.tmux
+
+
+# Create new pane
+bind -n M-n split-window -t :.0 \;\
+ swap-pane -s :.0 -t :.1 \;\
+ select-layout main-vertical \;\
+ run "tmux resize-pane -t :.0 -x \"$(echo \"#{window_width}/2/1\" | bc)\""
+
+# Create new pane in current directory
+bind -n M-w split-window -t :.0 -c "#{pane_current_path}" \;\
+ swap-pane -s :.0 -t :.1 \;\
+ select-layout main-vertical \;\
+ run "tmux resize-pane -t :.0 -x \"$(echo \"#{window_width}/2/1\" | bc)\""
+
+# Kill pane
+bind -n M-c kill-pane -t :. \;\
+ select-layout main-vertical \;\
+ run "tmux resize-pane -t :.0 -x \"$(echo \"#{window_width}/2/1\" | bc)\"" \;\
+ select-pane -t :.0
+
+
+# Next pane
+bind -n M-j select-pane -t :.+
+
+# Prev pane
+bind -n M-k select-pane -t :.-
+
+# Rotate counterclockwise
+bind -n M-, rotate-window -U \; select-pane -t 0
+
+# Rotate clockwise
+bind -n M-. rotate-window -D \; select-pane -t 0
+
+# Focus selected pane
+bind -n M-Space swap-pane -s :. -t :.0 \; select-pane -t :.0
+
+# Refresh layout
+bind -n M-r select-layout main-vertical \;\
+ run "tmux resize-pane -t :.0 -x \"$(echo \"#{window_width}/2/1\" | bc)\""
+# Monocle
+unbind M-m
+bind-key -n M-m resize-pane -Z
diff --git a/.vimrc b/.vimrc
new file mode 100755
index 0000000..28664d2
--- /dev/null
+++ b/.vimrc
@@ -0,0 +1,27 @@
+set t_Co=256
+syntax on
+" see https://github.com/sonjapeterson/1989.vim
+colorscheme 1989
+" Ensure transparency
+hi Normal ctermbg=NONE guibg=NONE
+hi LineNr ctermbg=NONE guibg=NONE
+hi SignColumn ctermbg=NONE guibg=NONE
+" Show tabs and trailing spaces
+set list listchars=tab:▸\ ,trail:·
+set nocompatible
+set showmatch
+set smartcase
+set autowrite
+set updatecount=0
+set mouse=a
+set ts=4
+set sw=4
+set expandtab
+set ru
+set ai
+set autoread
+set bs=2
+set wildmenu
+filetype on
+filetype plugin on
+filetype indent on
diff --git a/.xsession b/.xsession
new file mode 100755
index 0000000..1ed54fe
--- /dev/null
+++ b/.xsession
@@ -0,0 +1,54 @@
+#!/bin/ksh
+
+# With xenodm it's run as a login shell
+export ENV=$HOME/.kshrc
+# I don't need to run .kshrc, but i want my env vars
+. $HOME/.env
+# symlink the ssh agent socket so in case tmux is detached
+# and reattached by force (Xorg crashing etc.) i can still use ssh
+if test "${SSH_AUTH_SOCK}" ; then
+ ln -sf "${SSH_AUTH_SOCK}" ${HOME}/.ssh/ssh_auth_sock
+fi
+
+case "$(hostname -s)" in kagami|tsukasa)
+ # Switch to external vga if connected,
+ vga
+ # Set backlight
+ xbacklight -set 50
+ # Trackpoint wheel stuff
+ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
+ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
+ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
+ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Timeout" 300
+ xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Inertia" 1
+ # touchpads. Requires /etc/X11/xorg.conf.d/99-synaptics.conf
+ #Section "InputClass"
+ # Identifier "touchpad"
+ # MatchIsTouchpad "on"
+ # Driver "synaptics"
+ #EndSection
+ synclient TapButton2=2 TapButton3=3 VertScrollDelta=80 HorizTwoFingerScroll=1 PalmDetect=1
+ # Lock screen
+ #xidle -timeout 300 -program /usr/X11R6/bin/xlock &
+esac
+
+xset -dpms
+xsetroot -solid black
+xrdb -l ${HOME}/.Xresources
+xset +fp ${HOME}/.fonts
+# No bell
+xset b 0
+# Caps Lock -> Escape (vimmer inside)
+setxkbmap fr -variant oss -option caps:escape
+# sets standard mouse speed. I use 45/10 with the trackpoint
+xset m 11/10 0
+
+# I love my screen redish
+sct 3000 &
+urxvt -e tmux &
+
+#exec fvwm
+exec spectrwm
+
+# vim: ft=sh sw=4 ts=4
+
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..97a56ec
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,13 @@
+Copyright 2019 Charlène Wendling
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
diff --git a/README b/README
new file mode 100644
index 0000000..45ef508
--- /dev/null
+++ b/README
@@ -0,0 +1,3 @@
+# dotfiles
+
+Putting here a copy of my dotfiles.
diff --git a/bin/genmon b/bin/genmon
new file mode 100755
index 0000000..10f0daa
--- /dev/null
+++ b/bin/genmon
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+# genmon: displays some system stats. Intended for status bar apps.
+# This is not made for general use, you'll need to modify the code
+# to fit your needs.
+
+# It's made for spectrwm at the moment, you'll need to remove the
+# font markers if you want to use it elsewhere:
+# sed -E 's,\+@fn[0-9],,g' genmon
+
+_netstats() {
+ # USB tethering status
+ urndis="📱"
+ ifconfig urndis0 2> /dev/null | grep inet > /dev/null || urndis="📵"
+ printf "+@fn2${urndis}+@fn0"
+
+ # WiFi status
+ ifconfig iwn0 | awk -F": " '
+ /\t+status:/ {status = $2 }
+ /\t+ieee80211:/ && status == "active" {
+ # We ensure that nwid with spaces will be properly displayed
+ startnwid = index($0, "nwid") + 5
+ if (startnwid == 5) # it s a join instead
+ startnwid = index($0, "join") + 5
+ endnwid = index($0, " chan ")
+ nwid = substr($0, startnwid, endnwid - startnwid)
+ split($0, tokens, " ")
+ for (item in tokens)
+ if (tokens[item] ~ /-[0-9.]+dBm/)
+ strength = "," tokens[item]
+ }
+ END {
+ status = status == "active" ? "📶" : "✈️"
+ printf("+@fn1%s+@fn0%s%s ", status, nwid, strength)
+ }
+ ' 2> /dev/null || return
+}
+
+_genmon() {
+ sysctl | awk -F= \
+ -v date="$(date +"+@fn2📆+@fn0%a. %d/%m +@fn2🕐+@fn0%R")" \
+ -v ramused="$(vmstat | awk 'END{sub(/M/, "", $3); print $3}')" \
+ -v netstat="$(_netstats)" \
+ '
+ # status (charging or not)
+ /hw.sensors.acpibat0.raw0/ {split($2, batstat, " ")}
+ # battery capacity when full
+ /hw.sensors.acpibat0.(watt|amp)hour0/ {split($2, batful, " ")}
+ # current battery capacity
+ /hw.sensors.acpibat0.(watt|amp)hour3/ {split($2, batcur, " ")}
+ /vm.loadavg/ {split($2, loadavg, " ")}
+ /hw.physmem/ {split($2, ramtotal, " ")}
+
+ END {
+ if (batful[1] > 0) { # we need a battery to display stats
+ batsts = batstat[1] == 1 ? "🔋" : "🔌"
+ batlvl = int(batcur[1] * 100 / batful[1])
+ bat = sprintf("+@fn2%s+@fn0%s%%", batsts, batlvl)
+ }
+ ldsts = loadavg[1] >= 1 ? "🐣" : "🐥"
+ ldavg = sprintf("+@fn2%s+@fn0%s", ldsts, loadavg[1])
+
+ rampct = int(ramused * 100 * 1024**2 / ramtotal[1])
+ ram = sprintf("+@fn1▩+@fn0%s%%", rampct)
+
+ print(netstat, ram, ldavg, bat, date)
+ }
+ '
+}
+
+while true; do
+ _genmon
+ sleep 30
+done
+
+
+# vim: ts=4 sw=4 et ft=awk
diff --git a/bin/spwd b/bin/spwd
new file mode 100755
index 0000000..3fafba8
--- /dev/null
+++ b/bin/spwd
@@ -0,0 +1,44 @@
+#!/usr/bin/awk -f
+# spwd: pure AWK path shortener for PS1
+# Shortens a path by keeping only the first character of each directory, or the
+# two firsts if it starts with a dot.
+
+# Usage:
+# export PS1="\u:\$(awk -f /where/is/spwd -- "\${PWD}")> "
+
+# Runtime example:
+# charlene:/u/s/d/mg> echo $PWD
+# /usr/share/doc/mg
+# charlene:/u/s/d/mg> cd /home/charlene/.vim/colors/
+# charlene:~/.v/colors>
+
+# Should be POSIX-compliant, tested with OpenBSD's awk, mawk and gawk.
+# May break if you have funny chars in $HOME
+
+BEGIN {
+ # dealing with directories with spaces
+ for (elem = 1; elem < length(ARGV); elem++) {
+ pwd = sprintf("%s %s", pwd, ARGV[elem])
+ }
+ sub(/^ /, "", pwd)
+
+ home = ENVIRON["HOME"]
+ # Regex-ify $HOME
+ gsub(/\//, "\\/", home)
+ sub("^"home, "~", pwd)
+ if (pwd == "~") {
+ printf(pwd)
+ exit
+ }
+
+ split(pwd, pelems, /\//)
+ # we don't need the useless pelems[0], and the shortened "basename $PWD"
+ # (last one). Also the pelems[1] is empty because pwd starts with the
+ # seperator, so it will always prints '/'.
+ for (i = 1; i < length(pelems); i++) {
+ # two characters for dotfiles/dirs
+ nchar = substr(pelems[i], 1, 1) == "." ? 2 : 1
+ printf("%s/", substr(pelems[i], 1, nchar))
+ }
+ printf("%s", pelems[length(pelems)])
+}
diff --git a/bin/vga b/bin/vga
new file mode 100755
index 0000000..b19c4bc
--- /dev/null
+++ b/bin/vga
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# Switch to external vga if plugged in. This is a poor hack.
+
+xrandr | grep "VGA1 connected"
+
+case $? in
+ 0) _off="LVDS1"
+ _on="VGA1"
+ ;;
+ *) _on="LVDS1"
+ _off="VGA1"
+ ;;
+esac
+
+xrandr --output "${_off}" --off --output "${_on}" --auto