Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
A committed Jul 15, 2024
1 parent c4257b7 commit f291b81
Showing 1 changed file with 40 additions and 25 deletions.
65 changes: 40 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
# Zapusk

![Zapusk ScreenShot](.imgs/zapusk.png)
![Zapusk Screenshot](.imgs/zapusk.png)

Zapusk is a job runner for desktop environments. It helps you manage background tasks with features like pre-configured job execution, background shell commands, scheduling with cron-like syntax, log tailing, and notifications. It also provides detailed JSON output for easy data manipulation and analysis.
Zapusk is a versatile job runner designed for desktop environments. It simplifies the process of managing background tasks by providing robust features such as pre-configured job execution, background shell command execution, cron-like scheduling, log tailing, and notifications. Zapusk's detailed JSON output also enables powerful data manipulation and analysis when paired with tools like jq.

## Table of Contents

- [Key Features](#key-features)
- [Installation](#installation)
- [Usage](#usage)
- [Basic Commands](#basic-commands)
- [Advanced Usage](#advanced-usage)
- [Configuration](#configuration)
- [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)

## Key Features

Expand All @@ -15,6 +26,7 @@ Zapusk is a job runner for desktop environments. It helps you manage background
- **Job Groups:** Share settings like callbacks and parallelism between jobs.
- **Colored JSON Output:** Easily readable JSON output.
- **Waybar Integration:** Display job statuses and notifications on Waybar.
- **Custom Working Directory:** Run scripts and callbacks in a specified working directory.

## Installation

Expand All @@ -26,8 +38,9 @@ pip install zapusk

## Usage

Zapusk requires `zapusk-server` to be started. Zapusk offers a command-line interface for managing and executing jobs.
Here's a quick reference:
Zapusk requires `zapusk-server` to be started. Zapusk offers a command-line interface for managing and executing jobs. Here's a quick reference:

### Basic Commands

```sh
Usage:
Expand All @@ -51,34 +64,36 @@ Options:
-n --name=<name> Name for a command.
-g --group=<group> Job group to run the command in.
-t --tail Tail logfile immediately.
```

Examples:
### Examples

# Run npm install in the background
zapusk exec "npm i"
```sh
# Run npm install in the background
zapusk exec "npm i"

# Run pytest and tail its log
zapusk exec "pytest -v" -t
# Run pytest and tail its log
zapusk exec "pytest -v" -t

# Schedule a command to run every minute
zapusk exec "ping -c4 google.com" --schedule "*/1 * * * *"
# Schedule a command to run every minute
zapusk exec "ping -c4 google.com" --schedule "*/1 * * * *"

# Run a job defined in ~/.config/zapusk/config.yaml
zapusk run youtube_dl
# Run a job defined in ~/.config/zapusk/config.yaml
zapusk run youtube_dl

# Cancel a job by its ID
zapusk cancel 42
# Cancel a job by its ID
zapusk cancel 42

# See logs for a job by its ID
zapusk tail 42
# See logs for a job by its ID
zapusk tail 42
```

## Example Configuration
## Configuration

Here is an example configuration file for Zapusk. It defines job groups and individual jobs, specifying commands, schedules, and notifications.
Here is an example configuration file for Zapusk. It defines job groups and individual jobs, specifying commands, schedules, notifications, and working directories.

```yaml
# Port server starts on and client call to
# The port the server starts on and the client connects to
port: 9876

# Enable colored JSON output
Expand All @@ -103,6 +118,7 @@ jobs:
id: unsplash
args_command: "zenity --entry --text 'Collection ID'"
command: ~/.bin/jobs/unsplash_dl.sh
cwd: /path/to/working/directory

- name: Sleep
id: sleep
Expand Down Expand Up @@ -132,6 +148,7 @@ jobs:
id: unsplash
args_command: "zenity --entry --text 'Collection ID'"
command: ~/.bin/jobs/unsplash_wallpaper_collection_download.sh
cwd: /path/to/working/directory
on_finish: notify-send -a "Zapusk" "Wallpapers downloaded" --icon kitty
on_fail: notify-send -a "Zapusk" "Wallpaper download failed" --icon kitty
```
Expand Down Expand Up @@ -210,11 +227,12 @@ jobs:
id: sleep
group: sleep
command: ~/.bin/jobs/sleep
cwd: /path/to/working/directory
on_finish: notify-send -a "zapusk" "Job Finished" "{job.name} has finished" --icon kitty
on_fail: notify-send -a "zapusk" "Job Failed" "{job.name} has failed" --icon kitty
```
### Waybar Integration
## Waybar Integration
Zapusk integrates with Waybar to display job statuses and notifications directly on your desktop.
Expand All @@ -230,10 +248,7 @@ Zapusk integrates with Waybar to display job statuses and notifications directly
}
```

## Contribution

We welcome contributions! If you find a bug or have an idea for improvement, please open an issue or submit a pull request on our GitHub repository.

## License

Zapusk is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.
Zapusk is licensed under the MIT License. See the [LICENSE](LICENSE.md) file for more information.

1 comment on commit f291b81

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
zapusk
   logger.py00100% 
zapusk/client
   api_client.py840100% 
   command.py2455 79%
   command_cancel.py130100% 
   command_config_groups.py90100% 
   command_config_jobs.py90100% 
   command_exec.py180100% 
   command_list.py180100% 
   command_manager.py280100% 
   command_run.py90100% 
   command_tail.py160100% 
   command_testcase.py230100% 
   command_waybar.py300100% 
   output.py220100% 
   printer.py30100% 
zapusk/kawka
   consumer.py260100% 
   consumer_group.py330100% 
   linked_list.py100100% 
   producer.py290100% 
   topic.py270100% 
   topic_iterator.py450100% 
zapusk/lib
   create_jobitem.py60100% 
   json_serdes.py70100% 
zapusk/models
   base_model.py220100% 
   config.py100100% 
   id_field.py110100% 
   job.py620100% 
   job_config.py260100% 
   job_group.py120100% 
   scheduled_job.py240100% 
zapusk/server
   api.py100100% 
   controller_config.py110100% 
   controller_jobs.py500100% 
   controller_scheduled_jobs.py370100% 
   controller_testcase.py290100% 
   error_response.py40100% 
zapusk/services/config
   config_parser.py370100% 
   constants.py40100% 
   service.py580100% 
   yaml_filereader.py50100% 
zapusk/services/executor_manager
   service.py200100% 
zapusk/services/executor_manager/backends/kawka
   args_consumer.py280100% 
   backend.py350100% 
   consumer.py460100% 
   executor.py420100% 
   state.py90100% 
zapusk/services/scheduler_service
   service.py560100% 
TOTAL1137599% 

Please sign in to comment.