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
4 changed files with 57 additions and 5 deletions

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) {