setup mime-apps
This commit is contained in:
parent
50d517abc2
commit
21bf877967
@ -1,44 +1,4 @@
|
|||||||
{ config, pkgs, ... }: {
|
{ config, pkgs, ... }: {
|
||||||
defaultApplications = {
|
|
||||||
fm = {
|
|
||||||
cmd = "${pkgs.pcmanfm}/bin/pcmanfm";
|
|
||||||
desktop = "pcmanfm";
|
|
||||||
};
|
|
||||||
monitor = {
|
|
||||||
cmd = "${pkgs.gnome.gnome-system-monitor}/bin/gnome-system-monitor";
|
|
||||||
desktop = "gnome-system-monitor";
|
|
||||||
};
|
|
||||||
torrent = {
|
|
||||||
cmd = "${pkgs.qbittorrent}/bin/qbittorrent";
|
|
||||||
desktop = "qbittorrent";
|
|
||||||
};
|
|
||||||
archive = {
|
|
||||||
cmd = "${pkgs.xarchiver}/bin/xarchiver";
|
|
||||||
desktop = "xarchiver";
|
|
||||||
};
|
|
||||||
messenger = {
|
|
||||||
cmd = "${pkgs.tdesktop}/bin/telegram-desktop";
|
|
||||||
desktop = "telegram-desktop";
|
|
||||||
};
|
|
||||||
# text_processor = {
|
|
||||||
# cmd = "${pkgs.libreoffice}/bin/libreoffice";
|
|
||||||
# desktop = "libreoffice";
|
|
||||||
# };
|
|
||||||
# spreadsheet = {
|
|
||||||
# cmd = "${pkgs.gnumeric}/bin/gnumeric";
|
|
||||||
# desktop = "gnumeric";
|
|
||||||
# };
|
|
||||||
};
|
|
||||||
|
|
||||||
startupApplications = with config.defaultApplications; [
|
|
||||||
messenger.cmd
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.sessionVariables = {
|
|
||||||
EDITOR = config.defaultApplications.editor.cmd;
|
|
||||||
VISUAL = config.defaultApplications.editor.cmd;
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${config.mainuser} = {
|
home-manager.users.${config.mainuser} = {
|
||||||
home.activation."mimeapps-remove" = {
|
home.activation."mimeapps-remove" = {
|
||||||
before = [ "checkLinkTargets" ];
|
before = [ "checkLinkTargets" ];
|
||||||
@ -48,31 +8,181 @@
|
|||||||
|
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
associations.added = with config.defaultApplications;
|
||||||
|
builtins.mapAttrs (_name: value:
|
||||||
|
if value ? desktop then [ "${value.desktop}.desktop" ] else value) {
|
||||||
|
"application/pdf" = pdf;
|
||||||
|
"application/x-extension-htm" = browser;
|
||||||
|
"application/x-extension-html" = browser;
|
||||||
|
"application/x-extension-shtml" = browser;
|
||||||
|
"application/x-extension-xht" = browser;
|
||||||
|
"application/x-extension-xhtml" = browser;
|
||||||
|
"application/xhtml+xml" = browser;
|
||||||
|
"text/html" = browser;
|
||||||
|
"x-scheme-handler/chrome" = browser;
|
||||||
|
"x-scheme-handler/ftp" = browser;
|
||||||
|
"x-scheme-handler/http" = browser;
|
||||||
|
"x-scheme-handler/https" = browser;
|
||||||
|
};
|
||||||
defaultApplications =
|
defaultApplications =
|
||||||
with config.defaultApplications;
|
with config.defaultApplications;
|
||||||
builtins.mapAttrs (_name: value:
|
builtins.mapAttrs (_name: value:
|
||||||
if value ? desktop then [ "${value.desktop}.desktop" ] else value) {
|
if value ? desktop then [ "${value.desktop}.desktop" ] else value) {
|
||||||
"text/html" = browser;
|
# application
|
||||||
"inode/directory" = fm;
|
|
||||||
"image/*" = { desktop = "org.gnome.eog"; };
|
|
||||||
"application/x-bittorrent" = torrent;
|
|
||||||
"application/zip" = archive;
|
|
||||||
"application/rar" = archive;
|
|
||||||
"application/7z" = archive;
|
|
||||||
"application/*tar" = archive;
|
"application/*tar" = archive;
|
||||||
|
"application/7z" = archive;
|
||||||
|
"application/eps" = pdf;
|
||||||
|
"application/msword" = office;
|
||||||
|
"application/ogg" = media-player;
|
||||||
|
"application/pdf" = pdf;
|
||||||
|
"application/postscript" = pdf;
|
||||||
|
"application/rar" = archive;
|
||||||
|
"application/sdp" = media-player;
|
||||||
|
"application/smil" = media-player;
|
||||||
|
"application/streamingmedia" = media-player;
|
||||||
|
"application/vnd.oasis.opendocument.presentation" = office;
|
||||||
|
"application/vnd.oasis.opendocument.spreadsheet" = office;
|
||||||
|
"application/vnd.oasis.opendocument.text" = office;
|
||||||
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = office;
|
||||||
|
"application/vnd.rar" = archive;
|
||||||
|
"application/vnd.rn-realmedia-vbr" = media-player;
|
||||||
|
"application/vnd.rn-realmedia" = media-player;
|
||||||
|
"application/x-bittorrent" = torrent;
|
||||||
|
"application/x-eps" = pdf;
|
||||||
|
"application/x-extension-htm" = browser;
|
||||||
|
"application/x-extension-html" = browser;
|
||||||
|
"application/x-extension-shtml" = browser;
|
||||||
|
"application/x-extension-xht" = browser;
|
||||||
|
"application/x-extension-xhtml" = browser;
|
||||||
|
"application/x-flash-video" = media-player;
|
||||||
|
"application/x-ogg" = media-player;
|
||||||
|
"application/x-shellscript" = editor;
|
||||||
|
"application/x-smil" = media-player;
|
||||||
|
"application/x-streamingmedia" = media-player;
|
||||||
|
"application/xhtml+xml" = browser;
|
||||||
|
"application/zip" = archive;
|
||||||
|
# "application/rss+xml" = editor;
|
||||||
|
# "application/x-calendar" = "google-calendar-import.desktop";
|
||||||
|
# "application/x-java-archive" = "java.desktop";
|
||||||
|
# audio
|
||||||
|
"audio/aac" = media-player;
|
||||||
|
"audio/ac3" = media-player;
|
||||||
|
"audio/AMR" = media-player;
|
||||||
|
"audio/flac" = media-player;
|
||||||
|
"audio/m4a" = media-player;
|
||||||
|
"audio/mp1" = media-player;
|
||||||
|
"audio/mp2" = media-player;
|
||||||
|
"audio/mp3" = media-player;
|
||||||
|
"audio/mp4" = media-player;
|
||||||
|
"audio/mpeg" = media-player;
|
||||||
|
"audio/mpegurl" = media-player;
|
||||||
|
"audio/mpg" = media-player;
|
||||||
|
"audio/ogg" = media-player;
|
||||||
|
"audio/rn-mpeg" = media-player;
|
||||||
|
"audio/scpls" = media-player;
|
||||||
|
"audio/vnd.rn-realaudio" = media-player;
|
||||||
|
"audio/wav" = media-player;
|
||||||
|
"audio/x-aac" = media-player;
|
||||||
|
"audio/x-ape" = media-player;
|
||||||
|
"audio/x-flac" = media-player;
|
||||||
|
"audio/x-m4a" = media-player;
|
||||||
|
"audio/x-mp1" = media-player;
|
||||||
|
"audio/x-mp2" = media-player;
|
||||||
|
"audio/x-mp3" = media-player;
|
||||||
|
"audio/x-mpeg" = media-player;
|
||||||
|
"audio/x-mpegurl" = media-player;
|
||||||
|
"audio/x-mpg" = media-player;
|
||||||
|
"audio/x-ms-wma" = media-player;
|
||||||
|
"audio/x-pls" = media-player;
|
||||||
|
"audio/x-pn-realaudio" = media-player;
|
||||||
|
"audio/x-pn-windows-pcm" = media-player;
|
||||||
|
"audio/x-realaudio" = media-player;
|
||||||
|
"audio/x-scpls" = media-player;
|
||||||
|
"audio/x-shorten" = media-player;
|
||||||
|
"audio/x-tta" = media-player;
|
||||||
|
"audio/x-vorbis+ogg" = media-player;
|
||||||
|
"audio/x-wav" = media-player;
|
||||||
|
"audio/x-wavpack" = media-player;
|
||||||
|
# image
|
||||||
|
"image/bmp" = image;
|
||||||
|
"image/eps" = pdf;
|
||||||
|
"image/gif" = image;
|
||||||
|
"image/jpeg" = image;
|
||||||
|
"image/jpg" = image;
|
||||||
|
"image/pjpeg" = image;
|
||||||
|
"image/png" = image;
|
||||||
|
"image/tiff" = image;
|
||||||
|
"image/vnd.djvu" = pdf;
|
||||||
|
"image/webp" = image;
|
||||||
|
"image/x-bmp" = image;
|
||||||
|
"image/x-canon-cr2" = image;
|
||||||
|
# "image/x-dcraw" = "nufraw.desktop";
|
||||||
|
"image/x-eps" = pdf;
|
||||||
|
"image/x-pcx" = image;
|
||||||
|
"image/x-png" = image;
|
||||||
|
"image/x-portable-anymap" = image;
|
||||||
|
"image/x-portable-bitmap" = image;
|
||||||
|
"image/x-portable-graymap" = image;
|
||||||
|
"image/x-portable-pixmap" = image;
|
||||||
|
"image/x-tga" = image;
|
||||||
|
"image/x-xbitmap" = image;
|
||||||
|
# text
|
||||||
|
# "text/calendar" = "google-calendar-import.desktop";
|
||||||
|
"text/csv" = editor;
|
||||||
|
"text/html" = browser;
|
||||||
|
"text/plain" = editor;
|
||||||
|
"text/rhtml" = editor;
|
||||||
|
"text/x-java" = editor;
|
||||||
|
"text/x-markdown" = editor;
|
||||||
|
"text/x-python" = editor;
|
||||||
|
"text/x-readme" = editor;
|
||||||
|
"text/x-tex" = editor;
|
||||||
|
# video
|
||||||
|
"video/AV1" = media-player;
|
||||||
|
"video/H264" = media-player;
|
||||||
|
"video/H265" = media-player;
|
||||||
|
"video/matroska" = media-player;
|
||||||
|
"video/mp2t" = media-player;
|
||||||
|
"video/mp4" = media-player;
|
||||||
|
"video/MPV" = media-player;
|
||||||
|
"video/mpeg" = media-player;
|
||||||
|
"video/msvideo" = media-player;
|
||||||
|
"video/ogg" = media-player;
|
||||||
|
"video/quicktime" = media-player;
|
||||||
|
"video/vnd.rn-realvideo" = media-player;
|
||||||
|
"video/webm" = media-player;
|
||||||
|
"video/VP8" = media-player;
|
||||||
|
"video/VP9" = media-player;
|
||||||
|
"video/x-avi" = media-player;
|
||||||
|
"video/x-fli" = media-player;
|
||||||
|
"video/x-flv" = media-player;
|
||||||
|
"video/x-matroska" = media-player;
|
||||||
|
"video/x-mpeg" = media-player;
|
||||||
|
"video/x-mpeg2" = media-player;
|
||||||
|
"video/x-ms-afs" = media-player;
|
||||||
|
"video/x-ms-asf" = media-player;
|
||||||
|
"video/x-ms-wmv" = media-player;
|
||||||
|
"video/x-ms-wmx" = media-player;
|
||||||
|
"video/x-ms-wvxvideo" = media-player;
|
||||||
|
"video/x-msvideo" = media-player;
|
||||||
|
"video/x-ogm+ogg" = media-player;
|
||||||
|
"video/x-theora" = media-player;
|
||||||
|
# x-scheme-handler
|
||||||
|
"x-scheme-handler/about" = browser;
|
||||||
|
"x-scheme-handler/chrome" = browser;
|
||||||
|
"x-scheme-handler/element" = matrix;
|
||||||
|
"x-scheme-handler/ftp" = browser;
|
||||||
"x-scheme-handler/http" = browser;
|
"x-scheme-handler/http" = browser;
|
||||||
"x-scheme-handler/https" = browser;
|
"x-scheme-handler/https" = browser;
|
||||||
"x-scheme-handler/about" = browser;
|
# "x-scheme-handler/ics" = "google-calendar-import.desktop";
|
||||||
# "x-scheme-handler/mailto" = mail;
|
"x-scheme-handler/magnet" = torrent;
|
||||||
"application/pdf" = pdf;
|
"x-scheme-handler/mailto" = mail;
|
||||||
# "application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
|
"x-scheme-handler/spotify" = spotify;
|
||||||
# text_processor;
|
"x-scheme-handler/terminal" = term;
|
||||||
# "application/msword" = text_processor;
|
# other
|
||||||
# "application/vnd.oasis.opendocument.text" = text_processor;
|
"inode/directory" = fm;
|
||||||
# "text/csv" = spreadsheet;
|
"inode/mount-point" = fm;
|
||||||
# "application/vnd.oasis.opendocument.spreadsheet" = spreadsheet;
|
"inode/x-empty" = editor;
|
||||||
"text/plain" = editor;
|
|
||||||
"x-scheme-handler/element" = matrix;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
home-manager.users.${config.mainuser} = {
|
home-manager.users.${config.mainuser} = {
|
||||||
programs.mpv = {
|
programs.mpv = {
|
||||||
@ -23,6 +23,11 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
defaultApplications.media-player = {
|
||||||
|
cmd = "${pkgs.mpv}/bin/mpv";
|
||||||
|
desktop = "mpv";
|
||||||
|
};
|
||||||
|
|
||||||
persist.state.homeDirectories = [
|
persist.state.homeDirectories = [
|
||||||
".config/mpv"
|
".config/mpv"
|
||||||
];
|
];
|
||||||
|
@ -34,7 +34,7 @@ with config.deviceSpecific; {
|
|||||||
ncdu
|
ncdu
|
||||||
procs
|
procs
|
||||||
# --- gui ---
|
# --- gui ---
|
||||||
feh
|
pcmanfm
|
||||||
qimgv
|
qimgv
|
||||||
xarchiver
|
xarchiver
|
||||||
zathura
|
zathura
|
||||||
@ -55,7 +55,6 @@ with config.deviceSpecific; {
|
|||||||
pinta
|
pinta
|
||||||
qbittorrent
|
qbittorrent
|
||||||
sonixd
|
sonixd
|
||||||
tdesktop
|
|
||||||
tidal-dl
|
tidal-dl
|
||||||
tor-browser-bundle-bin
|
tor-browser-bundle-bin
|
||||||
ungoogled-chromium
|
ungoogled-chromium
|
||||||
@ -88,7 +87,6 @@ with config.deviceSpecific; {
|
|||||||
".config/Sonixd"
|
".config/Sonixd"
|
||||||
".config/WebCord"
|
".config/WebCord"
|
||||||
".config/xarchiver"
|
".config/xarchiver"
|
||||||
".local/share/TelegramDesktop"
|
|
||||||
".local/share/tor-browser"
|
".local/share/tor-browser"
|
||||||
".android"
|
".android"
|
||||||
".anydesk"
|
".anydesk"
|
||||||
@ -100,4 +98,31 @@ with config.deviceSpecific; {
|
|||||||
".config/.tidal-dl.json"
|
".config/.tidal-dl.json"
|
||||||
".config/.tidal-dl.token.json"
|
".config/.tidal-dl.token.json"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
defaultApplications = {
|
||||||
|
fm = {
|
||||||
|
cmd = "${pkgs.pcmanfm}/bin/pcmanfm";
|
||||||
|
desktop = "pcmanfm";
|
||||||
|
};
|
||||||
|
monitor = {
|
||||||
|
cmd = "${pkgs.gnome.gnome-system-monitor}/bin/gnome-system-monitor";
|
||||||
|
desktop = "gnome-system-monitor";
|
||||||
|
};
|
||||||
|
torrent = {
|
||||||
|
cmd = "${pkgs.qbittorrent}/bin/qbittorrent";
|
||||||
|
desktop = "qbittorrent";
|
||||||
|
};
|
||||||
|
archive = {
|
||||||
|
cmd = "${pkgs.xarchiver}/bin/xarchiver";
|
||||||
|
desktop = "xarchiver";
|
||||||
|
};
|
||||||
|
office = {
|
||||||
|
cmd = "${pkgs.onlyoffice-bin_latest}/bin/onlyoffice-desktopeditors";
|
||||||
|
desktop = "onlyoffice-desktopeditors";
|
||||||
|
};
|
||||||
|
image = {
|
||||||
|
cmd = "${pkgs.qimgv}/bin/qimgv";
|
||||||
|
desktop = "qimgv";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,11 @@
|
|||||||
spotifywm
|
spotifywm
|
||||||
];
|
];
|
||||||
|
|
||||||
|
defaultApplications.spotify = {
|
||||||
|
cmd = "${pkgs.spotify}/bin/spotify";
|
||||||
|
desktop = "spotify";
|
||||||
|
};
|
||||||
|
|
||||||
startupApplications = [
|
startupApplications = [
|
||||||
"${pkgs.spotifywm}/bin/spotify"
|
"${pkgs.spotifywm}/bin/spotify"
|
||||||
];
|
];
|
||||||
|
20
profiles/applications/telegram.nix
Normal file
20
profiles/applications/telegram.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{ config, pkgs, ... }: {
|
||||||
|
home-manager.users.${config.mainuser} = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
tdesktop
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
defaultApplications.messenger = {
|
||||||
|
cmd = "${pkgs.tdesktop}/bin/telegram-desktop";
|
||||||
|
desktop = "telegram-desktop";
|
||||||
|
};
|
||||||
|
|
||||||
|
startupApplications = with config.defaultApplications; [
|
||||||
|
messenger.cmd
|
||||||
|
];
|
||||||
|
|
||||||
|
persist.state.homeDirectories = [
|
||||||
|
".local/share/TelegramDesktop"
|
||||||
|
];
|
||||||
|
}
|
@ -16,6 +16,11 @@ let
|
|||||||
continue-ver = lib.getVersion ext-vscode.continue.continue;
|
continue-ver = lib.getVersion ext-vscode.continue.continue;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
environment.sessionVariables = {
|
||||||
|
EDITOR = config.defaultApplications.editor.cmd;
|
||||||
|
VISUAL = config.defaultApplications.editor.cmd;
|
||||||
|
};
|
||||||
|
|
||||||
defaultApplications.editor = {
|
defaultApplications.editor = {
|
||||||
cmd = "${EDITOR}";
|
cmd = "${EDITOR}";
|
||||||
desktop = "code-wayland";
|
desktop = "code-wayland";
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
packages
|
packages
|
||||||
rofi
|
rofi
|
||||||
spotify
|
spotify
|
||||||
|
telegram
|
||||||
steam
|
steam
|
||||||
vscode
|
vscode
|
||||||
waydroid
|
waydroid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user