fix swaync

This commit is contained in:
DACHXY 2024-12-31 00:52:33 +08:00
parent 64499a5e90
commit 2b6381ec57
15 changed files with 234 additions and 223 deletions

View file

@ -1,50 +0,0 @@
{
"$schema": "/etc/xdg/swaync/configSchema.json",
"positionX": "right",
"positionY": "top",
"layer": "overlay",
"control-center-margin-top": 20,
"control-center-margin-bottom": 20,
"control-center-margin-right": 20,
"control-center-margin-left": 20,
"notification-icon-size": 64,
"notification-body-image-height": 100,
"notification-body-image-width": 200,
"timeout": 3,
"timeout-low": 2,
"timeout-critical": 0,
"fit-to-screen": false,
"control-center-width": 500,
"control-center-height": 900,
"notification-window-width": 490,
"keyboard-shortcuts": true,
"image-visibility": "when-available",
"transition-time": 200,
"hide-on-clear": true,
"hide-on-action": true,
"script-fail-notify": true,
"widgets": [
"title",
"notifications",
"mpris"
],
"widget-config": {
"title": {
"text": "Notification Center",
"clear-all-button": true,
"button-text": "󰆴 Clear All"
},
"dnd": {
"text": "Leave me alone!!"
},
"label": {
"max-lines": 1,
"text": "Notification Center"
},
"mpris": {
"image-size": 96,
"image-radius": 7
}
}
}

View file

@ -1,145 +0,0 @@
@define-color bgc rgba(0, 0, 0, 0.1);
@define-color borderc #ebdbb2;
@define-color textc #282828;
* {
font-family: JetBrainsMonoNerdFontMono;
font-weight: bold;
font-size: 15px;
border-width: 3px;
border-color: #ebdbb2;
}
.control-center .notification-row:focus,
.control-center .notification-row:hover {
opacity: 1;
background: @bgc;
}
.notification-row {
outline: none;
margin: 20px;
padding: 0;
}
.notification {
background: @textc;
margin: 0px;
border-radius: 0px;
border-width: 3px;
border-color: #ebdbb2;
}
.notification-content {
background: @textc;
padding: 7px;
margin: 0;
}
.close-button {
background: @textc;
color: @borderc;
text-shadow: none;
padding: 0;
border-radius: 20px;
margin-top: 9px;
margin-right: 5px;
}
.close-button:hover {
box-shadow: none;
background: @borderc;
color: @textc;
transition: all 0.15s ease-in-out;
border: none;
}
.notification-action {
color: @bgc;
background: @textc;
}
.summary {
padding-top: 7px;
font-size: 13px;
color: @borderc;
}
.time {
font-size: 11px;
color: @borderc;
margin-right: 40px;
}
.body {
font-size: 12px;
color: @borderc;
}
.control-center {
background-color: @bgc;
border-radius: 20px;
}
.control-center-list {
background: transparent;
}
.control-center-list-placeholder {
opacity: 0.5;
}
.floating-notifications {
background: transparent;
}
.blank-window {
background: alpha(black, 0.1);
}
.widget-title {
color: @borderc;
padding: 10px 10px;
margin: 10px 10px 5px 10px;
font-size: 1.5rem;
}
.widget-title > button {
font-size: 1rem;
color: @borderc;
padding: 10px;
text-shadow: none;
background: @bgc;
box-shadow: none;
border-radius: 5px;
}
.widget-title > button:hover {
background: @borderc;
color: #282828;
}
.widget-label {
margin: 10px 10px 10px 10px;
}
.widget-label > label {
font-size: 1rem;
color: @textc;
}
.widget-mpris {
color: @borderc;
padding: 5px 5px 5px 5px;
margin: 10px;
border-radius: 20px;
}
.widget-mpris > box > button {
border-radius: 20px;
}
.widget-mpris-player {
padding: 5px 5px;
margin: 10px;
}

View file

