Fix GTK theme mess, use greetd

This commit is contained in:
Felix Suchert 2022-08-29 14:38:07 +02:00
parent 264b61f83b
commit 3faaec2655
Signed by: feliix42
GPG key ID: 24363525EA0E8A99
4 changed files with 119 additions and 22 deletions

View file

@ -221,13 +221,14 @@ in
openconnect
];
services.dbus.enable = true;
xdg.portal = {
enable = true;
gtkUsePortal = true;
extraPortals = with pkgs; [
xdg-desktop-portal-wlr
xdg-desktop-portal-kde
#xdg-desktop-portal-gtk
xdg-desktop-portal-gtk
];
wlr = {
enable = true;

View file

@ -1,12 +1,34 @@
{ pkgs, ... }:
{
services.xserver.desktopManager.plasma5 = {
enable = true;
services.xserver = {
enable = false;
autorun = false;
desktopManager.plasma5 = {
enable = true;
};
# use startx to run plasma
displayManager.startx.enable = true;
# I'd like a log please
logFile = "/var/log/Xorg.0.log";
# graphics
useGlamor = true;
};
environment.etc."X11/xinit/xinitrc".text = ''
export DESKTOP_SESSION=plasma
exec ${pkgs.libsForQt5.plasma-workspace}/bin/startplasma-x11
'';
#environment.variables = {
#GDK_SCALE = "2";
#GDK_DPI_SCALE = "0.5";
#_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2";
#};
}

View file

@ -1,5 +1,49 @@
{ pkgs, ... }:
let
# currently, there is some friction between sway and gtk:
# https://github.com/swaywm/sway/wiki/GTK-3-settings-on-Wayland
# the suggested way to set gtk settings is with gsettings
# for gsettings to work, we need to tell it where the schemas are
# using the XDG_DATA_DIR environment variable
# run at the end of sway config
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
executable = true;
text = let
schema = pkgs.gsettings-desktop-schemas;
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
in ''
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
gnome_schema=org.gnome.desktop.interface
gsettings set $gnome_schema gtk-theme "Dracula"
gsettings set $gnome_schema icon-theme "Paper"
'';
};
greetstyleWrapper = pkgs.writeText "gtkgreet.css" ''
window {
background-image: url("file://${pkgs.nixos-artwork.wallpapers.stripes-logo.gnomeFilePath}");
background-size: cover;
background-position: center;
color: #dddddd;
}
'';
# configures the sway wrapper for the GTK greeter
gtkgreetSwayWrapper = pkgs.writeText "gtkgreet-sway" ''
# `-l` activates layer-shell mode. Notice that `swaymsg exit` will run after gtkgreet.
exec configure-gtk
exec "${pkgs.greetd.gtkgreet}/bin/gtkgreet -l -s ${greetstyleWrapper}; swaymsg exit"
bindsym Mod4+shift+q exec swaynag \
-t warning \
-m 'What do you want to do?' \
-b 'Poweroff' 'systemctl poweroff' \
-b 'Reboot' 'systemctl reboot'
include /etc/sway/config.d/*
'';
in
{
programs.sway = {
enable = true;
@ -16,6 +60,11 @@
kanshi # replacement for autorandr
sway-contrib.grimshot
imv # image viewer
glib # gsettings
configure-gtk
#zafiro-icons
dracula-theme
paper-icon-theme
];
extraSessionCommands = ''
export SDL_VIDEODRIVER=wayland
@ -43,27 +92,49 @@
# ------------ Display Manager ----------------------------------------------
services.xserver = {
# under protest
services.greetd = {
enable = true;
# graphics
#videoDrivers = [ "modesetting" ];
useGlamor = true;
# use sddm for authentication
displayManager.sddm.enable = true;
settings = {
default_session = {
command = "${pkgs.sway}/bin/sway --config ${gtkgreetSwayWrapper}";
};
};
};
#services.xserver.videoDrivers = [
#"intel"
#"amdgpu"
#"radeon"
#"nouveau"
#"modesetting"
#"fbdev"
#];
#services.xserver.displayManager.gdm = {
environment.etc."greetd/environments".text = ''
${pkgs.sway}/bin/sway
startx
${pkgs.libsForQt5.plasma-workspace}/bin/startplasma-wayland
${pkgs.fish}/bin/fish
'';
#environment.etc."greetd/gtkgreet.css".text = ''
#window {
#background-image: url("file://${pkgs.nixos-artwork.wallpapers.stripes-logo.gnomeFilePath}");
#background-size: cover;
#background-position: center;
#}
#'';
#services.xserver = {
## under protest
#enable = true;
#wayland = true;
## graphics
##videoDrivers = [ "modesetting" ];
#useGlamor = true;
## use sddm for authentication
##displayManager.sddm.enable = true;
#displayManager.lightdm = {
#enable = true;
#greeters.enso = {
#enable = true;
#theme = {
#name = "Dracula";
#package = pkgs.dracula-theme;
#};
#};
#};
#};
}

View file

@ -39,6 +39,9 @@ exec systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
#exec dbus-update-activation-environment WAYLAND_DISPLAY
# Set up GTK properly
exec configure-gtk
### Idle configuration
#
# Example configuration: