Your Latest Workflow Improvement - Desktop Customization & Workflow
z3bra
Hey there.

I know we're all interrested in improving our day-to-day tasks to make them faster, or easier to do.
We all do different things to improve our workflow, and most of the time, it feels pretty good to see it working.

I create this thread so we can share any snippet, trick or solution we find to improve our workflow. I'll start with a script of mine I use a lot:

At work, I'm forced to use a window machine. Not a big deal as I'm allowed to run a VM on it (archlinux, for convenience). But from time to time, I need to send logfiles, memory dumps and similar to people, and this is a tedious task, as I need to copy the files from the VM to a shared folder with the host, then put it on people's desktop using the windows explorer (I'm a system admin, so that's why I have these access).

I then created a script call "winput" which uses smbclient to send search netbios names on the network, and put files on the desktop of these people.
Computers here are named after the login name, with 1,2 or 3 appended to it (or not):


Code:
#!/bin/sh

usage() {
    echo "usage: $(basename $0) <netbios> <file>" >&2
    exit 1
}

echolor() {
    printf '[1;3%dm%s\n' "$1" "$2"
}

find_hostname() {
    BASE=$1
    for SFX in '' 1 2 3; do
        ping -c1 ${BASE}${SFX} >/dev/null 2>&1 && echo ${BASE}${SFX} && return
    done
    echo NONE
}

test $# -lt 2 && usage

printf 'NETBIOS:  '
SMBHOST=$(find_hostname $1)

test "$SMBHOST" == "NONE" && echolor 1 "$SMBHOST" && exit 1
echolor 2 "$SMBHOST"
DIRNAME=$(dirname $2)
BASENAME=$(basename $2)

printf 'TRANSFER: '
if smbclient "//$SMBHOST/c$" -c "lcd $DIRNAME; cd Users/$1/Desktop; put $BASENAME" -A /etc/cifsauth -E 2>/dev/null; then
    echolor 2 OK
else
    echolor 1 FAIL
fi

Example of it running:

Code:
$ winput username ~/.profile
NETBIOS:  username2
TRANSFER: OK

And I can now si the .profile file on my desktop! Magic :D

Your turn now!
BANGARANG, MOTHERFUCKER
venam
I recently finished reading Practical Vim and because I spend most of my time programming it boosted my workflow.

I also got myself to use more and more background processes (ctrl-z) and specific zsh tricks with directories (using pushd).
z3bra
(17-08-2015, 09:58 AM)venam Wrote: specific zsh tricks with directories (using pushd).

Any example about these? I'm curious as to how popd/pushd can be used for interactive use.
venam
(17-08-2015, 11:50 AM)z3bra Wrote:
Quote:specific zsh tricks with directories (using pushd).
Any example about these? I'm curious as to how popd/pushd can be used for interactive use.
Code:
~ > pushd BUILDING                                                                                         <
~/BUILDING ~
~/BUILDING > pushd l_systems                                                                               <
~/BUILDING/l_systems ~/BUILDING ~
~/BUILDING/l_systems > cd -0                                                                               <
---- directory stack
0 -- /home/raptor
1 -- /home/raptor/BUILDING
~/BUILDING/l_systems > #OR
~/BUILDING/l_systems > popd -                                                                              <
---- directory stack
0 -- /home/raptor
1 -- /home/raptor/BUILDING
I press TAB after the '-'.
Like that you can move wherever you want in the stack in an interactive way.
neeasade
Well, I'm working on a small script to help me if I forget where open windows are/ multihead nicety[WIP]: https://sr.ht/6lif.webm

Still messing around with dzen2 a bit, it's fun.

The plan is to make it so that left click is focus and move cursor to window, and right click is bring to current workspace as biggest window.
dkeg
Just some pretty minor stuff for me. Small bash function for git for quicker and less typing.
Code:
function gitpush() {                                                            
    # usage: gitpush [ . |"file1 file2"] ["commit message"] [branchname]                                                
    args=("$@")                                                                
        git add "${args[0]}" && git commit -m "${args[1]}" && git push -u origin "${args[2]}"    
}
Also cleaning up and centralizing by organizing directories, with more on my /data partition, with symlinks in my $HOME. Gits, media, walls, colors, bin, tools
work hard, complain less
swathe
(17-08-2015, 10:56 PM)dkeg Wrote: Just some pretty minor stuff for me. Small bash function for git for quicker and less typing.
Code:
function gitpush() {                                                            
    # usage: gitpush [ . |"file1 file2"] ["commit message"] [branchname]                                                
    args=("$@")                                                                
        git add ${args[0]} && git commit -m ${args[1]} && git push -u origin ${args[2]}    
}
Also cleaning up and centralizing by organizing directories, with more on my /data partition, with symlinks in my $HOME. Gits, media, walls, colors, bin, tools

I've started using this with git, it's nice https://github.com/qw3rtman/gg
z3bra
Git can sure be a pain to deal with (as in, many commands to type...) I should start making it easier to use, at least for my dotfiles where I don't care about the history, I just want them to be in sync everywhere. Something like a script that would run every time I update a file, that would pull/commit/push the changes.

Mmmmmh... I might be onto something!
dkeg
Thanks swathe, looks interesting, but way over the top for my needs.
z3bra, sounds good! I'd be very interested to see what you come up with. I tend to think I may like manual pushes better, for me though, a bit more control.
Actually, I believe there is something a bit similar over at the linuxbbq forums similar .... found it ... http://linuxbbq.org/bbs/viewtopic.php?f=...pper#p9498 ...
work hard, complain less
Wildefyr
(17-08-2015, 07:21 PM)neeasade Wrote: Well, I'm working on a small script to help me if I forget where open windows are/ multihead nicety[WIP]: https://sr.ht/6lif.webm

Still messing around with dzen2 a bit, it's fun.

The plan is to make it so that left click is focus and move cursor to window, and right click is bring to current workspace as biggest window.

Nice! I've been thinking of doing something similar with wmutils, get a list of open windows and then select using hjkl; actually should be fairly easy to implement, just need to find ( or write ) a menu select system.




Members  |  Stats  |  Night Mode  |  Help