waybar............. gtk...............

This commit is contained in:
Aria Nolan 2023-11-14 23:51:07 -05:00
parent 37b79824a1
commit 73f874f000
8 changed files with 98 additions and 22 deletions

View file

@ -65,6 +65,7 @@
specialArgs = {inherit inputs;};
modules = [
./hosts/JWST/configuration.nix
./modules/sway.nix
nixos-hardware.nixosModules.dell-xps-15-9520
nixos-hardware.nixosModules.common-gpu-nvidia-disable
{ nixpkgs.overlays = overlays; }

View file

@ -92,12 +92,12 @@
brightnessctl
];
programs.sway.enable = true;
programs.sway.extraPackages = with pkgs; [
swaylock
swayidle
brightnessctl
];
# programs.sway.enable = true;
# programs.sway.extraPackages = with pkgs; [
# swaylock
# swayidle
# brightnessctl
# ];
# programs.waybar.enable = true;
# programs.nm-applet.enable = true;

63
modules/sway.nix Normal file
View file

@ -0,0 +1,63 @@
{
config,
pkgs,
lib,
...
}: let
# bash script to let dbus know about important env variables and
# propagate them to relevent services run at the end of sway config
# see
# https://github.com/emersion/xdg-desktop-portal-wlr/wiki/"It-doesn't-work"-Troubleshooting-Checklist
# note: this is pretty much the same as /etc/sway/config.d/nixos.conf but also restarts
# some user services to make sure they have the correct environment variables
dbus-sway-environment = pkgs.writeTextFile {
name = "dbus-sway-environment";
destination = "/bin/dbus-sway-environment";
executable = true;
text = ''
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
systemctl --user stop pipewire xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk
systemctl --user start pipewire xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk
'';
};
# 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'
'';
};
in {
# environment.systemPackages = [
# dbus-sway-environment
# configure-gtk
# ];
# enable sway window manager
programs.sway = {
enable = true;
wrapperFeatures.gtk = true;
extraPackages = with pkgs; [
dbus-sway-environment
configure-gtk
swaylock
swayidle
brightnessctl
];
};
# programs.waybar.enable = true;
}

View file

@ -44,10 +44,10 @@
texlab = {
command = "${pkgs.texlab}/bin/texlab";
config.texlab = {
forwardSearch.executable = "${pkgs.zathura}";
forwardSearch.executable = lib.getExe pkgs.zathura;
forwardSearch.args = ["--synctex-forward" "%l:1:%f"];
build = {
executable = "${pkgs.tectonic}/bin/tectonic";
executable = lib.getExe pkgs.tectonic;
onSave = true;
auxDirectory = "build";
logDirectory = "build";

View file

@ -21,6 +21,10 @@
xdg.configFile."sway/background.jpg".source = ../background.jpg;
# wayland.windowManager.sway = {
# enable = true;
# };
home.packages = with pkgs; [
wl-clipboard
# swaylock

View file

@ -1,13 +1,13 @@
# Default config for sway
include ~/.config/sway/config.d/*
include /etc/sway/config.d/*
#
# Copy this to ~/.config/sway/config and edit it to your liking.
#
# Read `man 5 sway` for a complete reference.
exec dbus-sway-environment
# exec configure-gtk
### Variables
#
# Logo key. Use Mod1 for Alt.
@ -53,7 +53,6 @@ client.unfocused $unfocus $unfocus $unfocus $unfocus
# Default wallpaper (more resolutions are available in /usr/share/backgrounds/sway/)
output * bg ~/.config/sway/background.jpg fill
bar swaybar_command waybar
#
# Example configuration:
#
@ -237,20 +236,23 @@ bindsym $mod+r mode "resize"
#
# Status Bar:
bar {
swaybar_command swaybar
#
# Read `man 5 sway-bar` for more information about this section.
# position top
position top
# # When the status_command prints a new line to stdout, swaybar updates.
# # The default just shows the current date and time.
# status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
status_command while date +'%Y-%m-%d %I:%M:%S %p'; do sleep 1; done
# colors {
# statusline #ffffff
# background #323232
# inactive_workspace #32323200 #32323200 #5c5c5c
# }
# }
colors {
statusline #ffffff
background #323232
inactive_workspace #32323200 #32323200 #5c5c5c
}
}
#
# Player
@ -278,4 +280,9 @@ bindsym $mod+r mode "resize"
# SwayFX
# blur on
# xwayland enable
xwayland enable
# include /etc/sway/config.d/*
include ~/.config/sway/config.d/*

View file

@ -1,7 +1,7 @@
exec nm-applet
# exec waybar
exec gammastep-indicator
exec dunst
# exec waybar
#exec swayidle -w \
# timeout 600 'swaylock -f -c 14171d' \
# before-sleep 'swaylock -f -c 14171d'

View file

@ -2,6 +2,7 @@
programs.waybar = {
enable = true;
style = ./style.css;
# systemd.enable = true;
settings = {
mainBar = {
layer = "top";