Skip to content
Snippets Groups Projects
Commit d6bdd044 authored by Andri Joos's avatar Andri Joos :blush:
Browse files

add jan appimage

parent 9170a6fb
No related branches found
No related tags found
No related merge requests found
...@@ -60,9 +60,11 @@ FLATPAK_REMMINA_PACKAGE_DISPLAY_NAME="Remmina" ...@@ -60,9 +60,11 @@ FLATPAK_REMMINA_PACKAGE_DISPLAY_NAME="Remmina"
# Raw packages # Raw packages
RAW_GITEXTENSIONS_PACKAGE="$RAW_IDENTIFIER:gitextensions" RAW_GITEXTENSIONS_PACKAGE="$RAW_IDENTIFIER:gitextensions"
RAW_K3D_PACKAGE="$RAW_IDENTIFIER:k3d" RAW_K3D_PACKAGE="$RAW_IDENTIFIER:k3d"
RAW_JAN_PACKAGE="$RAW_IDENTIFIER:jan"
RAW_GITEXTENSIONS_PACKAGE_DISPLAY_NAME="GitExtensions" RAW_GITEXTENSIONS_PACKAGE_DISPLAY_NAME="GitExtensions"
RAW_K3D_PACKAGE_DISPLAY_NAME="k3d" RAW_K3D_PACKAGE_DISPLAY_NAME="k3d"
RAW_JAN_PACKAGE_DISPLAY_NAME="Jan Local AI Assistant"
# Mainline kernel # Mainline kernel
MAINLINE_KERNEL_PACKAGE="$MAINLINE_KERNEL_IDENTIFIER" MAINLINE_KERNEL_PACKAGE="$MAINLINE_KERNEL_IDENTIFIER"
...@@ -98,4 +100,35 @@ PACKAGES=( ...@@ -98,4 +100,35 @@ PACKAGES=(
["$SNAP_FIREFOX_PACKAGE"]="$SNAP_FIREFOX_PACKAGE_DISPLAY_NAME" ["$SNAP_FIREFOX_PACKAGE"]="$SNAP_FIREFOX_PACKAGE_DISPLAY_NAME"
["$MAINLINE_KERNEL_PACKAGE"]="$MAINLINE_KERNEL_PACKAGE_DISPLAY_NAME" ["$MAINLINE_KERNEL_PACKAGE"]="$MAINLINE_KERNEL_PACKAGE_DISPLAY_NAME"
["$APT_DCONF_EDITOR"]="$APT_DCONF_EDITOR_DISPLAY_NAME" ["$APT_DCONF_EDITOR"]="$APT_DCONF_EDITOR_DISPLAY_NAME"
["$RAW_JAN_PACKAGE"]="$RAW_JAN_PACKAGE_DISPLAY_NAME"
)
ORDERED_PACKAGES=( # Needed when order matters
"$SNAP_VSCODE_PACKAGE"
"$FLATPAK_IDEA_COMMUNITY_PACKAGE"
"$SNAP_RIDER_PACKAGE"
"$FLATPAK_WEBSTORM_PACKAGE"
"$FLATPAK_ANDROID_STUDIO_PACKAGE"
"$APT_GIT_PACKAGE"
"$RAW_GITEXTENSIONS_PACKAGE"
"$APT_DOCKER_CE_PACKAGE"
"$RAW_K3D_PACKAGE"
"$SNAP_KUBECTL_PACKAGE"
"$SNAP_FIREFOX_PACKAGE"
"$FLATPAK_OBSIDIAN_PACKAGE"
"$FLATPAK_SPOTIFY_PACKAGE"
"$FLATPAK_GIMP_PACKAGE"
"$APT_VIRTUALBOX_PACKAGE"
"$APT_VLC_PACKAGE"
"$APT_NET_TOOLS_PACKAGE"
"$FLATPAK_FLAMESHOT_PACKAGE"
"$APT_DL_DRIVER_PACKAGE"
"$FLATPAK_NEXTCLOUD_CLIENT_PACKAGE"
"$APT_PROTONVPN_PACKAGE"
"$APT_WIREGUARDVPN_PACKAGE"
"$FLATPAK_FLATSEAL_PACKAGE"
"$FLATPAK_REMMINA_PACKAGE"
"$APT_DCONF_EDITOR"
"$RAW_JAN_PACKAGE"
"$MAINLINE_KERNEL_PACKAGE"
) )
...@@ -5,41 +5,13 @@ HELPER_SCRIPTS_DIR="$INSTALLER_DIR/helper_scripts" ...@@ -5,41 +5,13 @@ HELPER_SCRIPTS_DIR="$INSTALLER_DIR/helper_scripts"
source "$HELPER_SCRIPTS_DIR/packages.sh" source "$HELPER_SCRIPTS_DIR/packages.sh"
ORDERED_PACKAGES=( # Needed when order matters
"$SNAP_VSCODE_PACKAGE"
"$FLATPAK_IDEA_COMMUNITY_PACKAGE"
"$SNAP_RIDER_PACKAGE"
"$FLATPAK_WEBSTORM_PACKAGE"
"$FLATPAK_ANDROID_STUDIO_PACKAGE"
"$APT_GIT_PACKAGE"
"$RAW_GITEXTENSIONS_PACKAGE"
"$APT_DOCKER_CE_PACKAGE"
"$RAW_K3D_PACKAGE"
"$SNAP_KUBECTL_PACKAGE"
"$SNAP_FIREFOX_PACKAGE"
"$FLATPAK_OBSIDIAN_PACKAGE"
"$FLATPAK_SPOTIFY_PACKAGE"
"$FLATPAK_GIMP_PACKAGE"
"$APT_VIRTUALBOX_PACKAGE"
"$APT_VLC_PACKAGE"
"$APT_NET_TOOLS_PACKAGE"
"$FLATPAK_FLAMESHOT_PACKAGE"
"$APT_DL_DRIVER_PACKAGE"
"$FLATPAK_NEXTCLOUD_CLIENT_PACKAGE"
"$APT_PROTONVPN_PACKAGE"
"$APT_WIREGUARDVPN_PACKAGE"
"$FLATPAK_FLATSEAL_PACKAGE"
"$FLATPAK_REMMINA_PACKAGE"
"$APT_DCONF_EDITOR"
"$MAINLINE_KERNEL_PACKAGE"
)
declare -A NEEDS_VERSION declare -A NEEDS_VERSION
NEEDS_VERSION=( NEEDS_VERSION=(
["$APT_VIRTUALBOX_PACKAGE"]="https://www.virtualbox.org/wiki/Linux_Downloads|${PACKAGES["$APT_VIRTUALBOX_PACKAGE"]} version (e.g. 7.1)" ["$APT_VIRTUALBOX_PACKAGE"]="https://www.virtualbox.org/wiki/Linux_Downloads|${PACKAGES["$APT_VIRTUALBOX_PACKAGE"]} version (e.g. 7.1)"
["$RAW_GITEXTENSIONS_PACKAGE"]="https://github.com/gitextensions/gitextensions/releases|${PACKAGES["$RAW_GITEXTENSIONS_PACKAGE"]} version (e.g. 2.51.05)" ["$RAW_GITEXTENSIONS_PACKAGE"]="https://github.com/gitextensions/gitextensions/releases|${PACKAGES["$RAW_GITEXTENSIONS_PACKAGE"]} version (e.g. 2.51.05)"
["$APT_PROTONVPN_PACKAGE"]="https://protonvpn.com/support/official-linux-vpn-ubuntu|${PACKAGES["$APT_PROTONVPN_PACKAGE"]} Repository version (e.g. 1.0.6)" ["$APT_PROTONVPN_PACKAGE"]="https://protonvpn.com/support/official-linux-vpn-ubuntu|${PACKAGES["$APT_PROTONVPN_PACKAGE"]} Repository version (e.g. 1.0.6)"
["$MAINLINE_KERNEL_PACKAGE"]="https://kernel.ubuntu.com/mainline/|Kernel versions, comma separated (e.g. 6.11.10)" ["$MAINLINE_KERNEL_PACKAGE"]="https://kernel.ubuntu.com/mainline/|Kernel versions, comma separated (e.g. 6.11.10)"
["$RAW_JAN_PACKAGE"]="https://github.com/janhq/jan/releases|${PACKAGES["$RAW_JAN_PACKAGE"]} version (e.g. 0.5.13)"
) )
PACKAGES_WITH_GROUP=( PACKAGES_WITH_GROUP=(
...@@ -72,6 +44,7 @@ CAN_AUTOSTART=( ...@@ -72,6 +44,7 @@ CAN_AUTOSTART=(
"$APT_PROTONVPN_PACKAGE" "$APT_PROTONVPN_PACKAGE"
"$FLATPAK_FLATSEAL_PACKAGE" "$FLATPAK_FLATSEAL_PACKAGE"
"$SNAP_FIREFOX_PACKAGE" "$SNAP_FIREFOX_PACKAGE"
"$RAW_JAN_PACKAGE"
# "$FLATPAK_REMMINA_PACKAGE" # Adds itself to autostart # "$FLATPAK_REMMINA_PACKAGE" # Adds itself to autostart
) )
......
- name: Install AppImage
block:
- name: Copy AppImage
copy:
src: "{{ installation_file }}"
dest: "{{ destination }}"
- name: Install libfuse
include_tasks: ../apt_templates/install_apt_package.yaml
vars:
app: libfuse2
- name: Setting AppImage permissions
file:
path: "{{ destination }}"
mode: '0775'
state: file
- name: Extract Icon
when: "extract_icon | default (false)"
vars:
squashfs_path: "squashfs-root"
shell: |
chmod +x "{{ installation_file }}"
"{{ installation_file }}" --appimage-extract
cp "{{ squashfs_path }}/{{ appimage_icon_subpath }}" "{{ icon_destination }}"
rm -r "{{ squashfs_path }}"
- name: wget File
block:
- name: Install wget
include_tasks: ../apt_templates/install_apt_package.yaml
vars:
app: wget
- name: Download File
shell: wget -q "{{ url }}" -O "{{ output_path }}"
- name: wget File - name: wget and install File
vars: vars:
output_path: "{{ temporary_downloads_path }}/{{ wget_output_file }}" output_path: "{{ temporary_downloads_path }}/{{ wget_output_file }}"
block: block:
- name: Install wget - name: wget File
include_tasks: ../apt_templates/install_apt_package.yaml include_tasks: wget_file.yaml
vars:
app: wget
- name: Download File
shell: wget -q "{{ url }}" -O "{{ output_path }}"
- name: Install File - name: Install File
include_tasks: "{{ installation_task }}" include_tasks: "{{ installation_task }}"
vars: vars:
installation_file: "{{ output_path }}" installation_file: "{{ output_path }}"
download_path: "{{ temporary_downloads_path }}"
- name: wget Cleanup - name: wget Cleanup
file: file:
path: "{{ temporary_downloads_path }}/{{ wget_output_file }}" path: "{{ output_path }}"
state: absent state: absent
...@@ -68,3 +68,61 @@ ...@@ -68,3 +68,61 @@
wget_output_file: k3d.sh wget_output_file: k3d.sh
installation_task: bash_installation.yaml installation_task: bash_installation.yaml
when: "'k3d' in raw_packages" when: "'k3d' in raw_packages"
- name: Install Jan (Raw)
vars:
jan_path: "{{ portable_programs_path }}/Jan"
jan_filename: "jan.AppImage"
jan_appimage_path: "{{ jan_path }}/{{ jan_filename }}"
desktop_filename: jan
desktop_app_name: Jan
desktop_description: Jan - Local AI Assistant
desktop_icon_path: "{{ jan_path }}/icon.png"
when: raw_packages is search('jan:')
block:
- name: Remove old Jan Installation
file:
path: "{{ jan_path }}"
state: absent
- name: Ensure Jan directory
include_tasks: general_templates/make_dir.yaml
vars:
path: "{{ jan_path }}"
- name: Install Jan (Raw)
include_tasks: general_templates/wget_install.yaml
vars:
version: "{{ raw_packages | regex_search('jan:([^\\s]+)', '\\1') | first | trim }}"
url: https://github.com/janhq/jan/releases/download/v{{ version }}/jan-linux-x86_64-{{ version }}.AppImage
wget_output_file: "{{ jan_filename }}"
installation_task: appimage_installation.yaml
destination: "{{ jan_appimage_path }}"
extract_icon: true
icon_destination: "{{ desktop_icon_path }}"
appimage_icon_subpath: usr/share/icons/hicolor/512x512/apps/jan.png
# - name: Download Jan Icon
# include_tasks: general_templates/wget_file.yaml
# vars:
# url: https://avatars.githubusercontent.com/u/102363196?s=200&v=4
# output_path: "{{ desktop_icon_path }}"
- name: Create Application Entry
include_tasks: general_templates/create_desktop_file.yaml
vars:
dir: "{{ applications_directory }}"
filename: "{{ desktop_filename }}"
app_name: "{{ desktop_app_name }}"
description: "{{ desktop_description }}"
executable: "{{ jan_appimage_path }}"
icon_path: "{{ desktop_icon_path }}"
- name: Create Autostart Entry
include_tasks: general_templates/create_desktop_file.yaml
vars:
filename: "{{ desktop_filename }}"
app_name: "{{ desktop_app_name }}"
description: "{{ desktop_description }}"
executable: "{{ jan_appimage_path }}"
when: "'jan' in autostart_applications"
portable_programs_path: "{{ ansible_env.HOME }}/Programs" portable_programs_path: "{{ ansible_env.HOME }}/Programs"
temporary_downloads_path: "." temporary_downloads_path: "{{ '.' | realpath }}"
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment