dot

packages and services management
Log | Files | Refs | README

commit 7c93840f45206b45526812de235776df8417f1c7
parent eccd172f571ae70868585dfdc3c282e24ffdb44a
Author: Josuah Demangeon <josuah.demangeon@gandi.net>
Date:   Mon, 17 Jul 2017 19:16:37 +0200

merge

Diffstat:
MBUILD | 3+++
MREADME | 6+++---
Abin/grep-r | 4++++
Mbin/io | 2+-
Mbin/io-abduco | 1+
Rbin/l -> bin/lc | 0
Abin/name | 1+
Dbin/search | 1-
Mbin/status | 26+++++++++++++++++++-------
Abin/vmstatus | 15+++++++++++++++
Mbin/www | 54++++++++++++++++++++++++++++++++----------------------
Mbin/www-git | 184++++++++++++++++++++++---------------------------------------------------------
Mdvtm/build | 1-
Mdvtm/config.h | 35+++++++++++++++++------------------
Mdvtm/dvtm-status | 5++---
Ddvtm/dvtm-statusline.diff | 47-----------------------------------------------
Ddvtm/dvtm.c-0.14-pertag.diff | 215-------------------------------------------------------------------------------
Ddvtm/gaps.diff | 201-------------------------------------------------------------------------------
Mdwm/config.h | 26+++++++++++++-------------
Adwm/dwm-hide_vacant_tags-6.1.diff | 38++++++++++++++++++++++++++++++++++++++
Agit/setup | 7+++++++
Mshell/.profile | 4++--
Mshell/rc | 4++--
Mst/build | 2+-
Mx11/.xinitrc | 2+-
25 files changed, 212 insertions(+), 672 deletions(-)

diff --git a/BUILD b/BUILD @@ -1,6 +1,9 @@ # Install sources from build receipes +. "${0%/*}/profile" + + build() { cd "$OPT/$1" && export PREFIX="$PWD" || exit 1 diff --git a/README b/README @@ -1,8 +1,8 @@ $ETC/BUILD # download, build, and install packages -$ETC/BUILD -d <pkg> # download from $ETC/url to $SRC/<pkg> -$ETC/BUILD -i <pkg> # install from $SRC/<pkg> to $OPT/<pkg> -$ETC/BUILD -i <pkg> # symlink from $OPT/<pkg> to $ROOT/ +$ETC/BUILD -d <pkg> # download from $ETC/<pkg>/url to $SRC/<pkg> +$ETC/BUILD -i <pkg> # install from $SRC/<pkg> to $OPT/<pkg> +$ETC/BUILD -i <pkg> # symlink from $OPT/<pkg> to $ROOT/ $ETC/<pkg>/url # url to a tarball of the pkg sources $ETC/<pkg>/build # script that build the pkg into $PREFIX diff --git a/bin/grep-r b/bin/grep-r @@ -0,0 +1,4 @@ +regex=$1 +shift + +find "$@" -type f -exec grep "$regex" {} + diff --git a/bin/io b/bin/io @@ -1,6 +1,6 @@ # cache and filter find output and execute one path as argument of a script -[ "$ABDUCO" ] && exit 1 +[ "$ABDUCO" != dvtm ] && [ "$ABDUCO" ] && exit 1 # --- cache -------------------------------------------------------------------- diff --git a/bin/io-abduco b/bin/io-abduco @@ -47,6 +47,7 @@ hash=`printf %s "$1" | cksum | cut -d ' ' -f 1` if [ "$attach" = 1 ] then [ "$SSH_TTY" ] && e='^\' || e='^Z' + [ "$ABDUCO" != "$1" ] && ABDUCO=$1 exec abduco -e "$e" $mode "$hash" $command "$1" else sed 's/[^ ]* //' "$HOME/.abduco/names" diff --git a/bin/l b/bin/lc diff --git a/bin/name b/bin/name @@ -0,0 +1 @@ +printf '\033]0;%s\007' "$*" diff --git a/bin/search b/bin/search @@ -1 +0,0 @@ -find "$1" -type f -path "*$2*" -o -exec grep -le "$2" {} + diff --git a/bin/status b/bin/status @@ -16,7 +16,7 @@ status_mail() mail="$(find "$MAIL/new" -type f | wc -l | tr -d '\t ')" mail="${mail#0}" mail="${mail:+$mail MAIL}" - + printf %s "$mail" fi } @@ -65,13 +65,25 @@ status_memory() status_cpu() { - top -bn 1 | - sed -nr 's/.*[Cc][Pp][Uu][ :]*([0-9.]+)%.*/CPU \1%/ p' | - tr -d '\n' + printf 'CPU ' + + vmstat 1 2 | awk ' + NR == 2 { + split($0, keys, " ") + } + + NR == 4 { + i = split($0, values, " ") + + for (; i > 0; i--) + table[keys[i]] = values[i] + + printf "%02s%%", 100 - table["id"] + } + ' - uptime | - sed -r 's/.*load[^0-9]*([0-9.]*).*/ \1/' | - tr -d '\n' + # load average + uptime | sed -r 's/.*load[^0-9]*([0-9.]*).*/ \1/' | tr -d '\n' } diff --git a/bin/vmstatus b/bin/vmstatus @@ -0,0 +1,15 @@ +vmstat -w 1 | awk ' + +NR == 2 { + split($0, keys, " ") +} + +NR > 2 { + split($0, values, " ") + + for (i = length(values); i > 0; i--) + table[keys[i]] = values[i] + + print table["fre"] +}' + diff --git a/bin/www b/bin/www @@ -1,51 +1,61 @@ -# static website generator +# fast static website generator using POSIX sh, cat, printf, find, and sed LAYOUT=$(cat layout.html) || exit 1 -ROOT=$PWD -#1 content of the layout to parse +#1 directory processed +#2 content of the layout to parse parse() { - # print the input up to the next keyword, and shift position in input - printf %s "${1%%{{*}" + printf %s "${2%%{{*}" - # check for remaining keywords - [ "${1##*{{*}" ] && return 0 + [ "${2##*{{*}" ] && return 0 - # take the separator out of the keyword - set -- "${1#*{{}" + set -- "$1" "${2#*{{}" - # execute the keyword action and print its output - case "${1%%\}\}*}" in - ( *content* ) printf %s "$(sed 1d index.txt)" ;; - ( *title* ) printf %s "$(sed 1q index.txt)" ;; - ( *root* ) printf %s "$(root )" ;; - ( *nav* ) printf %s "$(nav )" ;; + case "${2%%\}\}*}" in + (*content*) [ -f "$1/index" ] && cat "$1/index" ;; + (*title* ) printf %s "${1##*/}" ;; + (*root* ) root "$1" ;; + (*nav* ) nav "$1" ;; + (*list* ) list "$1" ;; esac - parse "${1#*\}\}}" + parse "$1" "${2#*\}\}}" } root() { - printf '%s\n' "${PWD#$ROOT}" | - sed 's|[^/]||g; s|.|../|g; s|/$||; s|^$|.|' + printf %s/ "$1" | sed 's|[^/]||g; s|.|../|g; s|/$||; s|^$|.|' } nav() { - find . -mindepth 2 -maxdepth 2 -name index.txt | sort | + find -L . -mindepth 1 -maxdepth 1 -type d ! -name '.*' | sed 's|..||' | while IFS='' read -r path - do printf '<a href="%s">%s</a>\n' "${path%.txt}.html" "$(sed 1q "$path")" + do printf ' <a href="%s">%s</a>' "$(root "$1")/$path" "$path" done } -find . -name 'index.txt' | sort | while IFS='' read -r file -do (cd "${file%/*}" && (parse "$LAYOUT" > index.html)) +list() +{ + [ "$1" != . ] && find -L "$1" -mindepth 1 -maxdepth 1 ! -name 'index*' | + sort | sed 's|.*/||' | while IFS='' read -r path + do + printf -- '- <a href="%s">%s%s</a>\n' "$path" "$path" "$( + [ -f "$path/index" ] && sed 's|^| - | q' "$path/index" + )" + done +} + + +for dir in "$@" +do parse "$dir" "$LAYOUT" > "$dir/index.html" done + +parse . "$LAYOUT" > index.html diff --git a/bin/www-git b/bin/www-git @@ -1,163 +1,79 @@ -# Static Git index generator inspired from git.2f30.org/stagit +HEADER='<!doctype html><html><head><meta charset="utf-8"/></head><body><pre>' +FOOTER='</pre></body></html>' -#1 - path to the root - -header() +log() { - printf '<!doctype html> -<html><head><meta charset="UTF-8" /><title>%s</title> -<link rel="icon" type="image/png" href="%s/favicon.png" /> -<link rel="stylesheet" type="text/css" href="%s/style.css" /> -</head> - -<body><h1>%s <span id="description">%s</span></h1> -' "$NAME" "$1" "$1" "$NAME" "$DESC" + git -C "$1" log --graph --format='{%% %H %%} %ci%d%n %cn <%ce>%n %s%n' | + sed -r ' + s|&|\&amp;|g + s|<|\&lt;|g + s|\{% ([^%]{8})([^%]*) %\}|<a href="commit/\1\2.html">\1</a>| + ' } -footer() +tree() { - printf '</body>\n</html>\n' + git -C "$1" ls-files | sed 's|.*|<a href="file/&.html">&</a>|' } -#1 - long hash of the commit - -git_commit() +commits() { - git -C "$REPO" show --format='<pre> -<b>commit</b> <a href="%H.html">%H</a> -<b>author</b> %an &lt;<a href="mailto:%ae">%ae</a>&gt; -<b>date</b> %aD - -<hr /> -%s - -<hr />' "$1" | sed ' - /^diff/ { - s|a/\([^ ]*\)|a/<a href="../file/\1.html">\1</a>| - s|b/\([^ ]*\)|b/<a href="../file/\1.html">\1</a>| - s|.*|<b>&</b>| - } - - /^diff/,$ { - s|&|\&amp;|g - s|<|\&lt;|g - } - - /^+/ s|.*|<span style="color: green;">&</span>| - /^-/ s|.*|<span style="color: red;">&</span>| - /^@/ s|.*|<b style="color: blue;">&</b>| - ' -} - - -git_commits() -{ - printf ' -<table> -<thead><tr><th>Date</th><th>Commit message</th><th>Author</th></tr></thead> -<tbody> -' - git -C "$REPO" log --date='short' --format=' -<tr> - <td>%ad</td> - <td><a href="commit/%H.html">%s</a></td> - <td>%an</td> -</tr> -' - for hash in $(git -C "$REPO" log --format='%H') + for commit in $(git -C "$1" log --format='%H') do - { - header ../.. - - git_commit "$hash" + [ -f "$commit.html" ] && continue || echo "commit $commit" - footer - } > "$NAME/commit/$hash.html" + echo "$HEADER" > "$commit.html" + git -C "$1" show "$commit" | sed ' + s|&|\&amp;|g + s|<|\&lt;|g + /^+/ s|.*|<span style="color: green;">&</span>| + /^-/ s|.*|<span style="color: red;">&</span>| + /^@/ s|.*|<b style="color: blue;">&</b>| + ' >> "$commit.html" + echo "$FOOTER" >> "$commit.html" done - - printf '</tbody></table>\n' } -#1 - path of the file - -git_file() +files() { - printf '<table id="file"><tr><td><pre id="num">\n' - - if grep -qI . "$REPO/$1" - then - seq "$(wc -l < "$REPO/$1")" | - sed 's|.*|<a id="&" href="#&">&</a>|' - - printf '</pre></td><td><pre>\n' - - sed 's|&|\&amp;|g; s|<|\&lt;|g' "$REPO/$1" - else - printf 'binary file' - fi - - printf '</pre></td></tr></table>\n' -} - - -git_files() -{ - printf ' -<table> -<thead><tr><th>Mode</th><th>Name</th><th>Size</th></tr></thead> -<tbody> -' - - git -C "$REPO" ls-files | while IFS='' read -r file + git -C "$1" ls-files | while IFS='' read -r file do - [ -z "${file##*/*}" ] && mkdir -p "$NAME/file/${file%/*}" - - { - header "$( - printf %s "$file" | sed 's|[^/]*||g; s|/|../|g' - )../.." - - git_file "$file" + path="${file#$1/}" + [ "$path.html" -nt "$1/$file" ] && continue || echo "file $file" - footer - } > "$NAME/file/$file.html" + mkdir -p "$(dirname "$path")" - f='<tr><td>%s</td><td><a href="file/%s.html">%s</a></td></tr>' - printf "$f" "$(stat -c %A "$REPO/$file")" "$file" "$file" + echo "$HEADER" > "$path.html" + if [ "$(tr -cd '\0' < "$1/$file" | wc -c)" = 0 ] + then sed -r 's|&|\&amp;|g; s|<|\&lt;|g' "$1/$file" + else echo 'binary file' + fi >> "$path.html" + echo "$FOOTER" >> "$path.html" done - - printf '</tbody>\n</table>\n' } -#1 - path to repository -#2 - description - -main() -{ - REPO="$1" NAME="${1##*/}" DESC="$2" - - printf ' %s' "$NAME" 1>&2 - - [ -d "$NAME" ] && rm -r "$NAME" - mkdir -p "$NAME/commit" "$NAME/file" - - { - header .. +find "$1" -type d -name .git | while IFS='' read -r dir +do + repo="${dir%/.git}" + name="${repo##*/}" - printf '<h2>Files</h2>\n' - git_files + mkdir -p "$name/commit" "$name/file" - printf '<h2>Commits</h2>\n' - git_commits - - footer - } > "$NAME/index.html" -} + ( + cd "$name" || exit + echo "$HEADER <h1><a href="..">&lt;</a> $name</h1>" + tree "$repo" + echo '</pre><hr/><pre>' + log "$repo" + echo "$FOOTER" + ) > "$name/index.html" -main "$@" + (cd "$name/file" && files "$repo") + (cd "$name/commit" && commits "$repo") +done diff --git a/dvtm/build b/dvtm/build @@ -1,4 +1,3 @@ -patch -Ni "$ETC/dvtm/dvtm-statusline.diff" cp "$ETC/dvtm/config.h" config.h cp "$ETC/dvtm/dvtm-status" dvtm-status make PREFIX="$PREFIX" install diff --git a/dvtm/config.h b/dvtm/config.h @@ -59,7 +59,6 @@ static const ColorRule colorrules[] = { #define TAG_SYMBOL " %s " /* printf format string */ #define TAG_BEGIN "" #define TAG_END "" -#define TAG_SEPARATOR "│" /* status for status line */ #define BAR_BEGIN ' ' @@ -68,7 +67,7 @@ static const ColorRule colorrules[] = { /* tags ----------------------------------------------------------------------*/ -const char tags[][8] = { "1", "2", "3 doc", "4 mail", "5 irc", "6 music" }; +const char tags[][8] = { "1", "2", "3", "4:irc", "5:mail", "6:doc", "7:music" }; /* curses attributes for the currently selected tags */ #define TAG_SEL (COLOR(DEFAULT) | A_REVERSE) @@ -101,14 +100,14 @@ const char tags[][8] = { "1", "2", "3 doc", "4 mail", "5 irc", "6 music" }; /* by default the first layout entry is used */ static Layout layouts[] = { - { "│├┤f", tile }, - { "├┬┤b", bstack }, - { "├┴┤u", tstack }, - { "├─┤n", vstack }, - { "├┼┤g", grid }, - { "│@│o", spiral }, - { "│&│w", dwindle }, - { "│ │m", fullscreen }, + { "[f]", tile }, + { "[b]", bstack }, + { "[u]", tstack }, + { "[n]", vstack }, + { "[g]", grid }, + { "[o]", spiral }, + { "[w]", dwindle }, + { "[m]", fullscreen }, }; @@ -138,14 +137,14 @@ static KeyBinding bindings[] = { { { MOD, 'H', }, { focusleft, { NULL } } }, { { MOD, 'L', }, { focusright, { NULL } } }, - { { MOD, 'f', }, { setlayout, { "│├┤f" } } }, - { { MOD, 'b', }, { setlayout, { "├┬┤b" } } }, - { { MOD, 'u', }, { setlayout, { "├┴┤u" } } }, - { { MOD, 'n', }, { setlayout, { "├─┤n" } } }, - { { MOD, 'g', }, { setlayout, { "├┼┤g" } } }, - { { MOD, 'o', }, { setlayout, { "│@│o" } } }, - { { MOD, 'w', }, { setlayout, { "│&│w" } } }, - { { MOD, 'm', }, { setlayout, { "│ │m" } } }, + { { MOD, 'f', }, { setlayout, { "[f]" } } }, + { { MOD, 'b', }, { setlayout, { "[b]" } } }, + { { MOD, 'u', }, { setlayout, { "[u]" } } }, + { { MOD, 'n', }, { setlayout, { "[n]" } } }, + { { MOD, 'g', }, { setlayout, { "[g]" } } }, + { { MOD, 'o', }, { setlayout, { "[o]" } } }, + { { MOD, 'w', }, { setlayout, { "[w]" } } }, + { { MOD, 'm', }, { setlayout, { "[m]" } } }, { { MOD, ' ', }, { setlayout, { NULL } } }, { { MOD, 'i', }, { incnmaster, { "+1" } } }, diff --git a/dvtm/dvtm-status b/dvtm/dvtm-status @@ -4,9 +4,8 @@ export CMD_FIFO="${TMPDIR:-/tmp}/dvtm-command-$$" mkfifo -m 600 "$STATUS_FIFO" || exit 1 mkfifo -m 600 "$CMD_FIFO" || exit 1 -while printf %s "$(status)" > "$STATUS_FIFO" -do - sleep 5 +while printf '%s\n' "$(status)" > "$STATUS_FIFO" +do : done & pid="$!" dvtm -s "$STATUS_FIFO" -c "$CMD_FIFO" $@ diff --git a/dvtm/dvtm-statusline.diff b/dvtm/dvtm-statusline.diff @@ -1,47 +0,0 @@ -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_BEGIN "[" -+#define TAG_END "]" -+#define TAG_SEPARATOR "|" - /* 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_BEGIN); - 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_SEPARATOR); -+ } - } -+ attrset(BAR_ATTR); -+ printw(TAG_END); - -- attrset(runinall ? TAG_SEL : TAG_NORMAL); -+ attrset(runinall ? TAG_SEL : BAR_ATTR); - addstr(layout->symbol); - attrset(TAG_NORMAL); - diff --git a/dvtm/dvtm.c-0.14-pertag.diff b/dvtm/dvtm.c-0.14-pertag.diff @@ -1,215 +0,0 @@ -diff --git a/dvtm.c b/dvtm.c -index e337061..2085e84 100644 ---- a/dvtm.c -+++ b/dvtm.c -@@ -223,9 +223,20 @@ static char *title; - - #include "config.h" - -+typedef struct { -+ unsigned int curtag, prevtag; -+ int nmaster[LENGTH(tags) + 1]; -+ float mfact[LENGTH(tags) + 1]; -+ Layout *layout[LENGTH(tags) + 1]; -+ int barpos[LENGTH(tags) + 1]; -+ int barlastpos[LENGTH(tags) + 1]; -+ bool runinall[LENGTH(tags) + 1]; -+} Pertag; -+ - /* global variables */ - static const char *dvtm_name = "dvtm"; - Screen screen = { .mfact = MFACT, .nmaster = NMASTER, .history = SCROLL_HISTORY }; -+static Pertag pertag; - static Client *stack = NULL; - static Client *sel = NULL; - static Client *lastsel = NULL; -@@ -302,15 +313,15 @@ updatebarpos(void) { - static void - hidebar(void) { - if (bar.pos != BAR_OFF) { -- bar.lastpos = bar.pos; -- bar.pos = BAR_OFF; -+ bar.lastpos = pertag.barlastpos[pertag.curtag] = bar.pos; -+ bar.pos = pertag.barpos[pertag.curtag] = BAR_OFF; - } - } - - static void - showbar(void) { - if (bar.pos == BAR_OFF) -- bar.pos = bar.lastpos; -+ bar.pos = pertag.barpos[pertag.curtag] = bar.lastpos; - } - - static void -@@ -389,7 +400,7 @@ draw_border(Client *c) { - - if (!show_border()) - return; -- if (sel == c || (runinall && !c->minimized)) -+ if (sel == c || (pertag.runinall[pertag.curtag] && !c->minimized)) - attrs = SELECTED_ATTR; - if (sel != c && c->urgent) - attrs = URGENT_ATTR; -@@ -808,9 +819,33 @@ toggletag(const char *args[]) { - } - - static void -+setpertag(void) { -+ screen.nmaster = pertag.nmaster[pertag.curtag]; -+ screen.mfact = pertag.mfact[pertag.curtag]; -+ layout = pertag.layout[pertag.curtag]; -+ if (bar.pos != pertag.barpos[pertag.curtag]) { -+ bar.pos = pertag.barpos[pertag.curtag]; -+ updatebarpos(); -+ } -+ bar.lastpos = pertag.barlastpos[pertag.curtag]; -+ runinall = pertag.runinall[pertag.curtag]; -+} -+ -+static void - toggleview(const char *args[]) { -+ int i; -+ - unsigned int newtagset = tagset[seltags] ^ (bitoftag(args[0]) & TAGMASK); - if (newtagset) { -+ if(newtagset == TAGMASK) { -+ pertag.prevtag = pertag.curtag; -+ pertag.curtag = 0; -+ } else if(!(newtagset & 1 << (pertag.curtag - 1))) { -+ pertag.prevtag = pertag.curtag; -+ for (i=0; !(newtagset &1 << i); i++) ; -+ pertag.curtag = i + 1; -+ } -+ setpertag(); - tagset[seltags] = newtagset; - tagschanged(); - } -@@ -818,9 +853,19 @@ toggleview(const char *args[]) { - - static void - view(const char *args[]) { -+ int i; -+ - unsigned int newtagset = bitoftag(args[0]) & TAGMASK; - if (tagset[seltags] != newtagset && newtagset) { - seltags ^= 1; /* toggle sel tagset */ -+ pertag.prevtag = pertag.curtag; -+ if(args[0] == NULL) -+ pertag.curtag = 0; -+ else { -+ for (i = 0; (i < LENGTH(tags)) && (tags[i] != args[0]); i++) ; -+ pertag.curtag = i + 1; -+ } -+ setpertag(); - tagset[seltags] = newtagset; - tagschanged(); - } -@@ -828,7 +873,13 @@ view(const char *args[]) { - - static void - viewprevtag(const char *args[]) { -+ unsigned int tmptag; -+ - seltags ^= 1; -+ tmptag = pertag.prevtag; -+ pertag.prevtag = pertag.curtag; -+ pertag.curtag = tmptag; -+ setpertag(); - tagschanged(); - } - -@@ -845,7 +896,7 @@ keypress(int code) { - nodelay(stdscr, FALSE); - } - -- for (Client *c = runinall ? nextvisible(clients) : sel; c; c = nextvisible(c->next)) { -+ for (Client *c = pertag.runinall[pertag.curtag] ? nextvisible(clients) : sel; c; c = nextvisible(c->next)) { - if (is_content_visible(c)) { - c->urgent = false; - if (code == '\e') -@@ -853,7 +904,7 @@ keypress(int code) { - else - vt_keypress(c->term, code); - } -- if (!runinall) -+ if (!pertag.runinall[pertag.curtag]) - break; - } - } -@@ -872,6 +923,21 @@ mouse_setup(void) { - #endif /* CONFIG_MOUSE */ - } - -+static void -+initpertag(void) { -+ int i; -+ -+ pertag.curtag = pertag.prevtag = 1; -+ for(i=0; i <= LENGTH(tags); i++) { -+ pertag.nmaster[i] = screen.nmaster; -+ pertag.mfact[i] = screen.mfact; -+ pertag.layout[i] = layout; -+ pertag.barpos[i] = bar.pos; -+ pertag.barlastpos[i] = bar.lastpos; -+ pertag.runinall[i] = runinall; -+ } -+} -+ - static bool - checkshell(const char *shell) { - if (shell == NULL || *shell == '\0' || *shell != '/') -@@ -917,6 +983,7 @@ setup(void) { - } - colors[i].pair = vt_color_reserve(colors[i].fg, colors[i].bg); - } -+ initpertag(); - resize_screen(); - struct sigaction sa; - sa.sa_flags = 0; -@@ -1247,6 +1314,7 @@ setlayout(const char *args[]) { - return; - layout = &layouts[i]; - } -+ pertag.layout[pertag.curtag] = layout; - arrange(); - } - -@@ -1267,6 +1335,7 @@ incnmaster(const char *args[]) { - if (screen.nmaster < 1) - screen.nmaster = 1; - } -+ pertag.nmaster[pertag.curtag] = screen.nmaster; - arrange(); - } - -@@ -1289,6 +1358,7 @@ setmfact(const char *args[]) { - else if (screen.mfact > 0.9) - screen.mfact = 0.9; - } -+ pertag.mfact[pertag.curtag] = screen.mfact; - arrange(); - } - -@@ -1313,10 +1383,10 @@ static void - togglebarpos(const char *args[]) { - switch (bar.pos == BAR_OFF ? bar.lastpos : bar.pos) { - case BAR_TOP: -- bar.pos = BAR_BOTTOM; -+ bar.pos = pertag.barpos[pertag.curtag] = BAR_BOTTOM; - break; - case BAR_BOTTOM: -- bar.pos = BAR_TOP; -+ bar.pos = pertag.barpos[pertag.curtag] = BAR_TOP; - break; - } - updatebarpos(); -@@ -1371,7 +1441,7 @@ togglemouse(const char *args[]) { - - static void - togglerunall(const char *args[]) { -- runinall = !runinall; -+ pertag.runinall[pertag.curtag] = !pertag.runinall[pertag.curtag]; - draw_all(); - } - diff --git a/dvtm/gaps.diff b/dvtm/gaps.diff @@ -1,201 +0,0 @@ -diff --git a/bstack.c b/bstack.c -index 1d14776..81bb65e 100644 ---- a/bstack.c -+++ b/bstack.c -@@ -18,11 +18,6 @@ static void bstack(void) - if (c->minimized) - continue; - if (i < m) { /* master */ -- if (i > 0) { -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- nx++; -- } - nh = mh; - nw = (i < m - 1) ? mw : (wax + waw) - nx; - } else { /* tile window */ -@@ -31,11 +26,6 @@ static void bstack(void) - ny += mh; - nh = (way + wah) - ny; - } -- if (i > m) { -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- nx++; -- } - nw = (i < n - 1) ? tw : (wax + waw) - nx; - } - resize(c, nx, ny, nw, nh); -@@ -47,10 +37,6 @@ static void bstack(void) - if (n > m) { - nx = wax; - for (i = 0; i < m; i++) { -- if (i > 0) { -- mvaddch(ny, nx, ACS_PLUS); -- nx++; -- } - nw = (i < m - 1) ? mw : (wax + waw) - nx; - nx += nw; - } -diff --git a/dvtm.c b/dvtm.c -index 4cddea0..91c95a2 100644 ---- a/dvtm.c -+++ b/dvtm.c -@@ -399,7 +399,7 @@ draw_border(Client *c) { - - wattrset(c->window, attrs); - getyx(c->window, y, x); -- mvwhline(c->window, 0, 0, ACS_HLINE, c->w); -+ box(c->window, ACS_VLINE, ACS_HLINE); - maxlen = c->w - 10; - if (maxlen < 0) - maxlen = 0; -@@ -419,7 +419,7 @@ draw_border(Client *c) { - - static void - draw_content(Client *c) { -- vt_draw(c->term, c->window, c->has_title_line, 0); -+ vt_draw(c->term, c->window, c->has_title_line, c->has_title_line); - } - - static void -diff --git a/fibonacci.c b/fibonacci.c -index 70555f4..9b12361 100644 ---- a/fibonacci.c -+++ b/fibonacci.c -@@ -37,15 +37,11 @@ static void fibonacci(int s) - /* don't adjust the width for the last client */ - if (i < n - 1) { - nw /= 2; -- nnw -= nw + 1; -+ nnw -= nw; - } -- mvaddch(ny, nx - 1, ACS_LTEE); - } - } else if (i % mod == 1) { /* dwindle: odd case, spiral: case 1 */ - nx += nw; -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- ++nx; - nw = nnw; - /* don't adjust the height for the last client */ - if (i < n - 1) { -@@ -60,11 +56,6 @@ static void fibonacci(int s) - nw /= 2; - nnw -= nw + 1; - nx += nnw; -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- ++nx; -- } else { -- mvaddch(ny, nx - 1, ACS_LTEE); - } - } else if (s) { /* spiral: case 3 */ - nw = nnw; -@@ -75,7 +66,6 @@ static void fibonacci(int s) - nnh -= nh; - ny += nnh; - } -- mvaddch(ny, nx - 1, ACS_LTEE); - } - - resize(c, nx, ny, nw, nh); -diff --git a/grid.c b/grid.c -index ffa13b5..cb86abf 100644 ---- a/grid.c -+++ b/grid.c -@@ -31,19 +31,6 @@ static void grid(void) - aw = waw - nw * (n % cols); - else - aw = ((i + 1) % cols == 0) ? waw - nw * cols : 0; -- if (i % cols) { -- mvvline(ny, nx, ACS_VLINE, nh + ah); -- /* if we are on the first row, or on the last one and there are fewer clients -- * than normal whose border does not match the line above, print a top tree char -- * otherwise a plus sign. */ -- if (i <= cols -- || (i >= rows * cols - cols && n % cols -- && (cols - (n % cols)) % 2)) -- mvaddch(ny, nx, ACS_TTEE); -- else -- mvaddch(ny, nx, ACS_PLUS); -- nx++, aw--; -- } - resize(c, nx, ny, nw + aw, nh + ah); - i++; - } -diff --git a/tile.c b/tile.c -index 4a61a93..0f3dee8 100644 ---- a/tile.c -+++ b/tile.c -@@ -24,10 +24,7 @@ static void tile(void) - if (i == m) { - ny = way; - nx += mw; -- mvvline(ny, nx, ACS_VLINE, wah); -- mvaddch(ny, nx, ACS_TTEE); -- nx++; -- nw = waw - mw -1; -+ nw = waw - mw; - } - nh = (i < n - 1) ? th : (way + wah) - ny; - if (i > m) -diff --git a/tstack.c b/tstack.c -index f3f1eb9..9cbc8ce 100644 ---- a/tstack.c -+++ b/tstack.c -@@ -18,11 +18,6 @@ static void tstack(void) - if (c->minimized) - continue; - if (i < m) { /* master */ -- if (i > 0) { -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- nx++; -- } - nh = mh; - nw = (i < m - 1) ? mw : (wax + waw) - nx; - } else { /* tile window */ -@@ -31,11 +26,6 @@ static void tstack(void) - ny = way; - nh = (way + wah) - ny - mh; - } -- if (i > m) { -- mvvline(ny, nx, ACS_VLINE, nh); -- mvaddch(ny, nx, ACS_TTEE); -- nx++; -- } - nw = (i < n - 1) ? tw : (wax + waw) - nx; - } - resize(c, nx, ny, nw, nh); -diff --git a/vt.c b/vt.c -index 34c30ca..1b767e2 100644 ---- a/vt.c -+++ b/vt.c -@@ -1471,7 +1471,7 @@ Vt *vt_create(int rows, int cols, int scroll_size) - - void vt_resize(Vt *t, int rows, int cols) - { -- struct winsize ws = { .ws_row = rows, .ws_col = cols }; -+ struct winsize ws = { .ws_row = rows - 1, .ws_col = cols - 2 }; - - if (rows <= 0 || cols <= 0) - return; -@@ -1511,7 +1511,7 @@ void vt_draw(Vt *t, WINDOW *win, int srow, int scol) - t->scol = scol; - } - -- for (int i = 0; i < b->rows; i++) { -+ for (int i = 0; i < b->rows - 1 * srow; i++) { - Row *row = b->lines + i; - - if (!row->dirty) -@@ -1519,7 +1519,7 @@ void vt_draw(Vt *t, WINDOW *win, int srow, int scol) - - wmove(win, srow + i, scol); - Cell *cell = NULL; -- for (int j = 0; j < b->cols; j++) { -+ for (int j = 0; j < b->cols - 1 * srow; j++) { - Cell *prev_cell = cell; - cell = row->cells + j; - if (!prev_cell || cell->attr != prev_cell->attr diff --git a/dwm/config.h b/dwm/config.h @@ -1,8 +1,8 @@ /* See LICENSE file for copyright and license details. */ /* appearance */ -static const char *fonts[] = { "monospace:pixelsize=16" }; static const char font[] = "monospace:pixelsize=16"; +static const char *fonts[] = { font }; static const char normbordercolor[] = "#444444"; static const char normbgcolor[] = "#000000"; static const char normfgcolor[] = "#888888"; @@ -24,7 +24,7 @@ static const char *tags[] = { "6 ssh", "7 doc", "8 web", - "9 gui", + "9 media", }; static const Rule rules[] = { @@ -36,17 +36,17 @@ static const Rule rules[] = { { "Sam", NULL, NULL, 1 << 0, 0, -1 }, { "acme", NULL, NULL, 1 << 0, 0, -1 }, { "emacs", NULL, NULL, 1 << 0, 0, -1 }, - { "Chromium", NULL, NULL, 1 << 3, 0, -1 }, - { "Iceweasel", NULL, NULL, 1 << 3, 0, -1 }, - { "Firefox", NULL, NULL, 1 << 3, 0, -1 }, - { "Surf", NULL, NULL, 1 << 3, 0, -1 }, - { "Midori", NULL, NULL, 1 << 3, 0, -1 }, - { "Zathura", NULL, NULL, 1 << 4, 0, -1 }, - { NULL, "libreoffice", NULL, 1 << 4, 0, -1 }, - { "Gimp", NULL, NULL, 1 << 5, 0, -1 }, - { "Blender", NULL, NULL, 1 << 5, 0, -1 }, - { "ffplay", NULL, NULL, 1 << 5, 0, -1 }, - { "Pavucontrol", NULL, NULL, 1 << 5, 0, -1 }, + { "Chromium", NULL, NULL, 1 << 7, 0, -1 }, + { "Iceweasel", NULL, NULL, 1 << 7, 0, -1 }, + { "Firefox", NULL, NULL, 1 << 7, 0, -1 }, + { "Surf", NULL, NULL, 1 << 7, 0, -1 }, + { "Midori", NULL, NULL, 1 << 7, 0, -1 }, + { "Zathura", NULL, NULL, 1 << 8, 0, -1 }, + { NULL, "libreoffice", NULL, 1 << 8, 0, -1 }, + { "Gimp", NULL, NULL, 1 << 9, 0, -1 }, + { "Blender", NULL, NULL, 1 << 9, 0, -1 }, + { "ffplay", NULL, NULL, 1 << 9, 0, -1 }, + { "Pavucontrol", NULL, NULL, 1 << 9, 0, -1 }, }; /* layout(s) */ diff --git a/dwm/dwm-hide_vacant_tags-6.1.diff b/dwm/dwm-hide_vacant_tags-6.1.diff @@ -0,0 +1,38 @@ +diff --git a/dwm.c b/dwm.c +index 0362114..0da6e27 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -430,9 +430,15 @@ buttonpress(XEvent *e) + } + if (ev->window == selmon->barwin) { + i = x = 0; +- do ++ unsigned int occ = 0; ++ for(c = m->clients; c; c = c->next) ++ occ |= c->tags; ++ do { ++ /* do not reserve space for vacant tags */ ++ if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) ++ continue; + x += TEXTW(tags[i]); +- while (ev->x >= x && ++i < LENGTH(tags)); ++ } while (ev->x >= x && ++i < LENGTH(tags)); + if (i < LENGTH(tags)) { + click = ClkTagBar; + arg.ui = 1 << i; +@@ -717,11 +723,14 @@ drawbar(Monitor *m) + } + x = 0; + for (i = 0; i < LENGTH(tags); i++) { ++ /* do not draw vacant tags */ ++ if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) ++ continue; + w = TEXTW(tags[i]); + drw_setscheme(drw, m->tagset[m->seltags] & 1 << i ? &scheme[SchemeSel] : &scheme[SchemeNorm]); + drw_text(drw, x, 0, w, bh, tags[i], urg & 1 << i); + drw_rect(drw, x + 1, 1, dx, dx, m == selmon && selmon->sel && selmon->sel->tags & 1 << i, +- occ & 1 << i, urg & 1 << i); ++ 0, urg & 1 << i); + x += w; + } + w = blw = TEXTW(m->ltsymbol); diff --git a/git/setup b/git/setup @@ -0,0 +1,7 @@ +su -c 'adduser git' +su git -c ' + + cd + mkdir .ssh && chmod 700 .ssh + touch .ssh/authorized_keys && chmod 600 .ssh/authorized_keys +' diff --git a/shell/.profile b/shell/.profile @@ -7,8 +7,8 @@ export EMAIL='mail@josuah.net' export TZ='Europe/Paris' export LC_ALL='en_US.UTF-8' -export EDITOR=mg -export VISUAL=mg +export EDITOR=vi +export VISUAL=vi export PAGER=less export MANPAGER=less export BROWSER=firefox diff --git a/shell/rc b/shell/rc @@ -1,6 +1,6 @@ PS1='$([ $? = 0 ] || printf " \033[31;1mx\033[m\n ") -| $(hostname) $(pwd) $(type git-status > /dev/null 2>&1 && git-status) -| ' +$(hostname) $(pwd) $(type git-status > /dev/null 2>&1 && git-status) +$([ "$USER" = root ] && printf "#" || printf "$") ' PS2='... ' PS3='... ' diff --git a/st/build b/st/build @@ -2,7 +2,7 @@ cp -f "$ETC/build/st/config.mk" config.mk find "$ETC/build/st/" -name '*.diff' | xargs patch -N -p 1 -i -sed 's/gray90/#ffffff/; s/black/#001722/; s/white/#ffffaa/' config.def.h > config.h +sed 's/gray90/#eeeeee/; s/black/#000000/; s/white/#ffffff/' config.def.h > config.h make PREFIX="$PREFIX" install diff --git a/x11/.xinitrc b/x11/.xinitrc @@ -5,7 +5,7 @@ xsetroot -solid '#000000' xset +fp "$CONFIG/fonts" while xsetroot -name "$(status)" -do sleep 3 +do : done & exec dwm