monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

toolbox.txt (11354B)


      1 # [Toolbox](#)
      2 ## — 12 March, 2014
      3 
      4 Please, allow me to start this one with a smart quote, to let you
      5 know what will follow:
      6 
      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>
     10 
     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'.
     16 
     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.
     21 
     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.
     25 
     26 ### Computer
     27 
     28 * CRUX 3.0
     29 * AMD A10-5800k
     30 * Nvidia GeForce GTx 650 Ti
     31 * Roccat Kone Pure
     32 * Razer Vespuala
     33 
     34 ### Tool list
     35 
     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)
     49 
     50 <h3 id='2bwm'>2bwm</h3>
     51 
     52 [LINK](http://git.z3bra.org/2bwm/log.html) &mdash;
     53 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-01-08-2bwm.jpg)
     54 
     55 It means <q>Two borders window manager</q>. This is my WM of choice.  It is a
     56 fork of [mcwm](http://hack.org/mc/hacks/mcwm/), but the author, Venam, added so
     57 many feature that it became a new tool.
     58 
     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).
     61 
     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 !
     65 
     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](http://pub.z3bra.org/monochromatic/vid/2bwm.webm).
     70 
     71 <h3 id='9menu'>9menu</h3>
     72 
     73 [LINK](ftp://freefriends.org/arnold/Source/) &mdash;
     74 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-17-menus.jpg)
     75 
     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.
     79 
     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.
     83 
     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`
     87 
     88 <h3 id='bar'>bar</h3>
     89 
     90 [LINK](https://github.com/lemonboy/bar) &mdash;
     91 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-13-bar.jpg)
     92 
     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.
     97 
     98 It allow the use of complex scripts to get a tons of infos within that thin, lovely bar.
     99 
    100 <h3 id='dtach'>dtach</h3>
    101 
    102 [LINK](http://dtach.sourceforge.net/) &mdash;
    103 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-13-dtach.jpg)
    104 
    105 I often see newbies asking this question:
    106 
    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...
    117 
    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.
    121 
    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.
    125 
    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.
    130 
    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 ?
    134 
    135 <h3 id='fcount'>fcount</h3>
    136 
    137 [LINK](http://git.z3bra.org/fcount/log.html)
    138 
    139 That is a tool I made. It is REALLY DUMB, but totally usefull in a particular
    140 case.  
    141 
    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. 
    145 
    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.
    150 
    151 <h3 id='hsetroot'>hsetroot</h3>
    152 
    153 [LINK](http://thegraveyard.org/hsetroot.php) (dead)
    154 
    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 !
    160 
    161 <h3 id='ii'>ii</h3>
    162 
    163 [LINK](http://tools.suckless.org/ii/)
    164 
    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:
    168 
    169     $ tree irc/irc.oftc.net/
    170     irc/
    171     ├── irc.oftc.net
    172     │   ├── int
    173     │   ├── out
    174     │   └── #shblah
    175     │       ├── int
    176     │       └── out
    177     └── irc.iotek.org
    178         ├── in
    179         ├── nickserv
    180         │   ├── in
    181         │   └── out
    182         ├── out
    183         └── #wizards
    184             ├── in
    185             └── out
    186 
    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:
    191 
    192     echo "Hi, people of shblah!" > irc/irc.oftc.net/\#shblah/in
    193 
    194 Will effectively send a message to the channel "#shblah" on server
    195 "irc.oftc.net".
    196 
    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..
    201 
    202 <h3 id='meh'>meh</h3>
    203 
    204 [LINK](http://www.johnhawthorn.com/meh/)
    205 
    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.
    211 
    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.
    215 
    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>`.
    219 
    220 <h3 id='popup'>popup</h3>
    221 
    222 [LINK](http://git.z3bra.org/scripts/file/popup.html)
    223 
    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.
    226 
    227 <h3 id='prout'>prout</h3>
    228 
    229 [LINK](http://git.z3bra.org/prout/log.html)
    230 
    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?
    234 
    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...
    239 
    240 Anyway, this is pretty neat to me! I hope you'll enjoy it.
    241 
    242 <h3 id='skroll'>skroll</h3>
    243 
    244 [LINK](http://git.z3bra.org/skroll/log.html) &mdash;
    245 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-28-skroll.gif)
    246 
    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.
    251 
    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 !
    259 
    260 <h3 id='thingmenu'>thingmenu</h3>
    261 
    262 [LINK](http://git.r-36.net/thingmenu/) &mdash;
    263 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-17-menus.jpg)
    264 
    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.
    267 
    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.
    271 
    272 Also, feel free to browse the whole git repo, it's full of good stuff !
    273 
    274 <h3 id='wendy'>wendy</h3>
    275 
    276 [LINK](http://git.z3bra.org/cgit.cgi/wendy) &mdash;
    277 [SHOT](http://pub.z3bra.org/monochromatic/img/2014-03-13-wendy.jpg)
    278 
    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.
    281 
    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:
    284 
    285     # watch mail directory for new mails and raise an alert
    286     wendy -C ~/var/mail/INBOX/new -t 60 -e beep
    287 
    288     # automatic recompilation
    289     wendy -M wendy.c -e make
    290 
    291 Every inotify mask can be used, and they can be combined (eg, whatch creation
    292 AND modification).
    293 
    294 I tried to make this tool the most simple possible, to extend the
    295 possibilities. Be creative!
    296 
    297 <!-- vim: set ft=markdown ts=4 et: -->