Merge branch 'slim_fix' of git://github.com/jagajaga/nixpkgs

add normal theme support for slim and slimlock
This commit is contained in:
Shea Levy 2014-03-29 00:17:52 -04:00
commit 63f97fe9db
4 changed files with 57 additions and 5 deletions

View File

@ -37,6 +37,7 @@
ianwookim = "Ian-Woo Kim <ianwookim@gmail.com>";
iElectric = "Domen Kozar <domen@dev.si>";
iyzsong = "Song Wenwu <iyzsong@gmail.com>";
JagaJaga = "Arseniy Seroka <ars.seroka@gmail.com>";
jcumming = "Jack Cummings <jack@mudshark.org>";
kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
ktosiek = "Tomasz Kontusz <tomasz.kontusz@gmail.com>";

View File

@ -5,7 +5,10 @@ with pkgs.lib;
let
dmcfg = config.services.xserver.displayManager;
cfg = dmcfg.slim;
slimPackage = cfg.package;
slimConfig = pkgs.writeText "slim.cfg"
''
@ -32,7 +35,7 @@ let
ln -s * default
'';
};
in if cfg.theme == null then "${pkgs.slim}/share/slim/themes" else unpackedTheme;
in if cfg.theme == null then "${slimPackage}/share/slim/themes" else unpackedTheme;
in
@ -79,6 +82,24 @@ in
the focus is placed on the password.
'';
};
package = mkOption {
type = types.package;
default = pkgs.slim.override {
theme = slimThemesDir;
};
description = ''
Configure slim package.
'';
example = ''
pkgs.slim.override {
theme = pkgs.fetchurl {
url = http://download.berlios.de/slim/slim-wave.tar.gz;
sha256 = "0ndr419i5myzcylvxb89m9grl2xyq6fbnyc3lkd711mzlmnnfxdy";
};
};
'';
};
autoLogin = mkOption {
type = types.bool;
@ -106,7 +127,7 @@ in
{ SLIM_CFGFILE = slimConfig;
SLIM_THEMESDIR = slimThemesDir;
};
execCmd = "exec ${pkgs.slim}/bin/slim";
execCmd = "exec ${slimPackage}/bin/slim";
};
# Allow null passwords so that the user can login as root on the
@ -116,7 +137,7 @@ in
# Allow slimlock to work.
security.pam.services.slimlock = {};
environment.systemPackages = [ pkgs.slim ];
environment.systemPackages = [ slimPackage ];
};

View File

@ -1,5 +1,9 @@
{ stdenv, fetchurl, cmake, pkgconfig, xorg, libjpeg, libpng
, fontconfig, freetype, pam, dbus_libs }:
, fontconfig, freetype, pam, dbus_libs, makeWrapper, pkgs, theme ? null }:
let
slimThemesDir = if theme == null then "$out/share/slim/themes" else theme;
in
stdenv.mkDerivation rec {
name = "slim-1.3.6";
@ -29,9 +33,13 @@ stdenv.mkDerivation rec {
buildInputs =
[ cmake pkgconfig libjpeg libpng fontconfig freetype
pam dbus_libs
xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft
xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft makeWrapper
];
postInstall = ''
wrapProgram $out/bin/slimlock --set SLIM_THEMESDIR "${slimThemesDir}" --set SLIM_CFGFILE "$out/etc/slim.cfg"
'';
NIX_CFLAGS_LINK = "-lXmu";
meta = {

View File

@ -23,3 +23,25 @@ diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
themeName = cfg->getOption("current_theme");
string::size_type pos;
if ((pos = themeName.find(",")) != string::npos) {
--- slim-1.3.6-orig/slimlock.cpp 2014-02-05 01:58:01.576560731 +0400
+++ slim-1.3.6/slimlock.cpp 2014-02-05 02:11:16.587634246 +0400
@@ -106,13 +106,17 @@
unsigned int cfg_passwd_timeout;
// Read user's current theme
cfg = new Cfg;
- cfg->readConf(CFGFILE);
+ char *cfgfile = getenv("SLIM_CFGFILE");
+ if (!cfgfile) cfgfile = CFGFILE;
+ cfg->readConf(cfgfile);
cfg->readConf(SLIMLOCKCFG);
string themebase = "";
string themefile = "";
string themedir = "";
themeName = "";
- themebase = string(THEMESDIR) + "/";
+ char *themesdir = getenv("SLIM_THEMESDIR");
+ if (!themesdir) themesdir = THEMESDIR;
+ themebase = string(themesdir) + "/";
themeName = cfg->getOption("current_theme");
string::size_type pos;
if ((pos = themeName.find(",")) != string::npos) {