This project includes a Bash script for generating a menu on a Linux desktop panel that allows quick and elegant access to various Obsidian vaults. The script automates the process of creating executable files for individual vaults based on a list in a text file.
The usefulness of the generator depends on how you use Obsidian and, primarily, the number of vaults you manage. If, like me, you have multiple vaults for various personal and work-related matters, it can be beneficial to open a specific vault as needed rather than defaulting to the most recently opened one.
Prefer to automate repetitive tasks whenever possible. Vaults in a second brain system evolve organically as needed. Tools and processes support rather than define the workflow.
generate_menu.sh
: The main Bash script for generating executable files for individual vaults.vault_template.sh
: A template for vault executable files.vault_names.txt
: A list of vault names that the script uses.vaults/
: Directory for vault executable files.vaults/_last.sh
: Open last opened vault. Obsidian default behavior.icon.ico
: Default icon for the menu..gitignore
: Ignore build, temp, and config files.README.md
: This documentation file.LICENSE
: License file.
-
Setup:
- CREATE | Create the
vault_names.txt
file in the root directory of the project. - This file should contain one vault name per line.
- Empty lines have no effect.
- CREATE | Create the
-
Running the
generate_menu.sh
Script:- The script operates in
ObsidianVaultMG
directory. - Remove content of
vaults/
directory. - Reads vault names from the
vault_names.txt
file. - For each name, it creates a new executable file in the
vaults/
directory based on thevault_template.sh
template. - Each executable file will contain the vault name, which you can then use to open the vault.
- UPDATE | If you make changes in vaults, just update list of vaults names
vault_names.txt
and rungenerate_menu.sh
again.
- The script operates in
-
Scripts Menu:
- I have good experience with the menu applet for starting scripts Scripts Menu. But it is quite clear that there are many similar solutions for all systems.
- create a new applet via the applet menu
- right click on the created applet to configure
- script directory - select
vaults/
subdirectory in project directory - OPTIONAL | custom icon
on
, icon - selecticon.ico
in the root directory of the project; show titleoff
, but if you fill in the title before turning it off, it will be displayed when the mouse is hovered over
-
Usage:
- You can add these executable files to your desktop panel.
- Clicking on the Obsidian icon in the panel will display a list of vaults.
- Select the vault you wish to open, and it will open in Obsidian.
-
Generating Executable Files:
./generate_menu.sh
-
Format of
vault_names.txt
:PKM_Default PKM_ICT PKM_Psychology LIB_Psychology SharedProjectX
-
Format of
vault_template.sh
:#!/bin/bash xdg-open "obsidian://open?vault=${vault}"
- Bash shell
- Obsidian
- Scripts Menu (or something like that)
If you would like to contribute to this project, you can submit a pull request or create an issue for any problems or suggestions.
This project is licensed under the MIT License.
This README.md
should provide clear and comprehensive information about how the project works and how to use it. Let me know if there are any specific adjustments or additional details you’d like to include!