Skip to content

Commit

Permalink
Unsuccessful attempt to setup ranger as systemwide file picker
Browse files Browse the repository at this point in the history
  • Loading branch information
asciimoth committed Sep 29, 2023
1 parent 3e16204 commit e42a3b8
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 1 deletion.
2 changes: 1 addition & 1 deletion machines/pcLexell/controlbox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
...
}: let
controlbox = pkgs.writeShellScriptBin "controlbox" ''
${pkgs.alacritty}/bin/alacritty --class CONTROLBOX -o "scale_with_dpi=True" -o "dpi.x=144" -o "dpi.y=144" -o "font.size=8" -o "window.dimensions.lines=15" -o "window.dimensions.columns=30" -e ${pkgs.fish}/bin/fish -c "source /etc/theme.fish && base16-load && $*"
${pkgs.wezterm}/bin/wezterm start --class CONTROLBOX -e ${pkgs.fish}/bin/fish -c "source /etc/theme.fish && base16-load && $*"
'';
in {
environment.systemPackages = with pkgs; [controlbox];
Expand Down
2 changes: 2 additions & 0 deletions machines/pcLexell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ in {
cpufetch
pulseaudio

nix-tree

tmate
thefuck
#perl
Expand Down
75 changes: 75 additions & 0 deletions machines/pcLexell/gui.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
...
}: let
constants = import ./constants.nix;
wezterm-desktop = pkgs.makeDesktopItem {
name = "wezterm";
desktopName = "wezterm";
exec = "${pkgs.wezterm}/bin/wezterm";
terminal = false;
};
in {
imports = [
./x.nix
Expand All @@ -38,6 +44,70 @@ in {
enable = true;
};
};
xdg = {
portal = {
enable = true;
extraPortals = with pkgs; [
pass-secret-service
];
};
mime = let
defaultApplications = {
browser = {
cmd = "${pkgs.firefox}/bin/firefox";
desktop = "firefox";
};
matrix = {
cmd = "${pkgs.nheko}/bin/nheko";
desktop = "nheko";
};
editor = {
cmd = "${pkgs.micro}/bin/micro ${pkgs.micro}/bin/micro";
desktop = "micro";
};
fm = {
cmd = "ranger";
desktop = "ranger";
};
terminal = {
cmd = "${pkgs.wezterm}/bin/wezterm";
desktop = "WezTerm";
};
};
in {
enable = true;
defaultApplications = with defaultApplications;
builtins.mapAttrs
(name: value:
if value ? desktop
then ["${value.desktop}.desktop"]
else value)
{
"x-terminal-emulator" = terminal;
"inode/directory" = fm;
"text/html" = browser;
#"image/*" = { desktop = "org.gnome.eog"; };
#"application/zip" = archive;
#"application/rar" = archive;
#"application/7z" = archive;
#"application/*tar" = archive;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-www-browser" = browser;
#"x-scheme-handler/mailto" = mail;
"x-scheme-handler/matrix" = matrix;
#"application/pdf" = { desktop = "org.kde.okular"; };
#"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
# text_processor;
#"application/msword" = text_processor;
#"application/vnd.oasis.opendocument.text" = text_processor;
#"text/csv" = spreadsheet;
#"application/vnd.oasis.opendocument.spreadsheet" = spreadsheet;
"text/plain" = editor;
};
};
};
home-manager.users."${constants.MainUser}" = {
systemd.user.services.graphical-notify = {
Service = {
Expand All @@ -57,6 +127,7 @@ in {
rofi = {
enable = true;
font = lib.mkForce "FiraCode Nerd Font Mono 14";
#terminal = "wezterm";
};
wezterm = {
enable = true;
Expand All @@ -67,5 +138,9 @@ in {
pkgs.tdesktop
];
home.file.".icons/default".source = "${pkgs.vanilla-dmz}/share/icons/Vanilla-DMZ";
home.sessionVariables = {
TERMINAL = "wezterm";
TERM = "wezterm";
};
};
}
9 changes: 9 additions & 0 deletions machines/pcLexell/ranger.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@
HEIGTH=$(echo -n $DIM | cut -d 'x' -f 2)
echo "$WIDTH $HEIGTH"
'';
ranger-desktop = pkgs.makeDesktopItem {
name = "ranger";
desktopName = "ranger";
#exec = "${my-ranger}/bin/ranger";
exec = "controlbox ranger";
terminal = false;
};
in {
environment.systemPackages = with pkgs; [
my-ranger #ranger
Expand All @@ -81,6 +88,8 @@ in {
pick
get-main-img-dimension
get-img-dimension
#
ranger-desktop
];
home-manager.users.${constants.MainUser} = {pkgs, ...}: {
home.file.".config/ranger_nix".source = ./ranger;
Expand Down

0 comments on commit e42a3b8

Please sign in to comment.