monochromatic blog:
git clone git://
Log | Files | Refs

toolbox.txt (11354B)

      1 # [Toolbox](#)
      2 ## — 12 March, 2014
      4 Please, allow me to start this one with a smart quote, to let you
      5 know what will follow:
      7 > Show me what's the output of your '`ls /usr/bin`', and I'll tell you who you
      8 > are ...
      9 > &mdash; <cite>Nobody (because that's freakin' stupid)</cite>
     11 That being said, we can move on. I'll keep this article updated in time,
     12 because it's _more_ than an article. It's a list. A list of the tools I use (or
     13 have used maybe) daily, and that I think are worth mentioning. You'll find
     14 tools written by me, or by other.  Shell scripts, or compiled program.
     15 Everything that I find 'nice'.
     17 Those tools are (most of the time) not important or complex enough to get a
     18 dedicated post, so I'll just write a paragraph here about them. If you feel
     19 that one of them require a bigger description, email me and I'll consider
     20 writing an article about it.
     22 Let's start with my current setup ! Every tool in this list is installed on my
     23 main computer (a desktop one). I'll avoid mentioning server administration
     24 tools, because that's too specific.
     26 ### Computer
     28 * CRUX 3.0
     29 * AMD A10-5800k
     30 * Nvidia GeForce GTx 650 Ti
     31 * Roccat Kone Pure
     32 * Razer Vespuala
     34 ### Tool list
     36 * [2bwm](#2bwm)
     37 * [9menu](#9menu)
     38 * [bar](#bar)
     39 * [dtach](#dtach)
     40 * [fcount](#fcount)
     41 * [hsetroot](#hsetroot)
     42 * [ii](#ii)
     43 * [meh](#meh)
     44 * [popup](#popup)
     45 * [prout](#prout)
     46 * [skroll](#skroll)
     47 * [thingmenu](#thingmenu)
     48 * [wendy](#wendy)
     50 <h3 id='2bwm'>2bwm</h3>
     52 [LINK]( &mdash;
     53 [SHOT](
     55 It means <q>Two borders window manager</q>. This is my WM of choice.  It is a
     56 fork of [mcwm](, but the author, Venam, added so
     57 many feature that it became a new tool.
     59 2bwm is a floating WM. It means that your computer will never change the window
     60 geometry if you don't ask him (but tilling WM will).
     62 With 2bwm, you can resize window horiz/vertically, or grow them keeping aspect
     63 ratio. You can move them in any direction, or gut them in the corners or in the
     64 middle, all that, just with your keyboard !
     66 I personnally forked it myself to add a specific feature: window groups. It
     67 works kinda like traditionnal workspaces, except that you can show or hide them
     68 independently, allowing you to show multiple workspaces at the same time. See a
     69 showcase [here](
     71 <h3 id='9menu'>9menu</h3>
     73 [LINK]( &mdash;
     74 [SHOT](
     76 Here is a simple, yet powerfull menu application. 9menu allows you to create
     77 static menus to launch your favorite applications. Users of the \*box WM, or
     78 FVWM will relate to this.
     80 The advantages of 9menu over other applications like [thingmenu](#thingmenu) is
     81 that you can leave it running in the background, iconify it, bring it back, and
     82 teleport it.
     84 Another good advantage (but you can totally live without it), is the ability of
     85 9menu to act as an interpreter, so that you can write your menu using the
     86 shebang: `#!/usr/bin/9menu`
     88 <h3 id='bar'>bar</h3>
     90 [LINK]( &mdash;
     91 [SHOT](
     93 Bar (or (b)ar (a)in't (r)ecursive) is a lightweight status bar application
     94 written on top of XCB. You can pipe text to it, and it will be displayed within
     95 the bar. You can also use escape sequences to add colored backgrounds,
     96 foregrounds or underlining.
     98 It allow the use of complex scripts to get a tons of infos within that thin, lovely bar.
    100 <h3 id='dtach'>dtach</h3>
    102 [LINK]( &mdash;
    103 [SHOT](
    105 I often see newbies asking this question:
    107 > newbie &mdash; How can I move one application from one terminal to another ?  
    108 > stranger1 &mdash; you need screen.  
    109 > stranger2 &mdash; tmux is better !  
    110 > stranger1 &mdash; How so ?  
    111 > stranger3 &mdash; It has vertical splits !  
    112 > stranger2 &mdash; It's scriptable  
    113 > newbie &mdash; how does it works ?  
    114 > stranger1 &mdash; There is a vsplit patch fro screen  
    115 > stranger3 &mdash; Yes but ...  
    116 > str...
    118 The problem here, is that screen AND tmux are terminal MULTIPLEXER.  Their main
    119 job is to give access to multiple terminals within a PHYSICAL terminal. The
    120 possibility to detach and reattach them is just a feature.
    122 But that feature was so good, that a small team wrote a tool with ONLY the
    123 ability to detach an application, and reattach it somewhere else. Here came
    124 dtach.
    126 The advantages of dtach are its small size, (not only the code, because it only
    127 depends on glibc), and that you don't have to remember a million commands.
    128 There is one only bind: `^\` to detach the process. You can also disable this
    129 key and use signals to detach it from elsewhere.
    131 I personnaly use it to reattach to my irssi session, as it's the only
    132 application I need on a remote server. You will also be able to send an
    133 application from one screen/tmux session to another. Isn't that cool ?
    135 <h3 id='fcount'>fcount</h3>
    137 [LINK](
    139 That is a tool I made. It is REALLY DUMB, but totally usefull in a particular
    140 case.  
    142 fcount counts the number of files within a directory. NOTHING.
    143 F\*\*KING. MORE.  
    144 It's basically a "`ls -rAa1 | wc -l`" within one process. 
    146 I agree that you can find stupid to use a program like that, but within a
    147 script that will be executed every second to display the number of unread mails
    148 in a status bar, it is usefull to gain some miliseconds.   Take it or not, this
    149 is your choice.
    151 <h3 id='hsetroot'>hsetroot</h3>
    153 [LINK]( (dead)
    155 I like this one. This is a tool to display images on the root window (humans:
    156 understand "change wallpaper"). You can fit/expand/tile images, create
    157 gradients, add tint to images... Everything you could want to do with a
    158 wallpaper can be done with it. And it's light as I like ! Forget that crappy
    159 feh ! You can barely get rid of the .fehbg that pisses you off !
    161 <h3 id='ii'>ii</h3>
    163 [LINK](
    165 Okay, I don't use it _that_ often.  
    166 II stands for Irc It, and is a filesystem based irc client. Upon starting, ii
    167 will create a file hierarchy looking like this:
    169     $ tree irc/
    170     irc/
    171     ├──
    172     │   ├── int
    173     │   ├── out
    174     │   └── #shblah
    175     │       ├── int
    176     │       └── out
    177     └──
    178         ├── in
    179         ├── nickserv
    180         │   ├── in
    181         │   └── out
    182         ├── out
    183         └── #wizards
    184             ├── in
    185             └── out
    187 The first folder is the server, and the subfolders are the channels which you
    188 are connected to. The 'in' and 'out' files are named pipes that you can read
    189 from and write to to interact with servers/channels.  
    190 Example:
    192     echo "Hi, people of shblah!" > irc/\#shblah/in
    194 Will effectively send a message to the channel "#shblah" on server
    195 "".
    197 I agree that this is not the most practical client you've used, but it's a
    198 simple and good unix tool. I use it within a tiny script along with a tool of
    199 mine ([ptii](#ptii)) to get a quick access to the IRC without having to fire up
    200 irssi with 4 server connection, 10 channel autojoins, and such..
    202 <h3 id='meh'>meh</h3>
    204 [LINK](
    206 I've spit on feh before (see [hsetroot](#hsetroot). I have effectively some
    207 problems with it. Feh is impossible to use. it displays the images in full
    208 size, no matter what the window size is. And that's freaking annoying... I just
    209 want my image viewer to display an image at the maximum size for the window,
    210 and to resize when I change the window size.
    212 That is what meh does. And (almost) nothing more ! Meh take a list of images as
    213 arguments, and fits them in its window. Meh can also read a list from stdin.
    214 You can then cycle through images using h,j,k,l,left,down,up,right.
    216 When you press `<enter>`, meh outputs the current image name to stdout. It
    217 allows cool stuffs like meh \*.jpg | xargs rm to delete the images upon
    218 pressing `<enter>`.
    220 <h3 id='popup'>popup</h3>
    222 [LINK](
    224 This is just a simple script that uses my fork of [bar](#bar) to display a
    225 small notification bar at the top left hand corner of your desktop.
    227 <h3 id='prout'>prout</h3>
    229 [LINK](
    231 Did you notice? If you want to send a document to the printer configured to
    232 /etc/client.conf using the lp command, you need (at least, on Archlinux) to
    233 install the full cups server!  That's a shame, isn't it?
    235 That's the reason why I wrote prout. The only dependency is libcups.  This tool
    236 only sends a file given as argument to the default printer. Nothing else. You
    237 can't actually send options along with the document, but I'm not sure that I
    238 want to implement this feature...
    240 Anyway, this is pretty neat to me! I hope you'll enjoy it.
    242 <h3 id='skroll'>skroll</h3>
    244 [LINK]( &mdash;
    245 [SHOT](
    247 Here is something I wrote for fun. I don't actually need it, but other might
    248 find it useful. Skroll takes its input from stdin, and then makes it scroll on
    249 stdout. You can specify the scroll speed, as well as the number of characters
    250 to be displayed.
    252 The best application to this I can find so far, is for some kind of
    253 notification system. If you want to display the current playing song in a tiny
    254 box in the upper left had-corner, you soon notice that you _can't_ adapt the
    255 notification box to the size of the input text, because that's just too ugly.
    256 And here comes skroll ! Just pipe your text to it with the -r flag (so that
    257 there is a new line after each scroll-step), and pipe that output to dzen2 or
    258 bar or whatever. **BAM** that's black magic !
    260 <h3 id='thingmenu'>thingmenu</h3>
    262 [LINK]( &mdash;
    263 [SHOT](
    265 Thingmenu is one of those app you've never heard of, but you use (or have used)
    266 daily, because it was part of a WM.
    268 It is a simple tool that help you associate some strings with commands, and
    269 stack them up in a menu. It comes with a nice script that is able to deal with
    270 submenus and "back" buttons, that you can easily improve to fit your own needs.
    272 Also, feel free to browse the whole git repo, it's full of good stuff !
    274 <h3 id='wendy'>wendy</h3>
    276 [LINK]( &mdash;
    277 [SHOT](
    279 Wendy makes my life better. I first wrote it as an exercise to learn inotify,
    280 but it turned out to be a good replacement to inotifywait.
    282 Wendy let you watch a directory/file and execute a command when a watched event
    283 is received.    As an example is worth a thousand explications, there you go:
    285     # watch mail directory for new mails and raise an alert
    286     wendy -C ~/var/mail/INBOX/new -t 60 -e beep
    288     # automatic recompilation
    289     wendy -M wendy.c -e make
    291 Every inotify mask can be used, and they can be combined (eg, whatch creation
    292 AND modification).
    294 I tried to make this tool the most simple possible, to extend the
    295 possibilities. Be creative!
    297 <!-- vim: set ft=markdown ts=4 et: -->