Skip to content

Instantly share code, notes, and snippets.

@smeech
Last active January 31, 2025 16:08
Show Gist options
  • Select an option

  • Save smeech/1c1e7bdd1bf6499a7fe7d59df7609a17 to your computer and use it in GitHub Desktop.

Select an option

Save smeech/1c1e7bdd1bf6499a7fe7d59df7609a17 to your computer and use it in GitHub Desktop.
[OSVar] OS-independent variable setting #espanso #python
# Set an Espanso global variable for the system "HOME" directory, regardless of OS
# to avoid the need to use `filter_os:`, as Espanso can only use ONE app-specific
# configuration at a time.
# Requires Python
global_vars:
- name: home
type: script
params:
args: [python, -c, print(__import__('os').path.expanduser('~'))]
- trigger: :home
replace: "{{home}}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment