Move sway startups to desktop files

This commit is contained in:
Natsu Kagami 2024-06-25 20:24:48 +02:00
parent 47b96aee71
commit 41106623e8
Signed by: nki
GPG key ID: 55A032EB38B49ADB
4 changed files with 32 additions and 32 deletions

View file

@ -37,6 +37,7 @@
# Enable X11 configuration # Enable X11 configuration
linux.graphical.type = "wayland"; linux.graphical.type = "wayland";
linux.graphical.wallpaper = ./images/pixiv_18776904.png; linux.graphical.wallpaper = ./images/pixiv_18776904.png;
linux.graphical.defaults.webBrowser = "librewolf.desktop";
programs.my-sway.enable = true; programs.my-sway.enable = true;
programs.my-sway.fontSize = 15.0; programs.my-sway.fontSize = 15.0;
programs.my-sway.enableLaptopBars = false; programs.my-sway.enableLaptopBars = false;

View file

@ -33,11 +33,16 @@ in
startup = mkOption { startup = mkOption {
type = types.listOf types.package; type = types.listOf types.package;
description = "List of packages to include in ~/.config/autostart"; description = "List of packages to include in ~/.config/autostart";
default = [ ]; default = with pkgs; [
librewolf
thunderbird
vesktop
premid
];
}; };
defaults.webBrowser = mkOption { defaults.webBrowser = mkOption {
type = types.str; type = types.str;
default = "firefox.desktop"; default = "librewolf.desktop";
description = "Desktop file of the default web browser"; description = "Desktop file of the default web browser";
}; };
}; };
@ -52,7 +57,6 @@ in
feh # For images? feh # For images?
deluge # Torrent client deluge # Torrent client
pavucontrol # PulseAudio control panel pavucontrol # PulseAudio control panel
firefox
cinnamon.nemo # File manager cinnamon.nemo # File manager
thunderbird # Email thunderbird # Email
sublime-music # For navidrome sublime-music # For navidrome
@ -72,9 +76,7 @@ in
whatsapp-for-linux whatsapp-for-linux
obs-studio obs-studio
(librewolf.override { librewolf
nativeMessagingHosts = with pkgs; [ kdePackages.plasma-browser-integration ];
})
## CLI stuff ## CLI stuff
dex # .desktop file management, startup dex # .desktop file management, startup
@ -88,12 +90,7 @@ in
])); ]));
nki.programs.discord.enable = pkgs.stdenv.isx86_64; nki.programs.discord.enable = pkgs.stdenv.isx86_64;
nki.programs.discord.package = pkgs.vesktop.overrideAttrs (attrs: { nki.programs.discord.package = pkgs.vesktop;
nativeBuildInputs = attrs.nativeBuildInputs ++ [ pkgs.nss_latest pkgs.makeWrapper ];
postFixup = (attrs.postFixup or "") + ''
ln -s $out/bin/vesktop $out/bin/discord
'';
});
# Yellow light! # Yellow light!
services.wlsunset = { services.wlsunset = {
@ -224,9 +221,7 @@ in
let let
srcFile = pkgs.runCommand "${pkg.name}-startup" { } '' srcFile = pkgs.runCommand "${pkg.name}-startup" { } ''
mkdir -p $out mkdir -p $out
cp $ cp $(ls -d ${pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
(ls - d ${
pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
''; '';
in in
"${srcFile}/${pkg.name}.desktop"; "${srcFile}/${pkg.name}.desktop";

View file

@ -78,11 +78,6 @@ in
description = "The command for the browser"; description = "The command for the browser";
default = "${pkgs.firefox-wayland}/bin/firefox"; default = "${pkgs.firefox-wayland}/bin/firefox";
}; };
discord = mkOption {
type = types.nullOr types.str;
description = "The command for discord";
default = "${config.nki.programs.discord.package}/bin/discord";
};
lockCmd = mkOption { lockCmd = mkOption {
type = types.str; type = types.str;
@ -164,18 +159,9 @@ in
{ command = "${pkgs.dex}/bin/dex -ae sway"; } { command = "${pkgs.dex}/bin/dex -ae sway"; }
# Waybar # Waybar
{ command = "systemctl --user restart waybar"; always = true; } { command = "systemctl --user restart waybar"; always = true; }
# Startup programs
{ command = "${cfg.browser}"; }
{ command = "thunderbird"; }
# IME # IME
{ command = "fcitx5"; } { command = "fcitx5"; }
] ++ (if cfg.discord != null then [ ];
{ command = "${cfg.discord}"; }
] ++ lib.lists.optional
(!pkgs.stdenv.isAarch64)
(
{ command = "${pkgs.premid}/bin/premid"; }
) else [ ]);
### Keybindings ### Keybindings
# #

View file

@ -68,10 +68,28 @@ let
}) })
]; ];
}); });
librewolf = (prev.librewolf.override {
nativeMessagingHosts = with final; [ kdePackages.plasma-browser-integration ];
});
# Add desktop file to premid
premid = final.symlinkJoin {
name = prev.premid.name;
paths = [
prev.premid
(final.makeDesktopItem {
name = prev.premid.name;
desktopName = "PreMID";
exec = final.lib.getExe prev.premid;
icon = "premid";
})
];
};
}; };
overlay-libs = final: prev: { overlay-libs = final: prev: {
libs.crane = inputs.crane.lib.${prev.system}; libs.crane = inputs.crane.mkLib final;
}; };
overlay-packages = final: prev: { overlay-packages = final: prev: {