Your Latest Workflow Improvement - Desktop Customization & Workflow
z3bra
(05-05-2017, 12:42 AM)venam Wrote:
(04-05-2017, 05:39 PM)z3bra Wrote: Then you'll probably love piping your selection into random programs
Code:
:'<,'>!tr a-z A-Z
My favorite one:
Code:
:'<,'> !fmt

I think vim call fmt internally when pressing 'gq'. But yeah, I use that a lot!

EDIT: mine can be replaced with pressing 'gU' also
xcko
I also like using :'a,'bw !lua to check certain code snippits through the interpreter, or :!gcc && ./a.out though my favorite lately has been :!! to rerun the last shell command used in the command prompt
z3bra
I prefer using ^Z to run external commands though. It is more flexible IMO. Also, I never use gcc by itself, and rather a makefile, be it as simple as:

Code:
pgm: pgm.c
gaak
jvarg's remap capslock to escape is quite good.

tmux + vim + some REPL -- i.e. use vim+tmux to control a shell or interpreter. That way, you live in your editor and think about ssh'ing into a router or whatnot more programmatically.

inbox zero is a good hack for ppl who use email as their default message bus -- notifications that interrupt attention need to be pretty damn important.
thuban
(07-09-2015, 03:15 PM)jury Wrote: ^ That's why I'm rarely on IRC; I can never get anything else done when it's open =P

Unrelated: if you don't have a constantly displayed clock (because minimalism or, like me, laziness), you can put one in dmenu output. Here's my dmenu_run (same as vanilla except for a couple lines):
Code:
#!/bin/sh
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
if [ -d "$cachedir" ]; then
        cache=$cachedir/dmenu_run
else
        cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
fi
(
        IFS=:
        if stest -dqr -n "$cache" $PATH; then
                echo -e "$(date +"%m/%d %R")\n$(stest -flx $PATH | sort -u | tee $cache)" | dmenu "$@"
        else
                echo -e "$(date +"%m/%d %R")\n$(cat $cache)" | dmenu "$@"
                #dmenu "$@" < "$cache"
        fi
) | ${SHELL:-"/bin/sh"} &
More functionality for the same old shortcut! A friend of mine came up with it, but I use it all the time.
For this under CWM, I use this attached to a keystroke :

Code:
#!/bin/sh
xclock -digital -strftime "%H:%M  --  %d/%m/%Y" -geometry +0+0 &
PID=$!
sleep 5
kill -9 $PID

exit 0
gaak
Yeah, put all the status bits in one place and tie one keystroke to it

Code:
quiet() { $* 2>/dev/null ; }                                                  
net=$( quiet ip route show | grep -qs ^default || echo "NO NETWORK -- " )    
vpn=$( quiet ip route show | grep -qs ^10.82 && echo VPN )                    
bat=$( acpi -b | sed 's/Battery 0://;s/Discharging,//')                      
now=$( date +'%F %T' )                                                        
printf "\n%s %s %s %s\n" "$bat" "$now" "$net" "$vpn" | ~/pkg/x11/bin/dmenu.sh
                                                                              
exit 0
anthk
Well, I have several for irssi (I use it mainly with Bitlbee).
You'll need to autoload fnotify.pl from Irssi's script database.

Code:
drwho:~>cat bin/irc
tmux attach -t irssi ||  tmux new -s irssi irssi

drwho:~>cat bin/irc_notify
#!/bin/sh
if
(pgrep -f "entr -s /home/drwho/bin/lnotify" )
then
notify-send "entr <-> irc is up"
exit 0
fi
while true ; do ls ~/.irssi/fnotify | entr -p /home/drwho/bin/lnotify ; done

drwho:~>cat bin/lnotify  
#!/bin/sh
OL="$(tail -1 ~/.irssi/fnotify)"
if (echo "$OL" | grep -v -q anthk_)
then
notify-send "$OL"
else
exit 0
fi
TastyFugu
I wanted to know how many monitors are active at the moment so i came up with this one liner:

Code:
xrandr -d :0 -q | grep '*+' | wc -l

You can also check how many monitors are connected (on or off):

Code:
xrandr -d :0 -q | grep '+' | wc -l
thuban
I wanted to add magnet link in rtorrent from the hash found in omgtorrent (no torrent hosted, so not illegal) :
Code:
#!/bin/sh
#hash to magnet (omgtorrent)

T1="udp%3A%2F%2Ftracker.openbittorrent.com%3A80"
T2="udp%3A%2F%2Fudp://tracker.publicbt.com%3A80"
T3="udp%3A//9.rarbg.com%3A2800"
T4="udp%3A%2F%2Fexplodie.org%3A6969"
T5="udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969"
T6="udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969"

HASH=$(xclip -o)

MAGNET="magnet:?xt=urn:btih:$HASH&tr=${T1}&tr=${T2}&tr=${T3}&tr=${T4}&tr=${T5}&tr=${T6}"
echo -n "$MAGNET" | xclip -i
echo -n "$MAGNET" | xclip -i -selection clipboard
exit 0




Members  |  Stats  |  Night Mode  |  Help