mirror of
https://github.com/sddm/sddm.git
synced 2024-11-23 18:13:26 +08:00
Add faces to the users.
This commit is contained in:
parent
d0d6758582
commit
6c00a37508
@ -80,5 +80,7 @@ install(FILES scripts/Xsession
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
# install themes
|
||||
install(DIRECTORY themes DESTINATION /usr/share/apps/sddm)
|
||||
# install faces
|
||||
install(DIRECTORY faces DESTINATION /usr/share/apps/sddm)
|
||||
# install systemd service file
|
||||
install(FILES scripts/sddm.service DESTINATION /usr/lib/systemd/system)
|
||||
|
1
faces/README
Normal file
1
faces/README
Normal file
@ -0,0 +1 @@
|
||||
This files are directly copied from a KDE installation.
|
BIN
faces/default.face.icon
Normal file
BIN
faces/default.face.icon
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
faces/root.face.icon
Normal file
BIN
faces/root.face.icon
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
@ -38,6 +38,11 @@ LastSession=
|
||||
# Path of script to execute when starting the desktop session
|
||||
SessionCommand=/usr/share/config/sddm/Xsession
|
||||
|
||||
# Path of the directory containing face files
|
||||
# Face files should be in username.face.icon format
|
||||
# Default is "/usr/share/apps/sddm/faces"
|
||||
FacesDir=/usr/share/apps/sddm/faces
|
||||
|
||||
# Path of the directory containing theme files
|
||||
ThemesDir=/usr/share/apps/sddm/themes
|
||||
|
||||
|
@ -47,6 +47,8 @@ namespace SDE {
|
||||
QString lastSession { "" };
|
||||
QString sessionCommand { "" };
|
||||
|
||||
QString facesDir { "" };
|
||||
|
||||
QString themesDir { "" };
|
||||
QString currentTheme { "" };
|
||||
|
||||
@ -87,6 +89,7 @@ namespace SDE {
|
||||
d->sessionsDir = settings.value("SessionsDir", "").toString();
|
||||
d->lastSession = settings.value("LastSession", "").toString();
|
||||
d->sessionCommand = settings.value("SessionCommand", "").toString();
|
||||
d->facesDir = settings.value("FacesDir", "").toString();
|
||||
d->themesDir = settings.value("ThemesDir", "").toString();
|
||||
d->currentTheme = settings.value("CurrentTheme", "").toString();
|
||||
d->minimumUid = settings.value("MinimumUid", "0").toInt();
|
||||
@ -110,6 +113,7 @@ namespace SDE {
|
||||
settings.setValue("SessionsDir", d->sessionsDir);
|
||||
settings.setValue("LastSession", d->lastSession);
|
||||
settings.setValue("SessionCommand", d->sessionCommand);
|
||||
settings.setValue("FacesDir", d->facesDir);
|
||||
settings.setValue("ThemesDir", d->themesDir);
|
||||
settings.setValue("CurrentTheme", d->currentTheme);
|
||||
settings.setValue("MinimumUid", d->minimumUid);
|
||||
@ -173,6 +177,10 @@ namespace SDE {
|
||||
d->lastSession = lastSession;
|
||||
}
|
||||
|
||||
const QString &Configuration::facesDir() const {
|
||||
return d->facesDir;
|
||||
}
|
||||
|
||||
const QString &Configuration::themesDir() const {
|
||||
return d->themesDir;
|
||||
}
|
||||
|
@ -58,6 +58,8 @@ namespace SDE {
|
||||
|
||||
const QString &sessionCommand() const;
|
||||
|
||||
const QString &facesDir() const;
|
||||
|
||||
const QString &themesDir() const;
|
||||
const QString ¤tTheme() const;
|
||||
|
||||
|
@ -81,13 +81,20 @@ namespace SDE {
|
||||
if (fields.at(2).toInt() < Configuration::instance()->minimumUid())
|
||||
continue;
|
||||
|
||||
// create user
|
||||
UserPtr user { new User() };
|
||||
user->userName = fields.at(0);
|
||||
user->realName = fields.at(4).split(",").first();
|
||||
user->uid = fields.at(2).toInt();
|
||||
user->gid = fields.at(3).toInt();
|
||||
// TODO: set user icon
|
||||
user->icon = "/usr/share/apps/kdm/faces/root.face.icon";
|
||||
|
||||
// search for face icon
|
||||
QString userFace = QString("%1/%2.face.icon").arg(Configuration::instance()->facesDir()).arg(user->userName);
|
||||
if (QFile::exists(userFace))
|
||||
user->icon = userFace;
|
||||
else
|
||||
user->icon = QString("%1/default.face.icon").arg(Configuration::instance()->facesDir());
|
||||
|
||||
// add user
|
||||
beginInsertRows(QModelIndex(), rowCount(), rowCount());
|
||||
d->users << user;
|
||||
|
Loading…
Reference in New Issue
Block a user