dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 9414a0043740b0e43b568398ac8eef4df6ea0ae1
parent a4032d63fc7835d7bfb4ba171f7a71d1dc808843
Author: Hayden Hamilton <hayden@haydenvh.com>
Date:   Mon, 23 Dec 2019 11:59:28 +0000

Made the scripts 'just werk' a bit more.

Diffstat:
M.config/irssi/away.log | 2++
M.config/irssi/config | 1+
M.profile | 1+
M.scripts/bin/dmenu/dfm | 73++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
M.scripts/bin/dmenu/dmenurun | 3++-
5 files changed, 64 insertions(+), 16 deletions(-)

diff --git a/.config/irssi/away.log b/.config/irssi/away.log @@ -15,3 +15,5 @@ --- Log closed Wed Dec 18 07:12:52 2019 --- Log opened Sat Dec 21 01:27:29 2019 --- Log closed Sat Dec 21 11:01:32 2019 +--- Log opened Mon Dec 23 01:53:33 2019 +10:16 #GNU/matrix: 2/ n0a110wg8/ |g ehaydenh: i'd be interested in checking out your dmenu fm tool. and that center patch looks awesome... i wrote a script for managing and connecting to my wireless networks in dmenu, works good for me diff --git a/.config/irssi/config b/.config/irssi/config @@ -29,6 +29,7 @@ channels = ( { name = "#GNU/matrix"; chatnet = "Freenode"; autojoin = "Yes"; }, { name = "#i3"; chatnet = "Freenode"; autojoin = "Yes"; }, { name = "#archlinux-offtopic"; chatnet = "Freenode"; autojoin = "Yes"; }, + { name = "#GNU/matrix"; chatnet = "Rizon"; autojoin = "Yes"; }, ); aliases = { ATAG = "WINDOW SERVER"; diff --git a/.profile b/.profile @@ -8,6 +8,7 @@ export LC_CTYPE="en_US.UTF-8" export LANG="en_US.UTF-8" +export LC_ALL="C" export SCRIPTS="$HOME/.scripts/bin" scripts=$(ls -d $SCRIPTS/*/ | tr '\n' ':') export PATH="$PATH:$scripts" diff --git a/.scripts/bin/dmenu/dfm b/.scripts/bin/dmenu/dfm @@ -6,9 +6,30 @@ # haydenvh.com # Copyright (c) 2019 Hayden Hamilton. LICENSE:GPLv2 ../../.licenses/gplv2.license # + +if [ "$(echo $1 | awk '/help/ {print}')" != "" ] +then + echo "dfm [fm for standard mode/name of program for file-selection] + +$(tput bold)CONFIG:$(tput sgr0) +DFM_DOT=\"[0 for no/1 for yes]\" +DFM_USE_HH_PATCH=\"[0 for no/1 to use the patched dmenu from haydenvh.com\" + +Written by Hayden Hamilton <haydenvh.com>" + exit 0 +fi +forn1="$1" +if [ "$1" == "" ] +then + export forn1="fm" +fi dmenu="dmenu" . $HOME/.dmenurc . $HOME/.config/dfm/config +if [ "$DFM_USE_HH_PATCH" == "1" ] +then + dmenu="$dmenu -c -w 1000" +fi confdir="$HOME/.config/dfm" conffile="$confdir/config" @@ -26,17 +47,41 @@ sendconf(){ varname="$1" varcont="$2" makeconfdir - if [ -f conffile ] + if [ -f $conffile ] then - if [ "$(awk "/${varname}=/ {print}" $conffile)" != "" ] - then - sed -i "/${varname}=/d" $conffile - fi + sed -i "/${varname}/d" $conffile fi echo "${varname}=\"${varcont}\"" >> $conffile . $conffile } +fmornorm(){ + if [ "$forn1" == "fm" ] + then + output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:") + fmspecial + else + dooutput + if [ "$doarg" == "true" ] + then + echo $forn1 + $forn1 $argu + fi + fi +} + +dooutput(){ + enqueue=$(echo "DO ENQUEUE" | tr " " "\n" | $dmenu -i -p "What do you want to do?") + if [ "$enqueue" == "ENQUEUE" ] + then + argu+="$output " + doarg="false" + else + argu+="$output " + doarg="true" + fi +} + getdot(){ . $conffile if [ "$DFM_DOT" == "1" ] @@ -117,8 +162,13 @@ EDIT - Open with $EDITOR" elif [ "$output" == "FND - Find" ] then output=$(echo "" | $dmenu -i -p "Enter name of file:") - (find . | grep "$output") - output3=$(echo "$(find . | grep "$output")" | $dmenu -i -l 30 -p "Select file:") + output=$(echo "NONE $(find . | grep -i "$output")" | tr " " "\n" | $dmenu -i -l 30 -p "Select file:") + if [ "$output" == "NONE" ] + then + echo > /dev/null + else + fmornorm + fi elif [ "$output" == "HIDE - Toggle Dotfiles" ] then if [ "$DFM_DOT" == "0" ] @@ -144,13 +194,6 @@ EDIT - Open with $EDITOR" then exit 1 else - if [ "$1" == "fm" ] - then - output2=$(echo "$fmcmd2" | $dmenu -l 30 -i -p "Select command:") - fmspecial - else - $1 $output - $pause - fi + fmornorm fi done diff --git a/.scripts/bin/dmenu/dmenurun b/.scripts/bin/dmenu/dmenurun @@ -1,3 +1,4 @@ #!/bin/bash . $HOME/.dmenurc -dmenu_path | $dmenu "$@" | ${SHELL:-"/bin/bash"} & +dir=$(echo $PATH | tr ":" " ") +find $dir -maxdepth 1 -executable -not -type d -printf "%f\n" | sort | $dmenu "$@" | ${SHELL:-"/bin/bash"} &