I recently switched back to i3, having tried it out briefly (a day or two at most) in the past. In conjunction with that switch, I moved from GDM to LXDM.

After encountering some issues and wanting to fix them, I noticed i3’s i3-dump-log was not actually working for me. Some searching later, I found i3’s logs in /var/log/lxdm.log (This is on Arch Linux, YMMV). However, I wanted them separate from other output generated by LXDM and what else that ended up in there.

Checking i3’s debug page mentioned piping the output of i3 to your own file.

i3 <~/i3log-$(date +'%F-%k-%M-%S') 2>&1

Wanting to combine it with my new found knowledge of LXDM sessions workings however proved to be unsuccessful. I do not think .desktop files allow the piping around, or I was just doing it completely wrong.

So instead I wrapped the starting up of i3 into a very basic bash file. All it does, literally, is call up i3, but with output piping to the place I want. I have added a bunch of comments, in essence only the first and last line are needed. Also note that I changed the output file location to be in ~/.i3/logs/ instead of straight in the $HOME folder.


# Version 0.3 2012-06-26
# Change output to files in directory ~/.i3/logs/
# Version 0.2 2012-06-26
# Remove verbosity (-V) and -d all
# Version 0.1 2012-06-26

# A wrapper to put into /usr/share/xsessions/i3.desktop since I cannot
# seem to do piping within the .desktop file.

# -V: verbose mode
# -d all: debug output with all logging
# >~/i3log-...: Redirect stdout into that file
# 2>&1: Redirect stderr to stdout (which then redirects to the file)
#i3 -V -d all >~/.i3/logs/i3log-$(date +'%F-%k-%M-%S') 2>&1
i3 >~/.i3/logs/i3log-$(date +'%F-%k-%M-%S') 2>&1

Save that file wherever you like and mark it as being executable (chmod +x FILE). Now edit or add your .desktop file as explained in the previous blog post, putting the file you just made as the value for Exec. For completeness sake, here is mine.

[Desktop Entry]
Comment=improved dynamic tiling window manager