Set up a launcher
This commit is contained in:
parent
e2c2928585
commit
782a7be91d
|
@ -38,6 +38,8 @@ with lib; {
|
|||
"${config.home.homeDirectory}/.config/nixpkgs"
|
||||
];
|
||||
|
||||
systemd.user.startServices = "sd-switch";
|
||||
|
||||
# Bluetooth controls
|
||||
services.mpris-proxy.enable = true;
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
home.sessionPath = [
|
||||
# Sometimes we want to install custom scripts here
|
||||
"~/.local/bin"
|
||||
"${config.home.homeDirectory}/.local/bin"
|
||||
];
|
||||
|
||||
# Programs
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
# More packages
|
||||
home.packages = (with pkgs; [
|
||||
# CLI stuff
|
||||
python
|
||||
zip
|
||||
# TeX
|
||||
texlive.combined.scheme-full
|
||||
|
|
|
@ -6,6 +6,8 @@ let
|
|||
birdtray = pkgs.birdtray.overrideAttrs (attrs: {
|
||||
cmakeFlags = [ "-DOPT_THUNDERBIRD_CMDLINE=${pkgs.thunderbird}/bin/thunderbird" ];
|
||||
});
|
||||
|
||||
alwaysStartup = with pkgs; [ birdtray ];
|
||||
in
|
||||
{
|
||||
imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ];
|
||||
|
@ -20,6 +22,11 @@ in
|
|||
description = "Path to the wallpaper file";
|
||||
default = "";
|
||||
};
|
||||
startup = mkOption {
|
||||
type = types.listOf types.package;
|
||||
description = "List of packages to include in ~/.config/autostart";
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
config = mkIf (cfg.type != null) {
|
||||
# Packages
|
||||
|
@ -100,6 +107,24 @@ in
|
|||
# Set up Java font style
|
||||
_JAVA_OPTIONS = "-Dawt.useSystemAAFontSettings=lcd";
|
||||
};
|
||||
|
||||
xdg.configFile =
|
||||
let
|
||||
f = pkg: {
|
||||
name = "autostart/${pkg.name}.desktop";
|
||||
value = {
|
||||
source =
|
||||
let
|
||||
srcFile = pkgs.runCommand "${pkg.name}-startup" { } ''
|
||||
mkdir -p $out
|
||||
cp $(ls -d ${pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
|
||||
'';
|
||||
in
|
||||
"${srcFile}/${pkg.name}.desktop";
|
||||
};
|
||||
};
|
||||
in
|
||||
listToAttrs (map f (cfg.startup ++ alwaysStartup));
|
||||
# IBus configuration
|
||||
# dconf.settings."desktop/ibus/general" = {
|
||||
# engines-order = hm.gvariant.mkArray hm.gvariant.type.string [ "xkb:jp::jpn" "mozc-jp" "Bamboo" ];
|
||||
|
|
|
@ -129,7 +129,7 @@ in
|
|||
{ command = "systemctl --user restart waybar"; always = true; }
|
||||
# Startup programs
|
||||
{ command = "${cfg.browser}"; }
|
||||
{ command = "birdtray"; }
|
||||
{ command = "env PYTHONPATH=$(python -m site --user-site) ${pkgs.ulauncher}/bin/ulauncher --hide-window --no-window-shadow"; }
|
||||
] ++ (if cfg.discord != null then [
|
||||
{ command = "${cfg.discord}"; }
|
||||
] ++ lib.lists.optional
|
||||
|
@ -177,7 +177,6 @@ in
|
|||
"${mod}+e" = "layout toggle split";
|
||||
# Floating
|
||||
"${mod}+Shift+space" = "floating toggle";
|
||||
"${mod}+space" = "focus mode_toggle";
|
||||
# Scratchpad
|
||||
"${mod}+Shift+minus" = "move scratchpad";
|
||||
# Resize
|
||||
|
@ -187,6 +186,8 @@ in
|
|||
"${mod}+Shift+c" = "reload";
|
||||
"${mod}+Shift+e" =
|
||||
"exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
|
||||
# Launcher
|
||||
"${mod}+space" = "exec ${pkgs.ulauncher}/bin/ulauncher-toggle";
|
||||
} // {
|
||||
## Splits
|
||||
"${mod}+v" = "split v";
|
||||
|
@ -651,6 +652,8 @@ in
|
|||
qt5.qtwayland
|
||||
# For waybar
|
||||
font-awesome
|
||||
# For launcher
|
||||
ulauncher
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue