From a5a3ae373c6c7749d3a424db5163c1319ed75e1c Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Sat, 22 Apr 2017 18:04:17 +0200 Subject: [PATCH] cccccache ! --- bashrc | 9 ++++----- config/htop/htoprc | 2 +- scripts/sedrename | 47 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100755 scripts/sedrename diff --git a/bashrc b/bashrc index ce2bf9e..caac99c 100644 --- a/bashrc +++ b/bashrc @@ -15,10 +15,9 @@ export VISUAL=vim export BROWSER=qutebrowser # Some programs need those changes -if [ -d $HOME/.gem/ruby ]; then - ls $HOME/.gem/ruby | while read rubyVer; do - export PATH="$PATH:$HOME/.gem/ruby/$rubyVer/bin/" - done +export PATH="/usr/lib/ccache/bin/:$PATH" +if [ -d $HOME/.gem/ruby/2.4.0/bin ]; then + export PATH="$HOME/.gem/ruby/2.4.0/bin/:$PATH" fi #export PATH="$(echo "$PATH" | sed 's|:|\n|g' | sort | uniq | tr '\n' ':' | sed 's|:$||')" export JAVA_FONTS=/usr/share/fonts/TTF @@ -29,7 +28,7 @@ export XDG_CONFIG_HOME=$HOME/.config # ALIASES # Completion for existing commands -export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M" --color=auto --classify --human-readable' +export LS_OPTIONS='--group-directories-first --time-style=+"%d/%m/%Y %H:%M:%S" --color=auto --classify --human-readable' alias ls="ls $LS_OPTIONS" alias grep='grep --color=tty -d skip' alias mkdir='mkdir -v' diff --git a/config/htop/htoprc b/config/htop/htoprc index 882a239..51bf9c4 100644 --- a/config/htop/htoprc +++ b/config/htop/htoprc @@ -1,7 +1,7 @@ # Beware! This file is rewritten by htop when settings are changed in the interface. # The parser is also very primitive, and not human-friendly. fields=0 48 17 18 38 39 40 2 46 47 49 1 -sort_key=46 +sort_key=47 sort_direction=1 hide_threads=0 hide_kernel_threads=0 diff --git a/scripts/sedrename b/scripts/sedrename new file mode 100755 index 0000000..9c0f6b4 --- /dev/null +++ b/scripts/sedrename @@ -0,0 +1,47 @@ +#!/usr/bin/env bash + +# Rename a list of files with a sed pattern + +usage() { + echo "Usage: $0 PATTERN [-d] < filelist" + echo + echo "Arguments:" + echo " PATTERN Sed pattern to apply" + echo + echo "Options:" + echo " -d Dry run" + exit 1 +} + +if [[ -z "$1" ]]; then + usage +fi + +pattern="$1" + +dry=1 +if [[ -n "$2" ]]; then + if [[ "$2" = '-d' ]]; then + dry=0 + else + usage + fi +fi + +while read src +do + dst="$(echo "$src" | sed "$pattern")" + if [[ $? != 0 ]]; then + echo "ERREUR Invalid sed pattern" + exit 2 + fi + if [[ $dry == 0 ]]; then + echo "$src" → "$dst" + else + mv "$src" "$dst" + fi + +done + + +