├── .gitignore ├── LICENSE ├── README.md ├── share ├── applications │ └── formatlab.desktop ├── icons │ └── icon.png ├── license │ └── LICENSE ├── metainfo │ └── com.warlordsoftwares.formatlab.metainfo.xml └── screenshots │ ├── formatlab-warlordsoftwares_1.jpg │ ├── formatlab-warlordsoftwares_2.jpg │ ├── formatlab-warlordsoftwares_3.jpg │ ├── formatlab-warlordsoftwares_4.jpg │ └── formatlab-warlordsoftwares_5.jpg ├── snap ├── gui │ └── icon.png └── snapcraft.yaml └── snap_launcher ├── bin ├── desktop-launch └── formatlab └── formatlab.desktop /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyo 2 | *.pyc 3 | migrations/ 4 | *.iml 5 | .idea/ 6 | build 7 | dist 8 | formatlab.spec 9 | qrc 10 | resource 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Rishabh Bhardwaj 2 | 3 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | SOFTWARE. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **ABOUT APPLICATION :** 2 | 3 | **FormatLab** is a Powerful Tool for Converting **Video and Audio** files and supports almost **All Formats** with modern and widely supported codecs. 4 | 5 | **FEATURES :** 6 | 7 | - Supports **All Popular Video Formats** with Modern Lossless Compression Technique. 8 | - Supports **All Popular Audio Formats** in High quality Output with One Click. 9 | - Supports **Video to HD Audio** File Conversion. 10 | - Supports **Batch Conversions** for video and audio files. 11 | - Supports **Video Quality Tweak** to change Lossless Quality for a video. 12 | - Supports **FPS Tweak** to increase/decrease frame per second of a video. 13 | - Supports **Drag and Drop files** Feature for easy Usability. 14 | - System Monitor App inside to see your CPU usage while conversion. 15 | 16 | **Supported Video Formats:** 17 | 18 | 'mp4', 'mov', 'wmv', 'avi', 'flv', 'f4v', 'mkv', 'webm', 'mpeg', 19 | 'm2ts', 'mpg', 'asf', 'swf' ..etc 20 | 21 | **Supported Audio Formats:** 22 | 23 | 'mp3', 'm4a', 'wav', 'wma', 'aac', 'ogg', 'pcm', 'aiff', 'flac' .. etc 24 | 25 | **Support Valid input video formats** 26 | 27 | 'ogg', 'rmvb', 'wmv', 'm4v', 'vro', 'm2v', 'webm', 'mpeg', 'tp', 28 | 'mpg', 'ts', 'm2ts', 'mpeg4', 'm2p', 'mkv', '3gp2', 'mpeg2', 29 | 'mod', 'tod', 'mxf', 'swf', 'mts', '3gp', 'dvr-ms', 'mov', 'amv', 30 | '3gpp', 'mpv', 'avi', 'ogv', 'dat', 'flv', 'mp4', 'vob', 'ogm', 31 | 'qt', 'avs', 'asf', 'mpe', 'rm', 'trp', 'm1v', 'f4v', 'm2t', 32 | '3g2', 'nsv', 'dv', 'divx' ..etc 33 | 34 | **Support Valid input audio formats** 35 | 36 | 'mp3', 'm4a', 'wav', 'wma', 'aac', 'ogg', 'pcm', 'aiff', 'flac' ..etc 37 | 38 | ## Install FormatLab on Linux Desktop: 39 | 40 | **Snap** 41 | 42 | [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/formatlab) 43 | 44 | Install with command-line 45 | 46 | `snap install formatlab` 47 | 48 | and run 49 | 50 | `formatlab` 51 | 52 | **Flatpak** 53 | 54 | Get it from the Flathub Store 55 | 56 | Install with command-line 57 | 58 | `flatpak install flathub com.warlordsoftwares.formatlab` 59 | 60 | and run 61 | 62 | `flatpak run com.warlordsoftwares.formatlab` 63 | 64 | ## Screenshots of FormatLab 65 | 66 | ![FormatLab](https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_1.jpg?raw=true) 67 | 68 | ![FormatLab](https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_2.jpg?raw=true) 69 | 70 | ![FormatLab](https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_3.jpg?raw=true) 71 | 72 | ![FormatLab](https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_4.jpg?raw=true) 73 | 74 | ![FormatLab](https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_5.jpg?raw=true) 75 | 76 | 77 | **KEYWORDS:** 78 | 79 | *FFMpeg, Uniconverter, VideoProc Converter, Leawo Video Converter, WinX Video Converter, iDealshare, FonePaw, HitPaw, AVS, Movavi, Freemake, AVC, Prism, HandBrake, Wonderfox, VideoStudio, AnyMP4 Video Converter Ultimate, Aiseesoft Video Converter Ultimate, Acethinker, Stellar, Gilisoft, Porgram4pc, Cisdem, Tipard, Any Video Converter Free, Zamzar, Online-Convert, DVD VideoSoft, Hamster, MediaCoder, Gihosoft, Clone2Go, Free Audio Video Pack, iTube Studio, Cloud Convert, Aconvert, vsdc, video2audio, videotoaudio, videotomp3 converter* 80 | 81 | #Formatlab 82 | #VideoConverter 83 | #AudioConverter 84 | #MediaConversion 85 | #MP4toMP3 86 | #VideoCompression 87 | #BatchConversion 88 | #VideoEditingTool 89 | #CrossPlatformConverter 90 | #MediaEditing 91 | #HighQualityConversion 92 | #VideoToAudio 93 | 94 | --------------------------------------------------------------------------------------------------------------------------------------------- 95 | -------------------------------------------------------------------------------- /share/applications/formatlab.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=FORMAT LAB 3 | StartupWMClass=FORMAT LAB 4 | Comment=FormatLab for Desktop 5 | GenericName=FormatLab for Linux 6 | Exec=formatlab.sh %u 7 | Icon=com.warlordsoftwares.formatlab 8 | Terminal=false 9 | Type=Application 10 | StartupNotify=true 11 | Keywords=video converter;audio converter; mp4 converter;mp3 converter;videotomp3 converter; 12 | Categories=Utility; -------------------------------------------------------------------------------- /share/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/icons/icon.png -------------------------------------------------------------------------------- /share/license/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Rishabh Bhardwaj 2 | 3 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 4 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 5 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 6 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 7 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 8 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 9 | SOFTWARE. 10 | -------------------------------------------------------------------------------- /share/metainfo/com.warlordsoftwares.formatlab.metainfo.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.warlordsoftwares.formatlab 4 | CC0-1.0 5 | LicenseRef-proprietary=https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/license/LICENSE 6 | Warlord Softwares 7 | FormatLab 8 | Video Converter With Friendly UI 9 | 10 |

ABOUT APPLICATION :

11 |

FormatLab is a Powerful Audio Video Converter for converting media files in 4k resolution with widely supported codecs.

12 |

FEATURES :

13 | 23 |

SUPPORTED VIDEO FORMATS:

24 |

mp4, mov, wmv, avi, flv, f4v, mkv, webm, mpeg, m2ts, mpg, asf, swf, etc

25 |

SUPPORTED AUDIO FORMATS:

26 |

mp3, m4a, wav, wma, aac, ogg, pcm, aiff, flac, etc

27 |
28 | 29 | FormatLab 30 | FFMpeg 31 | HandBrake 32 | video converter 33 | audio converter 34 | mp4 converter 35 | mp3 converter 36 | video to mp3 converter 37 | Uniconverter 38 | VideoProc 39 | Leawo Video Converter 40 | WinX Video Converter 41 | iDealshare 42 | FonePaw 43 | HitPaw 44 | Movavi 45 | Freemake 46 | Prism 47 | Wonderfox 48 | AnyMP4 49 | Video Converter Ultimate 50 | Aiseesoft Video Converter Ultimate 51 | Acethinker 52 | Stellar 53 | Gilisoft 54 | Cisdem 55 | Tipard 56 | Any Video Converter 57 | Zamzar 58 | Hamster 59 | MediaCoder 60 | Gihosoft 61 | Clone2Go 62 | iTube Studio 63 | 64 | 65 | 66 | https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_1.jpg 67 | 68 | 69 | https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_2.jpg 70 | 71 | 72 | https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_3.jpg 73 | 74 | 75 | https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_4.jpg 76 | 77 | 78 | https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/main/share/screenshots/formatlab-warlordsoftwares_5.jpg 79 | 80 | 81 | https://github.com/rishabh3354/FORMAT_LAB 82 | https://github.com/rishabh3354/FORMAT_LAB/issues 83 | https://warlordsoftwares.com/contact-us/ 84 | https://www.paypal.me/rishabh3354/10 85 | contact@warlordsoftwares.com 86 | com.warlordsoftwares.formatlab.desktop 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
-------------------------------------------------------------------------------- /share/screenshots/formatlab-warlordsoftwares_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/screenshots/formatlab-warlordsoftwares_1.jpg -------------------------------------------------------------------------------- /share/screenshots/formatlab-warlordsoftwares_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/screenshots/formatlab-warlordsoftwares_2.jpg -------------------------------------------------------------------------------- /share/screenshots/formatlab-warlordsoftwares_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/screenshots/formatlab-warlordsoftwares_3.jpg -------------------------------------------------------------------------------- /share/screenshots/formatlab-warlordsoftwares_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/screenshots/formatlab-warlordsoftwares_4.jpg -------------------------------------------------------------------------------- /share/screenshots/formatlab-warlordsoftwares_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/share/screenshots/formatlab-warlordsoftwares_5.jpg -------------------------------------------------------------------------------- /snap/gui/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/snap/gui/icon.png -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: formatlab 2 | base: core20 3 | version: '2024.12.1' 4 | summary: FormatLab Video/Audio Lossless Converter 5 | description: FormatLab is a powerful Video/Audio Converter and Compressor for Linux OS which supports MP3, MP4, AVI, WMV, MKV or other file formats with Lossless Quality conversion. 6 | grade: stable 7 | confinement: strict 8 | 9 | icon: snap/gui/icon.png 10 | 11 | architectures: 12 | - build-on: [amd64] 13 | 14 | environment: 15 | SNAP_DESKTOP_RUNTIME: $SNAP/pyqt5-runtime-core20 16 | 17 | apps: 18 | formatlab: 19 | command: bin/desktop-launch formatlab 20 | desktop: formatlab.desktop 21 | environment: 22 | DISABLE_WAYLAND: 1 23 | plugs: 24 | - home 25 | - gsettings 26 | - network 27 | - network-bind 28 | - network-status 29 | - desktop 30 | - desktop-legacy 31 | - x11 32 | - unity7 33 | - wayland 34 | - opengl 35 | - audio-playback 36 | - hardware-observe 37 | - optical-drive 38 | - removable-media 39 | 40 | plugs: 41 | gsettings: 42 | gtk-3-themes: 43 | interface: content 44 | target: $SNAP/data-dir/themes 45 | default-provider: gtk-common-themes 46 | icon-themes: 47 | interface: content 48 | target: $SNAP/data-dir/icons 49 | default-provider: gtk-common-themes 50 | sound-themes: 51 | interface: content 52 | target: $SNAP/data-dir/sounds 53 | default-provider: gtk-common-themes 54 | pyqt5-runtime-core20: 55 | interface: content 56 | target: $SNAP/pyqt5-runtime-core20 57 | default-provider: pyqt5-runtime-core20 58 | 59 | parts: 60 | snap-launcher: 61 | plugin: dump 62 | source: snap_launcher/ 63 | override-build: | 64 | snapcraftctl build 65 | sed -i 's|Icon=.*|Icon=${SNAP}/meta/gui/icon.png|g' ${SNAPCRAFT_PART_SRC}/formatlab.desktop 66 | mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/ 67 | cp -rf ${SNAPCRAFT_PART_SRC}/formatlab.desktop ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/formatlab.desktop -------------------------------------------------------------------------------- /snap_launcher/bin/desktop-launch: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ################# 3 | # Launcher init # 4 | ################# 5 | 6 | # shellcheck disable=SC2034 7 | START=$(date +%s.%N) 8 | 9 | # ensure_dir_exists calls `mkdir -p` if the given path is not a directory. 10 | # This speeds up execution time by avoiding unnecessary calls to mkdir. 11 | # 12 | # Usage: ensure_dir_exists []... 13 | # 14 | function ensure_dir_exists() { 15 | [ -d "$1" ] || mkdir -p "$@" 16 | } 17 | 18 | declare -A PIDS 19 | function async_exec() { 20 | "$@" & 21 | PIDS[$!]=$* 22 | } 23 | function wait_for_async_execs() { 24 | for pid in "${!PIDS[@]}" 25 | do 26 | wait "$pid" && continue || echo "ERROR: ${PIDS[$pid]} exited abnormally with status $?" 27 | done 28 | } 29 | 30 | # shellcheck source=/dev/null 31 | 32 | source "$SNAP_USER_DATA/.last_revision" 2>/dev/null || true 33 | if [ "$SNAP_DESKTOP_LAST_REVISION" = "$SNAP_REVISION" ]; then 34 | needs_update=false 35 | else 36 | needs_update=true 37 | fi 38 | 39 | 40 | # Set $REALHOME to the users real home directory 41 | REALHOME=$(getent passwd $UID | cut -d ':' -f 6) 42 | 43 | # Set config folder to local path 44 | export XDG_CONFIG_HOME="$SNAP_USER_DATA/.config" 45 | ensure_dir_exists "$XDG_CONFIG_HOME" 46 | chmod 700 "$XDG_CONFIG_HOME" 47 | 48 | # If there is no user user-dirs, don't check for the checksum 49 | if [[ -f "$REALHOME/.config/user-dirs.dirs" ]]; then 50 | # If the user has modified their user-dirs settings, force an update 51 | if [[ -f "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum" ]]; then 52 | if [[ "$(md5sum < "$REALHOME/.config/user-dirs.dirs")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum")" || 53 | ( -f "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" && 54 | "$(md5sum < "$REALHOME/.config/user-dirs.locale")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.locale.md5sum")" ) ]]; then 55 | needs_update=true 56 | fi 57 | else 58 | # shellcheck disable=SC2034 59 | needs_update=true 60 | fi 61 | fi 62 | 63 | if [ "$SNAP_ARCH" = "amd64" ]; then 64 | ARCH="x86_64-linux-gnu" 65 | elif [ "$SNAP_ARCH" = "armhf" ]; then 66 | ARCH="arm-linux-gnueabihf" 67 | elif [ "$SNAP_ARCH" = "arm64" ]; then 68 | ARCH="aarch64-linux-gnu" 69 | elif [ "$SNAP_ARCH" = "ppc64el" ]; then 70 | ARCH="powerpc64le-linux-gnu" 71 | else 72 | ARCH="$SNAP_ARCH-linux-gnu" 73 | fi 74 | 75 | export SNAP_LAUNCHER_ARCH_TRIPLET="$ARCH" 76 | 77 | # Don't LD_PRELOAD bindtextdomain for classic snaps 78 | if ! grep -qs "^\s*confinement:\s*classic\s*" "$SNAP/meta/snap.yaml"; then 79 | if [ -f "$SNAP/gnome-platform/lib/$ARCH/bindtextdomain.so" ]; then 80 | export LD_PRELOAD="$LD_PRELOAD:$SNAP/gnome-platform/\$LIB/bindtextdomain.so" 81 | elif [ -f "$SNAP/lib/$ARCH/bindtextdomain.so" ]; then 82 | export LD_PRELOAD="$LD_PRELOAD:$SNAP/\$LIB/bindtextdomain.so" 83 | fi 84 | fi 85 | ############################################### 86 | # Launcher common exports for any desktop app # 87 | ############################################### 88 | 89 | # Note: We avoid using `eval` because we don't want to expand variable names 90 | # in paths. For example: LD_LIBRARY_PATH paths might contain `$LIB`. 91 | function prepend_dir() { 92 | local -n var="$1" 93 | local dir="$2" 94 | # We can't check if the dir exists when the dir contains variables 95 | if [[ "$dir" == *"\$"* || -d "$dir" ]]; then 96 | export "${!var}=${dir}${var:+:$var}" 97 | fi 98 | } 99 | 100 | function append_dir() { 101 | local -n var="$1" 102 | local dir="$2" 103 | # We can't check if the dir exists when the dir contains variables 104 | if [[ "$dir" == *"\$"* || -d "$dir" ]]; then 105 | export "${!var}=${var:+$var:}${dir}" 106 | fi 107 | } 108 | 109 | function can_open_file() { 110 | [ -f "$1" ] && [ -r "$1" ] 111 | } 112 | 113 | function update_xdg_dirs_values() { 114 | local save_initial_values=false 115 | local XDG_DIRS="DOCUMENTS DESKTOP DOWNLOAD MUSIC PICTURES VIDEOS PUBLICSHARE TEMPLATES" 116 | unset XDG_SPECIAL_DIRS_PATHS 117 | 118 | if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" ]; then 119 | # shellcheck source=/dev/null 120 | source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" 121 | fi 122 | 123 | if [ -z ${XDG_SPECIAL_DIRS+x} ]; then 124 | save_initial_values=true 125 | fi 126 | 127 | for d in $XDG_DIRS; do 128 | var="XDG_${d}_DIR" 129 | value="${!var}" 130 | 131 | if [ "$save_initial_values" = true ]; then 132 | XDG_SPECIAL_DIRS+=("$var") 133 | XDG_SPECIAL_DIRS_INITIAL_PATHS+=("$value") 134 | fi 135 | 136 | XDG_SPECIAL_DIRS_PATHS+=("$value") 137 | done 138 | } 139 | 140 | function is_subpath() { 141 | dir="$(realpath "$1")" 142 | parent="$(realpath "$2")" 143 | [ "${dir##"${parent}"/}" != "${dir}" ] && return 0 || return 1 144 | } 145 | 146 | #RUNTIME_NAME 147 | RUNTIME_NAME="pyqt5-runtime-core20" 148 | 149 | if ! snapctl is-connected $RUNTIME_NAME; then 150 | echo "ERROR: not connected to the $RUNTIME_NAME content interface." 151 | exit 1 152 | fi 153 | 154 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/lib/$ARCH" 155 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH" 156 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib" 157 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/lib" 158 | append_dir PATH "$SNAP_DESKTOP_RUNTIME/usr/bin" 159 | 160 | #samba lib path 161 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/samba/" 162 | 163 | #python 3.8 path 164 | export PYTHONPATH=${PYTHONPATH}:$SNAP_DESKTOP_RUNTIME/usr/lib/python38.zip:$SNAP_DESKTOP_RUNTIME/usr/lib/python3.8:$SNAP_DESKTOP_RUNTIME/usr/lib/python3.8/lib-dynload:$SNAP_DESKTOP_RUNTIME/usr/lib/python3/dist-packages:$SNAP_DESKTOP_RUNTIME/lib/python3.8/site-packages 165 | 166 | #python 3.8 path for pyinstaller 167 | export PYINSTALLER_PYTHONPATH=${PYINSTALLER_PYTHONPATH}:$PYTHONPATH 168 | 169 | 170 | # XKB config 171 | export XKB_CONFIG_ROOT="$SNAP_DESKTOP_RUNTIME/usr/share/X11/xkb" 172 | 173 | # Give XOpenIM a chance to locate locale data. 174 | # This is required for text input to work in SDL2 games. 175 | export XLOCALEDIR="$SNAP_DESKTOP_RUNTIME/usr/share/X11/locale" 176 | 177 | # Set XCursors path 178 | export XCURSOR_PATH="$SNAP_DESKTOP_RUNTIME/usr/share/icons" 179 | prepend_dir XCURSOR_PATH "$SNAP/data-dir/icons" 180 | 181 | # Mesa Libs for OpenGL support 182 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/mesa" 183 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/mesa-egl" 184 | 185 | # Tell libGL and libva where to find the drivers 186 | export LIBGL_DRIVERS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/dri" 187 | append_dir LD_LIBRARY_PATH "$LIBGL_DRIVERS_PATH" 188 | append_dir LIBVA_DRIVERS_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/dri" 189 | 190 | # Set where the VDPAU drivers are located 191 | export VDPAU_DRIVER_PATH="/usr/lib/$ARCH/vdpau/" 192 | if [ -e "/var/lib/snapd/lib/gl/vdpau/libvdpau_nvidia.so" ]; then 193 | export VDPAU_DRIVER_PATH="/var/lib/snapd/lib/gl/vdpau" 194 | # Prevent picking VA-API (Intel/AMD) over NVIDIA VDPAU; on PRIME systems for example 195 | unset LIBVA_DRIVERS_PATH 196 | fi 197 | 198 | # Workaround in snapd for proprietary nVidia drivers mounts the drivers in 199 | # /var/lib/snapd/lib/gl that needs to be in LD_LIBRARY_PATH 200 | # Without that OpenGL using apps do not work with the nVidia drivers. 201 | # Ref.: https://bugs.launchpad.net/snappy/+bug/1588192 202 | append_dir LD_LIBRARY_PATH "/var/lib/snapd/lib/gl" 203 | append_dir LD_LIBRARY_PATH "/var/lib/snapd/lib/gl/vdpau" 204 | 205 | # Unity7 export (workaround for https://launchpad.net/bugs/1638405) 206 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libunity" 207 | 208 | # Pulseaudio export 209 | append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pulseaudio" 210 | 211 | # EGL vendor files on glvnd enabled systems 212 | prepend_dir __EGL_VENDOR_LIBRARY_DIRS "/var/lib/snapd/lib/glvnd/egl_vendor.d" 213 | append_dir __EGL_VENDOR_LIBRARY_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share/glvnd/egl_vendor.d" 214 | 215 | # Tell GStreamer where to find its plugins 216 | export GST_PLUGIN_PATH="$SNAP/usr/lib/$ARCH/gstreamer-1.0" 217 | export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0" 218 | # gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43 219 | export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner" 220 | 221 | # XDG Config 222 | prepend_dir XDG_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/etc/xdg" 223 | prepend_dir XDG_CONFIG_DIRS "$SNAP/etc/xdg" 224 | 225 | # Define snaps' own data dir 226 | prepend_dir XDG_DATA_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share" 227 | prepend_dir XDG_DATA_DIRS "$SNAP/usr/share" 228 | prepend_dir XDG_DATA_DIRS "$SNAP/share" 229 | prepend_dir XDG_DATA_DIRS "$SNAP/data-dir" 230 | prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA" 231 | 232 | # Set XDG_DATA_HOME to local path 233 | export XDG_DATA_HOME="$SNAP_USER_DATA/.local/share" 234 | ensure_dir_exists "$XDG_DATA_HOME" 235 | 236 | #update mime if mime dir doesn't exist 237 | MIME_DIRECTORY="$XDG_DATA_HOME/mime" 238 | if [ ! -d "$MIME_DIRECTORY" ]; then 239 | needs_update=true 240 | fi 241 | 242 | # Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME: 243 | # https://bugzilla.gnome.org/show_bug.cgi?id=741335 244 | prepend_dir XDG_DATA_DIRS "$XDG_DATA_HOME" 245 | 246 | # Set cache folder to local path 247 | export XDG_CACHE_HOME="$SNAP_USER_COMMON/.cache" 248 | if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$XDG_CACHE_HOME" ]]; then 249 | # the .cache directory used to be stored under $SNAP_USER_DATA, migrate it 250 | mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/" 251 | fi 252 | ensure_dir_exists "$XDG_CACHE_HOME" 253 | 254 | # Create $XDG_RUNTIME_DIR if not exists (to be removed when LP: #1656340 is fixed) 255 | # shellcheck disable=SC2174 256 | ensure_dir_exists "$XDG_RUNTIME_DIR" -m 700 257 | 258 | # Ensure the app finds locale definitions (requires locales-all to be installed) 259 | append_dir LOCPATH "$SNAP_DESKTOP_RUNTIME/usr/lib/locale" 260 | 261 | # If any, keep track of where XDG dirs were so we can potentially migrate the content later 262 | update_xdg_dirs_values 263 | 264 | # Setup user-dirs.* or run xdg-user-dirs-update if needed 265 | needs_xdg_update=false 266 | needs_xdg_reload=false 267 | needs_xdg_links=false 268 | 269 | if [ "$HOME" != "$SNAP_USER_DATA" ] && ! is_subpath "$XDG_CONFIG_HOME" "$HOME"; then 270 | for f in user-dirs.dirs user-dirs.locale; do 271 | if [ -f "$HOME/.config/$f" ]; then 272 | mv "$HOME/.config/$f" "$XDG_CONFIG_HOME" 273 | needs_xdg_reload=true 274 | fi 275 | done 276 | fi 277 | 278 | if can_open_file "$REALHOME/.config/user-dirs.dirs"; then 279 | # shellcheck disable=SC2154 280 | if [ "$needs_update" = true ] || [ "$needs_xdg_reload" = true ]; then 281 | sed "/^#/!s#\$HOME#${REALHOME}#g" "$REALHOME/.config/user-dirs.dirs" > "$XDG_CONFIG_HOME/user-dirs.dirs" 282 | md5sum < "$REALHOME/.config/user-dirs.dirs" > "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum" 283 | # It's possible user-dirs.dirs exists when user-dirs.locale doesn't. This 284 | # simply means the user opted to never ask to translate their user dirs 285 | if can_open_file "$REALHOME/.config/user-dirs.locale"; then 286 | cp -a "$REALHOME/.config/user-dirs.locale" "$XDG_CONFIG_HOME" 287 | md5sum < "$REALHOME/.config/user-dirs.locale" > "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" 288 | elif [ -f "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" ]; then 289 | rm "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" 290 | fi 291 | needs_xdg_reload=true 292 | fi 293 | else 294 | needs_xdg_update=true 295 | needs_xdg_links=true 296 | fi 297 | 298 | if [ $needs_xdg_reload = true ]; then 299 | update_xdg_dirs_values 300 | needs_xdg_reload=false 301 | fi 302 | 303 | # Check if we can actually read the contents of each xdg dir 304 | for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do 305 | if ! can_open_file "${XDG_SPECIAL_DIRS_PATHS[$i]}"; then 306 | needs_xdg_update=true 307 | needs_xdg_links=true 308 | break 309 | fi 310 | done 311 | 312 | # If needs XDG update and xdg-user-dirs-update exists in $PATH, run it 313 | if [ "$needs_xdg_update" = true ] && command -v xdg-user-dirs-update >/dev/null; then 314 | xdg-user-dirs-update 315 | update_xdg_dirs_values 316 | fi 317 | 318 | # Create links for user-dirs.dirs 319 | if [ "$needs_xdg_links" = true ]; then 320 | for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do 321 | b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME" 2>/dev/null)" 322 | if [[ -n "$b" && "$b" != "." && -e "$REALHOME/$b" ]]; then 323 | [ -d "$HOME/$b" ] && rmdir "$HOME/$b" 2> /dev/null 324 | [ ! -e "$HOME/$b" ] && ln -s "$REALHOME/$b" "$HOME/$b" 325 | fi 326 | done 327 | else 328 | # If we aren't creating new links, check if we have content saved in old locations and move it 329 | for ((i = 0; i < ${#XDG_SPECIAL_DIRS[@]}; i++)); do 330 | old="${XDG_SPECIAL_DIRS_INITIAL_PATHS[$i]}" 331 | new="${XDG_SPECIAL_DIRS_PATHS[$i]}" 332 | if [ -L "$old" ] && [ -d "$new" ] && [ "$(readlink "$old" 2>/dev/null)" != "$new" ] && 333 | (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then 334 | mv -vn "$old"/* "$new"/ 2>/dev/null 335 | elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ] && 336 | (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then 337 | mv -vn "$old"/* "$new"/ 2>/dev/null 338 | fi 339 | done 340 | fi 341 | 342 | # If detect wayland server socket, then set environment so applications prefer 343 | # wayland, and setup compat symlink (until we use user mounts. Remember, 344 | # XDG_RUNTIME_DIR is /run/user//snap.$SNAP so look in the parent directory 345 | # for the socket. For details: 346 | # https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186/10 347 | # Applications that don't support wayland natively may define DISABLE_WAYLAND 348 | # (to any non-empty value) to skip that logic entirely. 349 | wayland_available=false 350 | if [[ -n "$XDG_RUNTIME_DIR" && -z "$DISABLE_WAYLAND" ]]; then 351 | wdisplay="wayland-0" 352 | if [ -n "$WAYLAND_DISPLAY" ]; then 353 | wdisplay="$WAYLAND_DISPLAY" 354 | fi 355 | wayland_sockpath="$XDG_RUNTIME_DIR/../$wdisplay" 356 | wayland_snappath="$XDG_RUNTIME_DIR/$wdisplay" 357 | if [ -S "$wayland_sockpath" ]; then 358 | # if running under wayland, use it 359 | #export WAYLAND_DEBUG=1 360 | # shellcheck disable=SC2034 361 | wayland_available=true 362 | # create the compat symlink for now 363 | if [ ! -e "$wayland_snappath" ]; then 364 | ln -s "$wayland_sockpath" "$wayland_snappath" 365 | fi 366 | fi 367 | fi 368 | 369 | # Make PulseAudio socket available inside the snap-specific $XDG_RUNTIME_DIR 370 | if [ -n "$XDG_RUNTIME_DIR" ]; then 371 | pulsenative="pulse/native" 372 | pulseaudio_sockpath="$XDG_RUNTIME_DIR/../$pulsenative" 373 | if [ -S "$pulseaudio_sockpath" ]; then 374 | export PULSE_SERVER="unix:${pulseaudio_sockpath}" 375 | fi 376 | fi 377 | 378 | # GI repository 379 | prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/girepository-1.0" 380 | prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/girepository-1.0" 381 | prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/gjs/girepository-1.0" 382 | prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/$ARCH/girepository-1.0" 383 | prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/girepository-1.0" 384 | prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/gjs/girepository-1.0" 385 | 386 | # Keep an array of data dirs, for looping through them 387 | IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS" 388 | 389 | # Font Config and themes 390 | export FONTCONFIG_PATH="$SNAP_DESKTOP_RUNTIME/etc/fonts" 391 | export FONTCONFIG_FILE="$SNAP_DESKTOP_RUNTIME/etc/fonts/fonts.conf" 392 | 393 | function make_user_fontconfig { 394 | echo "" 395 | if [ -d "$REALHOME/.local/share/fonts" ]; then 396 | echo " $REALHOME/.local/share/fonts" 397 | fi 398 | if [ -d "$REALHOME/.fonts" ]; then 399 | echo " $REALHOME/.fonts" 400 | fi 401 | for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do 402 | if [ -d "${data_dirs_array[$i]}/fonts" ]; then 403 | echo " ${data_dirs_array[$i]}/fonts" 404 | fi 405 | done 406 | # fix font render for modified fonts, that discussed on Snapcraft Forum: 407 | # https://forum.snapcraft.io/t/snap-package-cannot-read-fonts-conf/16657 408 | echo ' /etc/fonts/conf.d' 409 | echo ' conf.d' 410 | # We need to include a user-writable cachedir first to support 411 | # caching of per-user fonts. 412 | echo ' fontconfig' 413 | echo " $SNAP_COMMON/fontconfig" 414 | echo "" 415 | } 416 | 417 | if [ "$needs_update" = true ]; then 418 | rm -rf "$XDG_DATA_HOME"/{fontconfig,fonts,fonts-*,themes,.themes} 419 | 420 | # This fontconfig fragment is installed in a location that is 421 | # included by the system fontconfig configuration: namely the 422 | # etc/fonts/conf.d/50-user.conf file. 423 | ensure_dir_exists "$XDG_CONFIG_HOME/fontconfig" 424 | async_exec make_user_fontconfig > "$XDG_CONFIG_HOME/fontconfig/fonts.conf" 425 | 426 | # the themes symlink are needed for GTK 3.18 when the prefix isn't changed 427 | # GTK 3.20 looks into XDG_DATA_DIRS which has connected themes. 428 | if [ -d "$SNAP/data-dir/themes" ]; then 429 | ln -sf "$SNAP/data-dir/themes" "$XDG_DATA_HOME" 430 | ln -sfn "$SNAP/data-dir/themes" "$SNAP_USER_DATA/.themes" 431 | elif [ -d "$SNAP_DESKTOP_RUNTIME/usr/share/themes" ]; then 432 | ln -sf "$SNAP_DESKTOP_RUNTIME/usr/share/themes" "$XDG_DATA_HOME" 433 | ln -sfn "$SNAP_DESKTOP_RUNTIME/usr/share/themes" "$SNAP_USER_DATA/.themes" 434 | fi 435 | fi 436 | 437 | # Build mime.cache 438 | # needed for gtk and qt icon 439 | if [ "$needs_update" = true ]; then 440 | rm -rf "$XDG_DATA_HOME/mime" 441 | if [ ! -f "$SNAP_DESKTOP_RUNTIME/usr/share/mime/mime.cache" ]; then 442 | if command -v update-mime-database >/dev/null; then 443 | cp --preserve=timestamps -dR "$SNAP_DESKTOP_RUNTIME/usr/share/mime" "$XDG_DATA_HOME" 444 | async_exec update-mime-database "$XDG_DATA_HOME/mime" 445 | fi 446 | fi 447 | fi 448 | 449 | # Gio modules and cache (including gsettings module) 450 | export GIO_MODULE_DIR="$XDG_CACHE_HOME/gio-modules" 451 | function compile_giomodules { 452 | if [ -f "$1/glib-2.0/gio-querymodules" ]; then 453 | rm -rf "$GIO_MODULE_DIR" 454 | ensure_dir_exists "$GIO_MODULE_DIR" 455 | ln -s "$1"/gio/modules/*.so "$GIO_MODULE_DIR" 456 | "$1/glib-2.0/gio-querymodules" "$GIO_MODULE_DIR" 457 | fi 458 | } 459 | if [ "$needs_update" = true ]; then 460 | async_exec compile_giomodules "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH" 461 | fi 462 | 463 | # Setup compiled gsettings schema 464 | GS_SCHEMA_DIR="$XDG_DATA_HOME/glib-2.0/schemas" 465 | function compile_schemas { 466 | if [ -f "$1" ]; then 467 | rm -rf "$GS_SCHEMA_DIR" 468 | ensure_dir_exists "$GS_SCHEMA_DIR" 469 | for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do 470 | schema_dir="${data_dirs_array[$i]}/glib-2.0/schemas" 471 | if [ -f "$schema_dir/gschemas.compiled" ]; then 472 | # This directory already has compiled schemas 473 | continue 474 | fi 475 | if [ -n "$(ls -A "$schema_dir"/*.xml 2>/dev/null)" ]; then 476 | ln -s "$schema_dir"/*.xml "$GS_SCHEMA_DIR" 477 | fi 478 | if [ -n "$(ls -A "$schema_dir"/*.override 2>/dev/null)" ]; then 479 | ln -s "$schema_dir"/*.override "$GS_SCHEMA_DIR" 480 | fi 481 | done 482 | # Only compile schemas if we copied anything 483 | if [ -n "$(ls -A "$GS_SCHEMA_DIR"/*.xml "$GS_SCHEMA_DIR"/*.override 2>/dev/null)" ]; then 484 | "$1" "$GS_SCHEMA_DIR" 485 | fi 486 | fi 487 | } 488 | if [ "$needs_update" = true ]; then 489 | async_exec compile_schemas "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/glib-2.0/glib-compile-schemas" 490 | fi 491 | 492 | # Enable gsettings user changes 493 | # symlink the dconf file if home plug is connected for read 494 | DCONF_DEST_USER_DIR="$SNAP_USER_DATA/.config/dconf" 495 | if [ ! -f "$DCONF_DEST_USER_DIR/user" ]; then 496 | if [ -f "$REALHOME/.config/dconf/user" ]; then 497 | ensure_dir_exists "$DCONF_DEST_USER_DIR" 498 | ln -s "$REALHOME/.config/dconf/user" "$DCONF_DEST_USER_DIR" 499 | fi 500 | fi 501 | # symlink the runtime dconf file as well 502 | if [ -r "$XDG_RUNTIME_DIR/../dconf/user" ]; then 503 | ensure_dir_exists "$XDG_RUNTIME_DIR/dconf" 504 | ln -sf "../../dconf/user" "$XDG_RUNTIME_DIR/dconf/user" 505 | fi 506 | 507 | # Testability support 508 | append_dir LD_LIBRARY_PATH "$SNAP/testability" 509 | append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH" 510 | append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH/mesa" 511 | 512 | # Gdk-pixbuf loaders 513 | export GDK_PIXBUF_MODULE_FILE="$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache" 514 | export GDK_PIXBUF_MODULEDIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders" 515 | if [ "$needs_update" = true ] || [ ! -f "$GDK_PIXBUF_MODULE_FILE" ]; then 516 | rm -f "$GDK_PIXBUF_MODULE_FILE" 517 | if [ -f "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then 518 | async_exec "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE" 519 | fi 520 | fi 521 | 522 | # Icon themes cache 523 | if [ "$needs_update" = true ]; then 524 | rm -rf "$XDG_DATA_HOME/icons" 525 | ensure_dir_exists "$XDG_DATA_HOME/icons" 526 | for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do 527 | # The runtime and theme content snaps should already contain icon caches 528 | # so we skip them to optimise app start time. 529 | if [[ "${data_dirs_array[$i]}" == "$SNAP/data-dir" || "${data_dirs_array[$i]}" == "$SNAP_DESKTOP_RUNTIME/"* ]]; then 530 | continue 531 | fi 532 | for theme in "${data_dirs_array[$i]}"/icons/*; do 533 | if [ -f "$theme/index.theme" ] && [ ! -f "$theme/icon-theme.cache" ]; then 534 | theme_dir="$XDG_DATA_HOME/icons/$(basename "$theme")" 535 | if [ ! -d "$theme_dir" ]; then 536 | ensure_dir_exists "$theme_dir" 537 | ln -s "$theme"/* "$theme_dir" 538 | if [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" ]; then 539 | async_exec "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" "$theme_dir" 540 | elif [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" ]; then 541 | async_exec "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" "$theme_dir" 542 | fi 543 | fi 544 | fi 545 | done 546 | done 547 | fi 548 | 549 | # GTK theme and behavior modifier 550 | # Those can impact the theme engine used by Qt as well 551 | gtk_configs=(gtk-3.0/settings.ini gtk-3.0/bookmarks gtk-2.0/gtkfilechooser.ini) 552 | for f in "${gtk_configs[@]}"; do 553 | dest="$XDG_CONFIG_HOME/$f" 554 | if [ ! -L "$dest" ]; then 555 | ensure_dir_exists "$(dirname "$dest")" 556 | ln -s "$REALHOME/.config/$f" "$dest" 557 | fi 558 | done 559 | 560 | # create symbolic link to ibus socket path for ibus to look up its socket files 561 | # (see comments #3 and #6 on https://launchpad.net/bugs/1580463) 562 | IBUS_CONFIG_PATH="$XDG_CONFIG_HOME/ibus" 563 | ensure_dir_exists "$IBUS_CONFIG_PATH" 564 | [ -d "$IBUS_CONFIG_PATH/bus" ] && rm -rf "$IBUS_CONFIG_PATH/bus" 565 | ln -sfn "$REALHOME/.config/ibus/bus" "$IBUS_CONFIG_PATH" 566 | ################################### 567 | # KDE NEON launcher specific part # 568 | ################################### 569 | 570 | # Add paths for games 571 | append_dir PATH "$SNAP/usr/games" 572 | append_dir PATH "$SNAP_DESKTOP_RUNTIME/usr/games" 573 | 574 | # Qt Libs 575 | prepend_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/qt5/libs" 576 | 577 | # Add QT_PLUGIN_PATH (Qt Modules). 578 | append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH/qt5/plugins" 579 | append_dir QT_PLUGIN_PATH "$SNAP/usr/lib/$ARCH" 580 | append_dir QT_PLUGIN_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/qt5/plugins" 581 | append_dir QT_PLUGIN_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/" 582 | # And QML2_IMPORT_PATH (Qt Modules). 583 | append_dir QML2_IMPORT_PATH "$SNAP/usr/lib/$ARCH/qt5/qml" 584 | append_dir QML2_IMPORT_PATH "$SNAP/lib/$ARCH" 585 | append_dir QML2_IMPORT_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/qt5/qml" 586 | append_dir QML2_IMPORT_PATH "$SNAP_DESKTOP_RUNTIME/lib/$ARCH" 587 | 588 | # Fix locating the QtWebEngineProcess executable 589 | export QTWEBENGINEPROCESS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/qt5/libexec/QtWebEngineProcess" 590 | 591 | # Removes Qt warning: Could not find a location 592 | # of the system Compose files 593 | export QTCOMPOSE="$SNAP_DESKTOP_RUNTIME/usr/share/X11/locale" 594 | export QT_XKB_CONFIG_ROOT="/usr/share/X11/xkb" 595 | 596 | # KIO specific 597 | # Directly fork slaves. 598 | export KDE_FORK_SLAVES=1 599 | # Path to KIO slaves. 600 | export KF5_LIBEXEC_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libexec/kf5" 601 | 602 | # Add path to VLC plugins 603 | export VLC_PLUGIN_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/x86_64-linux-gnu/vlc/plugins" 604 | 605 | # Ensure QtChooser behaves. 606 | export QTCHOOSER_NO_GLOBAL_DIR=1 607 | export QT_SELECT=5 608 | # qtchooser hardcodes reference paths, we'll need to rewrite them properly 609 | ensure_dir_exists "$XDG_CONFIG_HOME/qtchooser" 610 | echo "$SNAP/usr/lib/qt5/bin" > "$XDG_CONFIG_HOME/qtchooser/5.conf" 611 | echo "$SNAP/usr/lib/$ARCH" >> "$XDG_CONFIG_HOME/qtchooser/5.conf" 612 | echo "$SNAP/usr/lib/qt5/bin" > "$XDG_CONFIG_HOME/qtchooser/default.conf" 613 | echo "$SNAP/usr/lib/$ARCH" >> "$XDG_CONFIG_HOME/qtchooser/default.conf" 614 | 615 | # This relies on qtbase patch 616 | # 0001-let-qlibraryinfo-fall-back-to-locate-qt.conf-via-XDG.patch 617 | # to make QLibraryInfo look in XDG_* locations for qt.conf. The paths configured 618 | # here are applied to everything that uses QLibraryInfo as final fallback and 619 | # has no XDG_* fallback before that. Currently the most interesting offender 620 | # is QtWebEngine which will not work unless the Data path is correctly set. 621 | cat << EOF > "$XDG_CONFIG_HOME/qt.conf" 622 | [Paths] 623 | Data = $SNAP_DESKTOP_RUNTIME/usr/share/qt5/ 624 | Translations = $SNAP_DESKTOP_RUNTIME/usr/share/qt5/translations 625 | EOF 626 | 627 | if [ -e "$SNAP_DESKTOP_RUNTIME/usr/share/i18n" ]; then 628 | export I18NPATH="$SNAP_DESKTOP_RUNTIME/usr/share/i18n" 629 | locpath="$XDG_DATA_HOME/locale" 630 | ensure_dir_exists "$locpath" 631 | export LOCPATH="$locpath:/usr/lib/locale" 632 | LC_ALL=C.UTF-8 async_exec "$SNAP/snap/command-chain/locale-gen" 633 | fi 634 | ############################### 635 | # Mark update and exec binary # 636 | ############################### 637 | 638 | # shellcheck disable=SC2154 639 | [ "$needs_update" = true ] && echo "SNAP_DESKTOP_LAST_REVISION=$SNAP_REVISION" > "$SNAP_USER_DATA/.last_revision" 640 | 641 | wait_for_async_execs 642 | 643 | if [ -n "$SNAP_DESKTOP_DEBUG" ]; then 644 | echo "desktop-launch elapsed time: $(date +%s.%N --date="$START seconds ago")" 645 | echo "Now running: exec $*" 646 | fi 647 | 648 | exec "$@" 649 | -------------------------------------------------------------------------------- /snap_launcher/bin/formatlab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rishabh3354/FORMAT_LAB/fba29d2b3e452abe203a042f6bf3a384698fdbd9/snap_launcher/bin/formatlab -------------------------------------------------------------------------------- /snap_launcher/formatlab.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Version=1.0 3 | GenericName=formatlab 4 | Name=FORMAT LAB 5 | Type=Application 6 | Icon=formatlab.png 7 | Keywords=video converter;audio converter; mp4 converter;mp3 converter;videotomp3 converter; 8 | Exec=formatlab %F 9 | Categories=Utility;Qt; 10 | Terminal=false 11 | Name[en_US]=FORMAT LAB --------------------------------------------------------------------------------