From 558fddda206d3ab2d05862dab3476f9e7bb5572a Mon Sep 17 00:00:00 2001 From: VHSgunzo Date: Tue, 19 Nov 2024 23:35:17 +0300 Subject: [PATCH] Add GIO_MODULE_DIR env var Update README --- Cargo.toml | 2 +- README.md | 25 +++++++++++++++++++++++++ src/main.rs | 6 ++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c7d7e3f..53d5cec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sharun" -version = "0.1.7" +version = "0.1.8" readme = "README.md" license = "MIT" repository = "https://github.com/VHSgunzo/sharun" diff --git a/README.md b/README.md index 3f924ba..74e3274 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,31 @@ cp ./target/$(uname -m)-unknown-linux-musl/release/sharun . # Screenshots: ![tree](img/tree.png) +Environment variables that are set if sharun finds a directory or file: +* `PATH` -- `${SHARUN_DIR}/bin` +* `PYTHONHOME` and `PYTHONDONTWRITEBYTECODE` -- `${SHARUN_DIR}/shared/$LIB/python*` +* `PERLLIB` -- `${SHARUN_DIR}/shared/$LIB/perl*` +* `GCONV_PATH` -- `${SHARUN_DIR}/shared/$LIB/gconv` +* `GIO_MODULE_DIR` -- `${SHARUN_DIR}/shared/$LIB/gio/modules` +* `GTK_PATH`, `GTK_EXE_PREFIX` and `GTK_DATA_PREFIX` -- `${SHARUN_DIR}/shared/$LIB/gtk-*` +* `QT_PLUGIN_PATH` -- `${SHARUN_DIR}/shared/$LIB/qt*/plugins` +* `BABL_PATH` -- `${SHARUN_DIR}/shared/$LIB/babl-*` +* `GEGL_PATH` -- `${SHARUN_DIR}/shared/$LIB/gegl-*` +* `GIMP2_PLUGINDIR` -- `${SHARUN_DIR}/shared/$LIB/gimp/2.0` +* `TCL_LIBRARY` -- `${SHARUN_DIR}/shared/$LIB/tcl*` +* `TK_LIBRARY` -- `${SHARUN_DIR}/shared/$LIB/tk*` +* `GST_PLUGIN_PATH`, `GST_PLUGIN_SYSTEM_PATH`, `GST_PLUGIN_SYSTEM_PATH_1_0`, and `GST_PLUGIN_SCANNER` -- `${SHARUN_DIR}/shared/$LIB/gstreamer-*` +* `GDK_PIXBUF_MODULEDIR` and `GDK_PIXBUF_MODULE_FILE` -- `${SHARUN_DIR}/shared/$LIB/gdk-pixbuf-*` + +* `XDG_DATA_DIRS` -- `${SHARUN_DIR}/share` +* `VK_DRIVER_FILES` -- `${SHARUN_DIR}/share/vulkan/icd.d` +* `XKB_CONFIG_ROOT` -- `${SHARUN_DIR}/share/X11/xkb` +* `GSETTINGS_SCHEMA_DIR` -- `${SHARUN_DIR}/share/glib-2.0/schemas` +* `GIMP2_DATADIR` -- `${SHARUN_DIR}/share/gimp/2.0` + +* `FONTCONFIG_FILE` -- `${SHARUN_DIR}/etc/fonts/fonts.conf` +* `GIMP2_SYSCONFDIR` -- `${SHARUN_DIR}/etc/gimp/2.0` + # Projects that use sharun: * [pelfCreator](https://github.com/xplshn/pelf/blob/pelf-ng/pelfCreator) * [AppBundleHUB](https://github.com/xplshn/AppBundleHUB) diff --git a/src/main.rs b/src/main.rs index f3c846a..18ca661 100644 --- a/src/main.rs +++ b/src/main.rs @@ -398,6 +398,12 @@ fn main() { if dir == "gconv" { add_to_env("GCONV_PATH", dir_path) } + if dir == "gio" { + let modules = &format!("{dir_path}/modules"); + if Path::new(modules).exists() { + env::set_var("GIO_MODULE_DIR", modules) + } + } if dir.starts_with("gtk-") { add_to_env("GTK_PATH", dir_path); env::set_var("GTK_EXE_PREFIX", &sharun_dir);