From 2c80444be39f99b41025916aa5b487105ba5b0c9 Mon Sep 17 00:00:00 2001 From: Pavel Zolotarevskiy Date: Sat, 3 Feb 2024 16:35:50 +0300 Subject: [PATCH] Add a bunch of apps (#352) * add tuist (#272) * add cocoapods (#270) * add swiftpm (#269) * add missing newline to tuist.json * add ash (#283) * add help for expo * set correct android env vars (#32, #342) * add scriptkit (#297) * update xdg-utils message (#300) * fix ipython error in pythonrc (#289) * zsh directories need to be created manually (#341) * add instructions for dotnet (#349) * simplify emacs instructions (#315) * ash: directory must be created manually * add instructions for tldrc (#295) * add a warning for xinitrc and Xauthority (#274) --- programs/android.json | 7 ++++++- programs/ash.json | 10 ++++++++++ programs/cocoapods.json | 10 ++++++++++ programs/dotnet.json | 6 +++--- programs/emacs.json | 9 ++------- programs/expo.json | 4 ++-- programs/python.json | 2 +- programs/scriptkit.json | 20 ++++++++++++++++++++ programs/swift-package-manager.json | 10 ++++++++++ programs/tldr.json | 7 ++++++- programs/tuist.json | 10 ++++++++++ programs/xdg-utils.json | 5 ++--- programs/xinit.json | 2 +- programs/xorg-xauth.json | 2 +- programs/zsh.json | 10 +++++----- 15 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 programs/ash.json create mode 100644 programs/cocoapods.json create mode 100644 programs/scriptkit.json create mode 100644 programs/swift-package-manager.json create mode 100644 programs/tuist.json diff --git a/programs/android.json b/programs/android.json index 4d3273e9..e48874af 100644 --- a/programs/android.json +++ b/programs/android.json @@ -1,9 +1,14 @@ { "files": [ { - "help": "Export the following environment variable:\n\n```bash\nexport ANDROID_HOME=\"$XDG_DATA_HOME\"/android\n```\n\nAdditionally, if you use adb, use the following alias:\n\n```bash\nalias adb='HOME=\"$XDG_DATA_HOME\"/android adb'\n```\n\n", + "help": "Export the following environment variable:\n\n```bash\nexport ANDROID_USER_HOME=\"$XDG_DATA_HOME\"/android\n```\n\nAdditionally, if you use adb, use the following alias:\n\n```bash\nalias adb='HOME=\"$XDG_DATA_HOME\"/android adb'\n```\n\n", "movable": true, "path": "$HOME/.android" + }, + { + "path": "$HOME/Android", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport ANDROID_HOME=\"$XDG_DATA_HOME\"/android/sdk\n```\n" } ], "name": "android" diff --git a/programs/ash.json b/programs/ash.json new file mode 100644 index 00000000..f8669b20 --- /dev/null +++ b/programs/ash.json @@ -0,0 +1,10 @@ +{ + "name": "ash", + "files": [ + { + "path": "$HOME/.ash_history", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/ash/history\n```\n\nYou must manually create the _$XDG_STATE_HOME/ash directory if it doesn't exist yet.\n" + } + ] +} diff --git a/programs/cocoapods.json b/programs/cocoapods.json new file mode 100644 index 00000000..c970376d --- /dev/null +++ b/programs/cocoapods.json @@ -0,0 +1,10 @@ +{ + "name": "CocoaPods", + "files": [ + { + "path": "$HOME/.cocoapods", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport CP_HOME_DIR=\"$XDG_DATA_HOME\"/cocoapods\n```\n" + } + ] +} diff --git a/programs/dotnet.json b/programs/dotnet.json index 9737cb2b..61f04c30 100644 --- a/programs/dotnet.json +++ b/programs/dotnet.json @@ -2,8 +2,8 @@ "files": [ { "path": "$HOME/.dotnet", - "movable": false, - "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/dotnet/sdk/issues/8678\n" + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport DOTNET_CLI_HOME=\"$XDG_DATA_HOME\"/dotnet\n```\n" }, { "path": "$HOME/.net", @@ -12,4 +12,4 @@ } ], "name": "dotnet" -} \ No newline at end of file +} diff --git a/programs/emacs.json b/programs/emacs.json index 566e6656..6bdb6d48 100644 --- a/programs/emacs.json +++ b/programs/emacs.json @@ -1,17 +1,12 @@ { "files": [ { - "help": "Supported since _27.1_.\n\nYou can move the file to _$XDG_CONFIG_HOME/emacs/init.el_.\n", + "help": "Supported since _27.1_.\n\nYou can move the directory to _$XDG_CONFIG_HOME/emacs_.\n", "movable": true, - "path": "$HOME/.emacs.d/init.el" - }, - { - "help": "Currently unsupported.\n\n_Relevant issue:_ \"Legacy paths have precedence over XDG paths. Emacs will never create XDG_CONFIG_HOME/emacs/.\" according to XDG.\n\n", - "movable": false, "path": "$HOME/.emacs.d" }, { - "help": "Looks to be supported natively. However, according to XDG \"Legacy paths have precedence over XDG paths. Emacs will never create _$XDG_CONFIG_HOME/emacs/_\".\nMove at your own risk.\n\nYou can move the file to _$XDG_CONFIG_HOME/emacs_.\n", + "help": "Supported since _27.1_.\n\nYou can move the file to _$XDG_CONFIG_HOME/emacs/init.el_.\n", "movable": true, "path": "$HOME/.emacs" } diff --git a/programs/expo.json b/programs/expo.json index 3f0e70b0..a50490a4 100644 --- a/programs/expo.json +++ b/programs/expo.json @@ -3,8 +3,8 @@ { "path": "$HOME/.expo", "movable": false, - "help": "" + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/expo/expo/discussions/18448\n" } ], "name": "expo" -} \ No newline at end of file +} diff --git a/programs/python.json b/programs/python.json index c9884bcc..3aa547e7 100644 --- a/programs/python.json +++ b/programs/python.json @@ -3,7 +3,7 @@ { "path": "$HOME/.python_history", "movable": true, - "help": "Export the following environment variables:\n\n```bash\nexport PYTHONSTARTUP=\"/etc/python/pythonrc\"\n```\n\nNow create the file _/etc/python/pythonrc_, and put the following code into it:\n\n```python\nimport os\nimport atexit\nimport readline\nfrom pathlib import Path\n\nif readline.get_current_history_length() == 0:\n\n state_home = os.environ.get(\"XDG_STATE_HOME\")\n if state_home is None:\n state_home = Path.home() / \".local\" / \"state\"\n else:\n state_home = Path(state_home)\n\n history_path = state_home / \"python_history\"\n if history_path.is_dir():\n raise OSError(f\"'{history_path}' cannot be a directory\")\n\n history = str(history_path)\n\n try:\n readline.read_history_file(history)\n except OSError: # Non existent\n pass\n\n def write_history():\n try:\n readline.write_history_file(history)\n except OSError:\n pass\n\n atexit.register(write_history)\n```\n\n_Note: This won't work if python is invoked with -i flag._\n\n_Credit:_ https://unix.stackexchange.com/questions/630642/change-location-of-python-history" + "help": "Export the following environment variables:\n\n```bash\nexport PYTHONSTARTUP=\"$HOME\"/python/pythonrc\n```\n\nNow create the file _~/python/pythonrc_, and put the following code into it:\n\n```python\ndef is_vanilla() -> bool:\n import sys\n return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]\n\n\ndef setup_history():\n import os\n import atexit\n import readline\n from pathlib import Path\n\n if state_home := os.environ.get('XDG_STATE_HOME'):\n state_home = Path(state_home)\n else:\n state_home = Path.home() / '.local' / 'state'\n\n history: Path = state_home / 'python_history'\n\n readline.read_history_file(str(history))\n atexit.register(readline.write_history_file, str(history))\n\n\nif is_vanilla():\n setup_history()\n```\n\nFinally, create an empty file at _$XDG_STATE_HOME/python_history_\n\n_Note: This won't work if python is invoked with -i flag._\n\n_Credit:_ https://github.com/b3nj5m1n/xdg-ninja/issues/289#issuecomment-1666024202" } ], "name": "python" diff --git a/programs/scriptkit.json b/programs/scriptkit.json new file mode 100644 index 00000000..5a075474 --- /dev/null +++ b/programs/scriptkit.json @@ -0,0 +1,20 @@ +{ + "name": "scriptkit", + "files": [ + { + "path": "$HOME/.kit", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport KIT=\"$XDG_DATA_HOME\"/scriptkit/kit\n```\n" + }, + { + "path": "$HOME/.kenv", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport KIT_DOTENV_PATH=\"$XDG_DATA_HOME\"/scriptkit/env\n```\n" + }, + { + "path": "$HOME/knode", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport KNODE=\"$XDG_DATA_HOME\"/scriptkit/node\n```\n" + } + ] +} diff --git a/programs/swift-package-manager.json b/programs/swift-package-manager.json new file mode 100644 index 00000000..d93447a6 --- /dev/null +++ b/programs/swift-package-manager.json @@ -0,0 +1,10 @@ +{ + "name": "Swift Package Manager", + "files": [ + { + "path": "$HOME/.swiftpm", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/apple/swift-package-manager/issues/6204\n" + } + ] +} diff --git a/programs/tldr.json b/programs/tldr.json index 3f7a3f65..da071199 100644 --- a/programs/tldr.json +++ b/programs/tldr.json @@ -1,10 +1,15 @@ { "name": "tldr", "files": [ + { + "path": "$HOME/.tldr", + "movable": true, + "help": "Tldr has multiple official clients, so the instructions depend on your installation method.\n\nIf you're using the C client, export the following environment variable:\n\n```bash\nexport TLDR_CACHE_DIR=\"$XDG_CACHE_HOME\"/tldr\n```\n\nThe Python client and tlrc (Rust client) use the correct XDG directory out of the box.\n\n**There is currently no way to use an XDG directory in the Node.js client.**\n" + }, { "path": "$HOME/.tldrc", "movable": true, - "help": "Currently tldr-pages do not have any specification for clients on where to cache tldr-pages. See the relevant [issue](https://github.com/tldr-pages/tldr/issues/876) and [specification](https://github.com/tldr-pages/tldr/blob/main/CLIENT-SPECIFICATION.md)\n\nOfficial tldr-nodejs-client, tldr-python-client or tldr-c-client do not support XDG Base Directories.\n\n**Use [Tealdeer](https://github.com/dbrgn/tealdeer), a rust client for tldr that supports XDG Base Directories instead.**\n" + "help": "Tldr has multiple official clients, so the instructions depend on your installation method.\n\nIf you're using the C client, export the following environment variable:\n\n```bash\nexport TLDR_CACHE_DIR=\"$XDG_CACHE_HOME\"/tldr\n```\n\nThe Python client and tlrc (Rust client) use the correct XDG directory out of the box.\n\n**There is currently no way to use an XDG directory in the Node.js client.**\n" } ] } diff --git a/programs/tuist.json b/programs/tuist.json new file mode 100644 index 00000000..a9275a2b --- /dev/null +++ b/programs/tuist.json @@ -0,0 +1,10 @@ +{ + "name": "tuist", + "files": [ + { + "path": "$HOME/.tuist", + "movable": false, + "help": "Currently unsupported.\n\nSupport for XDG Specification is planned in Tuist v4:\nhttps://github.com/tuist/tuist/pull/5791#discussion_r1451466334\n" + } + ] +} diff --git a/programs/xdg-utils.json b/programs/xdg-utils.json index ae162c70..914fd5d2 100644 --- a/programs/xdg-utils.json +++ b/programs/xdg-utils.json @@ -3,9 +3,8 @@ "files": [ { "path": "$HOME/.gnome", - "movable": false, - "help": "For some reason the script xdg-desktop-menu hard-codes gnome_user_dir=\"$HOME/.gnome/apps\". This is used by chromium among others. Bug discussion has moved to gitlab and PR with fix exists, however it is not merged yet.\n\n_Relevant Issues:_ https://gitlab.freedesktop.org/xdg/xdg-utils/-/issues/81\n\n_Merge Request:_ https://gitlab.freedesktop.org/xdg/xdg-utils/-/merge_requests/22\n" - + "movable": true, + "help": "This directory is created by old versions of `xdg-utils` and is no longer needed since GNOME 2.10. It can simply be deleted." } ] } diff --git a/programs/xinit.json b/programs/xinit.json index fd0cf681..07660761 100644 --- a/programs/xinit.json +++ b/programs/xinit.json @@ -6,7 +6,7 @@ "path": "$HOME/.xserverrc" }, { - "help": "Export the following environment variable:\n\n```bash\nexport XINITRC=\"$XDG_CONFIG_HOME\"/X11/xinitrc\n```\n", + "help": "Export the following environment variable:\n\n```bash\nexport XINITRC=\"$XDG_CONFIG_HOME\"/X11/xinitrc\n```\n\n**WARNING: Moving this file can potentially lead to not being able to start your X11 session or some programs (eg. Wine) not working as intended.**\n", "movable": true, "path": "$HOME/.xinitrc" } diff --git a/programs/xorg-xauth.json b/programs/xorg-xauth.json index 6d0856ae..584bc481 100644 --- a/programs/xorg-xauth.json +++ b/programs/xorg-xauth.json @@ -3,7 +3,7 @@ { "path": "$HOME/.Xauthority", "movable": true, - "help": "Export the following environment variables:\n\n```bash\nexport XAUTHORITY=\"$XDG_RUNTIME_DIR\"/Xauthority\n```\n\n- **LightDM does not allow you to do this.** See [here](https://askubuntu.com/a/961459) for workaround.\n- SLiM has _~/.Xauthority_ hardcoded\n\n- SDDM uses its own config to set XAUTHORITY variable. **Do not set it manually.**\nExample `/etc/sddm.conf.d/xorg_settings.conf`:\n```ini\n[X11]\nUserAuthFile=.local/share/sddm/Xauthority\n```\n_Note: this might not work as expected, so be careful._\n" + "help": "Export the following environment variables:\n\n```bash\nexport XAUTHORITY=\"$XDG_RUNTIME_DIR\"/Xauthority\n```\n\n- **LightDM does not allow you to do this.** See [here](https://askubuntu.com/a/961459) for workaround.\n- SLiM has _~/.Xauthority_ hardcoded\n\n- SDDM uses its own config to set XAUTHORITY variable. **Do not set it manually.**\nExample `/etc/sddm.conf.d/xorg_settings.conf`:\n```ini\n[X11]\nUserAuthFile=.local/share/sddm/Xauthority\n```\n**WARNING: Moving this file can potentially lead to not being able to start your X11 session or some programs (eg. Wine) not working as intended.**\n" } ], "name": "xorg-xauth" diff --git a/programs/zsh.json b/programs/zsh.json index b908485a..24d2fd73 100644 --- a/programs/zsh.json +++ b/programs/zsh.json @@ -1,27 +1,27 @@ { "files": [ { - "help": "Set this in your zshrc:\n\n```bash\nzstyle ':completion:*' cache-path \"$XDG_CACHE_HOME\"/zsh/zcompcache\n```\n", + "help": "Set this in your zshrc:\n\n```bash\nzstyle ':completion:*' cache-path \"$XDG_CACHE_HOME\"/zsh/zcompcache\n```\n\nYou must manually create the _$XDG_CACHE_HOME/zsh_ directory if it doesn't exist yet.\n", "movable": true, "path": "$HOME/.zcompcache" }, { - "help": "Set this in your zshrc:\n\n```bash\ncompinit -d \"$XDG_CACHE_HOME\"/zsh/zcompdump-\"$ZSH_VERSION\"\n```\n", + "help": "Set this in your zshrc:\n\n```bash\ncompinit -d \"$XDG_CACHE_HOME\"/zsh/zcompdump-\"$ZSH_VERSION\"\n```\n\nYou must manually create the _$XDG_CACHE_HOME/zsh_ directory if it doesn't exist yet.\n", "movable": true, "path": "$HOME/.zcompdump*" }, { - "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n", + "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n\nYou must manually create the _$XDG_STATE_HOME/zsh_ directory if it doesn't exist yet.\n", "movable": true, "path": "$HOME/.zhistory" }, { - "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n", + "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n\nYou must manually create the _$XDG_STATE_HOME/zsh_ directory if it doesn't exist yet.\n", "movable": true, "path": "$HOME/.histfile" }, { - "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n", + "help": "Set this in your zshrc:\n\n```bash\nexport HISTFILE=\"$XDG_STATE_HOME\"/zsh/history\n```\n\nYou must manually create the _$XDG_STATE_HOME/zsh_ directory if it doesn't exist yet.\n", "movable": true, "path": "$HOME/.zsh_history" },