aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2013-01-28 12:59:07 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2013-02-01 17:44:21 +0100
commit92ea562bafda6b201fae91c2bc13a404da4d581c (patch)
tree0ffbd7a6f526e0b17a6b78deb0870b398dff4f69 /meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist
parentc751691a0a731d9fcdc35bc6489ab689ee8e288a (diff)
downloadmeta-openembedded-92ea562bafda6b201fae91c2bc13a404da4d581c.tar.gz
gnome-terminal, system-tools-backends, slim, benchfft, syslog-ng: move to nonworking directories
* this set does not build with distroless qemuarm as reported in 'State of bitbake world' thread, nobody volunteered to fix them Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist')
-rw-r--r--meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist76
1 files changed, 76 insertions, 0 deletions
diff --git a/meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist b/meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist
new file mode 100644
index 0000000000..0f116537fd
--- /dev/null
+++ b/meta-oe/recipes-graphics/nonworking/slim/slim/update_slim_wmlist
@@ -0,0 +1,76 @@
+#!/usr/bin/perl -w
+#
+# update_slim_wmlist, based on:
+# update_wdm_wmlist, (c) 1998 Marcelo Magallón <mmagallo@debian.org>
+# rewriten to use the x-window-manager alternative
+# modified to also use the x-session-manager alternative by Arthur Korn
+# Copyright 2000 Wichert Akkerman <wakkerma@debian.org>
+# Modified to use the freedesktop.org .desktop like kdm and gdm
+#
+# This script will read the list of installed window managers from
+# the freedesktop .desktop files in <etc>/X11/sessions/:<etc>/dm/Sessions/:
+# <share>/xsessions/
+# and update the sessions line in /etc/slim.conf.
+# BEWARE: It doesn't ask any questions about this. It just does it. It
+# takes an optional list of window managers.
+
+use strict;
+use File::DesktopEntry;
+
+my $wm_list='';
+my %desktop_files;
+
+unless (@ARGV) {
+ #my @wm_list = ('default');
+ my @wm_list;
+ foreach my $dir ('/etc/X11/sessions/','/etc/dm/Sessions/','/usr/share/xsessions/') {
+ next unless (opendir DIR, $dir);
+ my @files;
+ @files = grep { /\.desktop$/ && -r "$dir/$_" } readdir(DIR);
+ foreach my $file (@files) {
+ push @{$desktop_files{$file}}, "$dir/$file";
+ }
+ }
+ DESKTOP: foreach my $desktop_file (keys(%desktop_files)) {
+ foreach my $file (@{$desktop_files{$desktop_file}}) {
+ my $entry = File::DesktopEntry->new_from_file($file);
+ next DESKTOP if (defined($entry->get_value('Hidden'))
+ and $entry->get_value('Hidden') eq 'true');
+ if ($entry->get_value('Name') =~ /^gnome$/i) {
+ push (@wm_list, 'gnome');
+ }
+ elsif ($entry->get_value('Name') =~ /^kde$/i) {
+ push (@wm_list, 'kde');
+ }
+ elsif (defined($entry->get_value('Exec'))) {
+ push (@wm_list, $entry->get_value('Exec'));
+ }
+ else { # not found, go to next file
+ next;
+ }
+ # found, proceed to next destop file
+ next DESKTOP;
+ }
+ }
+ $wm_list = join (',', sort @wm_list) . ',custom';
+} else {
+ $wm_list = join (',', sort @ARGV);
+}
+
+open (SLIM_CONFIG_FILE, '</etc/slim.conf')
+ or die "Can't open /etc/slim.conf for reading: $!";
+open (NEW_SLIM_CONFIG_FILE, '>/etc/slim.conf.new')
+ or die "Can't open /etc/slim.conf.new for writing: $!";
+
+while (<SLIM_CONFIG_FILE>) {
+ s|^(sessions\s*).*|$1$wm_list|;
+ print NEW_SLIM_CONFIG_FILE;
+}
+
+close(SLIM_CONFIG_FILE);
+close(NEW_SLIM_CONFIG_FILE);
+
+rename '/etc/slim.conf.new', '/etc/slim.conf'
+ or die "Can't rename /etc/slim.conf.new: $!";
+
+exit 0;