From 72a7791ef160d4627c9951d84559af09061f7a0d Mon Sep 17 00:00:00 2001 From: David Perry Date: Mon, 27 Feb 2023 06:50:24 -0500 Subject: [PATCH 01/16] Add mintty (#223) --- programs/mintty.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/mintty.json diff --git a/programs/mintty.json b/programs/mintty.json new file mode 100644 index 0000000..2975d64 --- /dev/null +++ b/programs/mintty.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.minttyrc", + "movable": true, + "help": "Supported out of the box, just move the file to:\n\n```bash\n$XDG_CONFIG_HOME/mintty/config \n```\n" + } + ], + "name": "mintty" +} -- 2.47.3 From b03a94b1b48103eab50e2afe51e6777693d83a91 Mon Sep 17 00:00:00 2001 From: Amy Date: Sun, 12 Mar 2023 22:16:37 +0000 Subject: [PATCH 02/16] Add flake.nix (#226) * Add nix flake support * Use derivation from nixpkgs in flake --------- Co-authored-by: b3nj5m1n --- .gitignore | 2 ++ flake.lock | 41 +++++++++++++++++++++++++++++++++++++++++ flake.nix | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index 6542fcd..4886181 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ dist-newstyle .stack-work +result/ +result diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9514603 --- /dev/null +++ b/flake.lock @@ -0,0 +1,41 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1678594102, + "narHash": "sha256-OHAHYiMWJFPNxuW/PcOMlSD2tvXnEYC1jxREBADHwwQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "796b4a3c1d903c4b9270cd2548fe46f524eeb886", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..080cee9 --- /dev/null +++ b/flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem (system: + let + runtimeDependencies = with pkgs; [ + glow + jq + ]; + overlays = [ + (self: super: { + xdg-ninja = super.xdg-ninja.overrideAttrs (old: { + version = "git"; + src = ./.; + }); + }) + ]; + pkgs = import nixpkgs { inherit system overlays; }; + in rec { + packages = flake-utils.lib.flattenTree { + xdg-ninja = pkgs.xdg-ninja; + }; + defaultPackage = packages.xdg-ninja; + apps = { + xdg-ninja = flake-utils.lib.mkApp { drv = packages.xdg-ninja; }; + }; + defaultApp = apps.xdg-ninja; + } + ); +} -- 2.47.3 From e884687f776282826817ec106d1e9b76b74bf266 Mon Sep 17 00:00:00 2001 From: SolarBear <81395386+UrsaSolar@users.noreply.github.com> Date: Sun, 12 Mar 2023 15:39:54 -0700 Subject: [PATCH 03/16] Add configuration for Steam game Tales of Maj'Eyal (#227) --- programs/t-engine.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/t-engine.json diff --git a/programs/t-engine.json b/programs/t-engine.json new file mode 100644 index 0000000..f578a3f --- /dev/null +++ b/programs/t-engine.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.t-engine", + "movable": true, + "help": "Add the following to the Steam arguments for Tales of Maj'Eyal 4: ```--home $XDG_DATA_HOME```\nThen, move _$HOME/.t-engine_ to _$XDG_DATA_HOME/.t-engine_\n\n**NOTE**: This flag only changes the location in which the directory is created. The actual directory itself is hardcoded as _.t-engine_, so it will still be hidden by default. There is currently no workaround for this.\n\nAlternatively, use the Flatpak version of Steam as noted in the help for _.steam_" + } + ], + "name": "t-engine" +} -- 2.47.3 From a3ff4754fb9af6fa82f8f92a41af4914c968549d Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Mon, 13 Mar 2023 00:07:42 +0100 Subject: [PATCH 04/16] Add xdgnj to flake --- flake.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/flake.nix b/flake.nix index 080cee9..91adf01 100644 --- a/flake.nix +++ b/flake.nix @@ -25,11 +25,28 @@ pkgs = import nixpkgs { inherit system overlays; }; in rec { packages = flake-utils.lib.flattenTree { + # The shell script and configurations, uses derivation from offical nixpkgs xdg-ninja = pkgs.xdg-ninja; + # Pre-built binary of xdgnj tool downloaded from github + xdgnj-bin = pkgs.stdenvNoCC.mkDerivation { + name = "xdgnj-bin"; + version = "0.2.0.1-alpha"; + description = "Pre-built binary of the xdgnj tool for creating and editing configuration files for xdg-ninja."; + src = pkgs.fetchurl { + url = "https://github.com/b3nj5m1n/xdg-ninja/releases/download/v0.2.0.1/xdgnj"; + sha256 = "y1BSqKQWbhCyg2sRgMsv8ivmylSUJj6XZ8o+/2oT5ns="; + }; + dontUnpack = true; + installPhase = '' + mkdir -p "$out/bin" + install -Dm755 $src "$out/bin/xdgnj" + ''; + }; }; defaultPackage = packages.xdg-ninja; apps = { xdg-ninja = flake-utils.lib.mkApp { drv = packages.xdg-ninja; }; + xdgnj-bin = flake-utils.lib.mkApp { drv = packages.xdgnj-bin; exePath = "/bin/xdgnj"; }; }; defaultApp = apps.xdg-ninja; } -- 2.47.3 From c1dc6c9694ead574b9bea4040ed5bbbcaacbe26a Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Mon, 13 Mar 2023 00:18:48 +0100 Subject: [PATCH 05/16] Add instructions about using nix flake --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a86b9c7..d650c1f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,13 @@ The configurations are from the [arch wiki page on XDG_BASE_DIR](https://wiki.ar ## Running +### Using 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 +``` + ### Cloning Manually Clone the repository somewhere, then run the _./xdg-ninja.sh_ script. @@ -48,15 +55,23 @@ Files in this directory can have any name, but using the name of the program is ### Automatically Generating Configuration -You can download the _xdgnj_ executable from the releases page. Alternatively you can 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) +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) Available commands: ```sh xdgnj add # Adds a new configuration xdgnj prev programs/FILE.json # Preview the configuration for a program +xdgnj edit programs/FILE.json # Edit the configuration for a program xdgnj run # Mostly the same as running the shell script ``` +#### Using 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 You can use `cabal build`, `stack build`, or the provided dockerfile in _build/_. -- 2.47.3 From 68ced838cd3d8fb5bcfafa6be64740fd4186142a Mon Sep 17 00:00:00 2001 From: volker1 <73304952+REALERvolker1@users.noreply.github.com> Date: Wed, 29 Mar 2023 05:31:27 -0400 Subject: [PATCH 06/16] Add `rusherhack` support (#228) --- programs/rusherhack.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/rusherhack.json diff --git a/programs/rusherhack.json b/programs/rusherhack.json new file mode 100644 index 0000000..a2717f7 --- /dev/null +++ b/programs/rusherhack.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.rusherhack", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/RusherDevelopment/rusherhack-issues/issues/1422\n" + } + ], + "name": "rusherhack" +} -- 2.47.3 From 0442c9e50f81f607558d4c9b3961e25c9a461413 Mon Sep 17 00:00:00 2001 From: Suren Lockwood <53460243+CheesyChocolate@users.noreply.github.com> Date: Wed, 29 Mar 2023 09:32:29 +0000 Subject: [PATCH 07/16] add `octave` to darabase (#229) * added octave to supported programs * the .octaverc file will not be auto generated by octave, but all the manuals point to making it in the home directory * source: [Arch Wiki Xdg Base Directory](https://wiki.archlinux.org/title/XDG_Base_Directory#Partial) * octave doesn't respect OCTAVE_HISTFILE varible * octave respects XDG * octave package mamanger by default will install packages in ~/.local/share/octave/api-v58/packages/ --- programs/octave.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/octave.json diff --git a/programs/octave.json b/programs/octave.json new file mode 100644 index 0000000..c204532 --- /dev/null +++ b/programs/octave.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "help": "Export the following environment variables:\n\n```bash\nexport OCTAVE_SITE_INITFILE=\"$XDG_CONFIG_HOME/octave/octaverc\"\n```", + "movable": true, + "path": "$HOME/.octaverc" + } + ], + "name": "octave" +} -- 2.47.3 From 4ee47996cb48f51a2a52d64bc5cb0e8967522e59 Mon Sep 17 00:00:00 2001 From: Maximilian Knespel Date: Wed, 29 Mar 2023 11:39:26 +0200 Subject: [PATCH 08/16] Add fzf (#231) --- programs/fzf.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/fzf.json diff --git a/programs/fzf.json b/programs/fzf.json new file mode 100644 index 0000000..ebb52b5 --- /dev/null +++ b/programs/fzf.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.fzf", + "movable": true, + "help": "This has been added since 0.17.4. See https://github.com/junegunn/fzf/pull/1282 .\nReinstall from git with ```bash\n~/.fzf/uninstall\nrm -rf ~/.fzf\ngit clone --depth 1 https://github.com/junegunn/fzf.git $XDG_DATA_HOME/fzf\n$XDG_DATA_HOME/fzf/install --xdg\n```\n" + } + ], + "name": "fzf" +} -- 2.47.3 From 5e208d2dbff3f2f97b1212bc19b3110d70cb09d4 Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Wed, 29 Mar 2023 11:55:59 +0200 Subject: [PATCH 09/16] Add conda --- programs/conda.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 programs/conda.json diff --git a/programs/conda.json b/programs/conda.json new file mode 100644 index 0000000..3145284 --- /dev/null +++ b/programs/conda.json @@ -0,0 +1,15 @@ +{ + "files": [ + { + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/b3nj5m1n/xdg-ninja/issues/14\n", + "movable": false, + "path": "$HOME/.condarc" + }, + { + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/b3nj5m1n/xdg-ninja/issues/14\n", + "movable": false, + "path": "$HOME/.conda" + } + ], + "name": "conda" +} \ No newline at end of file -- 2.47.3 From 4e96c1cbbe0f540e23a798fc64b918fdcff37140 Mon Sep 17 00:00:00 2001 From: Maximilian Knespel Date: Wed, 29 Mar 2023 12:00:00 +0200 Subject: [PATCH 10/16] Add SciTE (#230) Co-authored-by: b3nj5m1n <47924309+b3nj5m1n@users.noreply.github.com> --- programs/scite.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 programs/scite.json diff --git a/programs/scite.json b/programs/scite.json new file mode 100644 index 0000000..a22cdc5 --- /dev/null +++ b/programs/scite.json @@ -0,0 +1,15 @@ +{ + "name": "SciTE", + "files": [ + { + "path": "$HOME/.SciTE.session", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport SciTE_USERHOME=\"$XDG_CONFIG_HOME\"/SciTE\n```\n" + }, + { + "path": "$HOME/.SciTEUser.properties", + "movable": true, + "help": "Export the following environment variables:\n\n```bash\nexport SciTE_USERHOME=\"$XDG_CONFIG_HOME\"/SciTE\n```\n" + } + ] +} -- 2.47.3 From 6f9e63f16ef64d89b85b8d05c48950d9c0162533 Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Wed, 29 Mar 2023 12:05:13 +0200 Subject: [PATCH 11/16] Fix formatting fzf --- programs/fzf.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/fzf.json b/programs/fzf.json index ebb52b5..412931d 100644 --- a/programs/fzf.json +++ b/programs/fzf.json @@ -1,10 +1,10 @@ { "files": [ { - "path": "$HOME/.fzf", + "help": "This has been added since 0.17.4. See https://github.com/junegunn/fzf/pull/1282.\nReinstall from git with\n```bash\n~/.fzf/uninstall\nrm -rf ~/.fzf\ngit clone --depth 1 https://github.com/junegunn/fzf.git $XDG_DATA_HOME/fzf\n$XDG_DATA_HOME/fzf/install --xdg\n```\n", "movable": true, - "help": "This has been added since 0.17.4. See https://github.com/junegunn/fzf/pull/1282 .\nReinstall from git with ```bash\n~/.fzf/uninstall\nrm -rf ~/.fzf\ngit clone --depth 1 https://github.com/junegunn/fzf.git $XDG_DATA_HOME/fzf\n$XDG_DATA_HOME/fzf/install --xdg\n```\n" + "path": "$HOME/.fzf" } ], "name": "fzf" -} +} \ No newline at end of file -- 2.47.3 From 05eb43e9fd507a98c36f26d97e2f245809c0256e Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Wed, 29 Mar 2023 12:11:15 +0200 Subject: [PATCH 12/16] Add .fzf.bash & .fzf.zsh --- programs/fzf.json | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/programs/fzf.json b/programs/fzf.json index 412931d..41d42f5 100644 --- a/programs/fzf.json +++ b/programs/fzf.json @@ -4,6 +4,16 @@ "help": "This has been added since 0.17.4. See https://github.com/junegunn/fzf/pull/1282.\nReinstall from git with\n```bash\n~/.fzf/uninstall\nrm -rf ~/.fzf\ngit clone --depth 1 https://github.com/junegunn/fzf.git $XDG_DATA_HOME/fzf\n$XDG_DATA_HOME/fzf/install --xdg\n```\n", "movable": true, "path": "$HOME/.fzf" + }, + { + "help": "Follow instructions for moving `.fzf`\n", + "movable": true, + "path": "$HOME/.fzf.zsh" + }, + { + "help": "Follow instructions for moving `.fzf`\n", + "movable": true, + "path": "$HOME/.fzf.bash" } ], "name": "fzf" -- 2.47.3 From 296e56e0b523d4d24b5044ef6dbd0ad6eb79a2b5 Mon Sep 17 00:00:00 2001 From: b3nj5m1n Date: Wed, 29 Mar 2023 12:17:01 +0200 Subject: [PATCH 13/16] Remove disclaimer about startx Closes #222 --- programs/xinit.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/xinit.json b/programs/xinit.json index f0ed13d..2ee1e63 100644 --- a/programs/xinit.json +++ b/programs/xinit.json @@ -1,15 +1,15 @@ { "files": [ { - "path": "$HOME/.xserverrc", + "help": "Export the following environment variable:\n\n```bash\nexport XSERVERRC=\"$XDG_CONFIG_HOME\"/X11/xserverrc\n```\n", "movable": false, - "help": "**Disclaimer: this works only with xinit, not with startx.**\n\nExport the following environment variable:\n\n```bash\nexport XSERVERRC=\"$XDG_CONFIG_HOME\"/X11/xserverrc\n```\n" + "path": "$HOME/.xserverrc" }, { - "path": "$HOME/.xinitrc", + "help": "Export the following environment variable:\n\n```bash\nexport XINITRC=\"$XDG_CONFIG_HOME\"/X11/xinitrc\n```\n", "movable": false, - "help": "**Disclaimer: this works only with xinit, not with startx.**\n\nExport the following environment variable:\n\n```bash\nexport XINITRC=\"$XDG_CONFIG_HOME\"/X11/xinitrc\n```\n" + "path": "$HOME/.xinitrc" } ], "name": "xinit" -} +} \ No newline at end of file -- 2.47.3 From 79b0d09707a1f2513769db23878730e2754e0ba8 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 29 Mar 2023 21:23:00 -0400 Subject: [PATCH 14/16] Add vmodules (#233) Co-authored-by: b3nj5m1n <47924309+b3nj5m1n@users.noreply.github.com> --- programs/v.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/v.json diff --git a/programs/v.json b/programs/v.json new file mode 100644 index 0000000..21dbde1 --- /dev/null +++ b/programs/v.json @@ -0,0 +1,10 @@ +{ + "name": "v", + "files": [ + { + "path": "$HOME/.vmodules", + "movable": false, + "help": "Export the following environment variables:\n\n```bash\nexport VMODULES=\"$XDG_DATA_HOME\"/vmodules\n```\n" + } + ] +} -- 2.47.3 From a83bf25a1485fbdf8700ff2b0fc6730a120719ee Mon Sep 17 00:00:00 2001 From: Pierre Peltier Date: Thu, 30 Mar 2023 11:56:44 +0200 Subject: [PATCH 15/16] Add the stremio binary (#234) --- programs/stremio.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/stremio.json diff --git a/programs/stremio.json b/programs/stremio.json new file mode 100644 index 0000000..701b075 --- /dev/null +++ b/programs/stremio.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.stremio-server", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant issue:_ https://github.com/Stremio/stremio-web/issues/351\n" + } + ], + "name": "stremio" +} -- 2.47.3 From 7a09db63d7cd440cfc7a4216b83c3385c9db4e7d Mon Sep 17 00:00:00 2001 From: Pierre Peltier Date: Thu, 30 Mar 2023 12:38:09 +0200 Subject: [PATCH 16/16] Add Cozy (#235) --- programs/cozy.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 programs/cozy.json diff --git a/programs/cozy.json b/programs/cozy.json new file mode 100644 index 0000000..a4906bd --- /dev/null +++ b/programs/cozy.json @@ -0,0 +1,10 @@ +{ + "files": [ + { + "path": "$HOME/.cozy", + "movable": false, + "help": "Currently unsupported.\n\n_Relevant pull request:_ https://github.com/cozy/cozy-stack/pull/3863\n" + } + ], + "name": "cozy" +} -- 2.47.3