Automatically log into Xfce without a login manager

July 13, 2006 at 8:24 am | Posted in tips and tricks, xubuntu | 20 Comments

This has been done countless times before. However, I want to provide a version that doesn’t require messing with gcc and removing xubuntu-desktop. This howto is based off of this message from the Ubuntu Lite group.

1) Install mingetty:
sudo aptitude install mingetty

2) Edit your .bash_profile file. This controls what happens when you log in:

mousepad .bash_profile

And paste this in, at the bottom of the file:

# autologin tty2
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty2 ];
then
exec startxfce4
fi

Save the file, and exit.

3) Edit /etc/inittab (sudo mousepad /etc/inittab), and replace the following line:

1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2

with

#1:2345:respawn:/sbin/getty 38400 tty1
2:2345:respawn:/sbin/mingetty --autologin
YOURUSERNAME tty2

Obviously, replace YOURUSERNAME with your username. Save the file and exit.

4) Stop GDM from loading on startup. Go to Xfce menu > Services, and uncheck “Graphical Login Manager (gdm)”.

5) Reboot. While this saves RAM, Xfce’s default Quit menu does not work (for me, anyway.) To fix this, create a group that can shutdown your computer:

sudo addgroup shutdown

Then, edit /etc/group:

sudo mousepad /etc/group

Scroll down to the bottom, and write in your username after shutdown:x:1001:.

Then, run

export EDITOR=mousepad && sudo visudo

And paste in:

%shutdown ALL=(root) NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/shutdown

Then, right click the Xfce menu > run, Edit menu, and create shortcuts to gksudo /sbin/halt and gksudo /sbin/reboot. Save your menu, and exit.

Now, your computer will automatically log in, and save some RAM and CPU cycles along the way.

Advertisements

Manually edit the Xfce menu

July 12, 2006 at 9:43 am | Posted in tips and tricks, xubuntu | 48 Comments

Let’s face it, the built-in Xfce menu editor sucks. It leaves invalid XML and crashes at the oddest moments. If you’re feeling adventurous, you can manually edit the menu yourself. If you’re familiar with XML, this will be easy.

1) Copy Xfce’s default menu into your home folder:

cp /etc/xdg/xfce4/desktop/menu.xml ~/.config/xfce4/desktop/menu.xml

Here’s an overview of how the code works:

<xfdesktop-menu></xfdesktop-menu>: You need these! Otherwise, the menu is not loaded.

<app name="Name in menu" cmd="Command to run" term="false" icon="iconfile" snotify="false" visible="true" />:

To add a shortcut to an application, use <app>.

name tells the menu what the name of your shortcut is.

cmd says what is launched when you click the shortcut.

If you want a shortcut icon, put the full filename of the icon under iconfile.

snotify sets whether or not the program supports startup notification. (You can probably leave this to false.)

visibility tells the menu whether you want to see this shortcut or not. You should leave it to true.

<separator /> : Adds a separator between shortcut items.

<menu name="Name in menu" icon="iconfile" visible="true"></menu> :

This acts the same as app. However, this creates a menu, where you can put more shortcut items within. Make sure that you put </menu> afterwards when you are done!

<title name="Name in menu" icon="iconfile" visible="true" /> : Adds a title to the top of your menu (Where it currently says “Desktop Menu”).

<include type="file" src="menu2.xml" visible="true" /> : Allows you to add another menu file within a menu file. Under src, put the filename of this menu. This can serve as a backup in case one goes corrupt.

<include type="system" style="simple" unique="true" visible="true" /> : This code allows you to put in the system-generated menu. Use this if you want your menu file to be automatically updated when you install a new program.

<!-- 'comment' --> :
Use this to add comments within your menu. This will not show up in the menu. Obviously, replace ‘comment’ with your own comments.

2) Edit the menu:

mousepad ~/.config/xfce4/desktop/menu.xml

The rest is self-explanatory. Scroll down to <xfdesktop-menu>, where the menu starts, and change whatever you see fit. It’s very easy once you get used to it!

How to: Search for files with Thunar

July 12, 2006 at 9:39 am | Posted in scripts, tips and tricks, xubuntu | 14 Comments

