The SLIM project is abandoned and their last release was in 2013. Because of this it poses a security risk to systems, no one is working on it or picked up maintenance. It also lacks compatibility with systemd and logind sessions. For users, there liikely isn't anything like slim that's as lightweight in terms of dependencies.wip/yesman
parent
04c5e20496
commit
ce26b3eaf0
@ -1,66 +0,0 @@ |
||||
import ./make-test.nix ({ pkgs, ...} : { |
||||
name = "slim"; |
||||
|
||||
meta = with pkgs.stdenv.lib.maintainers; { |
||||
maintainers = [ aszlig ]; |
||||
}; |
||||
|
||||
machine = { pkgs, ... }: { |
||||
imports = [ ./common/user-account.nix ]; |
||||
services.xserver.enable = true; |
||||
services.xserver.windowManager.default = "icewm"; |
||||
services.xserver.windowManager.icewm.enable = true; |
||||
services.xserver.desktopManager.default = "none"; |
||||
services.xserver.displayManager.slim = { |
||||
enable = true; |
||||
|
||||
# Use a custom theme in order to get best OCR results |
||||
theme = pkgs.runCommand "slim-theme-ocr" { |
||||
nativeBuildInputs = [ pkgs.imagemagick ]; |
||||
} '' |
||||
mkdir "$out" |
||||
convert -size 1x1 xc:white "$out/background.jpg" |
||||
convert -size 200x100 xc:white "$out/panel.jpg" |
||||
cat > "$out/slim.theme" <<EOF |
||||
background_color #ffffff |
||||
background_style tile |
||||
|
||||
input_fgcolor #000000 |
||||
msg_color #000000 |
||||
|
||||
session_color #000000 |
||||
session_font Verdana:size=16:bold |
||||
|
||||
username_msg Username: |
||||
username_font Verdana:size=16:bold |
||||
username_color #000000 |
||||
username_x 50% |
||||
username_y 40% |
||||
|
||||
password_msg Password: |
||||
password_x 50% |
||||
password_y 40% |
||||
EOF |
||||
''; |
||||
}; |
||||
}; |
||||
|
||||
enableOCR = true; |
||||
|
||||
testScript = { nodes, ... }: let |
||||
user = nodes.machine.config.users.users.alice; |
||||
in '' |
||||
startAll; |
||||
$machine->waitForText(qr/Username:/); |
||||
$machine->sendChars("${user.name}\n"); |
||||
$machine->waitForText(qr/Password:/); |
||||
$machine->sendChars("${user.password}\n"); |
||||
|
||||
$machine->waitForFile('${user.home}/.Xauthority'); |
||||
$machine->succeed('xauth merge ${user.home}/.Xauthority'); |
||||
$machine->waitForWindow('^IceWM '); |
||||
|
||||
# Make sure SLiM doesn't create a log file |
||||
$machine->fail('test -e /var/log/slim.log'); |
||||
''; |
||||
}) |
@ -1,55 +0,0 @@ |
||||
{ stdenv, fetchurl, fetchpatch, cmake, pkgconfig, xorg, libjpeg, libpng |
||||
, fontconfig, freetype, pam, dbus, makeWrapper }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
name = "slim-1.3.6"; |
||||
|
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/${name}.tar.gz"; |
||||
sha256 = "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1"; |
||||
}; |
||||
|
||||
patches = |
||||
[ # Allow the paths of the configuration file and theme directory to |
||||
# be set at runtime. |
||||
./runtime-paths.patch |
||||
|
||||
# Exit after the user's session has finished. This works around |
||||
# slim's broken PAM session handling (see |
||||
# http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663). |
||||
./run-once.patch |
||||
|
||||
# Ensure that sessions appear in sort order, rather than in |
||||
# directory order. |
||||
./sort-sessions.patch |
||||
|
||||
# Allow to set logfile to a special "/dev/stderr" in order to continue |
||||
# logging to stderr and thus to the journal. |
||||
./no-logfile.patch |
||||
] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch { |
||||
url = "https://raw.githubusercontent.com/gentoo/musl/8eddda8072add075ebf56cf6d288bc1450d6b5f8/x11-misc/slim/files/slim-1.3.6-add-missing-libgen_h.patch"; |
||||
sha256 = "0f82672s2r2cmdqfn2mbg3di76mbla9n0ik20p2gv4igi6p866xm"; |
||||
}); |
||||
|
||||
preConfigure = "substituteInPlace CMakeLists.txt --replace /lib $out/lib"; |
||||
|
||||
cmakeFlags = [ "-DUSE_PAM=1" ]; |
||||
|
||||
NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype -std=c++11"; |
||||
|
||||
enableParallelBuilding = true; |
||||
|
||||
buildInputs = |
||||
[ cmake pkgconfig libjpeg libpng fontconfig freetype |
||||
pam dbus |
||||
xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft makeWrapper |
||||
]; |
||||
|
||||
NIX_CFLAGS_LINK = "-lXmu"; |
||||
|
||||
meta = { |
||||
homepage = https://sourceforge.net/projects/slim.berlios/; # berlios shut down; I found no replacement yet |
||||
platforms = stdenv.lib.platforms.linux; |
||||
license = stdenv.lib.licenses.gpl2; |
||||
}; |
||||
} |
@ -1,80 +0,0 @@ |
||||
diff --git a/log.cpp b/log.cpp
|
||||
index b44677a..7c89dda 100644
|
||||
--- a/log.cpp
|
||||
+++ b/log.cpp
|
||||
@@ -1,23 +1,31 @@
|
||||
#include "log.h"
|
||||
#include <iostream>
|
||||
+#include <cstring>
|
||||
|
||||
bool
|
||||
LogUnit::openLog(const char * filename)
|
||||
{
|
||||
- if (logFile.is_open()) {
|
||||
+ if (isFile && logFile.is_open()) {
|
||||
cerr << APPNAME
|
||||
<< ": opening a new Log file, while another is already open"
|
||||
<< endl;
|
||||
- logFile.close();
|
||||
+ closeLog();
|
||||
}
|
||||
- logFile.open(filename, ios_base::app);
|
||||
|
||||
- return !(logFile.fail());
|
||||
+ if (strcmp(filename, "/dev/stderr") == 0) {
|
||||
+ isFile = false;
|
||||
+ return true;
|
||||
+ } else {
|
||||
+ logFile.open(filename, ios_base::app);
|
||||
+ isFile = true;
|
||||
+ return !(logFile.fail());
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
LogUnit::closeLog()
|
||||
{
|
||||
+ if (!isFile) return;
|
||||
if (logFile.is_open())
|
||||
logFile.close();
|
||||
}
|
||||
diff --git a/log.h b/log.h
|
||||
index b7810be..ad548a2 100644
|
||||
--- a/log.h
|
||||
+++ b/log.h
|
||||
@@ -9,11 +9,14 @@
|
||||
#endif
|
||||
#include "const.h"
|
||||
#include <fstream>
|
||||
+#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
static class LogUnit {
|
||||
ofstream logFile;
|
||||
+ bool isFile;
|
||||
+ inline ostream &getStream() { return isFile ? logFile : cerr; }
|
||||
public:
|
||||
bool openLog(const char * filename);
|
||||
void closeLog();
|
||||
@@ -22,17 +25,17 @@ public:
|
||||
|
||||
template<typename Type>
|
||||
LogUnit & operator<<(const Type & text) {
|
||||
- logFile << text; logFile.flush();
|
||||
+ getStream() << text; getStream().flush();
|
||||
return *this;
|
||||
}
|
||||
|
||||
LogUnit & operator<<(ostream & (*fp)(ostream&)) {
|
||||
- logFile << fp; logFile.flush();
|
||||
+ getStream() << fp; getStream().flush();
|
||||
return *this;
|
||||
}
|
||||
|
||||
LogUnit & operator<<(ios_base & (*fp)(ios_base&)) {
|
||||
- logFile << fp; logFile.flush();
|
||||
+ getStream() << fp; getStream().flush();
|
||||
return *this;
|
||||
}
|
||||
} logStream;
|
@ -1,12 +0,0 @@ |
||||
diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
|
||||
--- slim-1.3.6-orig/app.cpp 2013-10-15 11:02:55.629263422 +0200
|
||||
+++ slim-1.3.6/app.cpp 2013-10-15 13:00:10.141210784 +0200
|
||||
@@ -816,7 +822,7 @@
|
||||
StopServer();
|
||||
RemoveLock();
|
||||
while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
|
||||
- Run();
|
||||
+ exit(OK_EXIT);
|
||||
}
|
||||
|
||||
void App::KillAllClients(Bool top) {
|
@ -1,70 +0,0 @@ |
||||
diff -ru slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
|
||||
--- slim-1.3.6-orig/app.cpp 2013-10-02 00:38:05.000000000 +0200
|
||||
+++ slim-1.3.6/app.cpp 2014-03-30 19:01:04.115414201 +0200
|
||||
@@ -200,7 +200,9 @@
|
||||
|
||||
/* Read configuration and theme */
|
||||
cfg = new Cfg;
|
||||
- cfg->readConf(CFGFILE);
|
||||
+ char *cfgfile = getenv("SLIM_CFGFILE");
|
||||
+ if (!cfgfile) cfgfile = CFGFILE;
|
||||
+ cfg->readConf(cfgfile);
|
||||
string themebase = "";
|
||||
string themefile = "";
|
||||
string themedir = "";
|
||||
@@ -208,7 +210,9 @@
|
||||
if (testing) {
|
||||
themeName = testtheme;
|
||||
} else {
|
||||
- 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) {
|
||||
diff -ru slim-1.3.6-orig/CMakeLists.txt slim-1.3.6/CMakeLists.txt
|
||||
--- slim-1.3.6-orig/CMakeLists.txt 2013-10-02 00:38:05.000000000 +0200
|
||||
+++ slim-1.3.6/CMakeLists.txt 2014-03-30 19:16:48.445069729 +0200
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE PATH "Installation Directory")
|
||||
set(PKGDATADIR "${CMAKE_INSTALL_PREFIX}/share/slim")
|
||||
-set(SYSCONFDIR "/etc")
|
||||
+set(SYSCONFDIR "$ENV{out}/etc")
|
||||
set(LIBDIR "/lib")
|
||||
set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPACKAGE=\"slim\"")
|
||||
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DVERSION=\"${SLIM_VERSION}\"")
|
||||
set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DPKGDATADIR=\"${PKGDATADIR}\"")
|
||||
-set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"${SYSCONFDIR}\"")
|
||||
+set(SLIM_DEFINITIONS ${SLIM_DEFINITIONS} "-DSYSCONFDIR=\"/etc\"")
|
||||
|
||||
# Flags
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -g -O2")
|
||||
Only in slim-1.3.6: CMakeLists.txt~
|
||||
diff -ru slim-1.3.6-orig/slimlock.cpp slim-1.3.6/slimlock.cpp
|
||||
--- slim-1.3.6-orig/slimlock.cpp 2013-10-02 00:38:05.000000000 +0200
|
||||
+++ slim-1.3.6/slimlock.cpp 2014-03-30 19:01:04.115414201 +0200
|
||||
@@ -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) {
|
@ -1,40 +0,0 @@ |
||||
diff -ru -x '*~' slim-1.3.6-orig/cfg.cpp slim-1.3.6/cfg.cpp
|
||||
--- slim-1.3.6-orig/cfg.cpp 2013-10-02 00:38:05.000000000 +0200
|
||||
+++ slim-1.3.6/cfg.cpp 2016-01-30 10:35:51.108766802 +0100
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
+#include <algorithm>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -293,6 +294,8 @@
|
||||
|
||||
sessions.clear();
|
||||
|
||||
+ typedef pair<string,string> session_t;
|
||||
+
|
||||
if( !strSessionDir.empty() ) {
|
||||
DIR *pDir = opendir(strSessionDir.c_str());
|
||||
|
||||
@@ -325,7 +328,7 @@
|
||||
}
|
||||
}
|
||||
desktop_file.close();
|
||||
- pair<string,string> session(session_name,session_exec);
|
||||
+ session_t session(session_name,session_exec);
|
||||
sessions.push_back(session);
|
||||
cout << session_exec << " - " << session_name << endl;
|
||||
}
|
||||
@@ -341,6 +344,10 @@
|
||||
pair<string,string> session("","");
|
||||
sessions.push_back(session);
|
||||
}
|
||||
+
|
||||
+ std::sort(sessions.begin(), sessions.end(), [](session_t& a, session_t& b) -> bool{
|
||||
+ return a.first < b.first;
|
||||
+ });
|
||||
}
|
||||
|
||||
pair<string,string> Cfg::nextSession() {
|
@ -1,183 +0,0 @@ |
||||
{ stdenv, fetchurl, slim }: |
||||
|
||||
# Inspired on aspell buildDict expression |
||||
|
||||
let |
||||
buildTheme = |
||||
{fullName, src, version ? "testing"}: |
||||
|
||||
stdenv. mkDerivation rec { |
||||
name = "${fullName}-${version}"; |
||||
|
||||
inherit src; |
||||
|
||||
buildInputs = [ slim ]; |
||||
|
||||
dontBuild = true; |
||||
|
||||
installPhase = '' |
||||
install -dm755 $out/share/slim/themes/${name} |
||||
install -m644 * $out/share/slim/themes/${name} |
||||
''; |
||||
|
||||
meta = { |
||||
description = "Slim theme for ${fullName}"; |
||||
platforms = stdenv.lib.platforms.linux; |
||||
}; |
||||
}; |
||||
|
||||
in { |
||||
|
||||
archlinuxSimple = buildTheme { |
||||
fullName = "archlinux-simple"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-archlinux-simple.tar.gz"; |
||||
sha256 = "7d60d6782fa86302646fe67253467c04692d247f89bdbe87178f690f32b270db"; |
||||
}; |
||||
}; |
||||
|
||||
capernoited = buildTheme { |
||||
fullName = "capernoited"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-capernoited.tar.gz"; |
||||
sha256 = "fb9163c6a2656d60f088dc4f2173aa7556a6794495122acfa7d3be7182f16b41"; |
||||
}; |
||||
}; |
||||
|
||||
debianMoreblue = buildTheme { |
||||
fullName = "debian-moreblue"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-debian-moreblue.tar.bz2"; |
||||
sha256 = "5b76929827d4a4d604ddca4f42668cca3309b6f7bd659901021c6f49d6d2c481"; |
||||
}; |
||||
}; |
||||
|
||||
fingerprint = buildTheme { |
||||
fullName = "fingerprint"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-fingerprint.tar.gz"; |
||||
sha256 = "48b703f84ce7b814cda0824f65cafebf695cd71a14166b481bb44616097d3144"; |
||||
}; |
||||
}; |
||||
|
||||
flat = buildTheme { |
||||
fullName = "flat"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-flat.tar.gz"; |
||||
sha256 = "0092d531540f9da8ef07ad173e527c4ef9c088d04962d142be3c11f0c5c0c5e9"; |
||||
}; |
||||
}; |
||||
|
||||
flower2 = buildTheme { |
||||
fullName = "flower2"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-flower2.tar.gz"; |
||||
sha256 = "840faf6459ffd6c2c363160c85cb98000717f9a425102976336f5d8f68ed95ee"; |
||||
}; |
||||
}; |
||||
|
||||
gentooSimple = buildTheme { |
||||
fullName = "gentoo-simple"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-gentoo-simple.tar.bz2"; |
||||
sha256 = "27c8614cc930ca200acf81f1192febc102501744939d5cbe997141e37c96d8c2"; |
||||
}; |
||||
}; |
||||
|
||||
lake = buildTheme { |
||||
fullName = "lake"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-lake.tar.gz"; |
||||
sha256 = "f7d662e37068a6c64cbf910adf3c192f1b50724baa427a8c9487cb9f7ed95851"; |
||||
}; |
||||
}; |
||||
|
||||
lunar = buildTheme { |
||||
fullName = "lunar-0.4"; |
||||
version = ""; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-lunar-0.4.tar.bz2"; |
||||
sha256 = "1543eb45e4d664377e0dd4f7f954aba005823034ba9692624398b3d58be87d76"; |
||||
}; |
||||
}; |
||||
|
||||
mindlock = buildTheme { |
||||
fullName = "mindlock"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-mindlock.tar.gz"; |
||||
sha256 = "99a6e6acd55bf55ece18a3f644299517b71c1adc49efd87ce2d7e654fb67033c"; |
||||
}; |
||||
}; |
||||
|
||||
parallelDimensions = buildTheme { |
||||
fullName = "parallel-dimensions"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-parallel-dimensions.tar.gz"; |
||||
sha256 = "2b17c3e6d3967a6a0744e20e6e05c9d3938f4ef04c62d49ddbd416bc4743046f"; |
||||
}; |
||||
}; |
||||
|
||||
previous = buildTheme { |
||||
fullName = "previous"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-previous.tar.gz"; |
||||
sha256 = "1f2a69f8fc0dc8ed8eb86a4c1d1087ba7be486973fb81efab52a63c661d726f8"; |
||||
}; |
||||
}; |
||||
|
||||
rainbow = buildTheme { |
||||
fullName = "rainbow"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-rainbow.tar.gz"; |
||||
sha256 = "d83e3afdb05be50cff7da037bb31208b2c152539d1a009740b13857f5f910072"; |
||||
}; |
||||
}; |
||||
|
||||
rear-window = buildTheme { |
||||
fullName = "rear-window"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-rear-window.tar.gz"; |
||||
sha256 = "0b123706ccb67e94f626c183530ec5732b209bab155bc661d6a3f5cd5ee39511"; |
||||
}; |
||||
}; |
||||
|
||||
scotlandRoad = buildTheme { |
||||
fullName = "scotland-road"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-scotland-road.tar.gz"; |
||||
sha256 = "fd60a434496ed39b968ffa1e5457b36cd12f64a4e2ecedffc675f97ca3f3bba1"; |
||||
}; |
||||
}; |
||||
|
||||
subway = buildTheme { |
||||
fullName = "subway"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-subway.tar.gz"; |
||||
sha256 = "0205568e3e157973b113a83b26d8829ce9962a85ef7eb8a33d3ae2f3f9292253"; |
||||
}; |
||||
}; |
||||
|
||||
wave = buildTheme { |
||||
fullName = "wave"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-wave.tar.gz"; |
||||
sha256 = "be75676da5bf8670daa48379bb9cc1be0b9a5faa09adbea967dfd7125320b959"; |
||||
}; |
||||
}; |
||||
|
||||
zenwalk = buildTheme { |
||||
fullName = "zenwalk"; |
||||
src = fetchurl { |
||||
url = "mirror://sourceforge/slim.berlios/slim-zenwalk.tar.gz"; |
||||
sha256 = "f0f41d17ea505b0aa96a036e978fabaf673a51d3f81a919cb0d43364d4bc7a57"; |
||||
}; |
||||
}; |
||||
|
||||
nixosSlim = buildTheme { |
||||
fullName = "nixos-slim"; |
||||
src = fetchurl { |
||||
url = "https://github.com/jagajaga/nixos-slim-theme/archive/2.0.tar.gz"; |
||||
sha256 = "0lldizhigx7bjhxkipii87y432hlf5wdvamnfxrryf9z7zkfypc8"; |
||||
}; |
||||
}; |
||||
} |
Loading…
Reference in new issue