From b4cf4ccd476b3ea87a58252bff09ecbc73a7aa19 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 7 May 2024 15:18:07 +0100 Subject: [PATCH 01/16] Add PokeMMO (#401) --- programs/pokemmo.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 programs/pokemmo.json diff --git a/programs/pokemmo.json b/programs/pokemmo.json new file mode 100644 index 0000000..db65654 --- /dev/null +++ b/programs/pokemmo.json @@ -0,0 +1,11 @@ +{ + "name": "pokemmo", + "files": [ + { + "path": "$HOME/.pokemmo", + "movable": true, + "help": "Supported by default, you can move this directory to _$XDG_DATA_HOME/pokemmo_.\n" + } + ] +} + -- 2.47.3 From 9c42dbc24f3a84531bef1269c2dbbe8c903b04dd Mon Sep 17 00:00:00 2001 From: KaBanks <20971850+KaBankz@users.noreply.github.com> Date: Wed, 8 May 2024 13:15:24 -0400 Subject: [PATCH 02/16] Add login entry (#405) * feat: add login entry * chore: add more info and clear up verbage --- programs/login.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/login.json diff --git a/programs/login.json b/programs/login.json new file mode 100644 index 0000000..bfc265b --- /dev/null +++ b/programs/login.json @@ -0,0 +1,10 @@ +{ + "name": "login", + "files": [ + { + "path": "$HOME/.hushlogin", + "movable": true, + "help": "This is an optional file that surpresses the shell login message\n\nYou can safely remove this file if you do not want to silence your shell startup\n\nSome systems support moving this file to _/etc/hushlogins_\n\nRun `man login` for documentation" + } + ] +} -- 2.47.3 From dddae21ddb63af3eb0326e092a5c60b4d1e2a4dc Mon Sep 17 00:00:00 2001 From: KaBanks <20971850+KaBankz@users.noreply.github.com> Date: Wed, 8 May 2024 13:19:21 -0400 Subject: [PATCH 03/16] Add warp terminal entry (#404) --- programs/warp.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/warp.json diff --git a/programs/warp.json b/programs/warp.json new file mode 100644 index 0000000..b2a1bdf --- /dev/null +++ b/programs/warp.json @@ -0,0 +1,10 @@ +{ + "name": "warp", + "files": [ + { + "path": "$HOME/.warp", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/warpdotdev/Warp/issues/814\n" + } + ] +} -- 2.47.3 From 9e9350a70356c2d681d6e303d4831fcdd3227445 Mon Sep 17 00:00:00 2001 From: KaBanks <20971850+KaBankz@users.noreply.github.com> Date: Thu, 9 May 2024 17:24:42 -0400 Subject: [PATCH 04/16] Update and reformat `README` (#400) * fix: update `brew` install docs * chore: fix formatting and spelling * feat!: reformat everything and change verbage The entire README has been reformatted following the guidelines of `markdownlint` The verbage has been changed to be more clear and concise. The information has not been changed * chore: move manual install instructions to top Also add the commands to do so. * feat: add repology link for other package managers * fix: accidentally replaced italics with codeblock * chore: move `Avaliable Commands` section back up Also add documentation on how to download from releases --- README.md | 141 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 102 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index 9af8c77..c2f6efd 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,106 @@ -
-

xdg-ninja

-
Because you wouldn't let just anyone into your $HOME
+ + + +
+

xdg-ninja

+

+ Because you wouldn't let just anyone into your $HOME +

-A shell script which checks your _$HOME_ for unwanted files and directories. +A shell script that checks your `$HOME` for unwanted files and directories.

- + xdg-ninja command output

-When it encounters a file it knows about, it will tell you whether it's possible to move this file to an appropriate location, and how to do it. +When `xdg-ninja` encounters a file or directory it knows about, it will tell you whether it's possible to move it to the appropriate location, and how to do it. -The configurations are from the [arch wiki page on XDG_BASE_DIR](https://wiki.archlinux.org/title/XDG_Base_Directory), [antidot](https://github.com/doron-cohen/antidot) (thanks to Scr0nch for writing a conversion tool), and contributed by other users. +The configurations are from the [arch wiki page on XDG_BASE_DIR](https://wiki.archlinux.org/title/XDG_Base_Directory), [antidot](https://github.com/doron-cohen/antidot) (thanks to Scr0nch for writing a conversion tool), and crowdsourced by other users. -## Running +## Installing -### Using nix +### Manual Installation + +Clone the repository, then run the [`./xdg-ninja.sh`](./xdg-ninja.sh) script. + +```sh +git clone https://github.com/b3nj5m1n/xdg-ninja +cd xdg-ninja +./xdg-ninja.sh +``` + +This will run every test in the default configuration. + +### [Nix](https://nixos.org) + +Turn on [flakes](https://nixos.wiki/wiki/Flakes), then run the following command: -If you're using [nix](https://nixos.org) and have flakes turned on, you can just run the following command: ```sh nix run github:b3nj5m1n/xdg-ninja ``` -### Cloning Manually +### [Homebrew](https://brew.sh) -Clone the repository somewhere, then run the _./xdg-ninja.sh_ script. +> [!NOTE] +> Due to how `xdg-ninja` is developed, releases are not cut, so Homebrew ships a stale version, therefore you have to install and upgrade `xdg-ninja` from the git HEAD. ref: [#204](https://github.com/b3nj5m1n/xdg-ninja/issues/204) +> +> Homebrew will not upgrade `xdg-ninja` when running a generic `brew upgrade`, you must specifically upgrade `xdg-ninja` from the git HEAD, _see below_ -This will run every test in the default configuration. +Install: + +```sh +brew install xdg-ninja --HEAD +``` + +Upgrade: + +```sh +brew upgrade xdg-ninja --fetch-HEAD +``` + +### Other Package Managers + +`xdg-ninja` is avaliable in many other package managers. -### Installing with Homebrew +The full list is available on the [repology page](https://repology.org/project/xdg-ninja/versions). -To install xdg-ninja with [Homebrew](https://brew.sh), run `brew install xdg-ninja` to install the script and all of its dependencies, then run the `xdg-ninja` command. +Follow the instructions for your package manager to install `xdg-ninja`. -## Dependencies +## Contributing -- your favorite POSIX-compliant shell ([bash](https://repology.org/project/bash/packages), [zsh](https://repology.org/project/zsh/packages), [dash](https://repology.org/project/dash-shell/packages), ...) +### Dependencies + +- Your favorite POSIX-compliant shell ([bash](https://repology.org/project/bash/packages), [zsh](https://repology.org/project/zsh/packages), [dash](https://repology.org/project/dash-shell/packages), etc.) - [jq](https://repology.org/project/jq/packages) for parsing the json files - [find](https://repology.org/project/findutils/versions) -### Optional +#### Optional -- [glow](https://repology.org/project/glow/packages) for rendering Markdown in the terminal ([bat](https://repology.org/project/bat-cat/packages), [pygmentize](https://repology.org/project/pygments/versions) or [highlight](https://repology.org/project/highlight/packages) can be used as fallback, but glow's output is clearer and therefore glow is recommended) +- [glow](https://repology.org/project/glow/packages) for rendering Markdown in the terminal ([bat](https://repology.org/project/bat-cat/packages), [pygmentize](https://repology.org/project/pygments/versions) or [highlight](https://repology.org/project/highlight/packages) can be used as a fallback, but glow's output is clearer therefore glow is recommended) -## Configuration +### Configuration -The configuration is done in the _programs/_ directory, which should be located in the same working directory as the xdg-ninja.sh script. This can be overriden with the `XN_PROGRAMS_DIR` environment variable. +The configuration is done in the [`./programs/`](./programs/) directory, which should be located in the same working directory as the [`xdg-ninja.sh`](./xdg-ninja.sh) script. This can be overridden with the `XN_PROGRAMS_DIR` environment variable. -You define a program, and then a list of files and directories which this program ruthlessly puts into your _$HOME_ directory. +You define a program, and then a list of files and directories which that program ruthlessly puts into your `$HOME` directory. For each file/directory, you specify if it can be (re)moved. If this is the case, you also specify instructions on how to accomplish this in Markdown. -Files in this directory can have any name, but using the name of the program is encouraged. +Files in this directory can have any name, but using the name of the program is recommended. ### Automatically Generating Configuration -You can download the _xdgnj_ executable from the releases page. Alternatively, you can use the nix flake or build it from scratch using _cabal_, _stack_, or the provided docker image in _build/_. (To be clear, this is just a tool that will help you automatically generate the config files, you still only need your shell to run the tests) +For x86_64 Linux systems, you can download the `xdgnj` binary from the [releases page](https://github.com/b3nj5m1n/xdg-ninja/releases). + +Alternatively, you can build it from source using `cabal` or `stack`, use the nix flake or use the provided docker image. + +> To be clear, this is just a tool that will help you automatically generate the config files, you still only need your shell to run the tests + +#### Available commands -Available commands: ```sh xdgnj add # Adds a new configuration xdgnj prev programs/FILE.json # Preview the configuration for a program @@ -66,49 +108,70 @@ xdgnj edit programs/FILE.json # Edit the configuration for a program xdgnj run # Mostly the same as running the shell script ``` -#### Using nix +#### Prebuilt Binaries + +> [!IMPORTANT] +> The binaries only run on x86_64 Linux systems. + +```sh +curl -fsSL -o xdgnj https://github.com/b3nj5m1n/xdg-ninja/releases/latest/download/xdgnj +chmod +x xdgnj +``` + +#### Building from source + +You can use `cabal build` or `stack build` + +#### Nix -If you're using [nix](https://nixos.org) and have flakes turned on, you can just run the following command: ```sh nix run github:b3nj5m1n/xdg-ninja#xdgnj-bin ... ``` -#### Building from scratch +#### Docker -You can use `cabal build`, `stack build`, or the provided dockerfile in _build/_. +Use the provided dockerfile in [`./haskell/build/`](./haskell/build/). -### Manually +### Manually Creating Configuration -We're going to use _git_ as an example. +We're going to use `git` as an example. -It puts the file _.gitconfig_ into _$HOME_. +By default, it puts the file `.gitconfig` into `$HOME`. -Luckily, the XDG spec is supported by git, so we can simply move the file to _XDG_CONFIG_HOME/git/config_. +Luckily, the XDG spec is supported by git, so we can simply move the file to `$XDG_CONFIG_HOME/git/config`. We can use that last sentence as our instructions. In this case, there are no newlines, so escaping this string for use in json is trivial, however, this is how you should generally approach it: + ```sh -echo "Luckily, the XDG spec is supported by git, so we can simply move the file to _XDG_CONFIG_HOME/git/config_." | jq -aRs . +echo "Luckily, the XDG spec is supported by git, so we can simply move the file to _$XDG_CONFIG_HOME/git/config_." | jq -aRs . ``` Let's see what the output of this command looks like for something a little more sophisticated. + Here's an example file: + ```sh cat example.md ``` -``` + +```text Currently not fixable. _(But you can probably just delete the dir)_ ``` -Here's what catting this file to the _jq_ command produces: + +Here's what catting this file into `jq` produces: + ```sh cat example.md | jq -aRs . ``` -``` + +```text "Currently not fixable.\n\n_(But you can probably just delete the dir)_\n" ``` Now, we can assemble our final json file: + ```json { "name": "git", @@ -116,12 +179,12 @@ Now, we can assemble our final json file: { "path": "$HOME/.gitconfig", "movable": true, - "help": "Luckily, the XDG spec is supported by git, so we can simply move the file to _XDG_CONFIG_HOME/git/config_.\n" + "help": "Luckily, the XDG spec is supported by git, so we can simply move the file to _$XDG_CONFIG_HOME/git/config_.\n" } ] } ``` -Saving this as _git.json_ in the _programs/_ directory will result in the script picking it up and checking the file. +Saving this as `git.json` in the [`./programs/`](./programs/) directory will result in the script picking it up and checking the file. If you've created a configuration for a file that isn't in the official repository yet, make sure to create a pull request so that other people can benefit from it as well. -- 2.47.3 From 7673416b9b1d48a96e4c14cbbdbd2eee6c560566 Mon Sep 17 00:00:00 2001 From: Noah GITsham <73707948+noahgitsham@users.noreply.github.com> Date: Sun, 12 May 2024 21:13:44 +0100 Subject: [PATCH 05/16] Add vital vst entry (#406) --- programs/vital.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/vital.json diff --git a/programs/vital.json b/programs/vital.json new file mode 100644 index 0000000..1595743 --- /dev/null +++ b/programs/vital.json @@ -0,0 +1,10 @@ +{ + "name": "vital", + "files": [ + { + "path": "$HOME/.vital", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant Issues_:\nhttps://github.com/mtytel/vital/issues/20\nhttps://forum.vital.audio/t/linux-move-vital-to-xdg-config-home/6243\n" + } + ] +} -- 2.47.3 From 45732bfcb6f62c92861f6549faa5006fd1e06266 Mon Sep 17 00:00:00 2001 From: Noah GITsham <73707948+noahgitsham@users.noreply.github.com> Date: Mon, 13 May 2024 15:53:22 +0100 Subject: [PATCH 06/16] Minecraft update (#407) * Update Minecraft to unsupported * Change to supported with alternative launcher --- programs/minecraft.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/minecraft.json b/programs/minecraft.json index a0266e4..3585798 100644 --- a/programs/minecraft.json +++ b/programs/minecraft.json @@ -4,7 +4,7 @@ { "path": "$HOME/.minecraft", "movable": true, - "help": "Most launchers support moving this directory:\n\n - Official launcher:\n\nSet directory path with --workDir flag.\n\n - TLauncher:\n\nChange directory path in settings.\n" + "help": "The official launcher currently does not allow this.\n\n - Official launcher:\n\nSet directory path with --workDir flag. **CURRENTLY BROKEN**\n\n*Relevant issue:*\nhttps://bugs.mojang.com/browse/MCL-17153\n\nMost third party launchers support moving this directory:\n\n- TLauncher:\n\nChange directory path in settings.\n" }, { "path": "$HOME/.betacraft", -- 2.47.3 From 624c83b1bb47588db0cded227c5bc2a34c1d7978 Mon Sep 17 00:00:00 2001 From: feelamee <106318766+feelamee@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:19:51 +0000 Subject: [PATCH 07/16] Add xmake (#411) * Add xmake * Update xmake --- programs/xmake.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 programs/xmake.json diff --git a/programs/xmake.json b/programs/xmake.json new file mode 100644 index 0000000..93af885 --- /dev/null +++ b/programs/xmake.json @@ -0,0 +1,20 @@ +{ + "name": "xmake", + "files": [ + { + "path": "$HOME/.xmake", + "movable": true, + "help": "export XMAKE_GLOBALDIR=\"$XDG_CONFIG_HOME/xmake\"\nSee `xmake show -l envs` or xmake doc for details\nhttps://xmake.io/#/guide/configuration?id=environment-variables" + }, + { + "path": "$HOME/.xmake/packages", + "movable": true, + "help": "export XMAKE_PKG_INSTALLDIR=\"$XDG_DATA_HOME/xmake\"\n" + }, + { + "path": "$HOME/.xmake/cache", + "movable": true, + "help": "export XMAKE_PKG_CACHEDIR=\"$XDG_CACHE_HOME/xmake\"\n" + } + ] +} -- 2.47.3 From b24bca13a8fc6b0227e0ef5fd2f3827ecb002681 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=ABlle=20van=20Essen?= <39169351+JoelleJS@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:16:47 +0200 Subject: [PATCH 08/16] Add Red Hat telemetry data (#414) --- programs/redhat.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/redhat.json diff --git a/programs/redhat.json b/programs/redhat.json new file mode 100644 index 0000000..ddb0f50 --- /dev/null +++ b/programs/redhat.json @@ -0,0 +1,10 @@ +{ + "name": "Red Hat telemetry", + "files": [ + { + "path": "$HOME/.redhat", + "movable": false, + "help": "Currently unsupported.\n\nThis directory contains data used by Red Hat for telemetry. If you don't want telemetry you can probably safely delete the directory. Note that the directory may also contain your preferences regarding telemetry though (enable or disable).\n\n_Relevant issue:_ https://github.com/redhat-developer/vscode-redhat-telemetry/issues/51\n" + } + ] +} -- 2.47.3 From cc015b86cc150e3df15c2eb0b3691cd1c654d679 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=ABlle=20van=20Essen?= <39169351+JoelleJS@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:17:06 +0200 Subject: [PATCH 09/16] Add ICAClient aka Citrix Workspace App (#413) --- programs/icaclient.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/icaclient.json diff --git a/programs/icaclient.json b/programs/icaclient.json new file mode 100644 index 0000000..e9431ef --- /dev/null +++ b/programs/icaclient.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.ICAClient", + "movable": false, + "help": "Currently unsupported.\n" + } + ], + "name": "Citrix Workspace App" +} -- 2.47.3 From d56175dfbbb25541228c2d62e6b466a2ee60639b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=ABlle=20van=20Essen?= <39169351+JoelleJS@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:17:49 +0200 Subject: [PATCH 10/16] Add neverball (#412) --- programs/neverball.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 programs/neverball.json diff --git a/programs/neverball.json b/programs/neverball.json new file mode 100644 index 0000000..7a458fc --- /dev/null +++ b/programs/neverball.json @@ -0,0 +1,15 @@ +{ + "files": [ + { + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/Neverball/neverball/pull/184\n", + "movable": false, + "path": "$HOME/.neverball" + }, + { + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/Neverball/neverball/pull/184\n", + "movable": false, + "path": "$HOME/.neverball-dev" + } + ], + "name": "Neverball" +} -- 2.47.3 From 3d65bfc06ba12b428699d5cdaac99ed99afc0f75 Mon Sep 17 00:00:00 2001 From: Edgar Orendain Date: Mon, 17 Jun 2024 12:20:37 -0700 Subject: [PATCH 11/16] Fix `.tmux` output suggesting incorrect target path. (#415) The previous `.tmux` output instructed users to update their TPM run command to `run ~/.local/share/...`, which is typically represented by `XDG_DATA_HOME`. However, the directions also told users to then move the corresponding `.tmux` directory to `XDG_CONFIG_HOME/tmux`. The two halves of the instructions were conflicting. To resolve this, this commit fixes the second half of the instructions with the correct target path (i.e., `XDG_DATA_HOME`). --- programs/tmux.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/tmux.json b/programs/tmux.json index d044e34..35ef7bf 100644 --- a/programs/tmux.json +++ b/programs/tmux.json @@ -9,7 +9,7 @@ { "path": "$HOME/.tmux", "movable": true, - "help": "Set this in your tmux.conf:\n\n```set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins'```\n\nThen update the path to tpm to:\n\n```run '~/.local/share/tmux/plugins/tpm/tpm'```\n\nNow move .tmux to _XDG_CONFIG_HOME_/tmux.\n" + "help": "Set this in your tmux.conf:\n\n```set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.local/share/tmux/plugins'```\n\nThen update the path to tpm to:\n\n```run '~/.local/share/tmux/plugins/tpm/tpm'```\n\nNow move .tmux to _XDG_DATA_HOME_/tmux.\n" } ] } -- 2.47.3 From 7013d5584af24ed012863d658bb47d3ba9c133b1 Mon Sep 17 00:00:00 2001 From: intiluha Date: Tue, 18 Jun 2024 08:24:57 +0000 Subject: [PATCH 12/16] remove .gitignore rule (#416) .config/git/ignore file is for listing global ignore rules for all user repositories. $HOME/.gitignore file is for listing ignore rules for $HOME repository (if you have any). They are not the same --- programs/git.json | 5 ----- 1 file changed, 5 deletions(-) diff --git a/programs/git.json b/programs/git.json index 2144edf..62b6f46 100644 --- a/programs/git.json +++ b/programs/git.json @@ -6,11 +6,6 @@ "movable": true, "help": "XDG is supported out-of-the-box, so we can simply move the file to _$XDG_CONFIG_HOME/git/config_.\n" }, - { - "path": "$HOME/.gitignore", - "movable": true, - "help": "XDG is supported out-of-the-box, so we can simply move the file to _$XDG_CONFIG_HOME/git/ignore_.\n" - }, { "path": "$HOME/.git-credentials", "movable": true, -- 2.47.3 From 66025879cd8d797841af326ec7a1c5aa496efff0 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 28 Jun 2024 13:03:49 +0000 Subject: [PATCH 13/16] Use native readline function for new history file (#417) --- programs/python.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/python.json b/programs/python.json index 9ad7bbd..fb9d0ad 100644 --- a/programs/python.json +++ b/programs/python.json @@ -1,7 +1,7 @@ { "files": [ { - "help": "If you're running python v3.13.0a3 or later, you can simply set the `PYTHON_HISTORY` environment variable.\n\nOtherwise, export the following environment variable:\n\n```bash\nexport PYTHONSTARTUP=\"$XDG_CONFIG_HOME\"/python/pythonrc\n```\n\nThen create the file _$XDG_CONFIG_HOME/python/pythonrc_, and put the following code into it:\n\n```python\n#!/usr/bin/env python3\n# This entire thing is unnecessary post v3.13.0a3\n# https://github.com/python/cpython/issues/73965\n\ndef is_vanilla() -> bool:\n \"\"\" :return: whether running \"vanilla\" Python \"\"\"\n import sys\n return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]\n\n\ndef setup_history():\n \"\"\" read and write history from state file \"\"\"\n import os\n import atexit\n import readline\n from pathlib import Path\n\n # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables\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 if not state_home.is_dir():\n print(\"Error: XDG_SATE_HOME does not exist at\", state_home)\n\n history: Path = state_home / 'python_history'\n\n # https://github.com/python/cpython/issues/105694\n if not history.is_file():\n with open(history,\"w\") as f:\n f.write(\"_HiStOrY_V2_\" + \"\\n\\n\") # breaks on macos + python3 without this.\n\n readline.read_history_file(history)\n atexit.register(readline.write_history_file, history)\n\n\nif is_vanilla():\n setup_history()\n```\n", + "help": "If you're running python v3.13.0a3 or later, you can simply set the `PYTHON_HISTORY` environment variable.\n\nOtherwise, export the following environment variable:\n\n```bash\nexport PYTHONSTARTUP=\"$XDG_CONFIG_HOME\"/python/pythonrc\n```\n\nThen create the file _$XDG_CONFIG_HOME/python/pythonrc_, and put the following code into it:\n\n```python\n#!/usr/bin/env python3\n# This entire thing is unnecessary post v3.13.0a3\n# https://github.com/python/cpython/issues/73965\n\ndef is_vanilla() -> bool:\n \"\"\" :return: whether running \"vanilla\" Python \"\"\"\n import sys\n return not hasattr(__builtins__, '__IPYTHON__') and 'bpython' not in sys.argv[0]\n\n\ndef setup_history():\n \"\"\" read and write history from state file \"\"\"\n import os\n import atexit\n import readline\n from pathlib import Path\n\n # https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables\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 if not state_home.is_dir():\n print(\"Error: XDG_STATE_HOME does not exist at\", state_home)\n\n history: Path = state_home / 'python_history'\n\n # https://github.com/python/cpython/issues/105694\n if not history.is_file():\n readline.write_history_file(str(history)) # breaks on macos + python3 without this.\n\n readline.read_history_file(history)\n atexit.register(readline.write_history_file, history)\n\n\nif is_vanilla():\n setup_history()\n```\n", "movable": true, "path": "$HOME/.python_history" } -- 2.47.3 From ce2b79884f083d4ecb68b12da0148de2e63f3f09 Mon Sep 17 00:00:00 2001 From: heather7283 <142042427+heather7283@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:23:13 +0400 Subject: [PATCH 14/16] add nyx.json (#419) --- programs/nyx.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/nyx.json diff --git a/programs/nyx.json b/programs/nyx.json new file mode 100644 index 0000000..8d78913 --- /dev/null +++ b/programs/nyx.json @@ -0,0 +1,10 @@ +{ + "name": "nyx", + "files": [ + { + "path": "$HOME/.nyx", + "movable": true, + "help": "First, create a _$XDG_CONFIG_HOME/nyxrc_ file with the following content:\n\n```\ndata_directory ~/.cache/nyx\n```\nNote that you can't use variable substitution inside nyxrc, so you will have to hardcode your _XDG_CACHE_HOME_.\nAlternatively, disable caching to disk:\n\n```\ndata_directory disabled\n```\nFinally, in your shell startup file:\n\n```sh\nalias nyx=\"nyx --config $XDG_CONFIG_HOME/nyxrc\"\n```\nSource: https://nyx.torproject.org/#configuration\n" + } + ] +} -- 2.47.3 From d25b7ae2dc93a488d2ff17910af0621346915abb Mon Sep 17 00:00:00 2001 From: "Clarence \"Sparr\" Risher" Date: Sun, 18 Aug 2024 12:59:13 -0400 Subject: [PATCH 15/16] Distinguish movable vs unmovable ~/.aws paths (#421) --- programs/aws-cli.json | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/programs/aws-cli.json b/programs/aws-cli.json index 12be803..1b69408 100644 --- a/programs/aws-cli.json +++ b/programs/aws-cli.json @@ -1,9 +1,24 @@ { "files": [ { - "path": "$HOME/.aws", + "path": "$HOME/.aws/credentials", "movable": true, - "help": "Export the following environment variables:\n\n```bash\nexport AWS_SHARED_CREDENTIALS_FILE=\"$XDG_CONFIG_HOME\"/aws/credentials\nexport AWS_CONFIG_FILE=\"$XDG_CONFIG_HOME\"/aws/config\n```\n" + "help": "Export the following environment variable:\n\n```bash\nexport AWS_SHARED_CREDENTIALS_FILE=\"$XDG_CONFIG_HOME\"/aws/credentials\n```\n" + }, + { + "path": "$HOME/.aws/config", + "movable": true, + "help": "Export the following environment variable:\n\n```bash\nexport AWS_CONFIG_FILE=\"$XDG_CONFIG_HOME\"/aws/config\n```\n" + }, + { + "path": "$HOME/.aws/sso", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/aws/aws-cli/issues/1804\n" + }, + { + "path": "$HOME/.aws/cli", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/aws/aws-cli/issues/1804\n" } ], "name": "aws-cli" -- 2.47.3 From d8c70fcdbac85b522248b7ff9691f6d7ed7aa612 Mon Sep 17 00:00:00 2001 From: baschi29 <55055342+baschi29@users.noreply.github.com> Date: Sun, 18 Aug 2024 19:01:00 +0200 Subject: [PATCH 16/16] Fix fontconfig base dirs (#422) according to https://www.freedesktop.org/software/fontconfig/fontconfig-user.html --- programs/fontconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/programs/fontconfig.json b/programs/fontconfig.json index 2edc7aa..ee67b23 100644 --- a/programs/fontconfig.json +++ b/programs/fontconfig.json @@ -4,12 +4,12 @@ { "path": "$HOME/.fontconfig", "movable": true, - "help": "Supported\n\nThe file $HOME/.fontconfig can be moved to $XDG_DATA_HOME/fontconfig.\n" + "help": "Supported\n\nThe file $HOME/.fontconfig can be moved to $XDG_CACHE_HOME/fontconfig.\n" }, { "path": "$HOME/.fonts.conf", "movable": true, - "help": "Supported\n\nThe file $HOME/.fonts.conf can be moved to $XDG_DATA_HOME/fontconfig/fonts.conf.\n" + "help": "Supported\n\nThe file $HOME/.fonts.conf can be moved to $XDG_CONFIG_HOME/fontconfig/fonts.conf.\nThe element may be changed to fonts\n" } ] } -- 2.47.3