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