Some set-up re: desktop apps

This commit is contained in:
Natsu Kagami 2023-04-04 20:27:00 +02:00
parent fc6f9f8987
commit bd54c41c33
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
2 changed files with 49 additions and 16 deletions

View file

@ -2,7 +2,8 @@
with lib; with lib;
let let
cfg = config.linux.graphical; cfg = config.linux.graphical;
alwaysStartup = with pkgs; [ birdtray ];
alwaysStartup = with pkgs; [ ];
in in
{ {
imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ]; imports = [ ./x11.nix ./wayland.nix ./alacritty.nix ];
@ -31,14 +32,12 @@ in
gnome.cheese # Webcam check gnome.cheese # Webcam check
evince # PDF reader evince # PDF reader
gparted gparted
pkgs.unstable.vscode pkgs.unstable.vscode-fhs
feh feh # For images?
deluge # Torrent client deluge # Torrent client
pavucontrol # PulseAudio control panel pavucontrol # PulseAudio control panel
firefox firefox
cinnamon.nemo # File manager
thunderbird
birdtray
zotero zotero
@ -48,7 +47,9 @@ in
xdg-utils # Open stuff xdg-utils # Open stuff
] ++ (if pkgs.stdenv.isAarch64 then [ ] else [ ] ++ (if pkgs.stdenv.isAarch64 then [ ] else [
mailspring mailspring
# Chat stuff
unstable.slack unstable.slack
cinny-desktop
])); ]));
nki.programs.discord.enable = pkgs.stdenv.isx86_64; nki.programs.discord.enable = pkgs.stdenv.isx86_64;
@ -65,17 +66,43 @@ in
xdg.mimeApps.enable = true; xdg.mimeApps.enable = true;
xdg.mimeApps.associations.added = { xdg.mimeApps.associations.added = {
"x-scheme-handler/mailto" = [ "userapp-Thunderbird-HPUL11.desktop" ]; "x-scheme-handler/mailto" = [ "org.gnome.Evolution.desktop" ];
"x-scheme-handler/mid" = [ "userapp-Thunderbird-HPUL11.desktop" ]; "text/plain" = [ "kakoune.desktop" ];
}; };
xdg.mimeApps.defaultApplications = { xdg.mimeApps.defaultApplications = {
# Email
"x-scheme-handler/mailto" = [ "org.gnome.Evolution.desktop" ];
# Default web browser stuff
"text/html" = [ "firefox.desktop" ];
"x-scheme-handler/about" = [ "firefox.desktop" ];
"x-scheme-handler/unknown" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ]; "x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ]; "x-scheme-handler/https" = [ "firefox.desktop" ];
"x-scheme-handler/ftp" = [ "firefox.desktop" ]; "x-scheme-handler/ftp" = [ "firefox.desktop" ];
"x-scheme-handler/ftps" = [ "firefox.desktop" ]; "x-scheme-handler/ftps" = [ "firefox.desktop" ];
"x-scheme-handler/mailto" = [ "userapp-Thunderbird-HPUL11.desktop" ];
"message/rfc822" = [ "userapp-Thunderbird-HPUL11.desktop" ]; # Torrent
"x-scheme-handler/mid" = [ "userapp-Thunderbird-HPUL11.desktop" ]; "application/x-bittorrent" = [ "deluge.desktop" ];
"x-scheme-handler/magnet" = [ "deluge.desktop" ];
# Text
"text/plain" = [ "kakoune.desktop" ];
# Files
"inode/directory" = [ "nemo.desktop" ];
};
# Add one for kakoune
xdg.desktopEntries."kakoune" = {
name = "Kakoune";
genericName = "Text Editor";
exec = ''kitty --class kitty-float -o initial_window_width=150c -o initial_window_height=40c ${pkgs.writeShellScript "editor.sh" ''
$EDITOR "$@"
''} %U'';
# exec = "kakoune %U";
terminal = false;
mimeType = [ "text/plain" ];
}; };
# Theming # Theming
@ -111,8 +138,10 @@ in
source = source =
let let
srcFile = pkgs.runCommand "${pkg.name}-startup" { } '' srcFile = pkgs.runCommand "${pkg.name}-startup" { } ''
mkdir -p $out mkdir - p $out
cp $(ls -d ${pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop cp $
(ls - d ${
pkg}/share/applications/*.desktop | head -n 1) $out/${pkg.name}.desktop
''; '';
in in
"${srcFile}/${pkg.name}.desktop"; "${srcFile}/${pkg.name}.desktop";
@ -131,3 +160,4 @@ in
}; };
} }

View file

@ -144,6 +144,7 @@ in
{ command = "systemctl --user restart waybar"; always = true; } { command = "systemctl --user restart waybar"; always = true; }
# Startup programs # Startup programs
{ command = "${cfg.browser}"; } { command = "${cfg.browser}"; }
{ command = "evolution"; } # Rely on system package with plugins
{ command = "env PYTHONPATH=$(python -m site --user-site) ${pkgs.ulauncher}/bin/ulauncher --hide-window --no-window-shadow"; } { command = "env PYTHONPATH=$(python -m site --user-site) ${pkgs.ulauncher}/bin/ulauncher --hide-window --no-window-shadow"; }
] ++ (if cfg.discord != null then [ ] ++ (if cfg.discord != null then [
{ command = "${cfg.discord}"; } { command = "${cfg.discord}"; }
@ -273,15 +274,17 @@ in
{ class = "^firefox$"; } { class = "^firefox$"; }
]; ];
"${builtins.elemAt workspaces 1}" = [ "${builtins.elemAt workspaces 1}" = [
{ class = "^(d|D)iscord$"; } { class = "^((d|D)iscord|((A|a)rmcord))$"; }
]; ];
"${builtins.elemAt workspaces 3}" = [ "📧 Email" = [
{ app_id = "kitty_ncmpcpp"; } { app_id = "evolution"; }
]; ];
}; };
# Commands # Commands
window.commands = [ window.commands = [
{ criteria = { title = ".*"; }; command = "inhibit_idle fullscreen"; } { criteria = { title = ".*"; }; command = "inhibit_idle fullscreen"; }
{ criteria = { app_id = ".*float.*"; }; command = "floating enable"; }
{ criteria = { class = ".*float.*"; }; command = "floating enable"; }
]; ];
# Focus # Focus
focus.followMouse = true; focus.followMouse = true;