2024-06-08 04:01:18 +12:00
|
|
|
# Execution types
|
2023-10-05 03:34:03 +13:00
|
|
|
|
2024-06-08 04:01:18 +12:00
|
|
|
You can use a script in multiple different scenarios.
|
2023-10-05 03:34:03 +13:00
|
|
|
|
2024-06-08 04:01:18 +12:00
|
|
|
When enabling a script, the execution types dictate what XPipe will do with the script.
|
2023-10-18 17:17:34 +13:00
|
|
|
|
2024-06-08 04:01:18 +12:00
|
|
|
## Init scripts
|
2023-10-05 03:34:03 +13:00
|
|
|
|
2024-06-08 04:01:18 +12:00
|
|
|
When a script is designated as init script, it can be selected in shell environments.
|
2023-11-04 18:36:47 +13:00
|
|
|
|
2024-06-08 04:01:18 +12:00
|
|
|
Furthermore, if a script is enabled, it will automatically be run on init in all compatible shells.
|
|
|
|
|
|
|
|
For example, if you create a simple init script like
|
|
|
|
```
|
|
|
|
alias ll="ls -l"
|
|
|
|
alias la="ls -A"
|
|
|
|
alias l="ls -CF"
|
|
|
|
```
|
|
|
|
you will have access to these aliases in all compatible shell sessions if the script is enabled.
|
|
|
|
|
|
|
|
## Shell scripts
|
|
|
|
|
|
|
|
A normal shell script is intended to be called in a shell session in your terminal.
|
|
|
|
When enabled, the script will be copied to the target system and put into the PATH in all compatible shells.
|
|
|
|
This allows you to call the script from anywhere in a terminal session.
|
|
|
|
The script name will be lowercased and spaces will be replaced with underscores, allowing you to easily call the script.
|
|
|
|
|
|
|
|
For example, if you create a simple shell script named `apti` like
|
|
|
|
```
|
|
|
|
sudo apt install "$1"
|
|
|
|
```
|
|
|
|
you can call that on any compatible system with `apti.sh <pkg>` if the script is enabled.
|
|
|
|
|
|
|
|
## File scripts
|
|
|
|
|
|
|
|
Lastly, you can also run custom script with file inputs from the file browser interface.
|
|
|
|
When a file script is enabled, it will show up in the file browser to be run with file inputs.
|
|
|
|
|
|
|
|
For example, if you create a simple file script like
|
|
|
|
```
|
|
|
|
sudo apt install "$@"
|
|
|
|
```
|
|
|
|
you can run the script on selected files if the script is enabled.
|
|
|
|
|
|
|
|
## Multiple types
|
|
|
|
|
|
|
|
As the sample file script is the same as the sample shell script above,
|
|
|
|
you see that you can also tick multiple boxes for execution types of a script if they should be used in multiple scenarios.
|
2023-11-04 18:36:47 +13:00
|
|
|
|
|
|
|
|