feat(t3_code): add T3 Code AppImage launcher and desktop entry
This commit is contained in:
@@ -7,6 +7,7 @@
|
|||||||
./firefox
|
./firefox
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./llm_tools.nix
|
./llm_tools.nix
|
||||||
|
./t3_code
|
||||||
./vscode
|
./vscode
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
t3-code = pkgs.writeShellApplication {
|
||||||
|
name = "t3-code";
|
||||||
|
runtimeInputs = with pkgs; [
|
||||||
|
coreutils
|
||||||
|
kdePackages.kdialog
|
||||||
|
];
|
||||||
|
text = builtins.readFile ./launch.sh;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
# AppImages are runnable from a shell as well
|
||||||
|
sessionPath = [ "${config.home.homeDirectory}/app_images" ];
|
||||||
|
packages = [ t3-code ];
|
||||||
|
};
|
||||||
|
|
||||||
|
# KDE builds its menu from desktop entries, not from PATH
|
||||||
|
xdg.desktopEntries.t3-code = {
|
||||||
|
name = "T3 Code";
|
||||||
|
genericName = "Code Editor";
|
||||||
|
comment = "Newest T3 Code AppImage in ~/app_images";
|
||||||
|
exec = "${lib.getExe t3-code} %U";
|
||||||
|
icon = "${./icon.png}";
|
||||||
|
terminal = false;
|
||||||
|
categories = [ "Development" ];
|
||||||
|
startupNotify = true;
|
||||||
|
settings.StartupWMClass = "t3code";
|
||||||
|
};
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 161 KiB |
@@ -0,0 +1,25 @@
|
|||||||
|
# Launch the newest T3 Code AppImage in the app image directory.
|
||||||
|
#
|
||||||
|
# The nightly builds carry the version in the file name, so the file to run is
|
||||||
|
# resolved at launch time rather than baked into the desktop entry.
|
||||||
|
# No shebang: this is wrapped by writeShellApplication, which supplies one.
|
||||||
|
|
||||||
|
dir="${T3_CODE_DIR:-$HOME/app_images}"
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
images=("$dir"/T3-Code-*.AppImage)
|
||||||
|
|
||||||
|
if [ "${#images[@]}" -eq 0 ]; then
|
||||||
|
msg="No T3 Code AppImage found in $dir"
|
||||||
|
echo "$msg" >&2
|
||||||
|
# launched from KDE there is no terminal to read, so say it on screen too
|
||||||
|
kdialog --error "$msg" || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
img="$(printf '%s\n' "${images[@]}" | sort -V | tail -n1)"
|
||||||
|
[ -x "$img" ] || chmod +x "$img"
|
||||||
|
|
||||||
|
# --no-sandbox matches the AppImage's own desktop entry; binfmt hands the
|
||||||
|
# AppImage off to appimage-run.
|
||||||
|
exec "$img" --no-sandbox "$@"
|
||||||
Reference in New Issue
Block a user