Skip to content

Commit

Permalink
Merge pull request #7 from MarcinOrlowski/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
MarcinOrlowski authored Oct 28, 2024
2 parents 45cc6df + 1d97016 commit 0f80685
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 109 deletions.
11 changes: 7 additions & 4 deletions .pre-commit-config.yaml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
# Prevent giant files from being committed
- id: check-added-large-files
Expand All @@ -39,7 +39,7 @@ repos:
args: ['--fix=no']

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.9.0
rev: v1.10.0
hooks:
# Forbid files which have a UTF-8 Unicode replacement character
- id: text-unicode-replacement-char
Expand All @@ -57,8 +57,11 @@ repos:
# - id: checkstyle-jar
# This hook trims trailing whitespace.
- id: trailing-whitespaces
exclude_types: ['xml']
exclude_types: ['xml', 'png', 'jpeg', 'svg']
exclude: '.*\.(xcf|png|jpg|jpeg|svg)$'
args: ['--markdown-linebreak-ext=md', '--fix=yes']
# Ensures that a file is either empty, or ends with one newline
- id: end-of-file
args: ['--fix=yes']
exclude_types: ['xml', 'png', 'jpeg', 'svg']
exclude: '.*\.(xcf|png|jpg|jpeg|svg)$'
args: ['--fix=no']
99 changes: 13 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,105 +4,32 @@

Run any website as standalone desktop application

---
## What is it?

This Python package offers a unique approach to web browsing by opening any webpage in a dedicated
This tool offers a unique approach to web browsing by opening any webpage in a dedicated
window using the embedded QT WebEngine. By removing the typical browser UI elements, it effectively
turns websites into standalone desktop applications. This can be particularly useful if you've ever
wished to run a frequently used website as a separate app, independent from your main browser. The
embedded website can access your clipboard, so all the "Copy" buttons from various generators or
chats works as expected. You can also upload and download files as you'd in any other application.
wished to run a frequently used website as a separate app, independent from your main browser.

The tool provides a practical solution for those who find themselves juggling numerous browser tabs
It provides a practical solution for those who find themselves juggling numerous browser tabs
or wanting a clearer separation between work and personal web applications. With each website
running as its own "app", you gain the benefit of individual entries in your window manager or task
switcher, potentially improving your workflow organization and efficiency.

![WebsiteAsApp in action](docs/screenshot.jpg)

1. Github website running as standalone app
2. Own application entry in the task switcher
3. Dedicated entry in system tray menu for easy access

Whether you're looking to streamline your digital workspace or simply curious about alternative
ways to interact with web content, this script presents an interesting concept that might just
solve a problem you didn't know you had.

**IMPORTANT:** It's worth pointing out however, that this tool doesn't transform websites into
offline applications. Rather, it focuses on separating your key websites from each other and from
the multitude of browser tabs you might typically have open. While this approach offers improved
organization and workflow, it's crucial to understand that an internet connection is still required
for these "apps" (websites) to function as they normally would in a traditional browser environment.

## Installation

This is regular Python package and is also hosted on [PyPi](https://pypi.org/project/website-as-app/) so
you can install it as usual. But because this one is supposed to rather act as the application, I
strongly recommend to use [pipx](https://pipx.pypa.io/) to install this tool in isolated environment:

```bash
$ pipx install website-as-app
```

You can also use plain `pip`:

```bash
$ pip install website-as-app
```

But that might be a problem on some distributions no longer allowing such installations, therefore
use of `pipx` is strongly recommended as the all-in-one solution.

Once installed `webapp` executable (and its alias `runasapp`) should be available in your system.
Please use `--help` to see all available options, as i.e. custom icons, window title etc.

## Usage

When app is installed system-wide, you can run it from anywhere:

```bash
$ webapp "https://github.com"
```

If you are using virtual environment, there's handy Bash script in `extras/` directory
which takes care of initializing virtual environment and running the app using that environment.
You simply use `extras/webapp.sh` script instead of `webapp` directly:

```bash
$ extras/webapp.sh "https://github.com"
```

### Configuration

Available options:

```bash
webapp -h
usage: webapp [--profile PROFILE] [--name NAME] [--icon ICON] [--zoom ZOOM] [--no-tray] url

Open any website in standalone window (like it's an app)
positional arguments:
url The URL to open
options:
--profile PROFILE, -p PROFILE Profile name (for cookies isolation etc). Default: "default"
--name NAME, -n NAME Application name (shown as window title)
--icon ICON, -i ICON Full path to PNG image file to be used as app icon
--geometry GEOMETRY, -g GEOMETRY Initial window ("WIDTHxHEIGHT+X+Y"). Default: "450x600+0+0"
--zoom ZOOM, -z ZOOM WebView scale. Default: 1.0 (no scale change).
--no-tray, -t Disables docking app in system tray (closing window quits app)
--minimized, -m Starts app minimized to system tray.
--allow-multiple, -a Allows multiple instances of the app to run on the same profile
--debug, -d Makes app print more debug messages during execution
```
The most important option is `--profile` which allows you to isolate cookies and app settings
per instance. Any instance using the same profile will have access to the same cookies and
settings. This is useful if you want to run multiple instances of the same app, but with
different accounts. By default `default` profile is used and it's recommended to use different
profile per each app instance.

By default only one instance per profile is allowed to run (attempt to run second instance
will bring the first one to the front). If you want to allow multiple instances of the app
to run on the same profile, use `--allow-multiple` switch.
## How to start?

NOTE: `--zoom` accepts fractional values, so you can use i.e. `--zoom 1.25` to scale content up by
25% or `--zoom 0.75` to scale down to 75% of the original size.
Please refer to the [documentation](docs/README.md) for detailed instructions on how to
quickly install and start using this tool.

## License

Expand Down
105 changes: 86 additions & 19 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,98 @@
![WebApp](logo.png)
![WebApp](docs/logo.png)

# WebApp

Run any website as standalone desktop application

---

This Python script offers a unique approach to web browsing by opening any webpage in a dedicated
window using the embedded QT WebEngine. By removing the typical browser UI elements, it effectively
turns websites into standalone desktop applications. This can be particularly useful if you've ever
wished to run a frequently used website as a separate app, independent from your main browser.
## Installation

The tool provides a practical solution for those who find themselves juggling numerous browser tabs
or wanting a clearer separation between work and personal web applications. With each website
running as its own "app", you gain the benefit of individual entries in your window manager or task
switcher, potentially improving your workflow organization and efficiency.
This is regular Python package and is also hosted on [PyPi](https://pypi.org/project/website-as-app/) so
you can install it as usual. But because this one is supposed to rather act as the application, I
strongly recommend to use [pipx](https://pipx.pypa.io/) to install this tool in isolated environment:

Whether you're looking to streamline your digital workspace or simply curious about alternative
ways to interact with web content, this script presents an interesting concept that might just
solve a problem you didn't know you had.
```bash
$ pipx install website-as-app
```

**IMPORTANT:** It's worth pointing out however, that this tool doesn't transform websites into
offline applications. Rather, it focuses on separating your key websites from each other and from
the multitude of browser tabs you might typically have open. While this approach offers improved
organization and workflow, it's crucial to understand that an internet connection is still required
for these "apps" (websites) to function as they normally would in a traditional browser environment.
You can also use plain `pip`:

---
```bash
$ pip install website-as-app
```

But that might be a problem on some distributions no longer allowing such installations, therefore
use of `pipx` is strongly recommended as the all-in-one solution.

Once installed `webapp` executable (and its alias `runasapp`) should be available in your system.
Please use `--help` to see all available options, as i.e. custom icons, window title etc.

## Usage

When app is installed system-wide, you can run it from anywhere:

```bash
$ webapp "https://github.com"
```

If you are using virtual environment, there's handy Bash script in `extras/` directory
which takes care of initializing virtual environment and running the app using that environment.
You simply use `extras/webapp.sh` script instead of `webapp` directly:

```bash
$ extras/webapp.sh "https://github.com"
```

### Configuration

Available options:

```bash
webapp -h
usage: webapp [--profile PROFILE] [--name NAME] [--icon ICON] [--zoom ZOOM] [--no-tray] url

Open any website in standalone window (like it's an app)
positional arguments:
url The URL to open
options:
--profile PROFILE, -p PROFILE Profile name (for cookies isolation etc). Default: "default"
--name NAME, -n NAME Application name (shown as window title)
--icon ICON, -i ICON Full path to PNG image file to be used as app icon
--geometry GEOMETRY, -g GEOMETRY Initial window ("WIDTHxHEIGHT+X+Y"). Default: "450x600+0+0"
--zoom ZOOM, -z ZOOM WebView scale. Default: 1.0 (no scale change).
--no-tray, -t Disables docking app in system tray (closing window quits app)
--minimized, -m Starts app minimized to system tray.
--allow-multiple, -a Allows multiple instances of the app to run on the same profile
--debug, -d Makes app print more debug messages during execution
```
The most important option is `--profile` which allows you to isolate cookies and app settings
per instance. Any instance using the same profile will have access to the same cookies and
settings. This is useful if you want to run multiple instances of the same app, but with
different accounts. By default `default` profile is used and it's recommended to use different
profile per each app instance.

By default only one instance per profile is allowed to run (attempt to run second instance
will bring the first one to the front). If you want to allow multiple instances of the app
to run on the same profile, use `--allow-multiple` switch.

NOTE: `--zoom` accepts fractional values, so you can use i.e. `--zoom 1.25` to scale content up by
25% or `--zoom 0.75` to scale down to 75% of the original size.

## Notes

This tool doesn't really transforms websites into offline applications. Rather, it focuses
on separating your key websites from each other and from the multitude of browser tabs you might
typically have open. While this approach offers improved organization and workflow, it's crucial
to understand that an internet connection is still required for these "apps" (websites) to function
as they normally would in a traditional browser environment.


## License

* [Dev corner](dev.md)
* Written and copyrighted &copy;2023-2024 by Marcin Orlowski <mail (#) marcinorlowski (.) com>
* ResponseBuilder is open-sourced software licensed under
the [MIT license](http://opensource.org/licenses/MIT)
Binary file added docs/screenshot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/screenshot.xcf
Binary file not shown.

0 comments on commit 0f80685

Please sign in to comment.