From 74e973b7327bc7e7bdd8a9d8aafd88051dc5fd8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 12 Oct 2017 20:04:48 +0200 Subject: Update some configurations --- shellrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'shellrc') diff --git a/shellrc b/shellrc index 10f6f2c..b26c8a8 100644 --- a/shellrc +++ b/shellrc @@ -15,6 +15,8 @@ else alias make="make -j$(nproc)" fi alias ll='ls -lh' +alias df='df -h' +alias du='du -h' alias grep='grep --color=auto' alias git='LANG=en_GB git' alias gdb='gdb -q' @@ -51,8 +53,8 @@ fi # 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 + [ -n "$l" ] || l=16 + tr -dc A-Za-z0-9_ < /dev/urandom | head -c "$l" | xargs } # Clip stdin to clipboard -- cgit v1.2.3 From c6cc9f526eaf1ab3f676d37c4f11dc013bdcde2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 19 Oct 2017 12:15:35 +0200 Subject: Add gitbnew function to shellrc --- shellrc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'shellrc') diff --git a/shellrc b/shellrc index b26c8a8..321c10a 100644 --- a/shellrc +++ b/shellrc @@ -90,6 +90,15 @@ gitbmerge() { ) } +# Create new branch from master +gitbnew() { + git branch "$1" master + local NW="$(git rev-parse --show-toplevel)-$1" + git worktree add "$NW" $1 + cd "$NW" + git submodule update --init --recursive +} + # Make screenshot xshot() { import -window "$(xdotool selectwindow)" ~/xshot_$(date +%F_%H%M%S_%N).png -- cgit v1.2.3 From 167166c9c1c0ab80dc1a67373241181b00b77b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 20 Oct 2017 18:10:23 +0200 Subject: Tiny cleanup --- shellrc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'shellrc') diff --git a/shellrc b/shellrc index 321c10a..a01b3e5 100644 --- a/shellrc +++ b/shellrc @@ -7,13 +7,8 @@ ################################################################################# # Aliases -if [ "$(uname -s)" = "FreeBSD" ]; then - alias ls='ls -G' -else - alias ls='ls --color=auto' - eval $(dircolors -b) - alias make="make -j$(nproc)" -fi +alias ls='ls --color=auto' +eval $(dircolors -b) alias ll='ls -lh' alias df='df -h' alias du='du -h' -- cgit v1.2.3