Added glib for gio trash.

Added nnn with support for opening text files detached.
This commit is contained in:
vorboyvo 2024-10-16 12:40:21 -04:00
parent 087ea5fb86
commit fef78a942e
2 changed files with 32 additions and 5 deletions

View file

@ -88,15 +88,13 @@ in {
blueman
upower
proselint # for prose lint
glib
] ++ # Basic utilities
[ bitwarden-cli htop snore hledger hledger-ui ]
++ # Personalized selection of command-line (CLI/TUI) apps
[ terminal ] ++ # Terminal emulator
[
qutebrowser
cinnamon.nemo
gnome.file-roller
cinnamon.nemo-fileroller
evince
imv
vlc
@ -168,8 +166,14 @@ in {
}];
};
# Fixes electron apps
home.sessionVariables = { NIXOS_OZONE_WL = "1"; };
# Fixes electron apps and also nnn
home.sessionVariables =
let detachedtext = pkgs.writeShellScript "detachedtext"
(builtins.readFile "${scripts}/detachedtext.sh");
in {
NIXOS_OZONE_WL = "1";
VISUAL = detachedtext;
};
# configure fonts correctly
fonts.fontconfig.enable = true;
@ -216,6 +220,20 @@ in {
categories = [ "Utility" "TextEditor" ];
};
programs.nnn = {
enable = true;
};
xdg.desktopEntries.nnn = {
name = "nnn";
genericName = "File Manager";
comment = "Terminal file manager";
exec = "nnn -Ade";
terminal = true;
mimeType = [ "inode/directory" ];
categories = [ "System" "FileTools" "FileManager" "ConsoleOnly" ];
settings.Keywords = "File;Manager;Management;Explorer;Launcher";
};
# programs.zathura = {
# enable = true;
# };

9
scripts/detachedtext.sh Normal file
View file

@ -0,0 +1,9 @@
#!/usr/bin/env sh
if [ -n "$TMUX" ] ; then
# tmux session running
tmux split-window -h "$EDITOR \"$*\""
else
# Remove option --tab for new window
( alacritty -e xdg-open $* & )
fi