My Weblog

Thu, 02 Jul 2009

Awesome
For quite some time now I've been using Fluxbox as my window manager of choice. It's simple, clean-looking and relatively lightweight. Like most other window managers, Fluxbox is a stacking WM, meaning windows can be moved around freely and overlap. I've never really worked well with this design however, since I tend to open lots of terminal windows and forget to close them. Eventually I have so many windows open it's hard to find anything, so I either have to spend time figuring out which ones I need and which I don't, or just let them be and open yet another terminal. Obviously, this only makes the situation worse.

To solve this problem, I recently switched to Awesome, a tiling window manager. Unlike stacking WMs, tiling WMs try to automatically arrange all of your on-screen windows so that they don't overlap (although most also support "floating" windows like you get with a stacking WM). Basically, when you open the first window it uses the entire screen. When a second window is opened, the screen will be divided between the two. If you close a window, the space it used is divided amongst the other windows, automatically resizing them as necessary to fill the space. This way you don't have to go manually moving and resizing everything.

Additionally, Awesome uses Lua for its configuration file, so it is much more extensible than many other window managers (tiling or not). Finally, like other tiling WMs, you can use the keyboard to do everything in Awesome, although you can use the mouse as well.

posted at: 14:14 | path: /computers/linux/apps/x11 | permanent link to this entry

Wed, 02 Mar 2005

Tweaking Firefox's Popup Blocker
Recently advertisers have figured out how to get around firefox's popup blocker. Normally, firefox blocks popups except for those that happen within a specified interval of user actions like click, double click, submit, etc. The problem is that some sites like zophar.net are set up so that most links have a javascript onClick handler that displays a popup ad. There's a way around this. Modify the dom.popup_allowed_events property to have the value 'change #click dblclick #mouseup reset submit'. This property specifies which events may create popup windows.

Commenting out 'mouseup' and 'click' allows popups associated with forms to work but stops onClick ads. Unfortunately, it also breaks sites that use onClick to do something useful, like display an image in a new window (which is still evil, but at least it's not an ad). If this breaks a particular site, set firefox to allow popup ads from it.

See this Slashdot thread for more useful stuff.

posted at: 09:04 | path: /computers/linux/apps/firefox | permanent link to this entry

Mon, 07 Jun 2004

Vi Keybindings for Firefox
I have finally figured out how to make firefox recognize vi keybindings. Below are the steps required to make it work on Debian boxes (most of them work for all unix platforms):

1. Copy /usr/lib/mozilla-firefox/chrome/browser.jar to your $HOME/.firefox/default/xxxxxx.xxx/chrome directory.
2. Unzip browser.jar and edit the content/browser/browser.xul file, adding the following lines to the end of the section:


<key  key="," command="Browser:Back"/>
<key  key="." command="Browser:Forward"/>
<key  key="a" command="Browser:Home" />
<key  key="r" oncommand="BrowserReload();" />
<key  key="r" oncommand="BrowserReloadSkipCache();" modifiers="shift" />
<key  key="n" command="cmd_findAgain" />
<key  key="n" command="cmd_findPrevious"  modifiers="shift"/>
<key  key="o" command="Browser:OpenLocation" />
<key  key="O" oncommand="focusSearchBar();" modifiers="shift"/>
<key  key="w" command="cmd_newNavigator" modifiers="shift"/>
<key  key="w" command="cmd_newNavigatorTab"/>
<key  key="q" command="cmd_close" />
<key  key="q" command="cmd_closeWindow"  modifiers="shift"/>
<key  key="f" command="View:FullScreen" />
<key  key="z" command="cmd_textZoomReduce"  />
<key  key="z" command="cmd_textZoomEnlarge" modifiers="shift"/>
<key  key="s" command="View:PageSource" />
<key  key="i" command="View:PageInfo" />
<key  key="b" command="Browser:AddBookmarkAs"  modifiers="shift"/>
<key  key="b" command="viewBookmarksSidebar" />
<key  key="h" command="viewHistorySidebar" modifiers="shift"/>
<key  key="d" command="Tools:Downloads" />
<key  key="p" command="cmd_print"  modifiers="shift"/>

3. Edit the $HOME/.firefox/default/xxxxxx.xxx/chrome/chrome.rdf file. Add the following attribute to the tag (below is the example from my chrome.rdf file):

c:baseURL="file:///home/ryan/.firefox/default/m2ukjd2m.slt/chrome/content/browser/"

4. Copy /usr/lib/mozilla-firefox/res/builtin/platformHTMLBindings.xml to /etc/mozilla-firefox.
5. Run 'dpkg-divert --rename /usr/lib/mozilla-firefox/res/builtin/platformHTMLBindings.xml'.
6. Run 'ln -s /etc/mozilla-firefox/platformHTMLBindings.xml /usr/lib/mozilla-firefox/res/builtin'.
7. Add the following lines to /etc/mozilla-firefox/platformHTMLBindings.xml at the end of the section:
  
<handler event="keypress" key="a" modifiers="alt" command="cmd_selectAll"/>
<handler event="keypress" key="u" command="cmd_scrollPageUp" />
<handler event="keypress" key="k" command="cmd_scrollLineUp"/>
<handler event="keypress" key="j" command="cmd_scrollLineDown"/>
<handler event="keypress" key="h" command="cmd_scrollLeft"/>
<handler event="keypress" key="l" command="cmd_scrollRight"/>
<handler event="keypress" key="g" command="cmd_scrollTop"/>
<handler event="keypress" key="g" command="cmd_scrollBottom" modifiers="shift"/>
<handler event="keypress" key=";" command="cmd_findTypeLinks"/>
  
Steps 4-6 prevent dpkg from replacing the modified file with the one in the package. If you're not running Debian, you can skip them and put the above lines straight into the platformHTMLBindings.xml file. You should be able to put the above lines into userHTMLBindings.xml in your chrome directory, but there is a bug in mozilla and firefox that prevents this from working. For now, doing steps 4-6 basically turns platformHTMLBindings.xml into a system-wide configuration file that will be preserved between upgrades.

posted at: 18:10 | path: /computers/linux/apps/firefox | permanent link to this entry

Sat, 17 Apr 2004

Yet Another FTP Client
I'll admit it: I'm a commandline junkie. I cut my teeth on an Apple II+ (literally: I started messing with computers at age 3), so to me a GUI has always seemed foreign: nice eye candy, but not the real user interface. I hate being tied to the window system to do my work, so most of the applications and utilities I use are text-based. It bugs me that I have to use OpenOffice to do real word processing and Mozilla Firefox to browse the web (for you fellow CLI addicts, I do use w3m and lynx fairly often, but most sites these days pretty much require a graphical browser to be useful).

I also get frustrated when I can't find a text-based or commandline program to accomplish a task. For a long time, I've been looking for a text-based sftp client that supports command history and tab-completion. Today, I finally found one: yafc (Yet Another FTP Client). I could tell you all about this very cool app, but instead I'll just shamelessly steal the list of features from the project's website:


Need I say more? Download it and try it out. For those enlightened enough to use Debian, just 'apt-get install yafc', and you're set. The rest of you will need to hunt for an RPM or build yafc from source.

posted at: 21:26 | path: /computers/linux/apps | permanent link to this entry