summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Vertes <mvertes@free.fr>2021-02-14 18:59:26 +0100
committerMarc Vertes <mvertes@free.fr>2021-02-14 18:59:26 +0100
commitfdbb4f3bd7a651834904d0446303b10a76a6e349 (patch)
treef5f79f29f740a43328c06e370d0cf7549b687e91
parent9aa203f7d7a1899aac7bb7d8209cc2a394ffdbd8 (diff)
update
-rw-r--r--.Xresources9
-rw-r--r--.gitconfig2
-rw-r--r--.vimrc2
-rw-r--r--.xinitrc24
-rwxr-xr-x.xsession24
-rw-r--r--.zsh-powerline.sh80
-rwxr-xr-xbin/open11
7 files changed, 88 insertions, 64 deletions
diff --git a/.Xresources b/.Xresources
index b1c3e3d..be0e99f 100644
--- a/.Xresources
+++ b/.Xresources
@@ -18,10 +18,11 @@ URxvt.keysym.C-Next: font-size:decrease
xterm*termName: xterm-256color
xterm*VT100.Translations: #override \
- Ctrl <Key> Next: smaller-vt-font() \n\
- Ctrl <Key> Prior: larger-vt-font() \n
-xterm*faceName: DejaVu Sans Mono
-xterm*faceSize: 10
+ Meta <Key> minus: smaller-vt-font() \n\
+ Meta <Key> equal: larger-vt-font() \n
+xterm*cursorColor: red
+!xterm*faceName: DejaVu Sans Mono
+!xterm*faceSize: 10
! xterm*font: 7x14
! Allow sixel graphics. (Try: "convert -colors 16 foo.jpg sixel:-").
xterm*decTerminalID: vt340
diff --git a/.gitconfig b/.gitconfig
index eaefde0..cefd5e5 100644
--- a/.gitconfig
+++ b/.gitconfig
@@ -13,3 +13,5 @@
name = Marc Vertes
[pull]
rebase = false
+[hub]
+ protocol = ssh
diff --git a/.vimrc b/.vimrc
index f8fce87..671af49 100644
--- a/.vimrc
+++ b/.vimrc
@@ -13,7 +13,7 @@ let g:fzf_preview = 'cat {}'
let g:vimki_lower = "a-zàçéèêếëîïñôöùûü"
autocmd filetype vimki syntax on
autocmd filetype vimki set autowrite
-autocmd filetype vimki setlocal spell spelllang=fr
+"autocmd filetype vimki setlocal spell spelllang=fr
autocmd filetype vimki nmap <leader>z :FZF ~/Wiki<CR>
autocmd filetype vimki nnoremap <leader>= YpVr=
diff --git a/.xinitrc b/.xinitrc
deleted file mode 100644
index f982ca7..0000000
--- a/.xinitrc
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# start pulseaudio on crux only. Should be handled by systemd on arch
-#pulseaudio --start --exit-idle-time=-1 --log-target=syslog &
-
-# enable tapping and natural scrolling on touchpad
-# see xinput --list[-props] for ids
-xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Tapping Enabled' 1
-xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Natural Scrolling Enabled' 1
-
-# Better use /etc/X11/xorg.conf.d/10-keyboard.conf to handle hot plugged keyboards
-#setxkbmap fr
-#xk
-hdmi
-
-xrdb ~/.Xresources
-#xsetroot -solid rgb:3/4/5
-xsetroot -solid rgb:1/3/4
-#feh --bg-fill ~/Downloads/Alaska_Range.jpg
-#conky
-#slock
-
-# Start window manager
-#exec fvwm
-exec i3
diff --git a/.xsession b/.xsession
deleted file mode 100755
index f982ca7..0000000
--- a/.xsession
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-# start pulseaudio on crux only. Should be handled by systemd on arch
-#pulseaudio --start --exit-idle-time=-1 --log-target=syslog &
-
-# enable tapping and natural scrolling on touchpad
-# see xinput --list[-props] for ids
-xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Tapping Enabled' 1
-xinput --set-prop 'SYNA7DAB:00 06CB:CD40 Touchpad' 'libinput Natural Scrolling Enabled' 1
-
-# Better use /etc/X11/xorg.conf.d/10-keyboard.conf to handle hot plugged keyboards
-#setxkbmap fr
-#xk
-hdmi
-
-xrdb ~/.Xresources
-#xsetroot -solid rgb:3/4/5
-xsetroot -solid rgb:1/3/4
-#feh --bg-fill ~/Downloads/Alaska_Range.jpg
-#conky
-#slock
-
-# Start window manager
-#exec fvwm
-exec i3
diff --git a/.zsh-powerline.sh b/.zsh-powerline.sh
new file mode 100644
index 0000000..f0835a4
--- /dev/null
+++ b/.zsh-powerline.sh
@@ -0,0 +1,80 @@
+# Colorscheme
+readonly COLOR_CWD='blue'
+readonly COLOR_GIT='cyan'
+readonly COLOR_SUCCESS='green'
+readonly COLOR_FAILURE='red'
+readonly COLOR_TIME='cyan'
+
+readonly SYMBOL_GIT_BRANCH='⑂'
+readonly SYMBOL_GIT_MODIFIED='*'
+readonly SYMBOL_GIT_PUSH='↑'
+readonly SYMBOL_GIT_PULL='↓'
+readonly PS_SYMBOL='$'
+
+_git_info() {
+ hash git 2>/dev/null || return # git not found
+
+ # get current branch
+ local ref=$(git symbolic-ref --short HEAD 2>/dev/null)
+
+ if [[ -n "$ref" ]]; then
+ # prepend branch symbol
+ ref=$SYMBOL_GIT_BRANCH$ref
+ else
+ # get most recent tag or abbreviated unique hash
+ ref=$(git describe --tags --always 2>/dev/null)
+ fi
+
+ [[ -n "$ref" ]] || return # not a git repo
+
+ local marks
+
+ # scan first two lines of output from `git status`
+ while IFS= read -r line; do
+ if [[ $line =~ ^## ]]; then # header line
+ [[ $line =~ ahead\ ([0-9]+) ]] && marks+=" $SYMBOL_GIT_PUSH$match[1]"
+ [[ $line =~ behind\ ([0-9]+) ]] && marks+=" $SYMBOL_GIT_PULL$match[1]"
+ else # branch is modified if output contains more lines after the header line
+ marks="$SYMBOL_GIT_MODIFIED$marks"
+ break
+ fi
+ done < <(git status --porcelain --branch 2>/dev/null) # note the space between the two <
+
+ # print without a trailing newline
+ printf " $ref$marks"
+}
+
+
+_config_prompt() {
+ # Color coding based on exit code of the previous command. Note this must
+ # be dealt with in the beginning of the function, otherwise the $? will not
+ # match the right command executed.
+
+ if [[ $? -eq 0 ]]; then
+ local symbol="%F{$COLOR_SUCCESS}$PS_SYMBOL%f"
+ else
+ local symbol="%F{$COLOR_FAILURE}$PS_SYMBOL%f"
+ fi
+
+ local cwd="%F{$COLOR_CWD}%~%f"
+ local git="%F{$COLOR_GIT}$(_git_info)%f"
+ local time="%F{$COLOR_TIME}%D{%H:%M:%S}%f"
+
+ PROMPT="$cwd$git $symbol "
+ RPROMPT="$time"
+}
+
+
+# useful zsh hook functions
+
+precmd() { # run before each prompt
+ _config_prompt
+}
+
+
+preexec() { # run after user command is read and about to execute
+}
+
+
+chpwd() { # run when changing current working directory
+}
diff --git a/bin/open b/bin/open
deleted file mode 100755
index 0fa97a7..0000000
--- a/bin/open
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-exec >/tmp/open.out 2>&1
-set -x
-
-cmd=xdg-open
-case $1 in
-(*.mkv|*.mp4) cmd=vlc;;
-esac
-
-exec $cmd "$@"