From 21d51449d43c0cf43ac76dc839a98012838cb156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 4 Aug 2017 16:21:03 +0200 Subject: Add -f option to system_install --- system_install | 3 +++ 1 file changed, 3 insertions(+) diff --git a/system_install b/system_install index bf93b15..69dbac7 100755 --- a/system_install +++ b/system_install @@ -12,6 +12,9 @@ git submodule update --init || (echo "Submodule update failed!"; exit 5) # Source inst and diff function . ./utils/inst +# Load if we force changes (implies no interaction) +[ "$1" = "-f" ] && FORCE=true || FORCE=false + ################################################################################# if [ -e /etc/arch-release ]; then -- cgit v1.2.3 From 42e1df975edd0f4b5ef1959f4684d526a02cabef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 8 Aug 2017 13:37:33 +0200 Subject: Add wt git alias --- gitconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/gitconfig b/gitconfig index 442f202..d4fb471 100644 --- a/gitconfig +++ b/gitconfig @@ -15,6 +15,7 @@ ci = commit st = status br = branch + wt = worktree hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short type = cat-file -t dump = cat-file -p -- cgit v1.2.3 From 86872dab2bfbb6aad93d566e66ddbb7bce5fd1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 10 Aug 2017 11:42:08 +0200 Subject: Fix suspend lock --- system/etc/pm/sleep.d/10lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/etc/pm/sleep.d/10lock b/system/etc/pm/sleep.d/10lock index da7c018..baddcb4 100755 --- a/system/etc/pm/sleep.d/10lock +++ b/system/etc/pm/sleep.d/10lock @@ -4,7 +4,7 @@ case "$1" in hibernate|suspend) - for socket in `find /run/user/*/i3 -name ipc-socket*`; do + for socket in `find /tmp/i3-* -name ipc-socket.*`; do i3-msg -s $socket "exec i3lock -d -c 000000" done ;; -- cgit v1.2.3 From 0466bf03a2d62d9e2117944c0c41def525f2c955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 10 Aug 2017 11:42:53 +0200 Subject: Update vim plugins --- vim/bundle/lightline.vim | 2 +- vim/bundle/syntastic | 2 +- vim/bundle/vim-snippets | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vim/bundle/lightline.vim b/vim/bundle/lightline.vim index ff74d65..08f9e22 160000 --- a/vim/bundle/lightline.vim +++ b/vim/bundle/lightline.vim @@ -1 +1 @@ -Subproject commit ff74d6561487d220ed9d878172d8b55a79a4c17e +Subproject commit 08f9e22c9ae4b9ecce32e7a617ef82cd419a8ace diff --git a/vim/bundle/syntastic b/vim/bundle/syntastic index e1161a7..5e1b26c 160000 --- a/vim/bundle/syntastic +++ b/vim/bundle/syntastic @@ -1 +1 @@ -Subproject commit e1161a723a353db99780f9a9351340df7abbb106 +Subproject commit 5e1b26c1724448c9d870b08dc93ce71528489333 diff --git a/vim/bundle/vim-snippets b/vim/bundle/vim-snippets index 2657c86..9181f29 160000 --- a/vim/bundle/vim-snippets +++ b/vim/bundle/vim-snippets @@ -1 +1 @@ -Subproject commit 2657c86d942e09b753dd63f200ddd05eb5b36f34 +Subproject commit 9181f29981c0fe8d633f7dea6ce69338fe6b7a47 -- cgit v1.2.3 From 629a867c5dff7c50a7cd0803957de4b9bbfae756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 10 Aug 2017 11:44:29 +0200 Subject: vim change indent guide size --- vimrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vimrc b/vimrc index 3d48e8d..16279e3 100644 --- a/vimrc +++ b/vimrc @@ -51,7 +51,7 @@ command TabToogle call TabToogle() " Indent guides let g:indent_guides_enable_on_vim_startup = 1 let g:indent_guides_start_level=2 -let g:indent_guides_guide_size=1 +let g:indent_guides_guide_size=8 let g:indent_guides_auto_colors = 0 autocmd VimEnter,Colorscheme * :hi IndentGuidesOdd ctermbg=232 autocmd VimEnter,Colorscheme * :hi IndentGuidesEven ctermbg=233 -- cgit v1.2.3 From d4177b26ddef38c6773116c34dfa6cb59c368bb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Tue, 15 Aug 2017 10:37:49 +0200 Subject: Move some oneliners from scripts to functions --- install | 3 --- local/bin/clip | 2 -- local/bin/xshot | 2 -- shellrc | 31 +++++++++++++++++++++++++++++++ 4 files changed, 31 insertions(+), 7 deletions(-) delete mode 100755 local/bin/clip delete mode 100755 local/bin/xshot diff --git a/install b/install index 30de1bb..b6a26db 100755 --- a/install +++ b/install @@ -89,9 +89,6 @@ if ask "Install desktop (i3..)"; then inst config/i3blocks/ ~/.config/i3blocks inst config/dunst/ ~/.config/dunst inst local/bin/mxrandr ~/.local/bin/ - # Some small Xserver tools - inst local/bin/clip ~/.local/bin/ - inst local/bin/xshot ~/.local/bin/ # Theme inst gtk-2.0/gtkrc ~/.gtkrc-2.0 inst gtk-3.0/ ~/.config/gtk-3.0/ diff --git a/local/bin/clip b/local/bin/clip deleted file mode 100755 index 1281090..0000000 --- a/local/bin/clip +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -xclip -selection clipboard diff --git a/local/bin/xshot b/local/bin/xshot deleted file mode 100755 index 90f91af..0000000 --- a/local/bin/xshot +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png diff --git a/shellrc b/shellrc index be99e18..1faa936 100644 --- a/shellrc +++ b/shellrc @@ -4,6 +4,9 @@ # Continue only if this is interactive shell [[ $- != *i* ]] && return +################################################################################# +# Aliases + if [ "$(uname -s)" = "FreeBSD" ]; then alias ls='ls -G' else @@ -42,8 +45,36 @@ if pidof systemd >/dev/null 2>/dev/null; then alias ujrn='jrn --user' fi +################################################################################# +# Utility functions + +# Generate random password (optionally takes length of password as first argument) genpasswd() { local l=$1 if [ "$l" = "" ]; then l=16; fi tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs } + +# Clip stdin to clipboard +clip() { + xclip -selection clipboard +} + +# Clip current HEAD hash to clipboard +gitclip() { + git rev-parse HEAD | clip +} + +# Make screenshot +xshot() { + import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png +} + +# Run given command every second +dorepeat() { + while true; do + "$@" + sleep 1 + echo + done +} -- cgit v1.2.3