Getting Window Managers to work properly

From Manjaro Linux
Jump to: navigation, search

Overview

Tip: This fix can also be applied to the 0.8.2 release of the LXDE flavour, as this desktop environment itself is based on the Openbox Window Manager. The fix provided below has already been applied to the February 2013 release of LXDE, as well as every release of the Manjaro Openbox flavour. In addition, where installing a file manager and finding that you are unable to mount removable media such as USB sticks or CDs/DVDs, then the article Getting File Managers to work properly in Window Managers should also be useful.


Those who have installed Window Managers such as Openbox, Fluxbox, Awesome, or i3 from the Manjaro repositories - particularly on the Net-Edition - will likely have noticed that several - essential - elements may fail to work properly, or even work at all. Examples of the common problems encountered are:


  • File Managers: Other partitions are not displayed or accessable. The trash function - where provided - does not work
  • Authentication: Passwords are not stored / remembered during sessions
  • Wifi Connection: Instant failure when attempting to connect to wifi (related to authentication)
  • Themes: Application windows are mismatched or haphazard-looking
  • Home Folder: Default folders such as "Downloads", "Documents", and "Pictures" are missing


These problems are actually the result of three separate issues, all of which can be fixed simultaneously by editing the .xprofile file - or if using SLiM instead, by editing the .xinitrc file. However, before doing so, it is worthwhile considering the reasons behind these problems:


1. D-Bus: The file manager, authentication, and wifi-connection problems will likely be due to the D-Bus Communication System not functioning correctly. In a nutshell, D-Bus is responsible for ensuring that programs running on your computer are able to communicate with each other. Where unable to communicate (and therefore unable receive or exchange relevant information), then those programs cannot work properly in turn.

2. GTK: Problems with the theme and look will likely be due to the absence of a special command that tells the system to ensure that a uniform look must be applied to applications that use GTK (a tool to create graphical user interfaces).

3. XDG: Where the default Home folders have not been provided automatically, then this will certainly be due the command xdg-user-dirs-update not having been called to create them.


Step 1: Open the .xprofile or .xinitrc File

note: Although hidden, the .xprofile and .xinitrc files are already owned by you, so you don't need to use the 'sudo' or 'gksu' commands.


Different files will have to be edited depending on whether or not SLiM is being used as your login manager. This is because SLiM does not source the .xprofile file, and instead uses the .xinitrc file. If you are not sure whether you are using SLiM, then it is likely you are not, as it must be installed explicitly.


If NOT using SLiM

The hidden .xprofile file is used as it is sourced by Login Managers such as LXDM, GDM, and MDM, making it universally applicable to any Desktop Environment or Window Manager. In essence, whenever logging in, any commands contained in your .xprofile will also be run. In this instance, the commands to be called will fix the D-Bus, GTK theming, and Home folders issues. The syntax of the command to open .xprofile is as follows:

[text editor] ~/.xprofile


For example, if you wish to edit the file within the terminal using nano (a standard terminal-based text editor) then enter:

nano ~/.xprofile


Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use a text editor like Gedit or Leafpad instead. This will create and open the .xprofile file up as a document, making it easier to read and edit. To use Gedit instead, the command is:

gedit ~/.xprofile


If using SLiM

The hidden .xinitrc file is used as it is sourced by SLiM. In essence, whenever logging in, any commands contained in your .xinitrc file will also be run; in fact it should already have been edited to allow the use of SLiM to log into your desktop environment(s). In this instance, additional commands to be called will fix the D-Bus, GTK theming, and Home folders issues. The syntax of the command to open .xinitrc is as follows:

[text editor] ~/.xinitrc


For example, if you wish to edit the file within the terminal using nano (a standard terminal-based text editor) then enter:

nano ~/.xinitrc


Otherwise - if you have installed the full version of Manjaro (i.e. not the NET-Edition) - you may find it easier to use a text editor like Gedit or Leafpad instead. This will create and open the .xprofile file up as a document, making it easier to read and edit. To use Gedit instead, the command is:

gedit ~/.xinitrc

Step 2: Edit the .xprofile or .xinitrc File

Tip: If there is a specific problem that you wish to resolve that does not require the inclusion of one or more of the commands provided, then feel free to omit any of them.


Once .xprofile or .xinitrc has been opened, copy and paste in the following commands at the top of the file (i.e. so that they are executed first before anything else):

## Ensure that the D-Bus Communication System is running properly to fix
## File management, authentication, and other essential system processes

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval "$(dbus-launch --sh-syntax --exit-with-session)"
fi


## Ensure that GTK themes are applied uniformly in the Desktop Environment

export GTK2_RC_FILES="$HOME/.gtkrc-2.0" 


## Where the default Home folders have not already been created, generate them

if [ -x /usr/bin/xdg-user-dirs-update ]; then
   /usr/bin/xdg-user-dirs-update
fi


Once you have made the necessary changes, save them and close the file by:

  • nano: Press CTRL and 'x' to exit, 'y' to save, and <enter> to finish, or
  • Gedit or Leafpad: Select the 'save' option and then close the window.


Now reboot your system for the changes to take effect.