At long last! Using this, you can right-click anywhere on Thunar and search for files. You can also run it by itself (by running bash ~/.bash-scripts/search-for-files).

1) Open up the terminal (Xfce menu > System > Terminal). First, we make a place for the script to stay. Then, we edit the script:

mkdir ~/.bash-scripts
mousepad ~/.bash-scripts/search-for-files

2) Paste the following into the file, and save it. (You can change the options at the top if you wish.)

#!/bin/bash
#search-for-files

# change this figure to suit yourself - I find zenity dies from about 1000 results but YMMV
maxresults=500

# again, change the path to the icon to suit yourself. But who doesn't like tango?
window_icon="/usr/share/icons/Tango/scalable/actions/search.svg"

# this script will work for any environment that has bash and zenity, so the filemanager is entirely down to you! you can add extra arguments to the string as long as the last argument is the path of the folder you open
filemanager="thunar"

window_title="Search for Files"

srcPath="$*"

if ! [ -d "$srcPath" ] ; then
cd ~/
srcPath=`zenity --file-selection --directory --title="$window_title - Look in folder" --window-icon="$window_icon"`
fi

if [ -d "$srcPath" ] ; then

fragment=`zenity --entry --title="$window_title - Name contains:" --window-icon="$window_icon" --text="Search strings less than 2 characters are ignored"`
if ! [ ${#fragment} -lt 2 ] ; then

(

echo 10
O=$IFS IFS=$'\n' files=( `find "$srcPath" -iname "*$fragment*" -printf \"%Y\"\ \"%f\"\ \"%k\ KB\"\ \"%t\"\ \"%h\"\\\n | head -n $maxresults` ) IFS=$O
echo 100

selected=`eval zenity --list --title=\"${#files[@]} Files Found - $window_title\" --window-icon="$window_icon" --width="600" --height="400" --text=\"Search results:\" --print-column=5 --column \"Type\" --column \"Name\" --column \"Size\" --column \"Date modified\" --column \"Path\" ${files[@]}`
if [ -e "$selected" ] ; then "$filemanager" "$selected" ; fi

) | zenity --progress --auto-close --pulsate --title="Searching..." --window-icon="$window_icon" --text="Searching for \"$fragment\""

fi

fi

exit

3) Make it so that Thunar is able to run the script:

chmod a+x ~/.bash-scripts/search-for-files

4) You need to put this script within Thunar’s right-click menu. Paste the following code into the terminal in order to backup the menu config and edit the current one.

cp ~/.config/Thunar/uca.xml ~/.config/Thunar/uca.xml.old ; mousepad ~/.config/Thunar/uca.xml

5) Scroll to the end of the file. Before where it says , paste in the following:

<action><icon>/usr/share/icons/Tango/scalable/actions/search.svg</icon><name>Search for Files</name><command>bash ~/.bash-scripts/search-for-files %f</command><description>Search this folder for files</description><patterns>*</patterns><directories/></action>

Save and exit.

6) To use it, open up Thunar, right click, and click on Search for Files. Type in a filename to search, and click Ok. A list of files will show up; clicking on one of them will show the directory the file is found in.

(Credit goes to lapsey at http://ubuntuforums.org/showthread.php?t=214059)

How to: solve the Thunar opening twice problem

July 11, 2006 at 10:29 am | Posted in tips and tricks, xubuntu | 4 Comments

If Thunar is left running in the background when you log out, and starts up in the background when you log in again, you may have a problem with Thunar opening twice. Here’s how to fix it:

1) Go to Xfce Menu > System > Xfce 4 Task Manager.

2) Scroll through until you see Thunar. Right click it, and click Kill. If it asks if you want to actually kill the process, say yes.

3) Exit all of your programs, and go to Xfce Menu > Quit. Check “Save session for future logins”, and log out.

4) Log in, start Thunar, and hopefully it will only load once.

5) If you are having troubles with the Run dialog (Alt+F2) loading twice, simply replace wherever it says Thunar in this guide with xfrun4.

* Note: To make sure Thunar doesn’t load up in the background next time you log in, uncheck “Save session for future logins”.

