Skip to content

Commit

Permalink
Add a bunch of apps (#352)
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
flexagoon authored Feb 3, 2024
1 parent c9f7b9d commit 2c80444
Show file tree
Hide file tree
Showing 15 changed files with 89 additions and 25 deletions.
7 changes: 6 additions & 1 deletion programs/android.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
10 changes: 10 additions & 0 deletions programs/ash.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
10 changes: 10 additions & 0 deletions programs/cocoapods.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
6 changes: 3 additions & 3 deletions programs/dotnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -12,4 +12,4 @@
}
],
"name": "dotnet"
}
}
9 changes: 2 additions & 7 deletions programs/emacs.json
Original file line number Diff line number Diff line change
@@ -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"
}
Expand Down
4 changes: 2 additions & 2 deletions programs/expo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
2 changes: 1 addition & 1 deletion programs/python.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 20 additions & 0 deletions programs/scriptkit.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
10 changes: 10 additions & 0 deletions programs/swift-package-manager.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
7 changes: 6 additions & 1 deletion programs/tldr.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
10 changes: 10 additions & 0 deletions programs/tuist.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
5 changes: 2 additions & 3 deletions programs/xdg-utils.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
]
}
2 changes: 1 addition & 1 deletion programs/xinit.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion programs/xorg-xauth.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 5 additions & 5 deletions programs/zsh.json
Original file line number Diff line number Diff line change
@@ -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"
},
Expand Down

0 comments on commit 2c80444

Please sign in to comment.