dot

packages and services management
Log | Files | Refs | README

commit a44acc04ec6a4d98b7529d406f679b7d53e61522
parent 1eb08e562298acfdde6e4085f1a55d3601402e73
Author: josuah <mail@josuah.net>
Date:   Sat, 17 Dec 2016 12:50:02 +0000

Back to git-prompt

Diffstat:
M.config/2wm/config.h | 3+--
M.config/dvtm/config.h | 34+++++++++++++++++-----------------
M.config/dvtm/dvtm-status | 17+++++++++--------
M.config/themes/pink | 2+-
M.local/bin/git-prompt | 4++--
M.local/bin/status | 4++--
M.local/share/build/iomenu | 2+-
M.profile | 14++++----------
8 files changed, 37 insertions(+), 43 deletions(-)

diff --git a/.config/2wm/config.h b/.config/2wm/config.h @@ -17,8 +17,6 @@ /* modifier key function argument */ \ { MODKEY, XK_Return, spawn, { .cmd = "exec st" } }, \ { MODKEY, XK_space, spawn, { .cmd = "exec dmenu_run" } }, \ - { MODKEY, XK_a, attach, { 0 } }, \ - { MODKEY, XK_d, detach, { 0 } }, \ { MODKEY, XK_j, focusnext, { 0 } }, \ { MODKEY, XK_k, focusprev, { 0 } }, \ { MODKEY|ShiftMask, XK_Return, zoom, { 0 } }, \ @@ -28,6 +26,7 @@ { MODKEY, XK_r, incnmaster, { .i = -1 } }, \ { MODKEY, XK_BackSpace, killclient, { 0 } }, \ { MODKEY, XK_Tab, toggleview, { 0 } }, \ + { MODKEY, XK_Tab, detach, { 0 } }, \ { MODKEY|ShiftMask, XK_space, togglefloat, { 0 } }, \ { MODKEY, XK_Escape, quit, { 0 } }, \ }; diff --git a/.config/dvtm/config.h b/.config/dvtm/config.h @@ -68,7 +68,7 @@ static Color colors[] = { /* curses attributes for not selected tags which with urgent windows */ #define TAG_URGENT (COLOR(RED) | A_BOLD) -const char tags[][8] = { "|", "||", "|||" }; +const char tags[][8] = { "1", "2", "3 mails", "4 chat", "5 music" }; #include "tile.c" #include "grid.c" @@ -80,14 +80,14 @@ const char tags[][8] = { "|", "||", "|||" }; /* by default the first layout entry is used */ static Layout layouts[] = { - { " │├┤f ", tile }, - { " ├┼┤g ", grid }, - { " ├┬┤b ", bstack }, - { " ├┴┤u ", tstack }, - { " ├─┤n ", vstack }, - { " │@│o ", spiral }, - { " │&│w ", dwindle }, - { " │ │m ", fullscreen }, + { "│├┤f", tile }, + { "├┼┤g", grid }, + { "├┬┤b", bstack }, + { "├┴┤u", tstack }, + { "├─┤n", vstack }, + { "│@│o", spiral }, + { "│&│w", dwindle }, + { "│ │m", fullscreen }, }; #define MOD CTRL(' ') @@ -106,14 +106,14 @@ static KeyBinding bindings[] = { { { MOD, 'J', }, { focusnextnm, { NULL } } }, { { MOD, 'K', }, { focusprevnm, { NULL } } }, { { MOD, 'k', }, { focusprev, { NULL } } }, - { { MOD, 'f', }, { setlayout, { " │├┤f " } } }, - { { MOD, 'g', }, { setlayout, { " ├┼┤g " } } }, - { { MOD, 'b', }, { setlayout, { " ├┬┤b " } } }, - { { MOD, 'u', }, { setlayout, { " ├┴┤u " } } }, - { { MOD, 'n', }, { setlayout, { " ├─┤n " } } }, - { { MOD, 'o', }, { setlayout, { " │@│o " } } }, - { { MOD, 'w', }, { setlayout, { " │&│w " } } }, - { { MOD, 'm', }, { setlayout, { " │ │m " } } }, + { { MOD, 'f', }, { setlayout, { "│├┤f" } } }, + { { MOD, 'g', }, { setlayout, { "├┼┤g" } } }, + { { MOD, 'b', }, { setlayout, { "├┬┤b" } } }, + { { MOD, 'u', }, { setlayout, { "├┴┤u" } } }, + { { MOD, 'n', }, { setlayout, { "├─┤n" } } }, + { { MOD, 'o', }, { setlayout, { "│@│o" } } }, + { { MOD, 'w', }, { setlayout, { "│&│w" } } }, + { { MOD, 'm', }, { setlayout, { "│ │m" } } }, { { MOD, ' ', }, { setlayout, { NULL } } }, { { MOD, 'i', }, { incnmaster, { "+1" } } }, { { MOD, 'd', }, { incnmaster, { "-1" } } }, diff --git a/.config/dvtm/dvtm-status b/.config/dvtm/dvtm-status @@ -1,15 +1,16 @@ -export STATUS_FIFO="${TMPDIR:-/tmp}/dvtm-status" -export CMD_FIFO="${TMPDIR:-/tmp}/dvtm-cmd" +export STATUS_FIFO="${TMPDIR:-/tmp}/dvtm-status-$$" +export CMD_FIFO="${TMPDIR:-/tmp}/dvtm-command-$$" -[ -p "$CMD_FIFO" ] || mkfifo -m 600 "$CMD_FIFO" -[ -p "$STATUS_FIFO" ] || mkfifo -m 600 "$STATUS_FIFO" && while : +mkfifo -m 600 "$STATUS_FIFO" || exit 1 +mkfifo -m 600 "$CMD_FIFO" || exit 1 + +while printf %s "$(status)" > "$STATUS_FIFO" do - printf '%s\n' "$(status)" sleep 5 -done > "$STATUS_FIFO" & STATUS_PID="$!" +done & pid="$!" dvtm -s "$STATUS_FIFO" -c "$CMD_FIFO" $@ -kill "$STATUS_PID" -wait "$STATUS_PID" 2> /dev/null +kill "$pid" +wait "$pid" 2> /dev/null rm -f "$STATUS_FIFO" "$CMD_FIFO" diff --git a/.config/themes/pink b/.config/themes/pink @@ -27,6 +27,6 @@ *.color14: #688e95 ! white -*.color7: #999999 +*.color7: #bbbbbb *.color15: #ffffff diff --git a/.local/bin/git-prompt b/.local/bin/git-prompt @@ -34,11 +34,11 @@ m == 0 && /^[^ ]. / { staged++; } m == 1 { m = 0; } END { - printf("\033[1m%s\033[0m", branch); + printf(" \033[1m%s\033[0m", branch); if (untracked + conflicts + changed + staged + behind + ahead \ == 0) { - printf " \033[32mok\033[0m"; + printf " \033[32mok\033[0m"; } else { if (untracked) printf " \033[33m?\033[0m%d", untracked; if (conflicts) printf " \033[31m!\033[0m%d", conflicts; diff --git a/.local/bin/status b/.local/bin/status @@ -74,7 +74,7 @@ main() { local segment - printf "$START" + printf %s "$START" while [ "$#" -gt 0 ] do segment="$(status_"$1")" @@ -85,7 +85,7 @@ main() shift done - printf "$STOP" + printf '%s\n' "$STOP" } diff --git a/.local/share/build/iomenu b/.local/share/build/iomenu @@ -1,3 +1,3 @@ # Input/Output interactive menu and completion engine. -tar=http://repo.or.cz/iomenu.git/snapshot/2abc152e13a1a9eb42c45587a4a3a797a7b36ac0.tar.gz +tar=http://repo.or.cz/iomenu.git/snapshot/9b02c6de2a40d4af69c7bcd06f5d297bfc22e044.tar.gz diff --git a/.profile b/.profile @@ -41,23 +41,17 @@ export XDG_RUNTIME_DIR="$HOME/.cache" export PS1='$( [ $? -eq 0 ] && color=2 || color=1 + printf "\a\n" + # cursor shape it TTY printf "\033[?6c" - cd "$1" - - printf "\n" - # current path with "$HOME" replaced with '~' [ -z "${PWD##$HOME*}" ] && printf ~%s "${PWD#$HOME}" || printf %s "$PWD" # git branch and status - if git rev-parse 2> /dev/null - then - git -c color.status=always status -sb - else - printf "\n" - fi + git rev-parse 2> /dev/null && git-prompt + printf "\n" # prompt character status_path "$PWD"