Xarchiver 0.3.9.2beta2

July 11, 2006 at 10:20 am | Posted in programs, xubuntu | 2 Comments

Xarchiver 0.3.9.2beta2 was recently released, and I’ve made an Ubuntu Dapper package.

Open up a terminal and run:

wget http://samztercomix.com/kim/tech/linux/programs/xarchiver_0.3.9.2-0ubuntu1_i386.deb

sudo dpkg -i xarchiver_0.3.9.2-0ubuntu1_i386.deb

It’s straight out of Edgy, so it should work well.

Xfce 4.4beta2!

July 10, 2006 at 4:21 pm | Posted in programs, xubuntu | 1 Comment

Xfce 4.4beta2 is released! To upgrade, you can use their installer, but I’m not sure how well this works with Xubuntu.

Galculator

July 10, 2006 at 3:14 pm | Posted in programs, xubuntu | 1 Comment

The lack of a calculator is one of the oddities of Xubuntu. If you don’t want to install the many Gnome-libs, you can just install Galculator:

Galculator

It works…pretty much like any other calculator. You can install it with

sudo aptitude install galculator.

Enjoy!

Mini-script: List the contents of a package

July 10, 2006 at 12:23 am | Posted in scripts, xubuntu | Leave a comment

If you’re like me, you don’t want to load up Synaptic to list the contents of a package. This script will let you do that quick and easily:

#!/bin/sh

# Check for dependencies
if [ -z "`which zenity`" ]; then
xmessage "zenity is required for this program."
exit;
else
SEARCH=`zenity --title "Search package files" --entry --text "Enter search term here:"`
fi
if [ "$SEARCH" ]; then
zenity --text-info --filename=/var/lib/dpkg/info/$SEARCH.list
fi

Save it under the filename list. Then run:

chmod +x list && sudo cp ./list /usr/bin/list && rm list

Enjoy!

Thunar and Abiword

July 10, 2006 at 12:17 am | Posted in programs, xubuntu | Leave a comment

Thunar 0.3.2beta2 was released today. New features include:

- The default operation when dropping files into a folder is now to move the
files if both the source files and the target folder is on the same file
system and the source files are owned by the user.
- The custom actions are now run using the shell.
- Added the "Send To" menu, which allows users to easily send files to other
applications from within the file manager. Default targets are "Desktop
(Create Link)", "Mail Recipient" and "Side Pane (Create Shortcut)". Additio-
nal targets can be dynamically added via .desktop files.
- Support for session management was added.
- The "Open With" dialog now allows users to remove launchers that were
previously added via the custom command box.
- The number of relocations for the libraries was reduced to improve the
application startup time.

No Ubuntu packages are currently available.

Also released is Abiword 2.4.5. Ubuntu packages aren’t available, but .package files are. More instructions on how to use them are at their download page.

Hotmail and Sylpheed-Claws

July 10, 2006 at 12:07 am | Posted in tips and tricks, xubuntu | 2 Comments

Don’t like the bloat of Thunderbird, but you want to check your Hotmail with Sylpheed-Claws? Well good news my friend, you can!

1) Install FreePOPs 0.99 from here (Note: x86 and amd64 packages are provided.) Install with GdebI.

2) Edit /etc/default/freepops. In the terminal put:

gksudo mousepad /etc/default/freepops

Change the line

DAEMON_OPTS=" -n"
to
DAEMON_OPTS=" -n -b 127.0.0.1 -p 2000".

Save and exit.

3) Open up Sylpheed-Claws, and go to Tools > Configuration > Create New Account.

4) Fill in your information. Under “Server Information”, select the protocol “POP3”. Under “Server for Receiving”, put mail.siemens-mobiles.org. Under “SMTP server (send)”, put null. Fill in your User ID and password. (Make sure to include @hotmail.com!)

5) Go to the “Advanced” tab, and check “POP3 port”. In the textbox, put “2000”.
Save and exit.

6) Click “Get Mail”, and it should check your account under Hotmail. Happy Hotmailing!

« Previous PageNext Page »

Blog at WordPress.com.
Entries and comments feeds.