Your Latest Workflow Improvement - Desktop Customization & Workflow
(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.
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.
Oh, that's an interesting one.
Would you mind sharing it?
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...
(26-10-2015, 12:46 PM)fraun Wrote: So had to generate a fake one...
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:

# 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

[Image: ieyxm6p.png]
(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:

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:

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 :)
(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.

c() {
  for file in "$@"
    pygmentize -O style=sourcerer -f console256 -g "$file"
@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: (Uses pmenu instead of slmenu.)
@xero I also found a good way to get syntax highlighting in the shell using 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:

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:

Here's the source:

Members  |  Stats  |  Night Mode