Commit Graph

26 Commits

Author SHA1 Message Date
Sami Kankaristo
fb00b35266 Add ability to load a project by name or "on" key
The "load" action now accepts an argument, which is used to find a
project by name/description or the "on" keyboard key.

This can be used to create a keybinding to load a specific project (here
named "Default"):
```yaml
{ on = [ "P", "P"  ], run = "plugin projects 'load Default'", desc = "Load the 'Default'project"  },
```

It can also be used to start Yazi with a specific project using a
script:
```bash
#!/bin/bash

#
# Open a project in Yazi.
#
# https://yazi-rs.github.io/docs/plugins/utils/#ya.emit
# https://github.com/MasouShizuka/projects.yazi
#

export yaziProject="$1"
shift

if [ -z "$yaziProject" ]; then
    >&2 echo "ERROR: The first argument must be a project"
    exit 64
fi

# Generate random Yazi client ID (DDS / `ya emit` uses `YAZI_ID`)
export YAZI_ID=$RANDOM

# Use Yazi's DDS to run a plugin command after Yazi has started
# (the nested subshell is only to suppress "Done" output for the job)
( (sleep 0.1; ya emit plugin projects "load $yaziProject") &)

# Run Yazi with the generated client ID
yazi --client-id $YAZI_ID "$@"
```
2025-06-17 13:40:01 +03:00
MasouShizuka
82febd5b45 fix: add @ to event name in yazi method 2025-06-14 22:19:16 +08:00
MasouShizuka
f39f4201bf docs: add description of yazi_load_event 2025-06-14 17:40:56 +08:00
MasouShizuka
4bd79b3f94 fix: add saved event for save_last_and_quit function 2025-06-14 17:35:42 +08:00
MasouShizuka
696214ca62 docs(readme): add the description of event 2025-06-14 10:03:44 +08:00
MasouShizuka
568168c09e feat: add corresponding event when executing each function 2025-06-14 09:56:46 +08:00
MasouShizuka
7037dd5eee docs(readme): replace manager with mgr 2025-06-03 08:53:27 +08:00
MasouShizuka
96af237d22 refactor: migrate to yazi v25.5.28 2025-05-29 09:04:40 +08:00
MasouShizuka
df44165610 docs(readme): Emphasize that setup must be written to init.lua 2025-05-17 20:48:28 +08:00
MasouShizuka
4f11eccf83 refactor: migrate to yazi v25.2.26 2025-03-03 10:31:17 +08:00
MasouShizuka
4a69a7f7e6 feat: Add "project-loaded" dds event 2025-02-19 08:52:02 +08:00
MasouShizuka
ac57d0ac34 refactor: migrate to yazi v25.2.7 2025-02-10 10:07:32 +08:00
陈思玉
f211b81c7a Merge pull request #4 from prosoitos/patch-1
Fix ya install code in README.md
2025-01-28 11:24:09 +08:00
Marie-Helene Burle
76d7ba2c5c Fix ya install code in README.md 2025-01-27 17:22:37 -08:00
MasouShizuka
ba8d00b220 refactor: migrate to yazi v0.4 2024-12-09 10:51:24 +08:00
MasouShizuka
c1f9d1c944 fix: fix the default location of projects.json under unix 2024-11-20 14:35:46 +08:00
MasouShizuka
5994bc9862 feat: add feature of loading last project after starting 2024-11-19 08:34:19 +08:00
MasouShizuka
7a1dc3729f fix: Corrected the reading of array index of dds in yazi v0.3 2024-08-05 08:58:52 +08:00
MasouShizuka
40bc9d49c2 feat: migrate to yazi v0.3, add persistence method based on lua api 2024-08-01 18:53:24 +08:00
MasouShizuka
e18ec80071 feat: add feature of merging a project to other projects 2024-05-15 10:49:06 +08:00
MasouShizuka
c2379fca9a feat: load the desc of saved projects 2024-05-06 18:16:19 +08:00
MasouShizuka
096765c489 feat: add function save_last_and_quit 2024-05-04 02:18:51 +08:00
陈思玉
6694bc5bdb Update README.md with video preview 2024-04-30 18:50:37 +08:00
MasouShizuka
4e3620923f fix: fix the update_after_save and update_after_load 2024-04-30 18:47:49 +08:00
陈思玉
2e64cc890e Create LICENSE 2024-04-30 18:31:26 +08:00
MasouShizuka
db83c3a9e9 Initialize the repository. 2024-04-30 18:23:17 +08:00