Make screensharing work and fix pdf default app
This commit is contained in:
parent
2769751b2e
commit
626acc0c31
6 changed files with 142 additions and 135 deletions
|
@ -18,6 +18,7 @@
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
./shell.nix
|
./shell.nix
|
||||||
./swaylock.nix
|
./swaylock.nix
|
||||||
|
./kanshi.nix
|
||||||
];
|
];
|
||||||
home-manager.users.fhauser.home.packages = with pkgs;
|
home-manager.users.fhauser.home.packages = with pkgs;
|
||||||
[ # Networking
|
[ # Networking
|
||||||
|
|
47
defaults/user-configuration/fhauser/applications/kanshi.nix
Normal file
47
defaults/user-configuration/fhauser/applications/kanshi.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ pkgs, lib, config, ... }: {
|
||||||
|
home-manager.users.fhauser.services.kanshi = {
|
||||||
|
enable = true;
|
||||||
|
profiles = let
|
||||||
|
backgroundPicturePath = "~/pictures/backgrounds";
|
||||||
|
backgroundCommand = ''
|
||||||
|
#swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"
|
||||||
|
'';
|
||||||
|
mkScreen = (screen: {
|
||||||
|
criteria = screen;
|
||||||
|
status = "enable";
|
||||||
|
scale = 1.0;
|
||||||
|
});
|
||||||
|
in rec {
|
||||||
|
#mobile.exec = backgroundCommand;
|
||||||
|
mobile.outputs = [
|
||||||
|
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
||||||
|
position = "0,0";
|
||||||
|
scale = 2.0;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
home-dock.outputs = mobile.outputs ++ [
|
||||||
|
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
||||||
|
position = "1920,0";
|
||||||
|
scale = 1.0;
|
||||||
|
status = "enable";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
office-dock.outputs = mobile.outputs ++ [
|
||||||
|
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // { position = "1920,0"; })
|
||||||
|
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // { position = "4480,0"; })
|
||||||
|
];
|
||||||
|
home-pc.outputs = [
|
||||||
|
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // { position = "0,0"; })
|
||||||
|
(mkScreen "Unknown HP Z27 CN482201RP" // {
|
||||||
|
position = "2560,0";
|
||||||
|
scale = 1.5;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
home-pc-row.outputs = home-pc.outputs ++ [
|
||||||
|
(mkScreen "Ancor Communications Inc ASUS VS247 B3LMTF180900" // {
|
||||||
|
position = "5120,0";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -59,4 +59,7 @@ let
|
||||||
echo "Starting '$COMMAND' in env '$ENV_FILE'"
|
echo "Starting '$COMMAND' in env '$ENV_FILE'"
|
||||||
${pkgs.nix}/bin/nix-shell ''${ENV_FILE} --run "$COMMAND"
|
${pkgs.nix}/bin/nix-shell ''${ENV_FILE} --run "$COMMAND"
|
||||||
'';
|
'';
|
||||||
in { home-manager.users.fhauser.home.packages = [ passbemenu threema-vpn threema-env ]; }
|
in {
|
||||||
|
home-manager.users.fhauser.home.packages =
|
||||||
|
[ passbemenu threema-vpn threema-env ];
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
./applications
|
./applications
|
||||||
./work
|
./work
|
||||||
./i3.nix
|
./i3.nix
|
||||||
|
./mimetypes.nix
|
||||||
];
|
];
|
||||||
home-manager.users.fhauser.home.stateVersion = config.system.stateVersion;
|
home-manager.users.fhauser.home.stateVersion = config.system.stateVersion;
|
||||||
}
|
}
|
||||||
|
|
58
defaults/user-configuration/fhauser/mimetypes.nix
Normal file
58
defaults/user-configuration/fhauser/mimetypes.nix
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
{ pkgs, lib, config, ... }: {
|
||||||
|
|
||||||
|
home-manager.users.fhauser.xdg.mimeApps = rec {
|
||||||
|
enable = true;
|
||||||
|
associations.added = defaultApplications;
|
||||||
|
defaultApplications = let
|
||||||
|
browser = [ "firefox.desktop" ];
|
||||||
|
email = [ "org.gnome.Evolution.desktop" ];
|
||||||
|
doc-editor = [ "writer.desktop" ];
|
||||||
|
sheet-editor = [ "calc.desktop" ];
|
||||||
|
presentation-editor = [ "impress.desktop" ];
|
||||||
|
pdf = [ "org.gnome.Evince.desktop" ];
|
||||||
|
image = [ "org.gnome.eog.desktop" ];
|
||||||
|
image-vector = [ "org.inkscape.Inkscape.desktop" ];
|
||||||
|
ebooks = [ "calibre-ebook-viewer.desktop" ];
|
||||||
|
code-general = [ "codium.desktop" ];
|
||||||
|
video = [ "vlc.desktop" ];
|
||||||
|
in {
|
||||||
|
"text/html" = browser;
|
||||||
|
"x-scheme-handler/http" = browser;
|
||||||
|
"x-scheme-handler/https" = browser;
|
||||||
|
"x-scheme-handler/chrome" = browser;
|
||||||
|
"application/xhtml+xml" = browser;
|
||||||
|
"application/x-extension-htm" = browser;
|
||||||
|
"application/x-extension-html" = browser;
|
||||||
|
"application/x-extension-shtml" = browser;
|
||||||
|
"application/x-extension-xhtml" = browser;
|
||||||
|
"application/x-extension-xht" = browser;
|
||||||
|
"x-scheme-handler/mailto" = email;
|
||||||
|
"x-scheme-handler/msteams" = [ "teams.desktop" ];
|
||||||
|
|
||||||
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
|
||||||
|
doc-editor;
|
||||||
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" =
|
||||||
|
sheet-editor;
|
||||||
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
|
||||||
|
presentation-editor;
|
||||||
|
"application/vnd.oasis.opendocument.presentation" = presentation-editor;
|
||||||
|
"application/pdf" = pdf;
|
||||||
|
"application/x-extension-pdf" = pdf;
|
||||||
|
"application/epub+zip" = ebooks;
|
||||||
|
|
||||||
|
"text/plain" = code-general;
|
||||||
|
"application/json" = code-general;
|
||||||
|
"text/markdown" = code-general;
|
||||||
|
|
||||||
|
"image/png" = image;
|
||||||
|
"image/jpg" = image;
|
||||||
|
"image/jpeg" = image;
|
||||||
|
"image/x-tga" = image;
|
||||||
|
"image/tiff" = image;
|
||||||
|
"image/x-canon-cr2" = image;
|
||||||
|
"image/svg+xml" = image-vector;
|
||||||
|
|
||||||
|
"video/mp4" = video;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -4,6 +4,11 @@
|
||||||
programs.sway.enable = true;
|
programs.sway.enable = true;
|
||||||
services.gnome3.gnome-remote-desktop.enable = true;
|
services.gnome3.gnome-remote-desktop.enable = true;
|
||||||
environment.systemPackages = with pkgs; [ pipewire_0_2 ];
|
environment.systemPackages = with pkgs; [ pipewire_0_2 ];
|
||||||
|
systemd.user.services.pipewire.environment.XDG_CURRENT_DESKTOP = "sway";
|
||||||
|
systemd.user.services.xdg-desktop-portal-wlr.environment.XDG_CURRENT_DESKTOP =
|
||||||
|
"sway";
|
||||||
|
# systemd.user.services.xdg-desktop-portal-wlr.script = "${pkgs.xdg-desktop-portal-wlr}/libexec/xdg-desktop-portal-wlr";
|
||||||
|
# systemd.user.services.xdg-desktop-portal-wlr.scriptArgs = "--output=DP-1"; # TODO: Extract this *****
|
||||||
home-manager.users.fhauser = let
|
home-manager.users.fhauser = let
|
||||||
adhereTheSwayTarget = {
|
adhereTheSwayTarget = {
|
||||||
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
Install.WantedBy = lib.mkForce [ "sway-session.target" ];
|
||||||
|
@ -17,6 +22,7 @@
|
||||||
${pkgs.bemenu}/bin/bemenu -m $active_screen --list 20 --ignorecase --prompt 'Start: ' | \
|
${pkgs.bemenu}/bin/bemenu -m $active_screen --list 20 --ignorecase --prompt 'Start: ' | \
|
||||||
xargs swaymsg exec --
|
xargs swaymsg exec --
|
||||||
'';
|
'';
|
||||||
|
homeManagerConfig = config.home-manager.users.fhauser;
|
||||||
in rec {
|
in rec {
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
sway-contrib.grimshot
|
sway-contrib.grimshot
|
||||||
|
@ -35,7 +41,9 @@
|
||||||
xwayland = true;
|
xwayland = true;
|
||||||
wrapperFeatures = { gtk = true; };
|
wrapperFeatures = { gtk = true; };
|
||||||
extraSessionCommands = ''
|
extraSessionCommands = ''
|
||||||
export XDG_CURRENT_DESKTOP=Unity
|
#export XDG_CURRENT_DESKTOP=Unity
|
||||||
|
export XDG_CURRENT_DESKTOP=sway
|
||||||
|
export XDG_SESSION_TYPE="wayland"
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh # TODO: Migrate
|
export SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh # TODO: Migrate
|
||||||
export QT_QPA_PLATFORM=wayland
|
export QT_QPA_PLATFORM=wayland
|
||||||
|
@ -122,88 +130,33 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.kanshi = {
|
|
||||||
enable = true;
|
|
||||||
profiles = let
|
|
||||||
backgroundPicturePath = "~/pictures/backgrounds";
|
|
||||||
mkScreen = (screen: {
|
|
||||||
criteria = screen;
|
|
||||||
status = "enable";
|
|
||||||
scale = 1.0;
|
|
||||||
});
|
|
||||||
in rec {
|
|
||||||
#mobile.exec = ''
|
|
||||||
# swaymsg "output * bg `find ${backgroundPicturePath} -type f | shuf -n 1` fill"'';
|
|
||||||
mobile.outputs = [
|
|
||||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
|
||||||
position = "0,0";
|
|
||||||
scale = 2.0;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
#home-dock.exec = mobile.exec;
|
|
||||||
home-dock.outputs = [
|
|
||||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
|
||||||
status = "enable";
|
|
||||||
scale = 2.0;
|
|
||||||
position = "0,0";
|
|
||||||
})
|
|
||||||
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
|
||||||
position = "1920,0";
|
|
||||||
scale = 1.0;
|
|
||||||
status = "enable";
|
|
||||||
})
|
|
||||||
#(mkScreen "Dell Inc. DELL P2720DC 6JRRK53" // {
|
|
||||||
# position = "2560,0";
|
|
||||||
# #position = "4480,0";
|
|
||||||
# scale = 1.0;
|
|
||||||
# status = "enable";
|
|
||||||
#})
|
|
||||||
];
|
|
||||||
#chur-dock.outputs = [
|
|
||||||
# (mkScreen "Unknown 0x08CE 0x00000000" // {
|
|
||||||
# position = "0,0";
|
|
||||||
# scale = 2.0;
|
|
||||||
# })
|
|
||||||
# (mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
|
||||||
# position = "1920,0";
|
|
||||||
# })
|
|
||||||
#];
|
|
||||||
#office-dock.exec = mobile.exec;
|
|
||||||
office-dock.outputs = [
|
|
||||||
(mkScreen "Unknown 0x08CE 0x00000000" // {
|
|
||||||
position = "0,0";
|
|
||||||
scale = 2.0;
|
|
||||||
})
|
|
||||||
(mkScreen "Dell Inc. DELL P2720DC BRKPK53" // {
|
|
||||||
position = "1920,0";
|
|
||||||
})
|
|
||||||
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // {
|
|
||||||
position = "4480,0";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
home-pc.outputs = [
|
|
||||||
(mkScreen "Dell Inc. DELL P2720DC 22JPK53" // { position = "0,0"; })
|
|
||||||
(mkScreen "Unknown HP Z27 CN482201RP" // {
|
|
||||||
position = "2560,0";
|
|
||||||
scale = 1.5;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# TODO: Move these services elsewhere
|
# TODO: Move these services elsewhere
|
||||||
services.network-manager-applet.enable = true;
|
services.network-manager-applet.enable = true;
|
||||||
systemd.user.services.network-manager-applet = adhereTheSwayTarget;
|
|
||||||
services.nextcloud-client.enable = true;
|
services.nextcloud-client.enable = true;
|
||||||
systemd.user.services.nextcloud-client = adhereTheSwayTarget // {
|
|
||||||
Service.ExecStart =
|
|
||||||
lib.mkForce "${pkgs.nextcloud-client}/bin/nextcloud --background";
|
|
||||||
Unit.After = [ "waybar.service" ]; # For trayicon to work
|
|
||||||
}; # TODO: Test and upstream
|
|
||||||
services.owncloud-client.enable = true;
|
services.owncloud-client.enable = true;
|
||||||
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
|
|
||||||
Unit.After = [ "waybar.service" ]; # For trayicon to work
|
|
||||||
};
|
|
||||||
services.pasystray.enable = true;
|
services.pasystray.enable = true;
|
||||||
|
|
||||||
|
systemd.user.services.network-manager-applet = adhereTheSwayTarget;
|
||||||
|
systemd.user.services.nextcloud-client = adhereTheSwayTarget // {
|
||||||
|
# For trayicon to work:
|
||||||
|
Unit.After = [ "waybar.service" ];
|
||||||
|
Service = {
|
||||||
|
ExecStart =
|
||||||
|
lib.mkForce "${pkgs.nextcloud-client}/bin/nextcloud --background";
|
||||||
|
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
||||||
|
Environment = lib.mkForce
|
||||||
|
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
systemd.user.services.owncloud-client = adhereTheSwayTarget // {
|
||||||
|
# For trayicon to work:
|
||||||
|
Unit.After = [ "waybar.service" ];
|
||||||
|
Service = {
|
||||||
|
ExecStartPre = "${pkgs.coreutils}/bin/sleep 3";
|
||||||
|
Environment = lib.mkForce
|
||||||
|
"PATH=${homeManagerConfig.home.profileDirectory}/bin XDG_CURRENT_DESKTOP=Unity";
|
||||||
|
};
|
||||||
|
};
|
||||||
systemd.user.services.pasystray = adhereTheSwayTarget;
|
systemd.user.services.pasystray = adhereTheSwayTarget;
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
|
@ -217,61 +170,5 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; };
|
dconf.settings = { "org/gnome/desktop/interface".menus-have-icons = true; };
|
||||||
|
|
||||||
xdg.mimeApps = rec {
|
|
||||||
enable = true;
|
|
||||||
associations.added = defaultApplications;
|
|
||||||
defaultApplications = let
|
|
||||||
browser = [ "firefox.desktop" ];
|
|
||||||
email = [ "org.gnome.Evolution.desktop" ];
|
|
||||||
doc-editor = [ "writer.desktop" ];
|
|
||||||
sheet-editor = [ "calc.desktop" ];
|
|
||||||
presentation-editor = [ "impress.desktop" ];
|
|
||||||
pdf = [ "org.gnome.Evince.desktop " ];
|
|
||||||
image = [ "org.gnome.eog.desktop" ];
|
|
||||||
image-vector = [ "org.inkscape.Inkscape.desktop" ];
|
|
||||||
ebooks = [ "calibre-ebook-viewer.desktop" ];
|
|
||||||
code-general = [ "codium.desktop" ];
|
|
||||||
video = [ "vlc.desktop" ];
|
|
||||||
in {
|
|
||||||
"text/html" = browser;
|
|
||||||
"x-scheme-handler/http" = browser;
|
|
||||||
"x-scheme-handler/https" = browser;
|
|
||||||
"x-scheme-handler/chrome" = browser;
|
|
||||||
"application/xhtml+xml" = browser;
|
|
||||||
"application/x-extension-htm" = browser;
|
|
||||||
"application/x-extension-html" = browser;
|
|
||||||
"application/x-extension-shtml" = browser;
|
|
||||||
"application/x-extension-xhtml" = browser;
|
|
||||||
"application/x-extension-xht" = browser;
|
|
||||||
"x-scheme-handler/mailto" = email;
|
|
||||||
"x-scheme-handler/msteams" = [ "teams.desktop" ];
|
|
||||||
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
|
|
||||||
doc-editor;
|
|
||||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" =
|
|
||||||
sheet-editor;
|
|
||||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" =
|
|
||||||
presentation-editor;
|
|
||||||
"application/vnd.oasis.opendocument.presentation" = presentation-editor;
|
|
||||||
"application/pdf" = pdf;
|
|
||||||
"application/x-extension-pdf" = pdf;
|
|
||||||
"application/epub+zip" = ebooks;
|
|
||||||
|
|
||||||
"text/plain" = code-general;
|
|
||||||
"application/json" = code-general;
|
|
||||||
"text/markdown" = code-general;
|
|
||||||
|
|
||||||
"image/png" = image;
|
|
||||||
"image/jpg" = image;
|
|
||||||
"image/jpeg" = image;
|
|
||||||
"image/x-tga" = image;
|
|
||||||
"image/tiff" = image;
|
|
||||||
"image/x-canon-cr2" = image;
|
|
||||||
"image/svg+xml" = image-vector;
|
|
||||||
|
|
||||||
"video/mp4" = video;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue