Every environment, it seems, has a settings manager of some kind, and it’s my personal opinion that GNOME’s bloody irritating gnome-settings-daemon is practically a textbook on how not to do it.
With its tendency to monopolise a system in terms of setting wallpapers, screensavers and GTK themes it is bad enough, but what is worse is the way in which it does so.
There is little modularity of which I am aware; why can’t I make it call Nitrogen, my preferred wallpaper application, to set the wallpaper for example? Why can’t I set one GTK theme for some applications and another for other applications (an ability which comes in very useful when you want to use a dark theme, which most web browsers inherit very badly from)?
Why, especially, are so many GNOME applications programmed not to take some acceptable defaults, or rely on a backup config file, when they can’t find a running gnome-settings-daemon process, and instead will immediately and without asking launch it to destroy my wallpaper and carefully crafted balance of themes within my Openbox desktop?
Why isn’t changing my preferred panel easier, rather than relying on arcane gconf modification and .desktop entries? Isn’t part of the aim of GNOME to be simple?
I suppose my frustrations boil down to the question of why, in short, can’t GNOME be less of an arrogant pig when it comes to my environment and actually allow some flexibility in the applications used?
Don’t get me wrong; on the whole I like GNOME. It’s certainly more elegant than most of the credible alternatives; xfce to my mind is crippled and KDE looks like someone let a tasteless and flamboyant three year old loose with plasticine and glitter. If I were feeling generous I might call it avant-garde.
I want to avoid making the same mistakes in bene. There will be a settings manager, but it won’t run all the time; I don’t see any need for it to do so. Instead any applications which need to read a setting can source it by running the settings manager when needed; there should be no need to run any component of bene longer than it’s needed.
In addition, bene should be flexible. It already shows some flexibility merely in in the existence of its file opening script, which is soon to be rewritten to have an even greater amount of flexibility in addition to functionality.
At the moment the settings manager’s main role is to handle dependencies and define some generic functions for other components. It’s very incomplete, largely because I didn’t plan it; I’m going to rewrite it and expand it in future however. The main reason for this post, to be honest, was so that the later post on the open-file script would be useful, as the open-file script sources the settings manager.
#!/bin/bash
echo "SM - Hello from the settings manager" ## Check for dependencies
echo "SM - Checking for dependencies"
for file in `ls core/dependencies/*.sh`
do
if [[ ! "$file" == "core/dependencies/example.sh" ]]; then
$file
if [ $? -eq 2 ]; then
## A required dependency was not found; exit
exit 1
fi
fi
done ## Check for config directory
if [ ! -e "$HOME/.bene/" ]; then
mkdir "$HOME/.bene"
fi ## Define function to create config files; only to be used by scripts sourcing this one
_create-config-file () {
if [ `touch "$create_file"` ]; then
echo "SM:$FUNCNAME - File not created, exiting script"
exit 1
else
echo "SM:$FUNCNAME - File created successfully"
fi
}