@ -1,4 +1,4 @@
{ ... }:
{ pkgs, ... }:
let configDir = ../config;
in
{
@ -10,7 +10,6 @@ in
".config/wallpapers".source = "${configDir}/wallpapers";
".config/kitty".source = "${configDir}/kitty";
".config/neofetch".source = "${configDir}/neofetch";
# ".config/hypr".source = "${configDir}/hypr";
".config/swayidle".source = "${configDir}/swayidle";
".config/swaylock".source = "${configDir}/swaylock";
".config/wlogout".source = "${configDir}/wlogout";
@ -19,11 +18,9 @@ in
source = "${configDir}/waybar";
};
".config/btop".source = "${configDir}/btop";
".config/wofi".source = "${configDir}/wofi";
".config/rofi".source = "${configDir}/rofi";
".config/mako".source = "${configDir}/mako";
".config/scripts".source = "${configDir}/scripts";
".config/swaync".source = "${configDir}/swaync";
".config/starship.toml".source = "${configDir}/starship/starship.toml";
".config/macchiato.toml".source = "${configDir}/starship/macchiato.toml";
".config/gh" = {

View file

@ -10,6 +10,7 @@
./environment.nix
./virtualization.nix
./hyprland.nix
./swaync.nix
inputs.hyprland.homeManagerModules.default
];

View file

@ -2,7 +2,7 @@
home.sessionVariables = {
BROWSER = "firefox";
EDITOR = "nvim";
TERMINAL = "kitty";
TERMINAL = "ghostty";
NIXOS_OZONE_WL = "1";
QT_QPA_PLATFORMTHEME = "gtk3";
QT_SCALE_FACTOR = "1";
@ -16,8 +16,6 @@
WLR_NO_HARDWARE_CURSORS = "1";
CLUTTER_BACKEND = "wayland";
WLR_RENDERER = "vulkan";
XCURSOR_THEME = "catppuccin-macchiato-lavender-cursors";
XCURSOR_SIZE = "24";
XDG_CURRENT_DESKTOP = "Hyprland";
XDG_SESSION_DESKTOP = "Hyprland";
XDG_SESSION_TYPE = "wayland";
@ -30,7 +28,7 @@
GTK_IM_MODULE = "";
XDG_DATA_DIRS = "\${XDG_DATA_DIRS}:/usr/share:/var/lib/flatpak/exports/share:\${HOME}/.local/share/flatpak/exports/share";
ELECTRON_OZONE_PLATFORM_HINT = "auto";
# GDK_BACKEND = "wayland";
GDK_BACKEND = "wayland";
# GPU
LIBVA_DRIVER_NAME = "nvidia";

View file

@ -1,15 +1,33 @@
{ pkgs, ... }:
let
cursorName = "catppuccin-macchiato-lavender-cursors";
themeName = "catppuccin-macchiato-lavender-compact";
cursorSize = "24";
in
{
home.sessionVariables = {
XCURSOR_THEME = cursorName;
XCURSOR_SIZE = cursorSize;
HYPERCURSOR_SIZE = cursorSize;
};
home.pointerCursor = {
gtk.enable = true;
package = pkgs.catppuccin-cursors.macchiatoLavender;
name = cursorName;
size = 24;
};
gtk = {
enable = true;
cursorTheme = {
name = "catppuccin-macchiato-lavender-cursors";
name = cursorName;
package = pkgs.catppuccin-cursors.macchiatoLavender;
};
theme = {
name = "catppuccin-macchiato-lavender-compact";
name = themeName;
package = pkgs.catppuccin-gtk.override {
accents = [ "lavender" ];
size = "compact";
@ -24,13 +42,13 @@
gtk3 = {
extraConfig = {
gtk-application-prefer-dark-theme = 1;
gtk-application-prefer-dark-theme = true;
};
};
gtk4 = {
extraConfig = {
gtk-application-prefer-dark-theme = 1;
gtk-application-prefer-dark-theme = true;
};
};
};

View file

@ -1,5 +1,6 @@
{ mainMod }:
let
uwsm = "uwsm app --";
browser = "firefox";
terminal = "ghostty";
filemanager = "thunar";
@ -19,7 +20,7 @@ in
''${mainMod}, E, exec, ${filemanager}''
''${mainMod}, V, togglefloating, ''
''ALT, SPACE, exec, rofi -config ~/.config/rofi/apps.rasi -show drun''
''${mainMod} ALT, W, exec, ${scripts}/waybarRestart.sh''
''${mainMod} ALT, W, exec, ${uwsm} ${scripts}/waybarRestart.sh''
''${mainMod}, P, pseudo, # dwindle''
''${mainMod}, S, togglesplit, # dwindle''
''CTRL ${mainMod} SHIFT, L, exec, swaylock''
@ -30,8 +31,7 @@ in
''${mainMod}, X, exec, sleep 0.1 && swaync-client -t -sw''
''${mainMod} SHIFT, C, centerwindow''
'',F11, fullscreen''
''${mainMod}, F, exec, ${browser}''
''${mainMod}, C, exec, NIXOS_OZONE_WL=1 code''
''${mainMod}, C, exec, code''
# Cycle windows
''ALT, TAB, cyclenext''

View file

@ -1,15 +1,21 @@
{ pkgs, lib, inputs, system, ... }:
let
swayncScript = pkgs.pkgs.writeShellScriptBin "swaync-start" ''
XDG_CONFIG_HOME="$HOME/.dummy" # Prevent swaync use default gtk theme
swaync -c "$HOME/.config/swaync/config.json" -s "$HOME/.config/swaync/style.css"
'';
startupScript = pkgs.pkgs.writeShellScriptBin "start" ''
swaync -s ~/.config/swaync/style.css -c ~/.config/swaync/config.json &
uwsm app -- ${swayncScript}/bin/swaync-start &
dbus-update-activation-environment --systemd --all &
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css &
swayidle -w &
sway-audio-idle-inhibit &
fcitx5 -d -r &
fcitx5-remote -r &
hyprsunset -t 3000k &
uwsm app -- hyprpaper &
uwsm app -- waybar -c ~/.config/waybar/config.json -s ~/.config/waybar/style.css &
uwsm app -- swayidle -w &
uwsm app -- sway-audio-idle-inhibit &
fcitx5 -rd &
uwsm app -- fcitx5-remote -r &
uwsm app -- hyprsunset -t 3000k
'';
in
''${startupScript}/bin/start''

View file

@ -9,6 +9,11 @@ let
plugins = import ./hypr/plugin.nix;
in
{
home.packages = with pkgs; [
hyprpaper
];
systemd.user.targets.hyprland-session.Unit.Wants = [
"xdg-desktop-autostart.target"
];
@ -16,6 +21,7 @@ in
wayland.windowManager.hyprland = {
enable = true;
xwayland.enable = true;
systemd.enable = false;
package = inputs.hyprland.packages.${system}.hyprland;
plugins = (with inputs.hyprland-plugins.packages.${system}; [
@ -40,7 +46,7 @@ in
settings = {
preload = [ "~/.config/wallpapers/wall.png" ];
wallpaper = [ ", ~/.config/wallpapers/wall.png" ];
splash = true;
splash = false;
ipc = "on";
};
};

View file

@ -10,7 +10,7 @@
vscode = {
enable = true;
package = pkgs.vscode.fhs;
package = pkgs.vscode;
};
obs-studio = {

View file

@ -3,7 +3,6 @@
cat = "bat";
y = "yazi";
g = "git";
cd = "z"; # Zoxide
t = "tmux";
vim = "nvim";
vi = "nvim";

182
home/user/swaync.nix Normal file
View file

@ -0,0 +1,182 @@
{ pkgs, ... }:
{
services.swaync = {
enable = true;
settings = {
"positionX" = "right";
"positionY" = "top";
"layer" = "overlay";
"control-center-margin-top" = 20;
"control-center-margin-bottom" = 20;
"control-center-margin-right" = 20;
"control-center-margin-left" = 20;
"notification-icon-size" = 64;
"notification-body-image-height" = 100;
"notification-body-image-width" = 200;
"timeout" = 3;
"timeout-low" = 2;
"timeout-critical" = 0;
"fit-to-screen" = false;
"control-center-width" = 500;
"control-center-height" = 900;
"notification-window-width" = 490;
"keyboard-shortcuts" = true;
"image-visibility" = "when-available";
"transition-time" = 200;
"hide-on-clear" = true;
"hide-on-action" = true;
"script-fail-notify" = true;
"widgets" = [
"title"
"notifications"
"mpris"
];
};
style = ''
@define-color bgc rgba(0, 0, 0, 0.1);
@define-color borderc #ebdbb2;
@define-color textc #282828;
.SwayNotificationCenterNotificationWindow {
background: @bgc;
background-color: @bgc;
}
.control-center .notification-row:focus,
.control-center .notification-row:hover {
opacity: 1;
background: @bgc;
}
.notification-row {
outline: none;
margin: 20px;
padding: 0;
}
.notification {
background: @textc;
margin: 0px;
border-radius: 0px;
border-width: 3px;
border-color: #ebdbb2;
}
.notification-content {
background: @textc;
padding: 7px;
margin: 0;
}
.close-button {
background: @textc;
color: @borderc;
text-shadow: none;
padding: 0;
border-radius: 20px;
margin-top: 9px;
margin-right: 5px;
}
.close-button:hover {
box-shadow: none;
background: @borderc;
color: @textc;
transition: all 0.15s ease-in-out;
border: none;
}
.notification-action {
color: @bgc;
background: @textc;
}
.summary {
padding-top: 7px;
font-size: 13px;
color: @borderc;
}
.time {
font-size: 11px;
color: @borderc;
margin-right: 40px;
}
.body {
font-size: 12px;
color: @borderc;
}
.control-center {
background-color: @bgc;
border-radius: 20px;
}
.control-center-list {
background: transparent;
}
.control-center-list-placeholder {
opacity: 0.5;
}
.floating-notifications {
background: transparent;
}
.blank-window {
background: alpha(black, 0.1);
}
.widget-title {
color: @borderc;
padding: 10px 10px;
margin: 10px 10px 5px 10px;
font-size: 1.5rem;
}
.widget-title > button {
font-size: 1rem;
color: @borderc;
padding: 10px;
text-shadow: none;
background: @bgc;
box-shadow: none;
border-radius: 5px;
}
.widget-title > button:hover {
background: @borderc;
color: #282828;
}
.widget-label {
margin: 10px 10px 10px 10px;
}
.widget-label > label {
font-size: 1rem;
color: @textc;
}
.widget-mpris {
color: @borderc;
padding: 5px 5px 5px 5px;
margin: 10px;
border-radius: 20px;
}
.widget-mpris > box > button {
border-radius: 20px;
}
.widget-mpris-player {
padding: 5px 5px;
margin: 10px;
}
'';
};
}

View file

@ -15,7 +15,7 @@
system.stateVersion = nix-version;
home-manager = {
backupFileExtension = "backup";
backupFileExtension = "hm-backup";
useUserPackages = true;
useGlobalPkgs = true;
extraSpecialArgs = { inherit inputs system nix-version; };

View file

@ -16,5 +16,6 @@ in
environment.variables = {
ELECTRON_OZONE_PLATFORM_HINT = "auto";
GSETTINGS_SCHEMA_DIR = "${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas";
HYPERCURSOR_SIZE = 24;
};
}

View file

@ -5,7 +5,5 @@
adwaita-icon-theme # default gnome cursors
glib
gsettings-desktop-schemas
nwg-look
];
}