Skip to content

Instantly share code, notes, and snippets.

@noscript
Created February 10, 2015 14:03
Show Gist options
  • Save noscript/8fb40c8842a78cde4e8a to your computer and use it in GitHub Desktop.
Save noscript/8fb40c8842a78cde4e8a to your computer and use it in GitHub Desktop.
Shortcut to show folders first in Nautilus
#!/bin/bash
# Version: Sun Sep 8 2013
OLD_VALUE=
LSB_RELEASE=$(lsb_release -sr)
if [ $LSB_RELEASE \< '12.04' ]; then
OLD_VALUE=$(gconftool --get /apps/nautilus/preferences/sort_directories_first)
else
OLD_VALUE=$(dconf read /org/gnome/nautilus/preferences/sort-directories-first)
fi
NEW_VALUE='false'
if [ $OLD_VALUE == 'false' ]; then
NEW_VALUE='true'
fi
if [ $LSB_RELEASE \< '12.04' ]; then
gconftool --type Boolean --set /apps/nautilus/preferences/sort_directories_first $NEW_VALUE
else
dconf write /org/gnome/nautilus/preferences/sort-directories-first $NEW_VALUE
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment