dot

packages and services management
Log | Files | Refs | README

commit 3b4b670636a19eacafba0a9f7c8c10dd1d675159
parent 294ebd4019f0ce814f1004606c67ca26058bf405
Author: josuah <mail@josuah.net>
Date:   Tue, 27 Dec 2016 00:20:56 +0000

dvtm config

Diffstat:
M.config/dvtm/config.h | 5++++-
A.config/dvtm/dvtm-statusline.diff | 47+++++++++++++++++++++++++++++++++++++++++++++++
A.local/bin/music-rename | 27+++++++++++++++++++++++++++
M.local/share/build/dvtm | 1+
M.profile | 13+++++++++++--
5 files changed, 90 insertions(+), 3 deletions(-)

diff --git a/.config/dvtm/config.h b/.config/dvtm/config.h @@ -58,7 +58,10 @@ static Color colors[] = { /* scroll back buffer size in lines */ #define SCROLL_HISTORY 5000 /* printf format string for the tag in the status bar */ -#define TAG_SYMBOL "│ %s " +#define TAG_SYMBOL " %s " +#define TAG_START "" +#define TAG_STOP "" +#define TAG_SEP "│" /* curses attributes for the currently selected tags */ #define TAG_SEL (COLOR(DEFAULT) | A_BOLD) /* curses attributes for not selected tags which contain no windows */ diff --git a/.config/dvtm/dvtm-statusline.diff b/.config/dvtm/dvtm-statusline.diff @@ -0,0 +1,47 @@ +diff --git a/config.def.h b/config.def.h +index fec230a..702c76f 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -44,7 +44,10 @@ static Color colors[] = { + /* scroll back buffer size in lines */ + #define SCROLL_HISTORY 500 + /* printf format string for the tag in the status bar */ +-#define TAG_SYMBOL "[%s]" ++#define TAG_SYMBOL " %s " ++#define TAG_START "[" ++#define TAG_STOP "]" ++#define TAG_SEP "|" + /* curses attributes for the currently selected tags */ + #define TAG_SEL (COLOR(BLUE) | A_BOLD) + /* curses attributes for not selected tags which contain no windows */ +diff --git a/dvtm.c b/dvtm.c +index 4bbf8eb..9d3c709 100644 +--- a/dvtm.c ++++ b/dvtm.c +@@ -334,6 +334,8 @@ drawbar(void) { + attrset(BAR_ATTR); + move(bar.y, 0); + ++ attrset(BAR_ATTR); ++ printw(TAG_START); + for (unsigned int i = 0; i < LENGTH(tags); i++){ + if (tagset[seltags] & (1 << i)) + attrset(TAG_SEL); +@@ -344,9 +346,16 @@ drawbar(void) { + else + attrset(TAG_NORMAL); + printw(TAG_SYMBOL, tags[i]); ++ ++ if (i < LENGTH(tags) - 1) { ++ attrset(BAR_ATTR); ++ printw(TAG_SEP); ++ } + } ++ attrset(BAR_ATTR); ++ printw(TAG_STOP); + +- attrset(runinall ? TAG_SEL : TAG_NORMAL); ++ attrset(runinall ? TAG_SEL : BAR_ATTR); + addstr(layout->symbol); + attrset(TAG_NORMAL); + diff --git a/.local/bin/music-rename b/.local/bin/music-rename @@ -0,0 +1,27 @@ +# Extract bandcamp downloaded album and reformat titles + + +transform() { + printf '%s\n' "$1" | sed -r ' + s|([^[:alnum:]][[:digit:]]+) - |\1-|g + s| - |/|g + s|&|and|g + y| |-| + ' | tr -d '|[[]{}()<>*$' +} + + +main() +{ + find . -type f | while IFS='' read -r file + do + path="$(transform "$file")" + mkdir -p "${path%/*}" + mv "$file" "$path" + done + + return 0 +} + + +main "$@" diff --git a/.local/share/build/dvtm b/.local/share/build/dvtm @@ -4,6 +4,7 @@ tar=http://github.com/martanne/dvtm/archive/master.tar.gz build() { + patch -Ni ~/.config/dvtm/dvtm-statusline.diff cp ~/.config/dvtm/config.h config.h cp ~/.config/dvtm/dvtm-status dvtm-status make PREFIX="$PREFIX" install diff --git a/.profile b/.profile @@ -62,8 +62,8 @@ export PS3=' > ' #_______________________________________________________________________________ # coreutils -alias l='ls -lh --color' -alias la='ls -Alh --color' +alias l='list -lh --color' +alias la='list -Alh --color' alias cl='printf "\033[H\033[2J"' alias bh='busybox --help' @@ -90,6 +90,15 @@ alias lines='find . -name "*.[ch]" | xargs wc -l' #_______________________________________________________________________________ +list() +{ + { + printf '\n\n' + ls "$@" + } | more +} + + color() { for i in 1 2 3 4 5 6 7