Your Latest Workflow Improvement - Desktop Customization & Workflow
ashen
(08-09-2015, 05:00 PM)Wildefyr Wrote:
(07-09-2015, 09:08 PM)ninjacharlie Wrote: Not a super recent performance boost, but I did start using Vimium in Chrome (adds vim-ish keybindings). It's way more comfortable for me to use now :)

I tried using that, but I think cVim is a much better implementation. Also vimperator for firefox is far more feature complete and more hackable, main reason why I switched over to firefox from chrome.

I started using pentasaurus in palemoon recently myself. I have it set up to be as much like qutebrowser as I can because qutebrowser has too many issues and isn't robust enough, but I absolutely love its interface.
fraun
On a different note, a month later... I've written a python script to take journal paper titles pass them through google scholar and output the bibtex entry or add it to my biblio.bib reference file for whatever latex doc I'm working on.
pranomostro
@fraun:
Oh, that's an interesting one.
Would you mind sharing it?
fraun
@pranomostro
Yeah sure. It's kind of tailored to me, but I'm sure you can work it out. The hard bit was getting the bibtex link to show up on google scholar without a google account signed in. So had to generate a fake one... https://github.com/fraun/scripts/blob/ma...tBibtex.py
pranomostro
(26-10-2015, 12:46 PM)fraun Wrote: So had to generate a fake one... https://github.com/fraun/scripts/blob/ma...tBibtex.py
Thanks.
xero
i've noticed that i use cat and less quite a bit when debugging code, and i'm a fan of syntax highlighting.

so i decided to come up with a way to add highlighting to these commands.

i discovered pygments, a cool little syntax highlighter that has a commandline interface. so i started by porting my my colorscheme then make two quick little aliases:

Code:
# cat - with syntax highlighting!
c() {
  pygmentize -O style=sourcerer -f console256 -g $1
}
# less - with syntax highlighting!
l() {
  pygmentize -O style=sourcerer -f console256 -g $1 | less -r
}

preview:
z3bra
(28-10-2015, 02:36 PM)xero Wrote: # cat - with syntax highlighting!
c() {
  pygmentize -O style=sourcerer -f console256 -g $1
}

AAAAAARGH !! You're killing me bro! "$1" !!! By using only one argument, you destroy the ONLY purpose of cat!

I'm particularly proud of my "ssh" workflow at work. I connect to many servers quite a lot, and thus optimized this process to make it simpler. I did 3 major things:
  • Maintain a decent /etc/hosts
  • Tweak $HOME/.ssh/config
  • Make a CLI menu

The first part is easy. I maintain a /etc/hosts file to map "decent" names to IPs on the network (the original names as provided by the DNS are pretty odd, and the DNS doesn't work well anyway. I know it 'cause it's part of my job to maintain it :P Sadly, I'm not the one who choose the servers names...). thanks to vim/curl and some shell glue, I now have a ~500 lines hosts file, meaning I can just run "ssh <hostname>" to connect to any host, using a name of MY invention, that I can easily recover from memory.

The second part is the ssh config file. This one is the simplest part, I defined my "default" parameters, and specific ones:

Code:
host *
    user me
    identityfile ~/.ssh/id_rsa

host *-dc*
    user me_admin
    identityfile none

host *somepattern*
    user root
    identityfile none

[...]

You get the idea...

The last part is actually the most interresting. My work terminal of choice is "rxvt-unicode", mostly because I know how it works in-depth, and something like "st" would make my productivity drop too much (for now...). It also let you bind keys to actions, and particularly the "string" actions which will input a string when you press a key.

I created a script based on slmenu (beware, bitbucket link), which is basically a dmenu, but for the terminal. I then feed it with the hostnames from my /etc/hosts, and upon pressing <ENTER>, it connects to the chosen host. I then used the directive: "URxvt.keysym.F1: string:sshmenu\n" to have it started everytime I press F10 in a terminal. Simple, efficient!

EDIT: here is video showing (at home) how it works: http://raw.z3bra.org/dev/random/ssh-menu.webm

The difference here is that I need to run "sshmenu" by hand because I'm not using urxvt. At work, I only need to press F10 :)
xero
(28-10-2015, 03:01 PM)z3bra Wrote: AAAAAARGH !! You're killing me bro! "$1" !!! By using only one argument, you destroy the ONLY purpose of cat!

i never view the source of more than one file time. but i agree with your argument. http://git.io/vlnDk

Code:
c() {
  for file in "$@"
  do
    pygmentize -O style=sourcerer -f console256 -g "$file"
  done
}
vain
@z3bra: Neat! I've seen something like this before, but now I finally took the time to "implement" it. :)

Just out of curiousity, how does your code look like? Here's mine: https://github.com/vain/bin-pub/blob/master/ssh-menu (Uses pmenu instead of slmenu.)
Wildefyr
@xero I also found a good way to get syntax highlighting in the shell using https://github.com/rkitover/vimpager after installing I can just call 'vimcat' from the commandline, but it also follows my vim colourscheme! neat huh?

@z3bra super cool! I might get around to using this at some point, although I think I will use fzf over slmenu as it has better fuzzy searching. I didn't know you could rebound keys with just urxvt, been rebinding everything in my zsh/keybindings file. Also slight question, how did you setup up those funky bars and icons in the top right?

Edit: here's a sick one liner for you all: https://github.com/Wildefyr/scripts/blob/master/sshmenu

I wrote a small script today to resize a mpv video back to it's
resolution when it was opened. I'll probably integrate it with my tiling script soon but it's still pretty neat: https://u.teknik.io/cavFpS.webm

Here's the source: https://github.com/Wildefyr/fyre/blob/ma...aximise.sh




Members  |  Stats  |  Night Mode  |  Help