running your file manager from a terminal

I do a lot of my work in a terminal. For the unfamiliar, this might seem strange, however once you’re comfortable with your shell, this is the best place to be. I don’t restrict myself to it though. I often want to spawn a file manager, or a graphical text editor. When I run nautilus, I usually see something like this:

james@computer:~/some/awesome/directory$ nautilus .
Initializing nautilus-open-terminal extension
Shutting down nautilus-open-terminal extension
james@computer:~/some/awesome/directory$

This is useful, because I can open a file browser right where I want it, it’s annoying, because nautilus runs in that terminal until I close it. (This doesn’t happen if the nautilus process is always running, but since GNOME 3, it isn’t.)

My solution is a short bash script that runs nautilus, and leaves your terminal alone. I named my script nautilus, and placed it inside my ~/bin/. Here is the script:

#!/bin/bash
# run nautilus from a terminal, without being attached to it; similar to nohup
# use the full path of nautilus to avoid it calling itself (recursion!)
{ `/usr/bin/nautilus "$@" &> /dev/null`; } &

I hope this is useful for you too. Feel free to do the same for gedit, nemo, and any other app which you often find convenient to run from the terminal. You can generalize this by leaving out the nautilus program:

#!/bin/bash
if [ "$1" == "" ]; then
        echo "usage: ./"`basename $0`"  (to run a command nohup style)"
        exit 1
fi
# do a nohup bash style according to:
{ `"$@" &> /dev/null`; } &

I name the above script run.sh, and it helps me out from time to time, when I don’t want to touch my mouse.

In case you haven’t heard about it, there’s also an open-terminal extension for nautilus and nemo which lets you get to a terminal, from your file manager. A quick internet search should help you install it.

If you found this information useful, please let me know, and as always,

Happy hacking,

James

PS: If you plan to do this for gedit, you probably want to preserve stdin, so that you can still pipe things in. To do this, you’ll probably want:

{ `/usr/bin/gedit "$@" &> /dev/null`; } < /dev/stdin &    # accept stdin too!

Picking up the pieces after a Fedora 18 install

I love GNOME and Fedora, but “upgrading” from Fedora 17 to 18 did not go well for me. I recommend you wait until either these are all fixed, or Fedora 19+ suits your needs. Here are a list of problems I had, and some workarounds. Hopefully proper patches to these bugs will get merged quickly, so that you don’t need to use these fixes.

Problem: Boot fails after upgrade from Fedora 17 to Fedora 18. I used the new “fedup” method.

Workaround: I did a fresh install. Make sure you have backups first, of course. I didn’t feel like spending a lot of time debugging why it broke.

Problem: The <Backspace> key no longer goes “up” in nautilus. I hope this wasn’t a “feature removal”.

Workaround: Add:

(gtk_accel_path "<Actions>/ShellActions/Up" "BackSpace")

to your: ~/.config/nautilus/accels and restart nautilus of course.

Problem: Split view (extra pane) functionality is missing in nautilus 3.6

Workaround: The GNOME developers plan to eventually replace this in a similar form. Until then, you can install the nemo file manager, which is a fork of nautilus 3.4 and is packaged in Fedora 18. (yum install nemo nemo-open-terminal)

Problem: GNOME Shell background is entirely black in overview mode.

Workaround: Using gnome-tweak-tool, under the “Desktop” section, set “Have file manager handle the desktop“, to “OFF“. Unfortunately, this disables viewing of files on your desktop. This wasn’t a problem in Fedora 17.

Problem: Restarting the X server with the familiar Control-Alt-Backspace, can’t be enabled in the keyboard shortcuts menu as it used to.

Workaround: This option is now hidden in the gnome-tweak-tool under typing: terminate.

I hope this scratches your itches!

Happy hacking,

James