Showing preview only (300K chars total). Download the full file or copy to clipboard to get everything.
Repository: dharmx/vile
Branch: main
Commit: 559bf8a317fe
Files: 112
Total size: 273.0 KB
Directory structure:
gitextract_e3k5oh14/
├── .github/
│ ├── README.md
│ └── workflows/
│ └── stale.yml
├── .gitignore
├── LICENSE
├── eww.scss
├── requirements.txt
├── src/
│ ├── scss/
│ │ ├── _base.scss
│ │ ├── _override.scss
│ │ ├── avatar/
│ │ │ ├── _init.scss
│ │ │ ├── _mpd.scss
│ │ │ ├── _override.scss
│ │ │ ├── _pctl.scss
│ │ │ ├── _quick.scss
│ │ │ └── _userinfo.scss
│ │ ├── bolt/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── chrono/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── clime/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── disclose/
│ │ │ ├── _cardimage.scss
│ │ │ ├── _cardprog.scss
│ │ │ ├── _cardradial.scss
│ │ │ ├── _cardscr.scss
│ │ │ ├── _dnd.scss
│ │ │ ├── _empty.scss
│ │ │ ├── _init.scss
│ │ │ ├── _modifiers.scss
│ │ │ ├── _override.scss
│ │ │ ├── _stats.scss
│ │ │ └── _urgency.scss
│ │ ├── horizon/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── lumin/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── melody/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── ocular/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── origin/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── power/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ └── vertigo/
│ │ ├── _info.scss
│ │ ├── _init.scss
│ │ ├── _node.scss
│ │ ├── _override.scss
│ │ └── _state.scss
│ ├── shell/
│ │ ├── cache.py
│ │ ├── combine.zsh
│ │ ├── github.sh
│ │ ├── handlers.py
│ │ ├── logger.py
│ │ ├── mpdaemon.py
│ │ ├── playerctl.py
│ │ ├── pollution.py
│ │ ├── uptime.awk
│ │ ├── utils.py
│ │ ├── weather.py
│ │ └── workspaces.zsh
│ └── yuck/
│ ├── _env.yuck
│ ├── _lib.yuck
│ ├── avatar/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── lib/
│ │ ├── _init.yuck
│ │ ├── _mpd.yuck
│ │ ├── _pctl.yuck
│ │ ├── _quick.yuck
│ │ └── _small.yuck
│ ├── bolt/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── chrono/
│ │ ├── _env.yuck
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── clime/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── disclose/
│ │ ├── _dnd.yuck
│ │ ├── _env.yuck
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ ├── _stats.yuck
│ │ └── cards/
│ │ ├── _cardimage.yuck
│ │ ├── _cardprog.yuck
│ │ ├── _cardradial.yuck
│ │ └── _cardscr.yuck
│ ├── horizon/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── lumin/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── melody/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── ocular/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── origin/
│ │ ├── _init.yuck
│ │ └── _layout.yuck
│ ├── power/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ └── vertigo/
│ ├── _env.yuck
│ ├── _init.yuck
│ ├── _label.yuck
│ ├── _layout.yuck
│ ├── _modules.yuck
│ └── _reveal.yuck
└── themes/
└── radium.scss
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/README.md
================================================
<div align="center">
[](https://github.com/dharmx/vile)
[](https://github.com/dharmx/vile/issues)
[](github.com/dharmx/vile)
[](https://github.com/dharmx/vile/stargazers)
[](https://github.com/dharmx/vile/commits)
</div>
# 👋 Introduction
Greetings, visitors. This is a repository of various useless GUI
[widgets](https://www.merriam-webster.com/dictionary/widget) that may or, may
not enchance the look of your current desktop interface.
I will walk you through each and every step of the installation process so,
make sure to hit that lik- follow everything in a step-by-step fashion.
And if you are here to borrow code then you may skip this README <samp>Obviously</samp>.
## 🚒 Procedure
A brief explanation of explanation (explanception!). This section is optional
but it wouldn't hurt to gloss over it.
- [Introduction, brief description and greetings.](https://github.com/dharmx/vile#-introduction)
- [Procedure, explanception.](https://github.com/dharmx/vile#-procedure)
- [Showcase. Brief showcase, two screenshots of the project in action.](https://github.com/dharmx/vile#-showcase)
- [Assumptions. Conditions and constraints.](https://github.com/dharmx/vile#-assumptions)
- [Structure. Project structure and design decisions.](https://github.com/dharmx/vile#-structure)
- <samp>MAKE IT STOP!</samp>
- [Dependencies. Modules, packages, scripts and resources that are required.](https://github.com/dharmx/vile#-dependencies)
- [Configuration. Setting things up.](https://github.com/dharmx/vile#configuration)
- [Hacking. Advanced configuration.](https://github.com/dharmx/vile#hacking)
- [Gallery.](https://github.com/dharmx/vile#gallery)
- [Samples.](https://github.com/dharmx/vile#samples)
- End Goals.
- Not Goals.
- Tips. Useless shit.
- FAQ.
- Credits. Acknowledgements.
- TODOs.
- License.
## 🖼 Showcase

## 🤔 Assumptions
List of conditions and constraints that are needed to be fulfilled.
This section solely to reduce some headaches.
This is done because I do not want to spend an extensive amount of time writing
instructions for several Linux distributions.
I will choose Archlinux as a reference frame as I have only used Archlinux,
Manjaro and EndeavourOS in the past.
So, following are roughly some assumptions that I will follow:
- You are using either Archlinux or, an Arch-based distro like Manjaro.
- You already have an editor, a browser and necessary utilities installed like
`sudo, git, etc`.
- You have `python` installed.
- You are using an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers).
- You are using `bspwm` as your [window manager](https://wiki.archlinux.org/title/Window_manager).
- You are using `sxhkd` as your [keyboard daemon](https://wiki.archlinux.org/title/Keyboard_shortcuts).
- You use pulseaudio.
## 🌿 Structure
This is an important section for those who want to borrow some piece of
functionality for use in their projects.
This section will paint a general idea of how stuff is being linked to one
another so, you can have a general idea
for handling or, understanding a bug if one appears (which it will at some point).
### 🌿 General structure
```txt
├── assets
├── src
│ ├── scss
│ ├── shell
│ └── yuck
└── themes
```
- `assets` contains images, graphics and svgs for use in the project.
- `src.scss` contains all theming files. Theming is done using
[SCSS](https://sass-lang.com/). So, all of the files in this directory will also
be SCSS.
- `src.yuck` contains markup files, all of which are of YUCK filetype.
- `src.shell` contains various scripts.
- `themes` this will also contain only SCSS files.
<samp>Why not have them in src.scss then?</samp> Because organization. That's it.
### 🌿 `src` substructure
This structure will seem familiar to webdevs.
```txt
src
├── scss
│ ├── bolt
│ ├── lumin
│ └── vertigo
└── yuck
├── bolt
├── lumin
└── vertigo
```
As you might have guessed.
The **modules** in the `scss` directory, style the classes that are defined in
the yuck directory.
For instance, the module `lumin` will have `scss.lumin` which will contain
styling specific to widgets defined in `yuck.lumin` only.
### 📚 Style Overrides
There is a `_override.scss` file which supplied for the purpose of overriding
and testing your own stylings.
I have made this in order to contain different designs for the same widget.
### Layouts
There is a `_layout.yuck` in every widget module
(eg: `src/yuck/lumin/_layout.yuck`) which acts like a mini-configuration.
Tweak the values if you wish to do so 😉.

The above is the transparent version of the bar which is different to that
shown in the showcase.
## 🔽 Dependencies
This section is divided into 2 parts:
- Main Dependencies
- Python Dependencies
### 🔽 Main Dependencies
Execute this in your terminal <samp>(if you dare.)</samp>.
```sh
yay --sync base-devel rustup python python-pip eww-git \
dunst bspwm sxkhd gobject-introspection imagemagick \
mpd mpc playerctl pamixer rofi redshift zsh jq todo-bin --needed
# NOTE: use paru or, a AUR helper of your choice or, do the dirty work yourself.
```
- [rustup](https://rustup.rs/) is needed for compiling eww.
- For [pipewire](https://wiki.archlinux.org/title/PipeWire) users you need to
replace all of the matches of [`pamixer`](https://github.com/cdemoulins/pamixer)
in
this repository with appropriate commands. You may use [`nvim-telescope's live-grep`](https://github.com/nvim-telescope/telescope.nvim)
feature to get the matches conveniently and elegantly.
- For [dunst](dunst-project.org) you need to have have a specific configuration,
which you can grab from the [**Samples**](https://github.com/dharmx/vile#samples)
section.
- And it should be a given that [`bspwm`](https://wiki.archlinux.org/title/Bspwm)
and [`sxkhd`](https://wiki.archlinux.org/title/Sxhkd) are already configured.
### 🔽 Python Dependencies
Inspect the packages that you are about to install from [`requirements.txt`](https://github.com/dharmx/vile/blob/main/requirements.txt).
Then run the following command in your terminal while in `vile's` root.
But, before that we need to create a `.venv` as the [PEP 0668](https://peps.python.org/pep-0668) is clinically insane.
```sh
cd ~/.config/eww
python -m venv .venv
source ./.venv/bin/activate
pip install --requirement=requirements.txt
```
## Configuration
Start by placing vile into `~/.config` and rename `vile` to `eww`. Or, you can use symlinks as shown below.
```sh
git clone --depth 1 https://github.com/dharmx/vile.git ~/Downloads
ln -s ~/Downloads/vile ~/.config/eww
## do not remove ~/Downloads/vile
```
Now, right after doing that you need to make the scripts executable.
```sh
chmod +x ~/Downloads/vile/src/shell/*
```
You need to install the fonts that are being used in this repo. Which can
be found [here](https://github.com/dharmx/dots.sh/tree/main/local/share/fonts).
Lastly, do not forget to update the font caches after you do install them
`fc-cache -frv`.
```txt
Caviar Dreams
Sagetarius
Phosphor
Dosis
Poiret One
monoMMM_5
Iosevka
Modum
Koulen
Feather
Lato
```
This is a very very very important section. As the previous one, this section
is also divided into various parts.
- Environment Variables.
- API Setups
- JSON / Script Configurations
- Layout Configurations
- Dependency Configurations
- Headless Testing / Trial Run.
### Environment Variables
Start by reading the [xdg-utils](https://wiki.archlinux.org/title/Xdg-utils)
and [xdg-vars](https://wiki.archlinux.org/title/XDG_user_directories) articles
from the [ArchWiki](https://wiki.archlinux.org/).
Then you need to setup those variables by adding some lines in your
[shellrc](https://www.tecmint.com/understanding-shell-initialization-files-and-user-profiles-linux/).
Anyways, I will be using [ZSH](https://zsh.sourceforge.io/)
for this so, we will add those environment variables by editing the `~/.zshenv`
file first (create it if it doesn't exist).
Then just append these lines to the file.
```zsh
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_MUSIC_DIR="$HOME/Music"
export XDG_PICTURES_DIR="$HOME/Pictures"
```
On top of that you would need to add these as well.
```zsh
# NOTE: Add defaults of your choice as these may not be your taste.
export TERMINAL=st ## kitty for example
export BROWSER=firefox ## brave for example
export VISUAL=neovide ## nano for example
export EDITOR=nvim ## vim for example
```
See more info on what these variables do [here](https://wiki.archlinux.org/title/Environment_variables).
### API Setups
Starting with the easiest. Firstly you need to go to the
[OpenWeather](https://home.openweathermap.org/users/sign_in)
website and grab your [API key](https://rapidapi.com/blog/api-glossary/api-key/).
Do this by creating an account and logging into the site. Then go to
the [`api_keys`](https://home.openweathermap.org/api_keys) tab and press the
generate button after typing a name in the textfield.
And if you already have a default key then use that instead.
Anyways, take a note of that key value as we will need it later.
### JSON and Script Configurations
Copy the `ewwrc` from the [**Samples**](https://github.com/dharmx/vile#samples)
section and remove all of the comments. Then the first thing you'd need to do is
add the tokens that you noted from the
[previous](https://github.com/dharmx/vile#-dependencies) section.
For example the `tokens.openweather` field.
> Note: You may skip this if you do not plan to use `clime and chrono` see
the Galley section.
Take a look at the `location` key and see what method of fetching the location
you want to select. If you have selected manual method then you'd need to fill
out either `latitude` and `longitude` or, `city` and `country_code` and `lang` fields.
Learn more about these [here](https://openweathermap.org/history-bulk#parameter).
As for automatic, you do not need to do anything in the location field.
Then customize, change and tweak the values to your liking.
Now, open `src/shell/combine.bash` then edit and match the `CACHE_PATH`,
`QUOTE_PATH`, `INTERVAL` and `DEFAULT_QUOTE` with the fields
`notify.cache_path`, `notify.quote_path`,
`notify.default_quote` and `notify.interval` from `ewwrc`.
> Note: `combine.bash` is created to be an alternative for some `logger.py
functions since it is quite slow.
### Layout Configurations
Moving on. Copy the sample `eww.yuck` from the
[**Samples**](https://github.com/dharmx/vile#samples) section. Create the
`eww.yuck` file and uncomment the widgets you need. You may take a look at the
[**Gallery**](https://github.com/dharmx/vile#gallery) section.
As explained in the [**Structure**](https://github.com/dharmx/vile#-structure)
section open the layout files of the modules that you enabled. For example
if you have uncommented the vertigo module then, you would
need to open `src/yuck/vertigo/_layout.yuck` file and _customize_ the values
like icons glyphs, labels, etc.
For example in the `bolt` widget if you change the `:volume_icon`
field i.e. `` to a smiley face `:)` then
```lisp
;; NOTE: can be found in src/yuck/bolt/_layout.yuck
(_boltpctl :cover {pctl_sub["mpris:artUrl"]}
:label {pctl_sub["status"]}
:title {pctl_sub["xesam:title"]}
:artist {pctl_sub["xesam:artist"]}
:volume volume_level
:volume_icon "" ;; to :volume_icon ":)"
:status_cmd "playerctl play-pause"
:status_icon {pctl_sub["status"] == "Playing" ? "" : ""})
```

### Dependency Configurations
- Make sure you have playerctl running at all times. Execute `playerctld daemon`
in your terminal to start playerctl.
- MPD needs to be running all times as well. Execute `mpd` in your terminal.
- Same goes for dunst. Only caveat is that you'd need a specific configuration
for making it work with the `disclose` module.
#### Disclose: Notification Manager
There are some very specific things that you would need to do for setting this up.
Firstly, grab or, inspect the sample `dunstrc` from the
[**Samples**](https://github.com/dharmx/vile#samples) section.
Take a good look at the rulesets:
```ini
[volume]
appname = "volume"
summary = "*"
set_stack_tag = "volume"
format = "<b>%s</b>\n%b"
[firefox]
appname = firefox
new_icon = firefox-default
```
The above is an example of said ruleset. When a notification is sent by a certain
application like for example firefox, they will send
some specific metadata on top of the usual message summary and message body.
Which then we can use to tell apart the notifications sent from
firefox and other applications. This is done using the `appname` value.
We take that value and match it to these ruleset's `appname` field. And if you
have looked at the above snippet carefully, you will notice that there is a
rule called `[firefox]` and within it there is a field called `appname` whose
value is `firefox`.
Now, whenever Firefox browser sends us a notification it will be redirected to
that ruleset.
Secondly, there is another field called `new_icon` which signifies that when
Firefox sends a notification, the notification icon will be replaced with an icon
from your icon theme named `firefox-default.svg` (Yes, the extension will be truncated).

### Testing
This section will describe how you would know if the script actually works.
Since, if the scripts work then most probably the widgets will work as well.
These (might) be automated later in the near future with unit testing.
Before we begin I would urge you to recheck and verify if all the XDG variables
have been set or not. Source the `~/.zshenv` again if you are not confident.
Now, go to the root of the vile repo. Then change the directory to where all of
the scripts are located at `cd src/shell`.
- <samp>logger.py</samp>: Run this using `./logger.py init` which will
initialize the[dbus](https://www.freedesktop.org/wiki/Software/dbus) eavesdropper.
Now, open another terminal and run `./logger.py subscribe` then open another
terminal and type `notfy-send hello`. Now, if something appears in the second
terminal then the script is working.
```lisp
(box :spacing 20 :orientation 'vertical' :space-evenly false
(_cardimage :class 'Spotify-rectangle' :identity ':::###::::
XXXWWW1660034424===::' :close_action './src/shell/combine.bash
rmid 1660034424' :limit_body '110' :limit_summary '30' :summary
'Forbidden Silence' :body 'Raimu - Forbidden Silence' :close '繁'
:class 'Spotify-rectangle' :identity ':::###::::XXXWWW1660034279===::'
...
```
- <samp>combine.bash</samp>: Run this using `./logger.py init` which will
initialize the [dbus](https://www.freedesktop.org/wiki/Software/dbus) eavesdropper.
Now, open another terminal and run `./combine.bash sub` then open another
terminal and type `notfy-send hello`. Now, if something appears in the
second terminal then the script is working. Sample should be the same as `logger.py`.
- <samp>covidstate.py</samp>: This is currently not in use but you can test it regardless.
Try running it `./covidstate.py` and see if there is any
[JSON](https://www.json.org/json-en.html) output.
You may need to wait for a few seconds by the way. Following is a sample.
```json
{
"country": {
<redacted>: {
"id": "81",
"country": <redacted>,
"confirmed": 44174650,
"active": null,
"deaths": 526772,
"recovered": null,
...
```
- <samp>github.sh</samp>: This too is not being used but wouldn't hurt to test it.
Try running it by `./github.sh repos` see if there is any JSON output. And do the
same for `./github.sh users` as well.
Following is a sample.
```json
[
{
"id": <some_number>,
"node_id": <some_number>,
"name": "dharmx",
"full_name": "dharmx/dharmx",
"private": false,
"owner": {
"login": "dharmx",
...
```
- <samp>pollution.py</samp>: Do the same as `github.sh`. Following is a sample.
```json
{
"coord": {
"lon": <redacted>,
"lat": <redacted>
},
"list": [
{
"main": {
"aqi": 3
},
"components": {
"co": 487.33,
"no": 0.13,
"no2": 21.08,
"o3": 39.34,
"so2": 31.47,
"pm2_5": 20.35,
"pm10": 24.43,
"nh3": 4.75
...
```
- <samp>weather.py</samp>: Do the same as `github.sh` only difference is
that you need to supply a flag i.e. `fetch`.
Following is a sample.
```json
{
"coord": {
"lon": <redacted>,
"lat": <redacted>
},
"weather": [
{
"id": 721,
"main": "Haze",
"description": "haze",
"icon": "50d",
...
```
- <samp>workspaces.zsh</samp>: This is [BSPWM](https://github.com/baskerville/bspwm) specific.
Try running this by `./workspaces.zsh subscribe_desktop` then try going to any
other workspace then return to the current one.
Now, see if there are any JSON values. Following is a sample.
```json
[
{
"class": "vertigo-button vertigo-workspace vertigo-workspace-occupied",
"tooltip": "workspace: state: occupied",
"onclick": "bspc desktop --focus 1",
"label": ""
},
{
"class": "vertigo-button vertigo-workspace vertigo-workspace-local",
"tooltip": "workspace: state: local",
"onclick": "bspc desktop --focus 2",
"label": ""
},
{
"class": "vertigo-button vertigo-workspace vertigo-workspace-focused",
"tooltip": "workspace: 北 state: focused",
"onclick": "bspc desktop --focus 3",
"label": "北"
}
]
```
- <samp>mpdaemon.py</samp>: Same as `github.sh`. Also, you might need to
traverse through your current MPD music playlist and play some songs to be
completely sure.
While you are at it see if JSON output changes or, not as well. Sample as follows.
```json
{
"file": "/home/maker/.cache/eww/mpd/3PM Coding Session.png",
"artist": "Lofi Ghostie",
"albumartist": "Unknown",
"title": "3PM Coding Session",
"album": "Unknown",
"last-modified": "2021-11-14T19:55:40Z",
"format": "44100:24:2",
"time": "4948",
"duration": "4947.748",
"pos": "0",
"id": "1",
"status": "pause",
"bright": "#4959A5",
"dark": "#CC96E0"
}
```
- <samp>playerctl.py</samp>: Similar to `mpdaemon.py`. Sample as follows.
```json
{
"mpris:artUrl": "/home/maker/.cache/eww/pctl/spotify/7468726565706F6F6C/4120506C6163652042656E65617468.png",
"xesam:artist": "threepool",
"xesam:title": "A Place Beneath",
"xesam:album": "A Place Beneath",
"status": "Playing",
"mpris:trackid": "/com/spotify/track/4m1Kg8I715SQUSOjFrvxR7",
"mpris:length": 132679000,
...
```
- <samp>uptime.awk</samp>: Run this by `uptime --pretty | ./uptime.awk`.
Output should be `2d, 4h` for uptime of `up 2 days, 4 hours, 35 minutes`.
### Note
- If any of these do not work then consult the Troubleshooting, FAQ and Tips sections.
- The notification manager (disclose) depends on my custom made icon theme that
can be found [here](https://github.com/dharmx/dots.sh/tree/main/home/.icons/custom.bak).
- With dunst you may need to remove its dbus service file
`/usr/share/dbus-1/services/org.knopwob.dunst.service`. Then kill all dunst
instances and start again with a new instance.
- There may be some difficulties with the `mpdaemon.py` script if your default
mpd Music storage is not as same as `XDG_MUSIC_DIR` i.e. `~/Music`.
## Hacking
Coming Soon...
## Gallery
| Avatar |
|---------|
|  |
| **Description**: Adaptive and dynamic music player daemon and playerctl frontends. |
| Note that this is still incomplete. |
| Bolt |
|---------|
|  |
| **Description**: Beautiful integrated bar mini-dashboard. |
| Disclose |
|---------|
|  |
| **Description**: Feature-Rich and Hacky notification manager. |
| Vertigo |
|---------|
|  |
| **Description**: BSPWM Specific bar. See the [**Hacking**](https://github.com/dharmx/vile#hacking) section to add support for your WM. |
| Chrono One | Chrono Two |
|---------|---------|
|  |  |
| **Description**: Calendar, Cool radial clock and a beautiful weather card. | **Description**: Extensive weather information and Air pollution information. |
| Lumin |
|---------|
|  |
| **Description**: Shows time and searches stuff on [duckduckgo](duckduckgo.com). |
| Clime |
|---------|
|  |
| **Description**: Minimal weather info. |
| Origin |
|---------|
|  |
| **Description**: Shows current logged username and hostname. |
| Melody |
|---------|
|  |
| **Description**: Shows current playing audio track with essential application icons. |
| Ocular |
|---------|
|  |
| **Description**: A moving seconds clock with added Ram, CPU, Temperatue and Battery monitor. |
## Samples
<details>
<summary>A sample <code>dunstrc</code> configuration.</summary>
```ini
[global]
background = "#11161b"
foreground = "#d4d4d5"
monitor = 0
follow = mouse
width = 480
height = 380
progress_bar = true
progress_bar_height = 25
progress_bar_frame_width = 3
progress_bar_min_width = 460
progress_bar_max_width = 480
highlight = "#79dcaa"
dmenu = /usr/bin/dmenu
indicate_hidden = true
shrink = true
transparency = 5
separator_height = 5
padding = 10
horizontal_padding = 10
frame_width = 3
frame_color = "#151a1f"
sort = true
idle_threshold = 0
font = Dosis,Iosevka Nerd Font 14
line_height = 2
markup = full
origin = "top-right"
offset = "50x50"
format = "<b>%s</b>\n%b"
alignment = left
show_age_threshold = 60
word_wrap = false
ignore_newline = true
stack_duplicates = true
hide_duplicate_count = true
show_indicators = true
icon_position = left
max_icon_size = 128
min_icon_size = 104
icon_theme = "custom,Reversal-green-dark,McMuse-green,Zafiro,McMuse,Papirus"
enable_recursive_icon_lookup = true
sticky_history = true
history_length = 50
browser = firefox
always_run_script = true
title = Dunst
class = Dunst
corner_radius = 0
notification_limit = 5
mouse_left_click = do_action
mouse_middle_click = close_current
mouse_right_click = context_all
ignore_dbusclose = true
ellipsize = end
[urgency_low]
timeout = 4
background = "#11161b"
frame_color = "#1f2429"
foreground = "#79dcaa"
[urgency_normal]
timeout = 8
background = "#11161b"
frame_color = "#1f2429"
foreground = "#7ab0df"
[urgency_critical]
timeout = 30
background = "#11161b"
frame_color = "#1f2429"
foreground = "#f87070"
[fullscreen_show_critical]
msg_urgency = critical
fullscreen = pushback
[volume]
appname = "volume"
summary = "*"
set_stack_tag = "volume"
format = "<b>%s</b>\n%b"
[microphone]
appname = "microphone"
summary = "*"
set_stack_tag = "microphone"
format = "<b>%s</b>\n%b"
[audiojack]
appname = "audiojack"
summary = "*"
set_stack_tag = "audiojack"
format = "<b>%s</b>\n%b"
[brightness]
appname = "brightness"
summary = "*"
set_stack_tag = "brightness"
format = "<b>%s</b>\n%b"
[shot]
appname = "shot"
summary = "*"
set_stack_tag = "shot"
format = "<b>%s</b>\n%b"
[shot_icon]
appname = "shot_icon"
summary = "*"
set_stack_tag = "shot_icon"
format = "<b>%s</b>\n%b"
[bar]
appname = "bar"
summary = "*"
set_stack_tag = "bar"
format = "<b>%s</b>\n%b"
[nightmode]
appname = "nightmode"
summary = "*"
set_stack_tag = "nightmode"
format = "<b>%s</b>\n%b"
[sxhkd]
appname = "sxhkd"
summary = "*"
set_stack_tag = "sxhkd"
format = "<b>%s</b>\n%b"
[layouts]
appname = "layouts"
summary = "*"
set_stack_tag = "layouts"
format = "<b>%s</b>\n%b"
[bspwm]
appname = "bspwm"
summary = "*"
set_stack_tag = "bspwm"
format = "<b>%s</b>\n%b"
[todo]
appname = "todo"
summary = "*"
set_stack_tag = "todo"
format = "<b>%s</b>\n%b"
new_icon = custom-to-do
background = "#161b20"
foreground = "#c397d8"
[picom]
appname = "picom"
summary = "*"
set_stack_tag = "picom"
format = "<b>%s</b>\n%b"
[spotify]
appname = "spotify"
summary = "*"
set_stack_tag = "spotify"
format = "<span size='x-large' font_desc='Cooper Hewitt 12' weight='bold' foreground='#79dcaa'>%s</span>\n%b"
[mpd]
appname = "mpd"
summary = "*"
set_stack_tag = "mpd"
format = "<span size='x-large' font_desc='Cooper Hewitt 12' weight='bold' foreground='#c397d8'>%s</span>\n%b"
[firefox]
appname = firefox
new_icon = firefox-default
[network]
appname = network
new_icon = network
summary = "*"
format = "<span size='x-large' weight='bold'>%s</span>\n<span font_desc='Cooper Hewitt,Iosevka Nerd Font 12'>%b</span>"
# vim:filetype=dosini
```
</details>
<details>
<summary>A sample <code>eww.yuck</code> configuration.</summary>
```lisp
(include "./src/yuck/_env.yuck")
(include "./src/yuck/_lib.yuck")
;; (include "./src/yuck/vertigo/_init.yuck")
;; (include "./src/yuck/disclose/_init.yuck")
;; (include "./src/yuck/avatar/_init.yuck")
;; (include "./src/yuck/melody/_init.yuck")
;; (include "./src/yuck/lumin/_init.yuck")
;; (include "./src/yuck/origin/_init.yuck")
;; (include "./src/yuck/ocular/_init.yuck")
;; (include "./src/yuck/clime/_init.yuck")
;; (include "./src/yuck/power/_init.yuck")
;; (include "./src/yuck/chrono/_init.yuck")
;; (include "./src/yuck/bolt/_init.yuck")
; vim:filetype=yuck
```
</details>
<details>
<summary>A sample <code>ewwrc</code> configuration.</summary>
```json
{
"player": {
"mpd_cache": "$XDG_CACHE_HOME/eww/mpd",
"pctl_cache": "$XDG_CACHE_HOME/eww/pctl",
"default_art": "$XDG_CONFIG_HOME/eww/assets/cover.png"
},
"desktops": {
"states": {
"focused": "北",
"occupied": "",
"urgent": "梅",
"empty": ""
},
"tags": {
"hidden": "",
"sticky": "",
"private": "",
"locked": "",
"marked": "",
"empty": ""
},
"layouts": {
"monocle": "",
"tiled": "",
"fullscreen": "",
"pseudo_tiled": "",
"floating": "",
"empty": ""
}
},
"network": {
"interface": "CURRENTLY_NOT_IN_USE"
},
"notify": {
"limit": 50,
"interval": 0.5,
"cache_path": "$XDG_CACHE_HOME/eww/dunst/notifications.txt",
"quote_path": "$XDG_CACHE_HOME/eww/dunst/quotes.txt",
"default_quote": "To fake it is to stand guard over emptiness. ── Arthur Herzog",
"timestamp": "%H:%M",
"excluded_appnames": null
},
"location": {
"method": "automatic",
"cache_dir": "$XDG_CACHE_HOME/eww/location",
"latitude": null,
"longitude": null,
"city": null,
"country_code": null,
"lang": null,
"zip": null
},
"tokens": {
"openweather": "641f54ef8b6cc337c7ea7e6d3881730d",
"gmail": "CURRENTLY_NOT_IN_USE"
},
"weather": {
"units": "metric",
"cache_dir": "$XDG_CACHE_HOME/eww/weather",
"icons": {
"01d": "",
"02d": "",
"03d": "",
"04d": "",
"09d": "",
"10d": "",
"11d": "",
"13d": "",
"50d": "",
"01n": "",
"02n": "",
"03n": "",
"04n": "",
"09n": "",
"10n": "",
"11n": "",
"13n": "",
"50n": "",
"default": ""
},
"images": {
"01d": "$XDG_CONFIG_HOME/eww/assets/01.jpg",
"02d": "$XDG_CONFIG_HOME/eww/assets/02.jpg",
"03d": "$XDG_CONFIG_HOME/eww/assets/03.jpg",
"04d": "$XDG_CONFIG_HOME/eww/assets/04.jpg",
"09d": "$XDG_CONFIG_HOME/eww/assets/09.jpg",
"10d": "$XDG_CONFIG_HOME/eww/assets/10.jpg",
"11d": "$XDG_CONFIG_HOME/eww/assets/11.jpg",
"13d": "$XDG_CONFIG_HOME/eww/assets/13.jpg",
"50d": "$XDG_CONFIG_HOME/eww/assets/50.jpg",
"01n": "$XDG_CONFIG_HOME/eww/assets/01.jpg",
"02n": "$XDG_CONFIG_HOME/eww/assets/02.jpg",
"03n": "$XDG_CONFIG_HOME/eww/assets/03.jpg",
"04n": "$XDG_CONFIG_HOME/eww/assets/04.jpg",
"09n": "$XDG_CONFIG_HOME/eww/assets/09.jpg",
"10n": "$XDG_CONFIG_HOME/eww/assets/10.jpg",
"11n": "$XDG_CONFIG_HOME/eww/assets/11.jpg",
"13n": "$XDG_CONFIG_HOME/eww/assets/13.jpg",
"50n": "$XDG_CONFIG_HOME/eww/assets/50.jpg",
"default": "$XDG_CONFIG_HOME/eww/assets/01.jpg"
}
},
"covid": {
"cache_dir": "$XDG_CACHE_HOME/eww/covid",
"icons": {
"country": "",
"confirmed": "",
"deaths": ""
}
},
"pollution": {
"cache_dir": "$XDG_CACHE_HOME/eww/pollution",
"icons": {
"good": "",
"fair": "",
"moderate": "",
"poor": "",
"very_poor": ""
}
},
"github": {
"cache_dir": "$XDG_CACHE_HOME/eww/github",
"username": "dharmx"
},
"layouts": [
{
"label": "tiled",
"icon": "",
"command": ""
},
{
"label": "monocle",
"icon": "",
"command": ""
},
{
"label": "even",
"icon": "",
"command": ""
},
{
"label": "grid",
"icon": "",
"command": ""
},
{
"label": "rgrid",
"icon": "",
"command": ""
},
{
"label": "rtall",
"icon": "",
"command": ""
},
{
"label": "rwide",
"icon": "",
"command": ""
},
{
"label": "tall",
"icon": "",
"command": ""
},
{
"label": "wide",
"icon": "",
"command": ""
}
]
}
```
</details>
<details>
<summary>A sample <code>_override.scss</code> configuration.</summary>
```scss
// exclude eww-vertigo in picom shadows exclude section
// this is an example to override the default vertigo style
// and make the bar transparent. Enjoy.
// .vertigo-layout-box {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-node-button-tiled { color: $base14; }
// .vertigo-node-button-monocle { color: $base11; }
// .vertigo-node-button-float { color: $base13; }
// .vertigo-node-button-pseudo { color: $base15; }
// .vertigo-node-button-full { color: $base09; }
// .vertigo-node-button-other { color: $base08; }
// .vertigo-node-button:hover { opacity: 0.8; }
// .vertigo-node-button-tiled,
// .vertigo-node-button-monocle,
// .vertigo-node-button-float,
// .vertigo-node-button-pseudo,
// .vertigo-node-button-full,
// .vertigo-node-button-other {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-battery-button {
// background-color: rgb(0, 0, 0, 0.0);
// color: $base11;
// }
// .vertigo-time-button {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-volume-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-volume-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-volume-on:hover { background-color: $base13; }
// .vertigo-volume-off:hover { background-color: $base11; }
// .vertigo-nightmode-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-nightmode-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-nightmode-on:hover { background-color: $base09; color: $shade01; }
// .vertigo-nightmode-off:hover { background-color: $base13; color: $shade01; }
// .vertigo-notify-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-notify-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-notify-on:hover { background-color: $base15; color: $base02; }
// .vertigo-notify-off:hover { background-color: $base11; color: $base02; }
// .vertigo-todo-button { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-todo-button:hover { background-color: $base07; color: $base01; }
// .vertigo-workspace-plus-button { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-plus-button:hover { background-color: $base11; color: $base02; }
// .vertigo-time-button:hover { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-separator {
// opacity: 0.0;
// }
// .vertigo-search-button {
// color: $base09;
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-search-button:hover { background-color: rgb(0, 0, 0, 0.0); color: $base07; }
// .vertigo-workspace { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace:hover { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-focused {
// background-color: rgb(0, 0, 0, 0.0);
// border-right-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-workspace-occupied:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-urgent:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-local:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// vim:ft=scss
```

</details>
<div align="center">
# ⚠ UNDER CONSTRUCTION ⚠
<div>
================================================
FILE: .github/workflows/stale.yml
================================================
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '44 19 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 14
================================================
FILE: .gitignore
================================================
**/.*-env
src/shell/__pycache__/
.venv/
.config.json
config.json
ewwrc
.ewwrc
themes/auto.scss
eww.yuck
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
================================================
FILE: eww.scss
================================================
@import "themes/radium";
@import "src/scss/base";
@import "src/scss/avatar/init";
@import "src/scss/disclose/init";
@import "src/scss/vertigo/init";
@import "src/scss/ocular/init";
@import "src/scss/lumin/init";
@import "src/scss/melody/init";
@import "src/scss/origin/init";
@import "src/scss/horizon/init";
@import "src/scss/clime/init";
@import "src/scss/power/init";
@import "src/scss/chrono/init";
@import "src/scss/bolt/init";
@import "src/scss/override";
================================================
FILE: requirements.txt
================================================
dbus-python==1.2.18
PyGObject==3.42.2
python-mpd2==3.0.5
requests==2.32.4
Wand==0.6.8
================================================
FILE: src/scss/_base.scss
================================================
* {
all: unset;
transition: 200ms ease-out;
}
tooltip {
font-family: Phosphor, Dosis;
background-color: $base15;
color: $base01;
font-size: 14px;
}
// vim:ft=scss
================================================
FILE: src/scss/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/avatar/_init.scss
================================================
.avatar-layout-box {
font-family: Phosphor, Dosis, "Iosevka Nerd Font", sans-serif;
background-color: $shade10;
padding: 0.5em;
}
.avatar-headers-label {
color: $base05;
}
.avatar-headers-close {
color: $base11;
}
.avatar-headers-close:hover {
color: $base09;
}
.avatar-headers {
padding: 1.2em 1.5em 0.8em 1.5em;
font-size: 25;
font-family: Phosphor, "Caviar Dreams";
}
.avatar-box-inner:last-child {
margin-bottom: 0.6em;
}
@import "mpd";
@import "pctl";
@import "userinfo";
@import "quick";
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/avatar/_mpd.scss
================================================
.avatar-mpd-box {
font-family: Phosphor, Dosis, "Iosevka Nerd Font", sans-serif;
border-radius: 1em;
background-repeat: no-repeat;
background-size: contain;
background-position: right;
padding: 1.5em;
}
.avatar-mpd-icon {
font-size: 30;
margin-right: 0.6em;
}
.avatar-mpd-icon,
.avatar-mpd-name { font-weight: 500; }
.avatar-mpd-separator {
font-size: 15;
padding: 0 0.5em 0 0.5em;
}
.avatar-mpd-artist,
.avatar-mpd-title { font-size: 20; }
.avatar-mpd-title { font-weight: bold; }
.avatar-mpd-controls { font-size: 25; }
.avatar-mpd-button-playback:hover { color: $base10; }
.avatar-mpd-button-prev:hover { color: $base09; }
.avatar-mpd-button-next:hover { color: $base09; }
.avatar-mpd-button-like {
padding-left: 0.5em;
font-size: 30;
}
.avatar-mpd-button-like:hover { color: $base11; }
.avatar-mpd-minimal { font-size: 20; }
.avatar-mpd-footer { font-size: 17; }
.avatar-mpd-progress {
trough {
background-color: darken($base05, 25%);
min-height: 0.3em;
border-radius: 0.2em;
highlight {
background-color: lighten($base05, 15%);
border-radius: 0.2em;
}
slider {
background: lighten($base05, 25%);
border-radius: 100%;
margin: -8px;
}
}
}
.avatar-mpd-button-playback {
font-size: 50;
}
.ava-mpdx-box {
background-color: $shade09;
font-family: Phosphor, Dosis, sans-serif;
border-radius: 0.5em;
font-size: 30;
padding: 1em;
}
.ava-mpdx-btn {
background-color: $shade05;
color: $base04;
border-radius: 2em;
padding: 1.3em;
&:hover {
background-color: $shade03;
}
}
.ava-mpdx-btn:active {
background-color: $shade00;
}
.ava-mpdx-random-on:hover,
.ava-mpdx-consume-on:hover,
.ava-mpdx-single-on:hover,
.ava-mpdx-xfade-on:hover,
.ava-mpdx-repeat-on:hover {
background-color: $shade05;
color: $base04;
}
.ava-mpdx-xfade-off,
.ava-mpdx-repeat-off,
.ava-mpdx-random-off,
.ava-mpdx-single-off,
.ava-mpdx-consume-off {
background-color: $shade05;
}
.ava-mpdx-xfade-off {
color: $base15;
}
.ava-mpdx-repeat-off {
color: $base13;
}
.ava-mpdx-random-off {
color: $base11;
}
.ava-mpdx-single-off {
color: $base14;
}
.ava-mpdx-consume-off {
color: $base08;
}
.ava-mpdx-btn-shuffle {
color: $base07;
}
.ava-mpdx-random-on {
background-color: $base11;
color: $base02;
}
.ava-mpdx-consume-on {
background-color: $base08;
color: $base02;
}
.ava-mpdx-single-on {
background-color: $base14;
color: $base02;
}
.ava-mpdx-xfade-on {
background-color: $base15;
color: $base02;
}
.ava-mpdx-repeat-on {
background-color: $base13;
color: $base02;
}
// vim:ft=scss
================================================
FILE: src/scss/avatar/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/avatar/_pctl.scss
================================================
.avatar-pctl-box {
font-family: Phosphor, Dosis, "Iosevka Nerd Font", sans-serif;
border-radius: 1em;
background-repeat: no-repeat;
background-size: contain;
background-position: right;
padding: 1.5em;
color: $base05;
}
.avatar-pctl-icon {
font-size: 30;
margin-right: 0.6em;
}
.avatar-pctl-icon,
.avatar-pctl-name { font-weight: 500; }
.avatar-pctl-separator {
font-size: 15;
padding: 0 0.5em 0 0.5em;
}
.avatar-pctl-artist,
.avatar-pctl-title { font-size: 20; }
.avatar-pctl-title { font-weight: bold; }
.avatar-pctl-controls { font-size: 30; }
.avatar-pctl-button-playback {
font-size: 50;
}
.avatar-pctl-button-playback:hover { color: $base10; }
.avatar-pctl-button-prev:hover { color: $base09; }
.avatar-pctl-button-next:hover { color: $base09; }
.avatar-pctl-minimal { font-size: 20; }
// vim:ft=scss
================================================
FILE: src/scss/avatar/_quick.scss
================================================
.ava-quick-box {
font-family: Phosphor, monoMMM_5;
background-color: $shade09;
font-size: 15;
border-radius: 1em;
padding: 1.5em;
}
.ava-main-label {
color: $base15;
}
.ava-quick-vol {
trough {
background-color: $base02;
min-height: 0.3em;
border-radius: 3em;
highlight {
padding: 2.5em;
background-color: $base11;
border-radius: 3em;
}
}
}
.ava-quick-mic {
trough {
background-color: $base02;
min-height: 0.3em;
border-radius: 3em;
highlight {
padding: 2.5em;
background-color: $base09;
border-radius: 3em;
}
}
}
.ava-btn-mi,
.ava-btn-all,
.ava-btn-au {
background-color: $shade03;
border-radius: 2em;
padding: 4em;
label {
font-size: 50;
}
}
.ava-mpd-ebox {
background-color: $shade03;
border-radius: 2em;
padding: 4em;
label {
font-size: 50;
}
}
.ava-btn-mi {
label {
color: $base11;
}
}
.ava-btn-au {
label {
color: $base14;
}
}
.ava-btn-all {
label {
color: $base15;
}
}
.ava-btn-au:hover,
.ava-btn-all:hover,
.ava-btn-mi:hover,
.ava-mpd-ebox:hover {
background-color: $shade02;
}
.ava-mpd-radial {
margin: 1.2em;
color: $base09;
background-color: $shade02;
label {
color: $base09;
background-color: $shade01;
padding: 0.8em;
}
}
.ava-au-btn-box,
.ava-mi-btn-box,
.ava-all-btn-box,
.ava-mp-btn-box {
background-color: $shade07;
border-radius: 2em;
padding-bottom: 1.2em;
}
.ava-au-head,
.ava-all-head,
.ava-mi-head,
.ava-mp-head {
padding: 1em 0 1em 1.5em;
color: $base04;
}
.ava-mi-scale-lbl,
.ava-au-scale-lbl {
font-size: 20;
font-weight: bold;
border-radius: 4em;
font-family: Dosis;
padding: 0 1.4em 0 1.4em;
}
.ava-mi-scale-lbl {
color: $base02;
background-color: $base09;
}
.ava-au-scale-lbl {
color: $base02;
background-color: $base11;
}
.ava-sep {
font-size: 5;
border-radius: 1em;
background-color: $base03;
}
// vim:filetype=scss
================================================
FILE: src/scss/avatar/_userinfo.scss
================================================
.avatar-profile-user-box {
background: linear-gradient(45deg, rgba(16, 19, 23, 1.0) 20%, $base01 100%);
padding: 2em 2.5em 0 2.5em;
margin: 2em;
border-radius: 0.5em;
box-shadow: 1px 1px 3px 2px $shade09;
}
.avatar-profile-username {
color: $base09;
font-size: 25;
font-weight: bold;
padding-top: 0.5em;
}
.avatar-profile-hostname {
color: $base11;
padding-top: 0.2em;
}
.avatar-icon { padding-right: 0.7em; }
.avatar-quick-settings {
padding: 1em;
margin-top: 3em;
color: $base04;
}
.avatar-profile-bluetooth-on .avatar-icon { color: $base14; }
.avatar-profile-bluetooth-off .avatar-icon { color: $base11; }
.avatar-icon-connected { color: $base14; }
.avatar-icon-disconnected { color: $base11; }
.avatar-icon-connecting { color: $base13; }
.avatar-icon-unavailable { color: $base03; }
.avatar-icon-unmanaged { color: $base09; }
.avatar-icon-deactivating { color: $base10; }
.avatar-icon-using { color: $base12; }
.avatar-updates-has .avatar-icon { color: $base13; }
.avatar-updates-none .avatar-icon { color: $base14; }
.avatar-box-inner { padding: 1em; }
// vim:ft=scss
================================================
FILE: src/scss/bolt/_init.scss
================================================
.bolt-layout-box {
font-family: Phosphor, Dosis;
background-color: $shade08;
color: $base05;
padding: 2em;
border-radius: 0.5em;
color: $base05;
}
.bolt-date-box {
padding: 1.5em 2em 1.6em 1.5em;
background-image: linear-gradient(100deg, $shade05, $shade06);
border-radius: 0.5em;
}
.bolt-date-pretty {
font-size: 16;
color: $base04;
}
.bolt-date-day {
font-size: 23;
}
.bolt-bat-overlay {
color: $base03;
}
.bolt-bat-prog {
border-radius: 0.5em;
trough {
padding: 3em 0 3em 0;
background-color: $low;
border-radius: 0.5em;
progress {
padding: 3em 1em 3em 1em;
background-color: rgba(darken($base14, 10%), 0.8);
border-radius: 0.5em;
}
}
}
.bolt-bat-label {
font-size: 16;
padding-left: 1em;
}
.bolt-bat-status-label {
font-size: 20;
font-weight: bold;
padding-left: 0.8em;
}
.bolt-bat-icon {
padding-right: 1em;
font-size: 30;
}
.bolt-bat-full {
trough {
background-color: $low;
progress {
background-color: rgba(darken($base14, 10%), 0.8);
}
}
}
.bolt-bat-norm {
trough {
background-color: $normal;
progress {
background-color: rgba(darken($base09, 10%), 0.8);
}
}
}
.bolt-bat-warn {
trough {
background-color: $other;
progress {
background-color: rgba(darken($base13, 10%), 0.8);
}
}
}
.bolt-bat-crit {
trough {
background-color: $critical;
progress {
background-color: rgba(darken($base11, 10%), 0.8);
}
}
}
.bolt-pctl-box {
background-repeat: no-repeat;
background-size: contain;
background-position: right;
padding: 1em;
border-radius: 0.5em;
}
.bolt-pctl-label {
font-size: 16;
color: $base04;
}
.bolt-pctl-title {
font-size: 20;
font-weight: bold;
color: $base05;
}
.bolt-pctl-artist {
font-size: 16;
color: $base04;
}
.bolt-pctl-volume-icon {
font-size: 25;
}
.bolt-pctl-volume-label {
font-size: 18;
padding-top: 0.25em;
}
.bolt-pctl-status {
font-size: 30;
}
.bolt-pctl-status:hover {
color: $base15;
}
.bolt-uptime-box {
background-color: $shade05;
padding: 1.2em;
border-radius: 0.5em;
}
.bolt-uptime-label {
color: $base04;
font-size: 16;
}
.bolt-uptime-value {
font-size: 18;
color: $base05;
}
.bolt-uptime-hl {
background-color: $base09;
font-size: 1;
padding: 2em;
margin-top: 4em;
margin-bottom: 4em;
border-radius: 0.1rem;
}
.bolt-wifi-box {
background-color: $shade05;
padding: 1.2em;
border-radius: 0.5em;
}
.bolt-wifi-label {
font-size: 16;
color: $base04;
}
.bolt-wifi-ssid {
font-size: 18;
color: $base05;
}
.bolt-wifi-icon {
font-size: 25;
background-color: $shade08;
padding: 0.8em;
border-radius: 0.2em;
color: $base09;
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/bolt/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/chrono/_init.scss
================================================
.chrono-layout-box {
font-family: Phosphor, "Caviar Dreams";
background-color: $shade10;
padding-top: 0.7em;
font-size: 16;
}
.chrono-layout-box:last-child {
padding-bottom: 1em;
}
.chrono-weather-box {
padding: 0 2.8em 0 2.8em;
background-size: 120%;
background-repeat: no-repeat;
border-radius: 0.5em;
background-blend-mode: exclusion;
}
.chrono-weather-glyph {
font-size: 120;
padding-top: 0.2em;
}
.chrono-weather-main {
font-size: 35;
font-weight: bold;
font-family: "Caviar Dreams";
}
.chrono-sundial-prefix,
.chrono-sundial-label {
padding: 0;
margin: 0;
font-size: 15;
font-family: Phosphor, "Caviar Dreams";
font-weight: 500;
}
.chrono-weather-info-box {
border-radius: 0.5em;
opacity: 0.8;
font-size: 15;
}
.chrono-sundial-prefix,
.chrono-weather-min-icon,
.chrono-weather-pressure-icon,
.chrono-weather-location-icon,
.chrono-weather-max-icon,
.chrono-weather-humid-icon {
padding-bottom: 0.1em;
font-size: 20;
}
.chrono-weather-temp-feels {
padding-top: 1em;
}
.chrono-weather-feels {
font-size: 17;
}
.chrono-sundial-prefix {
color: darken($base15, 30%);
}
.chrono-weather-max-icon {
color: $base11;
}
.chrono-weather-min-icon {
color: darken($base09, 20%);
}
.chrono-weather-location-icon {
color: darken($base07, 20%);
}
.chrono-weather-pressure-icon {
color: lighten($base13, 10%);
}
.chrono-sundial-label,
.chrono-weather-min-label,
.chrono-weather-location-label,
.chrono-weather-pressure-label,
.chrono-weather-max-label {
font-weight: bold;
}
.chrono-weather-temp {
font-size: 100;
font-weight: bold;
}
.chrono-calen-box {
font-size: 16;
background-image: linear-gradient(100deg, $shade02, $shade06);
color: $base05;
padding: 3em 0 0 0;
border-radius: 0.5em;
}
.chrono-calen-label {
font-weight: bold;
font-family: "Caviar Dreams";
}
.chrono-calen {
font-family: Dosis;
font-weight: bold;
padding: 1.3em 0.5em 0;
&:selected {
color: $base15;
font-weight: bolder;
border-radius: 50%;
}
&:indeterminate {
color: rgba($shade03, 0.3);
}
}
.chrono-calen.button {
color: $shade00;
}
.chrono-calen.highlight {
color: $base09;
font-weight: bold;
}
.chrono-time-box {
background-image: linear-gradient(100deg, $shade02, $shade06);
border-radius: 0.5em;
padding: 2.5em 1.5em 2.5em 1.5em;
color: $base05;
}
.chrono-time-label {
font-size: 70;
font-weight: bolder;
color: $base09;
font-family: Modum;
}
.chrono-prog {
background-color: $shade00;
color: darken($base09, 5%);
}
.chrono-prog label {
padding: 1em;
background-color: $shade02;
color: $base05;
font-weight: bold;
font-size: 25;
font-family: Iosevka;
}
.chrono-prog-minute label {
padding: 1.55em;
}
.chrono-prog-minute {
background-color: $shade04;
color: $base09;
}
.chrono-sep {
background-color: $shade00;
padding-left: 0.25em;
border-radius: 0.5em;
}
.chrono-uptime-label {
font-size: 18;
font-family: Modum;
}
.chrono-weather-extra {
font-family: Phosphor, Dosis;
background-image: linear-gradient(100deg, $shade02, $shade06);
border-radius: 0.5em;
padding: 2em 0 2em 0;
font-size: 16;
color: $base05
}
.chrono-weather-extra-header {
color: $base15;
font-size: 20;
font-weight: bold;
}
.chrono-weather-extra-description {
font-size: 12;
}
.chrono-weather-humid-text,
.chrono-weather-visible-text,
.chrono-weather-wind-text,
.chrono-weather-cloud-text {
color: $base09;
font-weight: bold;
}
.chrono-weather-humid-label,
.chrono-weather-visible-label,
.chrono-weather-wind-label,
.chrono-weather-cloud-label {
color: $base04;
}
.chrono-weather-humid-icon,
.chrono-weather-visible-icon,
.chrono-weather-wind-icon,
.chrono-weather-cloud-icon {
font-size: 20;
}
.chrono-headers-label {
color: $base05;
}
.chrono-headers-close {
color: $base11;
}
.chrono-headers-close:hover {
color: $base09;
}
.chrono-headers {
padding: 1em 1.5em 0.5em 1.5em;
font-size: 25;
}
.chrono-air-box {
background-image: linear-gradient(100deg, $shade02, $shade06);
border-radius: 0.5em;
font-family: Phosphor, Dosis;
padding: 1.5em;
padding-bottom: 2em;
}
.chrono-aqi-box {
padding: 1em;
}
.chrono-aqi-radial label {
padding: 1em;
font-size: 40;
background-color: $shade05;
}
.chrono-aqi-radial {
background-color: $shade01;
}
.chrono-air-radial-1 {
color: $base14;
}
.chrono-air-radial-2 {
color: $base09;
}
.chrono-air-radial-3 {
color: $base13;
}
.chrono-air-radial-4 {
color: lighten($base11, 0.5);
}
.chrono-air-radial-5 {
color: $base11;
}
.chrono-aqi-inner {
font-size: 20;
border-radius: 0.3em;
padding: 2em;
}
.chrono-aqi-inner-1 {
background-image: linear-gradient(100deg, $shade01, rgba($base14, 0.5));
}
.chrono-aqi-inner-2 {
background-image: linear-gradient(100deg, $shade01, rgba($base09, 0.5));
}
.chrono-aqi-inner-3 {
background-image: linear-gradient(100deg, $shade01, rgba($base13, 0.5));
}
.chrono-aqi-inner-4 {
background-image: linear-gradient(100deg, $shade01, rgba(lighten($base11, 10%), 0.5));
}
.chrono-aqi-inner-5 {
background-image: linear-gradient(100deg, $shade01, rgba($base11, 0.5));
}
.chrono-air-aqi-label {
color: $base15;
font-weight: bold;
}
.chrono-air-aqi-quality {
font-size: 16;
color: $base05;
}
.chrono-air-separator {
background-color: $shade00;
padding-left: 0.18em;
font-size: 5;
border-radius: 0.5em;
}
.chrono-info-label {
color: $base15;
font-weight: bold;
font-size: 20;
}
.chrono-air-co-box,
.chrono-air-o3-box,
.chrono-air-no-box,
.chrono-air-no2-box,
.chrono-air-so2-box,
.chrono-air-pm2_5-box,
.chrono-air-pm10-box,
.chrono-air-nh3-box {
font-size: 16;
}
.chrono-air-co-label,
.chrono-air-o3-label,
.chrono-air-no-label,
.chrono-air-no2-label,
.chrono-air-so2-label,
.chrono-air-pm2_5-label,
.chrono-air-pm10-label,
.chrono-air-nh3-label {
color: $base09;
font-weight: bold;
}
.chrono-air-co-value,
.chrono-air-o3-value,
.chrono-air-no-value,
.chrono-air-no2-value,
.chrono-air-so2-value,
.chrono-air-pm2_5-value,
.chrono-air-pm10-value,
.chrono-air-nh3-value {
color: $base04;
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/chrono/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/clime/_init.scss
================================================
.clime-layout-box {
font-family: "Caviar Dreams", Phosphor;
font-size: 17;
opacity: 0.8;
}
.clime-img {
font-size: 80;
padding-left: 0.2em;
color: $base04;
}
.clime-temp {
font-size: 60;
font-family: Sagetarius;
font-weight: bold;
}
.clime-city {
margin-bottom: 0.5em;
}
.clime-category,
.clime-max,
.clime-min {
font-weight: bold;
}
@import "override";
// vim:filetype=scss
================================================
FILE: src/scss/clime/_override.scss
================================================
================================================
FILE: src/scss/disclose/_cardimage.scss
================================================
.disclose-cardimage-eventbox {
background: linear-gradient(45deg, $base02 20%, $base01 100%);
border-radius: 0.5em;
}
.disclose-cardimage-eventbox:hover {
background: linear-gradient(170deg, $base01 20%, $shade01 100%);
}
.disclose-cardimage-icon {
margin: 0 0 0 -0.21em;
background-size: cover;
background-repeat: no-repeat;
border-radius: 50%;
}
.disclose-cardimage-image-box {
padding: 0 1em 0 1em;
}
.disclose-cardimage-image {
background-size: cover;
background-repeat: no-repeat;
box-shadow: -0.4px -0.3px 4px 4px $shade08;
border-radius: 50%;
border: 0.25em solid $base09;
}
.disclose-cardimage-separator {
background-color: $shade02;
font-size: 1;
padding: 3.4em 0 0 0;
margin: 0 10em 0 10em;
}
.disclose-cardimage-body-box {
font-size: 15;
padding: 1em 0 1em 0;
}
.disclose-cardimage-summary-box {
padding: 0.5em 0 0.5em 0.9em;
background-color: darken($base09, 10%);
border-radius: 0.3em 0.3em 0 0;
color: $base02;
}
.disclose-cardimage-appname-label {
font-size: 16;
font-weight: bold;
}
.disclose-cardimage-close-button {
margin: 0.6em 1em 0.6em 0;
padding: 0.2em;
background-color: $base11;
color: $base01;
border-radius: 50%;
box-shadow: -0.4px -0.3px 4px -1.8px $shade09;
}
.disclose-cardimage-close-button:hover {
background-color: $base01;
color: $base11;
}
.disclose-cardimage-body-outer {
padding: 0 1em 0 0;
}
.disclose-cardimage-summary-label {
font-size: 20;
font-weight: bold;
color: $base05;
}
.disclose-cardimage-body-label {
font-size: 16;
color: $base05;
}
.disclose-cardimage-timestamp {
color: $base10;
font-weight: bold;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_cardprog.scss
================================================
.disclose-cardprog-eventbox {
background: linear-gradient(45deg, $base02 20%, $base01 100%);
border-radius: 0.5em;
}
.disclose-cardprog-eventbox:hover {
background: linear-gradient(170deg, $base01 20%, $shade01 100%);
}
.disclose-cardprog-icon {
margin: 0 0 0 -0.21em;
background-size: cover;
background-repeat: no-repeat;
}
.disclose-cardprog-image-box {
padding: 0 1em 0 1em;
}
.disclose-cardprog-image {
background-size: cover;
background-repeat: no-repeat;
box-shadow: -0.4px -0.3px 4px 4px $shade08;
border-radius: 50%;
border: 0.25em solid $base09;
}
.disclose-cardprog-separator {
background-color: $shade02;
font-size: 1;
padding: 3.4em 0 0 0;
margin: 0 10em 0 10em;
}
.disclose-cardprog-body-box {
font-size: 15;
padding: 1em 0 1em 0;
}
.disclose-cardprog-summary-box {
padding: 0.5em 0 0.5em 0.9em;
background-color: darken($base09, 10%);
border-radius: 0.3em 0.3em 0 0;
color: $base02;
}
.disclose-cardprog-appname-label {
font-size: 16;
font-weight: bold;
}
.disclose-cardprog-close-button {
margin: 0.6em 1em 0.6em 0;
padding: 0.2em;
background-color: $base11;
color: $base01;
border-radius: 50%;
box-shadow: -0.4px -0.3px 4px -1.8px $shade09;
}
.disclose-cardprog-close-button:hover {
background-color: $base01;
color: $base11;
}
.disclose-cardprog-body-outer {
padding: 0 1em 0 0;
}
.disclose-cardprog-summary-label {
font-size: 20;
font-weight: bold;
color: $base05;
}
.disclose-cardprog-body-label {
font-size: 16;
color: $base05;
}
.disclose-cardprog-timestamp {
color: $base10;
font-weight: bold;
}
.disclose-cardprog-scale {
background-color: $shade01;
border-radius: 0.2em;
margin: 0.5em 0 0.5em;
contents {
trough {
border-radius: 0.2em;
// Uncomment to enable slider pointer
// slider {
// margin: -8px;
// background-color: $base15;
// box-shadow: -0.4px -0.3px 4px -1.8px $shade09;
// border-radius: 20%;
// }
highlight {
background-color: $base09;
padding: 0.7em;
border-radius: 0.2em;
}
}
}
}
.disclose-cardprog-value-label {
padding: 0 0.5em 0 0.5em;
margin: 0.2em 0 0.2em 0;
color: $base02;
font-weight: 700;
background-color: $base10;
border-radius: 10%;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_cardradial.scss
================================================
.disclose-cardradial-eventbox {
background: linear-gradient(45deg, $base02 20%, $base01 100%);
border-radius: 0.5em;
}
.disclose-cardradial-eventbox:hover {
background: linear-gradient(170deg, $base01 20%, $shade01 100%);
}
.disclose-cardradial-separator {
background-color: $shade02;
font-size: 1;
padding: 3.4em 0 0 0;
margin: 0 10em 0 10em;
}
.disclose-cardradial-body-box {
font-size: 15;
padding: 1em 0 1em 0;
}
.disclose-cardradial-summary-box {
padding: 0.5em 0 0.5em 0.9em;
background-color: darken($base09, 10%);
border-radius: 0.3em 0.3em 0 0;
color: $base02;
}
.disclose-cardradial-appname-label {
font-size: 16;
font-weight: bold;
}
.disclose-cardradial-close-button {
margin: 0.6em 1em 0.6em 0;
padding: 0.2em;
background-color: $base11;
color: $base01;
border-radius: 50%;
box-shadow: -0.4px -0.3px 4px -1.8px $shade09;
}
.disclose-cardradial-close-button:hover {
background-color: $base01;
color: $base11;
}
.disclose-cardradial-body-outer {
padding: 0 1em 0 0;
}
.disclose-cardradial-summary-label {
font-size: 20;
font-weight: bold;
color: $base05;
}
.disclose-cardradial-body-label {
font-size: 16;
color: $base05;
}
.disclose-cardradial-timestamp {
color: $base10;
font-weight: bold;
}
.disclose-cardradial-circle-box {
padding: 0 1em 0 1em;
}
.disclose-cardradial-circle {
font-size: 25;
color: $base09;
background-color: $shade01;
}
.disclose-cardradial-tasks {
padding: 1.4em;
font-weight: bolder;
color: $base10;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_cardscr.scss
================================================
.disclose-cardscr-eventbox {
background: linear-gradient(45deg, $base02 20%, $base01 100%);
border-radius: 0.5em;
}
.disclose-cardscr-eventbox:hover {
background: linear-gradient(170deg, $shade01 20%, $base01 100%);
}
.disclose-cardscr-summary-box {
padding: 0.5em 0 0 1em;
border-radius: 0.3em 0.3em 0 0;
color: $base02;
}
.disclose-cardscr-close-button {
margin: 0.6em 1em 0.6em 0;
padding: 0.2em;
background-color: $base11;
color: $base01;
border-radius: 50%;
box-shadow: -0.4px -0.3px 4px -1.8px $shade09;
}
.disclose-cardscr-close-button:hover {
background-color: $base01;
color: $base11;
}
.disclose-cardscr-summary-label {
font-size: 20;
font-weight: bold;
color: $base05;
}
.disclose-cardscr-body-label {
font-size: 16;
color: $base05;
}
.disclose-cardscr-timestamp {
color: $base10;
font-weight: bold;
}
.disclose-cardscr-image {
margin: 1em;
border-radius: 0.5em;
background-size: cover;
background-repeat: no-repeat;
}
.disclose-cardscr-timestamp {
padding-right: 1em;
}
.disclose-cardscr-open-button,
.disclose-cardscr-delete-button {
font-size: 20;
font-weight: bold;
padding: 0.6em 3.72em 0.6em 3.72em;
margin-bottom: 0.7em;
border-radius: 0.2em;
color: $base02;
}
.disclose-cardscr-open-button {
background-color: darken($base09, 10%);
}
.disclose-cardscr-open-button:hover {
color: $base09;
background-color: $shade02;
}
.disclose-cardscr-delete-button {
background-color: $shade02;
color: $base11;
}
.disclose-cardscr-delete-button:hover {
background-color: $base11;
color: $shade02;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_dnd.scss
================================================
.disclose-dnd-box {
background-image: linear-gradient(to bottom left, rgba(0, 0, 0, 1.0), rgba(30, 33, 40, 0.5)), url("./assets/speaker.jpg");
background-size: cover;
background-repeat: no-repeat;
margin-right: 1em;
border-radius: 1.5em;
}
.disclose-dnd-header {
font-size: 20;
font-weight: bold;
color: $base05;
}
.disclose-dnd-footer {
font-size: 15;
color: lighten($base04, 8%);
}
.disclose-dnd-labels {
padding: 1.5em;
}
.disclose-dnd-toggle {
padding: 0.3em 0.8em 0.3em 0.8em;
border-radius: 0.3em;
font-weight: bold;
color: $base02;
opacity: 0.6;
}
.disclose-dnd-box-inner {
padding-top: 0.8em;
opacity: 0.4;
}
.disclose-dnd-total {
font-size: 40;
font-weight: bold;
color: $base13;
}
.disclose-dnd-total-label {
color: $base13;
}
.disclose-dnd-toggle:hover {
opacity: 1.0;
border-radius: 1em;
}
.disclose-dnd-toggle-ON {
background-color: $base14;
}
.disclose-dnd-toggle-OFF {
background-color: $base11;
}
.disclose-dnd-waiting-icon-label {
background-color: $base03;
border-radius: 2em;
opacity: 0.5;
}
.disclose-dnd-waiting-padding {
padding: 0 0.8em 0 0;
}
.disclose-dnd-waiting-margin {
margin: 0.3em;
}
.disclose-dnd-waiting-icon {
background-color: $base13;
margin: 0.3em;
padding: 0.2em;
border-radius: 1em;
font-size: 20;
color: $base04;
}
.disclose-dnd-waiting-label {
font-weight: 600;
}
// vim:filetype=scss
================================================
FILE: src/scss/disclose/_empty.scss
================================================
.disclose-empty-banner {
padding-top: 8em;
}
.disclose-empty-box {
padding: 1em 1em 10em 0;
}
.disclose-empty-label {
padding-top: 3em;
color: $shade00;
font-size: 16;
}
.disclose-separator {
font-size: 0.5;
background-color: $shade06;
margin: 35em 25em 35em 25em;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_init.scss
================================================
.disclose-layout-box {
background-color: $shade10;
font-family: Dosis, Phosphor, "Iosevka Nerd Font", sans-serif;
padding-bottom: 1em;
}
.disclose-headers {
padding: 1em 2em 0 2em;
margin-bottom: 1.5em;
color: $base05;
}
.disclose-headers-label {
font-size: 20;
font-family: "Caviar Dreams";
color: $base05;
opacity: 0.8;
}
.disclose-headers-clear {
font-size: 25;
color: $base09;
}
.disclose-headers-close {
font-size: 25;
color: $base11;
}
.disclose-headers-clear:hover {
color: $base14;
}
.disclose-headers-close:hover {
color: $base09;
}
.disclose-scroll {
margin: 0 1.5em 0 1.5em;
}
@import "empty";
@import "cardprog";
@import "cardscr";
@import "cardimage";
@import "cardradial";
@import "urgency";
@import "stats";
@import "dnd";
@import "modifiers";
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/disclose/_modifiers.scss
================================================
.shot-image-bord-dashed {
border-style: dashed;
}
.Spotify-rectangle {
margin: 0.3em;
border-radius: 0.2em;
border-width: 0
}
.Qbittorrent-rectangle {
border-radius: 0;
border-width: 0;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_override.scss
================================================
.disclose-cardprog-separator,
.disclose-cardradial-separator,
.disclose-cardimage-separator {
opacity: 0.0;
}
// vim:ft=scss
================================================
FILE: src/scss/disclose/_stats.scss
================================================
.disclose-stats-crit-box,
.disclose-stats-norm-box,
.disclose-stats-low-box {
background-color: $shade06;
border-radius: 3em;
margin: 0 1em 0 1em;
padding: 0.8em;
}
.disclose-stats-crit,
.disclose-stats-norm,
.disclose-stats-low {
background-color: $shade03;
}
.disclose-stats-crit {
color: $base11;
}
.disclose-stats-low {
color: $base14;
}
.disclose-stats-norm {
color: $base09;
}
.disclose-stats-crit-label,
.disclose-stats-norm-label,
.disclose-stats-low-label {
padding: 0.9em 0.9em 0.9em 0.83em;
font-size: 23;
font-weight: bold;
background-color: $shade07;
}
.disclose-stats-crit-info-value {
font-size: 20;
font-weight: bold;
color: $base11;
}
.disclose-stats-norm-info-value {
font-size: 20;
font-weight: bold;
color: $base09;
}
.disclose-stats-norm-info-box,
.disclose-stats-norm-info-box,
.disclose-stats-norm-info-box {
padding: 0 0.8em 0 1em;
}
.disclose-stats-low-info-value {
font-size: 20;
font-weight: bold;
color: $base14;
}
.disclose-stats-low-info-label,
.disclose-stats-norm-info-label,
.disclose-stats-crit-info-label {
color: $base15;
}
.disclose-stats-separator {
font-size: 1;
background-color: $shade02;
padding: 1em;
margin-left: 15em;
}
// vim:filetype=scss
================================================
FILE: src/scss/disclose/_urgency.scss
================================================
.disclose-cardimage-summary-box-CRITICAL {
background-color: darken($base11, 10%);
}
.disclose-cardimage-summary-box-LOW {
background-color: darken($base15, 10%);
}
// vim:ft=scss
================================================
FILE: src/scss/horizon/_init.scss
================================================
.horizon-layout-box {
font-family: Phosphor, Dosis;
background-color: rgba(#000, 0.0);
color: rgba($base05, 0.75);
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/horizon/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/lumin/_init.scss
================================================
.lumin-layout-box {
font-family: Phosphor, Dosis;
background-color: rgba(#000, 0.0);
color: rgba($base05, 0.75);
}
.lumin-apps-box {
font-size: 30;
}
.lumin-app-btn-one,
.lumin-app-btn-two,
.lumin-app-btn-three,
.lumin-app-btn-four,
.lumin-app-btn-five,
.lumin-app-btn-six {
border-radius: 1em;
padding: 0.2em;
color: rgba($base01, 0.6);
}
.lumin-app-btn-one,
.lumin-app-btn-two,
.lumin-app-btn-three,
.lumin-app-btn-four,
.lumin-app-btn-five,
.lumin-app-btn-six {
background-color: rgba($base08, 0.6);
}
.lumin-app-btn-one:hover,
.lumin-app-btn-two:hover,
.lumin-app-btn-three:hover,
.lumin-app-btn-four:hover,
.lumin-app-btn-five:hover,
.lumin-app-btn-six:hover { background-color: $base08; }
.lumin-day-label {
font-family: Modum;
font-size: 150;
font-weight: bold;
}
.lumin-date-label {
font-size: 20;
font-family: Koulen;
}
.lumin-quote-box {
font-size: 18;
}
.lumin-quote-icon {
font-size: 48;
margin-left: -0.08em;
color: rgba($base14, 0.7);
}
.lumin-quote-auth {
font-weight: bold;
font-size: 15;
}
.lumin-battery-box {
font-size: 20;
color: rgb($base12, 0.8);
}
.lumin-network-box {
font-size: 24;
color: rgb($base12, 0.8);
}
.lumin-separator {
font-size: 1;
background-color: rgb($base05, 0.6);
margin-top: 7em;
margin-bottom: 8em;
}
.lumin-sundial-label {
margin-top: 0.3em;
margin-left: 0.4em;
background-color: rgba($base09, 0.7);
padding: 0.3em 0.8em 0.3em 0.8em;
color: $base02;
border-radius: 0.2em;
font-family: "Poiret One";
font-weight: bold;
}
.lumin-search {
background-color: rgba($base04, 0.3);
font-size: 18;
font-family: Dosis;
font-weight: bold;
padding: 0.5em 0 0.5em 1.5em;
border-radius: 2em 0 0 2em;
}
.lumin-search-button {
background-color: rgba($base11, 0.3);
border-radius: 0 2em 2em 0;
padding: 0.5em 0.7em 0.5em 0.5em;
font-size: 25;
}
.lumin-search-button:hover {
background-color: rgba($base04, 0.3);
color: $base11;
}
@import "./_override.scss";
// vim:ft=scss
================================================
FILE: src/scss/lumin/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/melody/_init.scss
================================================
.melody-layout-box {
font-family: Phosphor, Dosis;
background-color: rgba(#000, 0.0);
color: rgba($base05, 0.75);
}
.melody-cover-box { opacity: 0.5; }
.melody-cover {
padding: 3em;
background-size: cover;
background-repeat: no-repeat;
}
.melody-cover-label {
font-family: "Poiret One";
font-weight: bold;
}
.melody-apps-box-one,
.melody-apps-box-two,
.melody-apps-box-three,
.melody-apps-box-four,
.melody-apps-box-five,
.melody-apps-box-six {
color: rgba($base05, 0.6);
font-size: 25;
}
.melody-apps-box-one:hover,
.melody-apps-box-two:hover,
.melody-apps-box-three:hover,
.melody-apps-box-four:hover,
.melody-apps-box-five:hover,
.melody-apps-box-six:hover {
color: $base05;
}
.melody-artist {
font-size: 20;
font-family: "Poiret One";
font-weight: bold;
}
.melody-title {
font-size: 15;
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/melody/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/ocular/_init.scss
================================================
.ocular-layout-box {
font-family: Phosphor, "Poiret One";
background-color: rgba(#000, 0.0);
color: $base12;
}
.ocular-battery-icon {
font-size: 35;
color: $base12;
}
.ocular-battery-label {
font-size: 18;
}
.ocular-network-icon {
font-size: 35;
color: $base14;
}
.ocular-network-label {
font-size: 18;
}
.ocular-generic-icon {
font-size: 35;
color: $base11;
}
.ocular-generic-label {
font-size: 18;
}
.ocular-time-radial label {
padding: 2em;
font-size: 40;
font-weight: bold;
}
.ocular-date-label {
font-size: 20;
}
.ocular-temp-icon {
font-size: 30;
color: $base13;
}
.ocular-temp-label {
font-size: 20;
}
.ocular-sundial-label {
background-color: $base09;
padding: 0.2em 0.5em 0.2em 0.5em;
color: $base02;
border-radius: 0.2em;
font-weight: bold;
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/ocular/_override.scss
================================================
// exclude eww-ocular in picom shadows exclude section
// this is an example to override the default ocular style
// and make the widget text labels all white. Enjoy.
// .ocular-layout-box {
// font-family: Phosphor, "Poiret One";
// background-color: rgba(#000, 0.0);
// color: $base06;
// }
// .ocular-battery-icon,
// .ocular-battery-label,
// .ocular-network-icon,
// .ocular-generic-icon,
// .ocular-temp-icon {
// color: $base06;
// }
// .ocular-sundial-label {
// background-color: $base09;
// color: $base02;
// }
// vim:ft=scss
================================================
FILE: src/scss/origin/_init.scss
================================================
.origin-layout-box {
font-family: Phosphor;
background-color: rgba(#000, 0.0);
color: rgba($base05, 0.7);
}
.origin-greet {
font-family: "Poiret One";
font-weight: bold;
font-size: 20;
}
.origin-hostname {
font-family: monoMMM_5;
color: rgba($base09, 0.7);
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/origin/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/power/_init.scss
================================================
.power-layout-box {
font-family: Phosphor;
background-repeat: no-repeat;
background-size: contain;
padding: 5em;
}
.power-label,
.power-label-icon {
font-family: Phosphor, Koulen;
font-size: 25;
background-color: rgba(#000, 0.0);
color: rgba($base04, 0.8);
}
.power-label-time {
font-size: 25;
}
.power-label-icon {
font-size: 30;
padding-bottom: 0.06em;
color: rgba($base04, 0.8);
}
.power-close-button {
font-size: 30;
color: rgba($base04, 0.8);
}
.power-close-button:hover {
color: $base11;
}
.power-box {
font-size: 35;
}
.power-box button:hover {
border-radius: 0.1em;
transition: 200ms linear background-color, border-radius;
background-color: rgba($shade00, 0.6);
}
.power-box button {
padding: 0.4em;
background-color: rgba($base03, 0.3);
color: rgba($base04, 0.5);
// box-shadow: 1px 1px 4px 4px $shade01;
}
.power-shutdown-button label {
color: rgba($base11, 0.8);
}
.power-info-net {
font-size: 25;
color: rgba($base04, 0.8);
}
.power-info-bat {
font-size: 30;
color: rgba($base04, 0.8);
}
.power-info-bat label {
font-size: 30;
color: rgba($base04, 0.6);
}
.power-separator {
color: rgba($base04, 0.6);
font-size: 15;
padding-top: 0.15em;
padding-left: 0.2em;
padding-right: 0.2em;
font-family: "Iosevka Nerd Font";
font-weight: 200;
}
.power-sundial-label {
font-size: 20;
font-weight: bold;
border-radius: 0.2em;
padding: 0.4em;
padding-bottom: 0.5em;
font-family: "Poiret One";
color: rgba($base04, 0.8);
}
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/power/_override.scss
================================================
// vim:ft=scss
================================================
FILE: src/scss/vertigo/_info.scss
================================================
.vertigo-battery-button {
background-color: $base11;
border-radius: 50% 0 0 0;
font-size: 25;
padding: 0.57em 0 0.5em 0;
color: $base01;
}
.vertigo-battery-button:hover { opacity: 0.85; }
.vertigo-time-button {
font-size: 26;
background-color: $base01;
padding: 0.4em 0 0.4em 0;
font-family: "Iosevka Nerd Font", sans-serif;
}
.vertigo-time-format-first { font-weight: bold; color: $base15; }
.vertigo-time-format-second { color: $base14; }
.vertigo-time-format-third { color: $base13; }
.vertigo-reveal-box button { padding: 0.57em 0 0.57em 0; font-size: 26; }
.vertigo-volume-on { background-color: $shade01; color: $base13; }
.vertigo-volume-off { background-color: $shade01; color: $base11; }
.vertigo-volume-on:hover { background-color: $base13; color: $shade01; }
.vertigo-volume-off:hover { background-color: $base11; color: $shade01; }
.vertigo-nightmode-on { background-color: $shade01; color: $base09; }
.vertigo-nightmode-off { background-color: $shade01; color: $base13; }
.vertigo-nightmode-on:hover { background-color: $base09; color: $shade01; }
.vertigo-nightmode-off:hover { background-color: $base13; color: $shade01; }
.vertigo-notify-on { background-color: $base02; color: $base15; }
.vertigo-notify-off { background-color: $base02; color: $base11; }
.vertigo-notify-on:hover { background-color: $base15; color: $base02; }
.vertigo-notify-off:hover { background-color: $base11; color: $base02; }
.vertigo-todo-button { background-color: $base01; color: $base07; }
.vertigo-todo-button:hover { background-color: $base07; color: $base01; }
.vertigo-workspace-plus-button { color: $base11; background-color: $base02; }
.vertigo-workspace-plus-button:hover { background-color: $base11; color: $base02; }
.vertigo-time-button:hover { background-color: $base03; color: $base01; }
.vertigo-profile-button { margin: 0 0 1em 0; }
.vertigo-tall,
.vertigo-wide,
.vertigo-rtall,
.vertigo-rwide,
.vertigo-grid,
.vertigo-rgrid,
.vertigo-even,
.vertigo-tiled,
.vertigo-monocle {
background-color: $shade06;
}
.vertigo-tall {
color: $base11;
}
.vertigo-wide {
color: $base12;
}
.vertigo-rtall {
color: $base13;
}
.vertigo-rwide {
color: $base14;
}
.vertigo-grid {
color: $base15;
}
.vertigo-rgrid {
color: $base10;
}
.vertigo-even {
color: $base09;
}
.vertigo-tiled {
color: $base08;
}
.vertigo-monocle {
color: $base07;
}
// .vertigo-tall:hover {
// background-color: $base11;
// color: $base02;
// }
// .vertigo-wide:hover {
// background-color: $base12;
// color: $base02;
// }
// .vertigo-rtall:hover {
// background-color: $base13;
// color: $base02;
// }
// .vertigo-rwide:hover {
// background-color: $base14;
// color: $base02;
// }
// .vertigo-grid:hover {
// background-color: $base15;
// color: $base02;
// }
// .vertigo-rgrid:hover {
// background-color: $base10;
// color: $base02;
// }
// .vertigo-even:hover {
// background-color: $base09;
// color: $base02;
// }
// .vertigo-tiled:hover {
// background-color: $base08;
// color: $base02;
// }
// .vertigo-monocle:hover {
// background-color: $base07;
// color: $base02;
// }
.vertigo-tall:hover,
.vertigo-wide:hover,
.vertigo-rtall:hover,
.vertigo-rwide:hover,
.vertigo-grid:hover,
.vertigo-rgrid:hover,
.vertigo-even:hover,
.vertigo-tiled:hover,
.vertigo-monocle:hover {
background-color: $shade04;
}
.vertigo-separator {
background-color: $base03;
margin-top: 5em;
margin-bottom: 5em;
font-size: 2;
}
// vim:ft=scss
================================================
FILE: src/scss/vertigo/_init.scss
================================================
.vertigo-layout-box {
// background-color: $base00;
background-color: $shade10;
font-family: Phosphor, Dosis, sans-serif;
padding: 0.8em 0.8em 0 0.8em;
}
@import "state";
@import "info";
@import "node";
@import "override";
// vim:ft=scss
================================================
FILE: src/scss/vertigo/_node.scss
================================================
.vertigo-node-button {
padding: 0.57em 0 0.58em 0;
font-size: 25;
color: $base02;
}
.vertigo-node-button-tiled { background-color: $base14; }
.vertigo-node-button-monocle { background-color: $base11; }
.vertigo-node-button-float { background-color: $base13; }
.vertigo-node-button-pseudo { background-color: $base15; }
.vertigo-node-button-full { background-color: $base09; }
.vertigo-node-button-other { background-color: $base08; }
.vertigo-node-button:hover { opacity: 0.8; }
// vim:ft=scss
================================================
FILE: src/scss/vertigo/_override.scss
================================================
// exclude eww-vertigo in picom shadows exclude section
// this is an example to override the default vertigo style
// and make the bar transparent. Enjoy.
// .vertigo-layout-box {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-node-button-tiled { color: $base14; }
// .vertigo-node-button-monocle { color: $base11; }
// .vertigo-node-button-float { color: $base13; }
// .vertigo-node-button-pseudo { color: $base15; }
// .vertigo-node-button-full { color: $base09; }
// .vertigo-node-button-other { color: $base08; }
// .vertigo-node-button:hover { opacity: 0.8; }
// .vertigo-node-button-tiled,
// .vertigo-node-button-monocle,
// .vertigo-node-button-float,
// .vertigo-node-button-pseudo,
// .vertigo-node-button-full,
// .vertigo-node-button-other {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-battery-button {
// background-color: rgb(0, 0, 0, 0.0);
// color: $base11;
// }
// .vertigo-time-button {
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-volume-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-volume-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-volume-on:hover { background-color: $base13; }
// .vertigo-volume-off:hover { background-color: $base11; }
// .vertigo-nightmode-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-nightmode-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-nightmode-on:hover { background-color: $base09; color: $shade01; }
// .vertigo-nightmode-off:hover { background-color: $base13; color: $shade01; }
// .vertigo-notify-on { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-notify-off { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-notify-on:hover { background-color: $base15; color: $base02; }
// .vertigo-notify-off:hover { background-color: $base11; color: $base02; }
// .vertigo-todo-button { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-todo-button:hover { background-color: $base07; color: $base01; }
// .vertigo-workspace-plus-button { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-plus-button:hover { background-color: $base11; color: $base02; }
// .vertigo-time-button:hover { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-separator {
// opacity: 0.0;
// }
// .vertigo-search-button {
// color: $base09;
// background-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-search-button:hover { background-color: rgb(0, 0, 0, 0.0); color: $base07; }
// .vertigo-workspace { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace:hover { background-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-focused {
// background-color: rgb(0, 0, 0, 0.0);
// border-right-color: rgb(0, 0, 0, 0.0);
// }
// .vertigo-workspace-occupied:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-urgent:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// .vertigo-workspace-local:hover { border-left-color: rgb(0, 0, 0, 0.0); }
// vim:ft=scss
================================================
FILE: src/scss/vertigo/_state.scss
================================================
.vertigo-search-button {
padding: 0.57em 0 0.57em 0;
background-color: $base09;
font-size: 25;
color: $base02;
}
.vertigo-search-button:hover { background-color: $base07; }
.vertigo-workspace { background-color: $base01; }
.vertigo-workspace:first-child { padding-top: 0.3em; }
.vertigo-workspace:last-child { border-radius: 0 0 50% 0; }
.vertigo-workspace label {
font-size: 25;
padding: 0.57em 0 0.57em 0;
}
.vertigo-workspace:hover { background-color: $base03; }
.vertigo-workspace-urgent { color: $base11; }
.vertigo-workspace-occupied { color: $base13; }
.vertigo-workspace-local { color: $shade01; }
.vertigo-workspace-focused {
color: $base14;
background-color: $base02;
border-right: 3px solid $base14;
}
.vertigo-workspace-occupied:hover { border-left: 3px solid $base13; }
.vertigo-workspace-urgent:hover { border-left: 3px solid $base11; }
.vertigo-workspace-local:hover { border-left: 3px solid $base04; }
// vim:ft=scss
================================================
FILE: src/shell/cache.py
================================================
"""A DBus eavesdropper for org.freedesktop.Notifications
interface.
This is created mainly to cache the raw image data that is
sent by stupid applications like Spotify, Discord, etc.
Now that I think about it all of the electron clients do this.
Usually any application, if they had to they'd send the
notifications as a path i.e. caching the image themselves
and then returning the path to it.
Also, <https://specifications.freedesktop.org/notification-spec/latest/>
is a really nice manual. Give it a read.
"""
# Authored By dharmx <dharmx@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
import datetime
import os
import sys
import pathlib
import sys
import typing
import dbus
import utils
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
# TODO: Use actual enumerations by using the enum module from the standard library.
class Urgency:
"""Acts as an Enum for indicating the urgency levels as per
the notifications specification.
You may use these to match wheter a specific notification belongs
to a specific urgency class or, not.
Attributes:
LOW: Ads, Login, etc.
NORMAL: USB unplugged, Drive mounted, etc.
CRITICAL: Your PC is on fire, Storage Full, etc.
"""
LOW = b"\x00"
NORMAL = b"\x01"
CRITICAL = b"\x02"
def console_write(string: str):
sys.stdout.write(string + "\n")
sys.stdout.flush()
class Eavesdropper:
"""A quick and naive way of saving the image-data.
The main idea is to keep a notification server running that
implements image-data and image-path as per the freedesktop
notification specification.
And, then you'd run the eavesdropper which will connect to that
interface (org.freedesktop.Notifications) and will continuously
monitor that interface.
And, if any application sends a notification, that contains a raw
icon then it will be saved into the cache directory.
Attributes:
callback:
The arbitrary subroutine that will executed on getting a notification.
cache_dir:
The directory path that all of those image-data would be saved.
"""
# TODO: Segregate more.
def __init__(
self,
callback: typing.Callable = console_write,
cache_dir: str = "/tmp"
):
"""Assigns the CTOR parameters to the field variables (duh..)
Arguments:
callback: The arbitrary subroutine that will executed on getting a notification.
cache_dir: The directory path that all of those image-data would be saved.
"""
self.callback = callback
self.cache_dir = f"{os.path.expandvars(cache_dir)}/image-data"
# translation: mkdir --parents cache_dir
pathlib.PosixPath(self.cache_dir).mkdir(parents=True, exist_ok=True)
def _message_callback(
self, _,
message: dbus.lowlevel.MethodReturnMessage
or dbus.lowlevel.MethodCallMessage
):
"""A filter callback for parsing the specific messages that are received from the DBus interface.
Arguments:
proxy_bus:
The bus that sent the message.
message:
In this case a message is sent when the
Notify method is called AND when the Notify method returns something.
If the message is of type dbus.lowlevel.MethodCallMessage then this will NOT call the passed callback.
"""
# we will be filtering this out as we only need the value that the method call returns
# i.e. dbus.lowlevel.MethodReturnMessage
if type(message) != dbus.lowlevel.MethodCallMessage:
return
args_list = message.get_args_list()
# convert dbus data types to pythonic ones
# eg: dbus.String('Hello') -> 'Hello'
args_list = [utils.unwrap(item) for item in args_list]
# set fallbacks like a fine gentleman
details = {
"appname": args_list[0].strip() or "Unknown",
"summary": args_list[3].strip() or "Summary Unavailable.",
"body": args_list[4].strip() or "Body Unavailable.",
"id": datetime.datetime.now().strftime("%s"),
"urgency": "unknown",
}
if "urgency" in args_list[6]:
details["urgency"] = args_list[6]["urgency"]
if args_list[2].strip():
# if the iconpath value is a path i.e. if it has slashes on them
# then assign that as the iconpath
if "/" in args_list[2] or "." in args_list[2]:
details["iconpath"] = args_list[2]
else:
# and if the iconpath is just a string that has no extensions or,
# a pathlike structure like: 'bell' or 'custom-folder-bookmark'
# it might have a dash (-) sign but not all the time.
# then fetch that actual path of that icon as that is a part of the
# icon theme naming convention and the current icon theme should probably have it
details["iconpath"] = utils.get_gtk_icon_path(args_list[2])
else:
# if there are no icon hints then use fallback (generic bell)
details["iconpath"] = utils.get_gtk_icon_path(
"custom-notification")
if "image-data" in args_list[6]:
# capture the raw image bytes and save them to the cache_dir/x.png path
details["iconpath"] = f"{self.cache_dir}/{details['appname']}-{details['id']}.png"
utils.save_img_byte(
args_list[6]["image-data"], details["iconpath"])
# BUG: add a print statement -> init logger.py and disown the process
# then you'll notice the notifications with value (progress) hint
# does not get logged.
if "value" in args_list[6]:
details["progress"] = args_list[6]["value"]
# execute arbitrary callback and passing details about the current notification.
self.callback(details)
# TODO: Segregate more.
def eavesdrop(
self,
timeout: int or bool = False,
timeout_callback: typing.Callable = print
):
"""Primes the session bus instance and starts a GLib mainloop.
Arguments:
timeout:
Intervals for executing the callback.
timeout_callback:
Callback that will be executed on intervals.
"""
DBusGMainLoop(set_as_default=True)
rules = {
"interface": "org.freedesktop.Notifications",
"member": "Notify",
"eavesdrop": "true", # https://bugs.freedesktop.org/show_bug.cgi?id=39450
}
bus = dbus.SessionBus()
# discard all other interfaces except org.freedesktop.Notifications
# setting eavesdrop to true enables DBus to send the messages that are
# not meant for you.
# removing the eavesdrop key from rules will not send the Notify method's
# contents to you (you can try and see what happens)
bus.add_match_string(",".join([f"{key}={value}" for key, value in rules.items()]))
bus.add_message_filter(self._message_callback)
try:
loop = GLib.MainLoop()
if timeout:
# executes a callback in intervals
GLib.set_timeout(timeout, timeout_callback)
loop.run()
except (KeyboardInterrupt, Exception) as excep:
sys.stderr.write(str(excep) + "\n")
bus.close()
# vim:filetype=python
================================================
FILE: src/shell/combine.zsh
================================================
#!/usr/bin/env zsh
CACHE_PATH="$XDG_CACHE_HOME/eww/dunst/notifications.txt"
QUOTE_PATH="$XDG_CACHE_HOME/eww/dunst/quotes.txt"
DEFAULT_QUOTE="To fake it is to stand guard over emptiness. \u2500\u2500 Arthur Herzog"
mkdir -p "${CACHE_PATH:h}" "${QUOTE_PATH:h}" 2> /dev/null
touch "$CACHE_PATH" "$QUOTE_PATH" 2> /dev/null
INTERVAL='0.2'
function rand_quote() {
local format
format="$(tr '\n \t\r' 's' < "$QUOTE_PATH")"
if [[ "$format" != "" ]]; then
shuf "$QUOTE_PATH" | head -n1
else
echo "$DEFAULT_QUOTE"
fi
}
function empty_format() {
local format
format=(
"(box"
":class"
"'disclose-empty-box'"
":height"
"750"
":orientation"
"'vertical'"
":space-evenly"
"false"
"(image"
":class"
"'disclose-empty-banner'"
":valign"
"'end'"
":vexpand"
"true"
":path"
"'./assets/wedding-bells.png'"
":image-width"
"250"
":image-height"
"250)"
"(label"
":vexpand"
"true"
":valign"
"'start'"
":wrap"
"true"
":class"
"'disclose-empty-label'"
":text"
"'$(rand_quote)'))"
)
echo "${format[@]}"
}
function not_empty() {
echo -n "(box :spacing 20 :orientation 'vertical' :space-evenly false"
if [[ "$(echo "$1" | tr -d ' ')" != "" ]]; then
echo -n "$1"
else
echo -n "$(empty_format)"
fi
echo ")"
}
case "$1" in
rmid) sed -i "/:identity ':::###::::XXXWWW$2===::'/d" "$CACHE_PATH" ;;
sub)
old="$(tr '\n' ' ' < "$CACHE_PATH")"
not_empty "$old"
while sleep "$INTERVAL"; do
new="$(tr '\n' ' ' < "$CACHE_PATH")"
if [[ "$old" != "$new" ]]; then
not_empty "$new"
old="$new"
fi
done
;;
quote) rand_quote ;;
cls) echo > "$CACHE_PATH" ;;
esac
# vim:filetype=sh
================================================
FILE: src/shell/github.sh
================================================
#!/bin/bash
CONFIG="$XDG_CONFIG_HOME/eww/ewwrc"
CACHE_DIR=$(jq --raw-output .github.cache_dir "$CONFIG")
eval "CACHE_DIR=${CACHE_DIR}"
USER_NAME=$(jq --raw-output .github.username "$CONFIG")
DATE=$(date +%F)
[ -f "$CACHE_DIR" ] || mkdir --parents "$CACHE_DIR"
fetch_user_info() {
[ -f "$CACHE_DIR/users-$USER_NAME-$DATE.json" ] || curl --silent https://api.github.com/users/dharmx > "$CACHE_DIR/users-$USER_NAME-$DATE.json"
[ -f "$CACHE_DIR/repos-$USER_NAME-$DATE.json" ] || curl --silent https://api.github.com/users/dharmx/repos > "$CACHE_DIR/repos-$USER_NAME-$DATE.json"
}
fetch_user_info
case "$1" in
users) cat "$CACHE_DIR/users-$USER_NAME-$DATE.json" ;;
repos) cat "$CACHE_DIR/repos-$USER_NAME-$DATE.json" ;;
esac
# vim:filetype=sh
================================================
FILE: src/shell/handlers.py
================================================
"""This file is tightly integrated with logger.py and won't work without it.
Unlike the files cache.py and utils.py.
This module just redirects specific presets of messages based on the source
(the application) that sent that message.
The redirector will call the specific function based off the appname, then
the called handler function will evaluate the YUCK literal and replace all
of the items on the format string with the passed attributes and then return it.
"""
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
import datetime
import cache
import utils
# WARN: Subject to heavy change.
# TODO: Use OOP instead of passing around variables
# TODO: Add fallback / canned lambdas for common handler operations eg: formats["appname"] % attributes
# TODO: Handle '\n' in body / summary.
def redir_to_handlers(formats, attributes: dict) -> str:
r"""Function for evaluating which handler function will be called.
Before calling the handler function it will do some filtering and
then actually call the handler which should return a fully evaluated
YUCK literal string.
Arguments:
formats:
All of the YUCK literal format strings.
attributes:
Details about the currently sent notification like summary, body, appname, etc.
Returns:
A str that is a primed YUCK literal with passed attributes.
Example:
Format:
(_cardimage :identity ':::###::::XXXWWW%(id)s===::'
:close_action './src/shell/logger.py rmid %(id)s'
:limit_body '%(BODY_LIMITER)s'
:limit_summary '%(SUMMARY_LIMITER)s'
:summary '%(summary)s'
:body '%(body)s'
:close '繁'
:image_height 100
:image_width 100
:image '%(iconpath)s'
:appname '%(appname)s'
:icon '%(iconpath)s'
:icon_height 32
:icon_width 32
:timestamp '%(TIMESTAMP)s'
:urgency '%(URGENCY)s')
Primed:
(_cardimage :identity ':::###::::XXXWWW1658665761===::'
:close_action './src/shell/logger.py rmid 1658665761'
:limit_body '110'
:limit_summary '30'
:summary 'Picom'
:body 'The compositer is now disabled.'
:close '繁'
:image_height 100
:image_width 100
:image '/home/maker/.icons/custom/stock/128/custom-crying.png'
:appname 'Picom'
:icon '/home/maker/.icons/custom/stock/128/custom-crying.png'
:icon_height 32
:icon_width 32
:timestamp '17:59'
:urgency 'CRITICAL')
"""
# assign the timestamp of the notification.
attributes["TIMESTAMP"] = datetime.datetime.now().strftime(
attributes["TIMESTAMP_FORMAT"])
# turn the urgency values (which are in bytes) to a more readable format (string).
match attributes["urgency"]:
case cache.Urgency.LOW:
attributes["URGENCY"] = "LOW"
case cache.Urgency.NORMAL:
attributes["URGENCY"] = "NORMAL"
case cache.Urgency.CRITICAL:
attributes["URGENCY"] = "CRITICAL"
case _:
attributes["URGENCY"] = "NORMAL"
# handle next lines (especially discord code blocks)
# NOTE: may make this only discord / firefox specific
attributes["body"] = attributes["body"].replace("\n", " ")
attributes["summary"] = attributes["summary"].replace("\n", " ")
# check if there are any pango tags on the body and summary and if so
# it will then remove it.
if utils.contains_pango(attributes["body"]):
attributes["body"] = utils.strip_pango_tags(attributes["body"])
if utils.contains_pango(attributes["summary"]):
attributes["summary"] = utils.strip_pango_tags(
attributes["summary"]
)
# it will replace all of the apostrophes with \' i.e. escape them.
if "'" in attributes["body"]:
attributes["body"] = attributes["body"].replace("'", "\\'")
if "'" in attributes["summary"]:
attributes["summary"] = attributes["summary"].replace("'", "\\'")
# only 15 chars would be taken if the summary has non-english charecters.
attributes["SUMMARY_LIMITER"] = ""
summary_lang_char_check = utils.has_non_english_chars(
attributes["summary"][:15]
)
# if summary has asian characters like Japanese, Hindi or, Chinese
if summary_lang_char_check["CJK"]:
attributes["SUMMARY_LIMITER"] = 14
# if summary has Cyrillic characters
elif summary_lang_char_check["CYR"]:
attributes["SUMMARY_LIMITER"] = 30
attributes["BODY_LIMITER"] = ""
body_lang_char_check = utils.has_non_english_chars(attributes["body"][:70])
if body_lang_char_check["CJK"]:
attributes["BODY_LIMITER"] = 80
elif body_lang_char_check["CYR"]:
attributes["BODY_LIMITER"] = 110
else:
attributes["BODY_LIMITER"] = 100
# redirect to handlers
match attributes["appname"]:
case "notify-send":
return notify_send_handler(formats, attributes)
case "volume":
return volume_handler(formats, attributes)
case "brightness":
return brightness_handler(formats, attributes)
case "shot":
return shot_handler(formats, attributes)
case "shot_icon":
return shot_icon_handler(formats, attributes)
case "todo":
return todo_handler(formats, attributes)
case "Spotify":
return Spotify_handler(formats, attributes)
case _:
return default_handler(formats, attributes)
# TODO: Segregate redir_to_handlers into more utility / helper functions.
# NOTE: Currently it is a bit hard to utilize config values without making the code dirtier.
# NOTE: For instance shot_handler will eventually load the command strings from the config JSON for attributes["DELETE"]. See logger.py
def shot_handler(formats, attributes: dict) -> str:
"""Handler for screenshot related notifications.
Note that this handler will only handle the screenshots itself.
That is, it won't handle it if say.. the screenshot is copied to the clipboard, etc.
All of those are handled by shot_icon_handler.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
# TODO: Make this better
attributes["DELETE"] = f"rm --force \\'{attributes['iconpath']}\\' && ./src/shell/logger.py rmid {attributes['id']}"
attributes["OPEN"] = f"xdg-open \\'{attributes['iconpath']}\\'"
# capitalize words i.e. notify_send -> Notify Send
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["shot"] % attributes
def Spotify_handler(formats, attributes: dict) -> str:
"""Handler for notifications related to the official electron client for Spotify.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
return formats["Spotify"] % attributes
def default_handler(formats, attributes: dict) -> str:
r"""Handler for basic notifications. The notifications that are ordinary.
Or, rather the notifications that do not match any of the match-cases in
the redir_to_handlers function.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Example:
notify-send Hello
notify-send Greetings
notify-send -u low -i bell Greetings Ding\!
notify-send -a appname-does-not-exist -i bell Yo
Returns:
See redir_to_handlers
"""
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["default"] % attributes
def notify_send_handler(formats, attributes: dict) -> str:
"""Handler for notifications related to the notify-send command.
See:
default_handler
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["notify-send"] % attributes
def brightness_handler(formats, attributes: dict) -> str:
"""Handler for notifications related to brightness control.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["brightness"] % attributes
def volume_handler(formats, attributes: dict) -> str:
"""Handler for notifications related to volume control.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["volume"] % attributes
# TODO: Make this general purpose and not just todo specific.
def todo_handler(formats, attributes: dict) -> str:
"""Handler for notifications related to todo-bin CLI application by Siddomy.
The notification body needs to be in a particular format in order for it to register.
That is: <completed_tasks> tasks done and <total_tasks> are remaining.
The fragments <completed_tasks> and <total_tasks> will be picked up by this handler.
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
splitted = attributes["body"].split(" ")
attributes["TOTAL"] = int(splitted[4])
attributes["DONE"] = int(splitted[0])
# handle division by zero
attributes["PERC"] = (attributes["DONE"] / attributes["TOTAL"]
) * 100 if attributes["DONE"] > 0 else 0
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["todo"] % attributes
def shot_icon_handler(formats, attributes: dict) -> str:
"""Almost same as default_handler only just it uses a different icon.
Redundant, but still nice to if you want to add additional
functionalities on this particular appname.
See:
default_handler
shot_handler
Arguments:
formats: See redir_to_handlers.
attributes: See redir_to_handlers.
Returns:
See redir_to_handlers
"""
attributes["appname"] = utils.prettify_name(attributes["appname"])
return formats["shot_icon"] % attributes
# vim:filetype=python
================================================
FILE: src/shell/logger.py
================================================
"""Script for logging desktop notifications in the form of YUCK literal.
General idea is to have a file log the notifications in the form of YUCK
literal containing a widget structure which will then be concatenated into
a box widget to take a list-like structure.
The said structure needs to be re-rendered whenever the log file notices
a change. Like, deleting an entry or, adding an entry or, editing an entry.
Note, if you still have not guessed already, if you make any changes to the
log file then the list of notifications will be re-rendered again.
"""
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
# TODO: Utilize JSON instead of YUCK Literals.
# WARN: This script is under active development and is subject to frequent changes.
# WARN: Currently this script is quite inefficient. So, you have been warned.
import json
import os
import pathlib
import sys
import cache
import handlers
import utils
# presetted notification format strings i.e. they are just utility items that help reducing the size of code
# another reason is convenience i.e. it would be easier to have all the formats in one place and defining them
# would be less cumbersome.
FORMATS = {
"spotifyd": "(_cardimage :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"ncspot": "(_cardimage :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"Spotify": "(_cardimage :class 'Spotify-rectangle' :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"shot_icon": "(_cardimage :class 'shot-image-bord-dashed' :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"shot": "(_cardscr :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :delete '%(DELETE)s' :open '%(OPEN)s' :summary '%(summary)s' :image '%(iconpath)s' :image_height 250 :image_width 100 :urgency '%(URGENCY)s' :close '繁' :timestamp '%(TIMESTAMP)s')",
"default": "(_cardimage :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"notify-send": "(_cardimage :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon './assets/browser.png' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"empty": "(box :class 'disclose-empty-box' :height 750 :orientation 'vertical' :space-evenly false (image :class 'disclose-empty-banner' :valign 'end' :vexpand true :path './assets/wedding-bells.png' :image-width 250 :image-height 250) (label :vexpand true :valign 'start' :wrap true :class 'disclose-empty-label' :text '%(QUOTE)s'))",
"brightness": "(_cardprog :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s' :progress '%(progress)s')",
"todo": "(_cardradial :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :appname '%(appname)s' :progress %(PERC)s :thickness 20.0 :total %(TOTAL)s :done %(DONE)s :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s')",
"volume": "(_cardprog :identity ':::###::::XXXWWW%(id)s===::' :close_action './src/shell/combine.zsh rmid %(id)s' :limit_body '%(BODY_LIMITER)s' :limit_summary '%(SUMMARY_LIMITER)s' :summary '%(summary)s' :body '%(body)s' :close '繁' :image_height 100 :image_width 100 :image '%(iconpath)s' :appname '%(appname)s' :icon '%(iconpath)s' :icon_height 32 :icon_width 32 :timestamp '%(TIMESTAMP)s' :urgency '%(URGENCY)s' :progress '%(progress)s')"
}
if __name__ == "__main__":
# load only notification related options from the config JSON
config = json.loads(
pathlib.PosixPath(
os.path.expandvars("$XDG_CONFIG_HOME/eww/ewwrc")
).read_text()
)["notify"]
# kind of like the sliding window algorithm i.e. will pop the notifications if this number is reached
HISTORY_LIMIT = config["limit"]
# file path where the notifications will be saved
CACHE_PATH = os.path.expandvars(config["cache_path"])
# directory path where the notifications will be saved
# WARN: Do not edit this; Only edit this if you know what you are doing!
CACHE_DIR = os.path.dirname(CACHE_PATH)
# file path where the quotes are stored
QUOTE_PATH = os.path.expandvars(config["quote_path"])
# fallback if the quote DB has no quotes in them
DEFAULT_QUOTE = config["default_quote"]
# Watcher interval; Reflects how fast disclose will be rendered.
INTERVAL = config["interval"]
# handle IndexError
if len(sys.argv) < 2:
sys.argv = ("dummy", "dummy")
match sys.argv[1]:
case "subscribe":
utils.create_parents_file(CACHE_PATH) # mkdir --parents
utils.create_parents_file(QUOTE_PATH) # mkdir --parents
utils.watcher(
CACHE_PATH,
lambda contents: sys.stdout.write(
"(box :spacing 20 :orientation 'vertical' :space-evenly false " +
# handle empty and display fallback
contents.replace("\n", " ") + ")\n"
if contents.strip()
else (
(FORMATS["empty"] + "\n")
% {"QUOTE": utils.get_rand_quote(QUOTE_PATH, DEFAULT_QUOTE)}
)
),
INTERVAL,
)
case "rmid":
# grep based off the notification id and then remove that YUCK literal entry from the log file
utils.file_matched_index_rm(
CACHE_PATH, f":identity ':::###::::XXXWWW{sys.argv[2]}===::'"
)
case "stats":
sys.stdout.write(
json.dumps(
utils.parse_and_print_stats(pathlib.PosixPath(CACHE_PATH).read_text())
)
+ "\n"
)
case "rm":
utils.file_rm_line(CACHE_PATH, int(sys.argv[2]))
case "quote":
sys.stdout.write(utils.get_rand_quote(QUOTE_PATH, DEFAULT_QUOTE))
case "cls":
pathlib.PosixPath(CACHE_PATH).write_text("")
case "init":
def master_callback(details: dict):
r"""Callback function that handles fetching and logging the notification details.
Arguments:
details: the JSON that should have a similar structure to the following:
{
"summary": "Hello",
"body": "Who's there?",
"id": 16444442,
"urgency": "LOW"
}
"""
details["TIMESTAMP_FORMAT"] = config["timestamp"]
if not config["excluded_appnames"] or details["appname"] not in config["excluded_appnames"]:
saved_path = handlers.redir_to_handlers(FORMATS, details)
# actual point where the notification is being logged.
utils.file_add_line(CACHE_PATH, saved_path, HISTORY_LIMIT)
# start eavesdropping on the org.freedesktop.Notifications interface and log the notification info
cache.Eavesdropper(master_callback, CACHE_DIR).eavesdrop()
# vim:filetype=python
================================================
FILE: src/shell/mpdaemon.py
================================================
"""Script to cache and fetch the current track details for MPD"""
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
import json
import os
import pathlib
import utils
import time
import sys
import mpd
from mpd.base import CommandError
class MPDHandler:
"""A class that represents the MPD daemon."""
def __init__(self, prefix: str, cache, default):
"""Initialize the mpd client and get all the boiler plate code out of the way.
Then check if the cache paths and directory exists or, not. Create them if they don't.
Arguments:
prefix: The directory of the source i.e. the place where your music is stored.
This must be the same as your mpd config.
cache: The directory where all of the cover art caches are stored.
default: The path to the default / fallback cover art.
"""
self._client: mpd.MPDClient = mpd.MPDClient()
self._client.timeout = 3
self._client.connect("localhost", 6600)
# equivalent: mkdir --parents
self.prefix, self.cache, self.default = prefix, cache, default
pathlib.Path(self.prefix).mkdir(parents=True, exist_ok=True)
pathlib.Path(self.cache).mkdir(parents=True, exist_ok=True)
def _validatepath(self, path: str) -> str:
"""Add an extra slash if the file is in a sub-directory as passing
a.ext to dirname will result in returning an empty string.
Arguments:
path: The location of the file.
"""
path = os.path.dirname(path)
return f"{path}/" if "/" in path or path else path
def _embeddedcover(self, key: str) -> str | bytes:
"""If there is no embedded cover art in the current playing track file then
return a path to the fallback image instead.
Arguments:
key: the name of the track.
Returns:
A str when there is no embedded cover art, bytes otherwise.
"""
content = {"binary": self.default}
try:
self._client.readpicture(key)
content = self._client.albumart(key)
except CommandError:
content = {"binary": self.default}
return content["binary"]
def get(self, key: str) -> str:
"""Return the path to the cover art if it exists.
Arguments:
key: Title of the song.
"""
music: str = (
f"{self.cache}/{self._validatepath(key)}{pathlib.Path(key).stem}.png"
)
return music if os.path.exists(music) else self.default
def create(self, key: str) -> bool:
"""If embedded cover exists for the current track then it fetches
that in the form of bytes and then writes that to a file. In other
words it caches that cover art.
Arguments:
key: Path to the current playing song.
Returns:
A bool, True if a cache file is created, False otherwise.
"""
# a/b/c/d.e: dirname -> a/b/c | stem -> d
# generate cache path -> cache + dirname + stem + ".png"
cachefull = f"{self._validatepath(key)}{pathlib.Path(key).stem}"
if not os.path.exists(f"{self.cache}/{cachefull}.png"):
if covercontent := self._embeddedcover(f"{cachefull}.mp3"):
if type(covercontent) != str: # check
pathlib.Path(os.path.dirname(f"{self.cache}/{key}")).mkdir(
parents=True, exist_ok=True
)
with open(f"{self.cache}/{cachefull}.png", "wb") as target:
target.write(covercontent) # then write bytes to file
return True
return False
return False # will return True iff a file is created
def metadatajson(self, tojson=True) -> str | dict:
"""Fetch current song metadata, tags and player statistics
and pack the cover image as well.
Arguments:
tojson: Return json format string if set to True, otherwise just print a raw pythonic dict.
Returns:
A JSON str if tojson is True, a dict otherwise.
"""
metadata: dict = self._client.status()
metadata["current"] = {
"file": config["default_art"],
"artist": "Unknown",
"albumartist": "Unknown",
"title": "Unknown",
"album": "Unknown",
}
metadata["current"] |= self._client.currentsong()
metadata["stats"] = self._client.stats()
metadata["current"]["file"] = self.get(metadata["current"]["file"])
metadata["current"]["status"] = self._client.status()["state"]
metadata["current"]["x"] = self._client.status()
if "xfade" not in metadata["current"]["x"]:
metadata["current"]["x"]["xfade"] = 0
# simplify image + apply dither for handling gradients + get histogram -> it will yield 8 hex codes
colors = utils.img_dark_bright_col(metadata['current']['file'])
# pick out the brightest and the darkest color and use that as foreground | background.
metadata["current"]["bright"] = colors[3]
metadata["current"]["dark"] = colors[-1]
return json.dumps(metadata) if tojson else metadata
def cacheplaylist(self):
"""Cache all of the cover art in the current playlist."""
[self.create(file[6:]) for file in self._client.playlist()]
def cachedatatbase(self):
"""Cache all tracks that are currently in the database."""
self._client.rescan()
self._client.update()
for file in self._client.listall():
todict: dict = dict(file)
if "directory" not in todict:
self.create(todict["file"])
def subscribe(self, interval: float = 1.0) -> str:
"""A simple watcher that monitors track changes. And prints
the current track info on track change in JSON format.
Arguments:
interval: Interval between checking the current playing track for changes.
"""
old = self.metadatajson(tojson=False)["current"]
sys.stdout.write(json.dumps(old) + "\n")
sys.stdout.flush()
while not time.sleep(interval):
new = self.metadatajson(tojson=False)["current"]
old_formatted = f"{old['artist']}-{old['title']}-{old['album']}-{old['status']}-{old['x']['repeat']}-{old['x']['volume']}-{old['x']['random']}-{old['x']['single']}-{old['x']['consume']}-{old['x']['xfade']}"
new_formatted = f"{new['artist']}-{new['title']}-{new['album']}-{new['status']}-{new['x']['repeat']}-{new['x']['volume']}-{new['x']['random']}-{new['x']['single']}-{new['x']['consume']}-{new['x']['xfade']}"
if old_formatted != new_formatted:
sys.stdout.write(json.dumps(new) + "\n")
sys.stdout.flush()
old = new
def close(self):
"""Close the close and then disconnect from the mpd client."""
self._client.close()
self._client.disconnect()
if __name__ == "__main__":
with open(os.path.expandvars("$XDG_CONFIG_HOME/eww/ewwrc"), encoding="utf8") as file:
# load config values
config: dict = json.loads(file.read())["player"]
config["default_art"] = os.path.expandvars(config["default_art"])
config["mpd_cache"] = os.path.expandvars(config["mpd_cache"])
handler = MPDHandler(
os.path.expandvars("$XDG_MUSIC_DIR"),
config["mpd_cache"],
config["default_art"],
)
# cache the database and look if there are any music files that haven't been cached yet
# if there are then cache them.
handler.cachedatatbase()
handler.subscribe(1)
handler.close()
# vim:filetype=python
================================================
FILE: src/shell/playerctl.py
================================================
"""Script that interacts with playerctl to manipulate all MPRIS players.
Here it is mostly being used for getting the current track metadata and feeding it
to an YUCK listener variable.
"""
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
import json
import os
import sys
import pathlib
import shutil
import utils
# supress GIO warnings.
import gi
gi.require_version("Playerctl", "2.0")
from gi.repository import GLib, Playerctl
import requests
def on_metadata(*args):
"""The current song metadata and the player metadata is parsed
and packed into a nice dictionary then to a JSON format string
which is then print to STDOUT.
There is a fallback dict already in place, which gets overwritten
with newer / actual values (if they exist).
Arguments:
args: contains the current active MPRIS player object at [0]
and a metadata dictionary at [1].
"""
# sourcery skip: identity-comprehension, remove-redundant-constructor-in-dict-union
metadata = {
"mpris:artUrl": default_cover,
"xesam:artist": "Unknown",
"xesam:title": "Unknown",
"xesam:album": "Unknown",
"status": "Stopped",
} | {key: val for key, val in dict(args[1]).items() if val} # overwrite
name = args[0].props.player_name
metadata["player"] = name or "none"
metadata["status"] = args[0].props.status
# prettify artist list
if not "".join(metadata["xesam:artist"]):
# [] -> "Unknown"
metadata["xesam:artist"] = "Unknown"
elif len(metadata["xesam:artist"]) == 1:
# ["Dazbee"] -> "Dazbee"
metadata["xesam:artist"] = metadata["xesam:artist"][0]
elif len(metadata["xesam:artist"]) == 2:
# ["Eir Aoi", "LiSA"] -> "Eir Aoi and LiSA"
metadata["xesam:artist"] = "and".join(metadata["xesam:artist"])
else:
# ["Masato", "coladrain", "Hiroaki Tsutsumi"] -> "Masato, coladrain and Hiroaki Tsutsumi"
metadata["xesam:artist"] = "and".join(
[",".join(metadata["xesam:artist"][:-1]), metadata["xesam:artist"][-1]]
)
# apply fallback cover image
if (
"file://" not in metadata["mpris:artUrl"]
and default_cover not in metadata["mpris:artUrl"]
):
# cache the album art and return the cache path.
metadata["mpris:artUrl"] = cache_and_get(metadata)
metadata |= get_bright_dark_from_cover(metadata["mpris:artUrl"])
sys.stdout.write(json.dumps(metadata) + "\n")
sys.stdout.flush()
def on_play_pause(player, *_):
"""Callback function to regenerate and print the current state of the
player when it is paused.
Arguments:
player: A Player object.
"""
on_metadata(player, player.props.metadata)
def init_player(name):
"""Creates a Player object by passing a PlayerName object.
It basically prepares and equips the player with instructions
(callbacks) on what to do if a player:
- receives track metadata
- if a player is paused
- if a player is not paused
Finally it will add it to the PlayerManager object.
Arguments:
name: A PlayerName object.
"""
player = Playerctl.Player.new_from_name(name)
player.connect("metadata", on_metadata, manager)
player.connect("playback-status::playing", on_play_pause, manager)
player.connect("playback-status::paused", on_play_pause, manager)
manager.manage_player(player)
def player_null_check(player_manager) -> bool:
"""Checks if there are any players being managed by the manager and print
the default metadata if there are none.
Arguments:
player_manager: A PlayerManager object.
Returns:
A bool i.e. True if there are no active players, False otherwise.
"""
if not len(player_manager.props.player_names):
metadata = {
"mpris:artUrl": default_cover,
"xesam:artist": "Unavailable",
"xesam:title": "Unavailable",
"xesam:album": "Unavailable",
"status": "Stopped",
"player": "none",
}
metadata |= get_bright_dark_from_cover(default_cover) # overwrite fallback
sys.stdout.write(json.dumps(metadata) + "\n")
sys.stdout.flush()
return False
return True
def on_name_appeared_vanished(player_manager, name):
"""Callback function for taking action when a player gets either connected or,
disconnected from the manager.
Arguments:
player_manager: A PlayerManager object.
name: A PlayerName object.
"""
if player_null_check(player_manager):
init_player(name)
def gen_hex_path_encode(unique_path_name: list) -> str:
"""Convert all characters to uppercased hex string.
Arguments:
unique_path_name: The normal string that needs to be converted to hex code.
Returns:
A uppercased JSON str.
"""
return "".join(["%X" % ord(char) for char in unique_path_name])
def fetch_save_cover(link: str, save_path: str) -> bool:
"""Fetch media cover and save the bytes to a file path.
Arguments:
link: The URL link to the image.
save_path: The location where the cache will be saved.
Returns:
A bool i.e. True if the image is actually cached False, otherwise.
"""
data = requests.get(link, stream=True)
if data.status_code == 200:
data.raw.decode_content = True
with open(save_path, "wb") as file:
shutil.copyfileobj(data.raw, file)
return True
return False
def cache_and_get(metadata: dict) -> str:
"""Handles creating the cache directory if it does not exist,
handles generating a alphanumeric (hex) name with a combination
of the artist name(s) and the album name.
Arguments:
metadata: A dictionary containing the current playing media metadata.
Returns:
A str of the generated cache path or, the fallback path.
"""
player_dir = f"{pctl_cache}/{metadata['player']}"
if metadata["player"] not in ["none", "firefox"]:
# artist: Fifth Dawn, song: Duality -> artist: 4669667468204461776E, song: 4475616C697479
new_meta = {
"artist": gen_hex_path_encode(metadata["xesam:artist"]),
"album": gen_hex_path_encode(metadata["xesam:album"]),
}
# finally -> path/to/4669667468204461776E/4475616C697479.png
gen_path = f"{player_dir}/{new_meta['artist']}"
if not os.path.isdir(gen_path):
pathlib.Path(gen_path).mkdir(parents=True, exist_ok=True)
cover_path = f"{gen_path}/{new_meta['album']}.png"
if not os.path.exists(cover_path):
try:
return (
cover_path
if fetch_save_cover(metadata["mpris:artUrl"], cover_path)
else default_cover
)
except requests.exceptions.ConnectionError:
return default_cover
return cover_path
return default_cover
def get_bright_dark_from_cover(image_path: str) -> dict:
"""Get the brightest and lightest colors from an image and save them to a
JSON file if it isn't already. Then return the path to that JSON file.
Arguments:
image_path: The location of the image.
Returns:
A dict of bright and dark color eg: {'bright': '#292929', 'dark': '#BEBFC1'}
"""
if image_path == default_cover:
return {'bright': '#292929', 'dark': '#BEBFC1'}
# if the color cache already exists then load that and return
color_cached = pathlib.PosixPath(f"{os.path.dirname(image_path)}/colors.json")
if color_cached.is_file():
return json.loads(color_cached.read_text())
# generate the brightest and darkest color out of the image
colors = utils.img_dark_bright_col(image_path)
# since Firefox only caches one thumbnail at a time and overwrites it
# we need to keep on regenerating the colors and return them without
# caching them.
parsed_colors = {"bright": colors[3], "dark": colors[9]}
if "firefox-mpris" in image_path:
return parsed_colors
# for other players like spotify - save / cache the thumbnail and return its
# cache path instead
color_cached.write_text(json.dumps(parsed_colors))
return parsed_colors
if __name__ == "__main__":
with open(os.path.expandvars("$XDG_CONFIG_HOME/eww/ewwrc"), encoding="utf8") as file:
config: dict = json.loads(file.read())["player"]
default_cover = os.path.expandvars(config["default_art"])
pctl_cache = os.path.expandvars(config["pctl_cache"])
manager = Playerctl.PlayerManager()
manager.connect("name-appeared", on_name_appeared_vanished)
manager.connect("name-vanished", on_name_appeared_vanished)
# loop through and initialize all registered and active MPRIS player on first run.
[init_player(name) for name in manager.props.player_names]
# if there are no player on the first run then print fallback / dummy metadata.
# WARN: Note that a really bad error is thrown when this check is not done.
# WARN: IIRC it is from the underlying C library so, you can't really try-except that.
if player_null_check(manager):
player = Playerctl.Player()
on_metadata(player, player.props.metadata)
try:
loop = GLib.MainLoop()
loop.run()
except (KeyboardInterrupt, Exception) as excep:
loop.quit()
# vim:filetype=python
================================================
FILE: src/shell/pollution.py
================================================
from datetime import datetime
import utils
import json
import os
import sys
import pathlib
def prepare_link(options: dict, token: str) -> str | None:
link = f"http://api.openweathermap.org/data/2.5/air_pollution?appid={token}"
link_fragment = ""
if options["latitude"] and options["longitude"]:
link_fragment += f"&lat={options['latitude']}&lon={options['longitude']}"
return f"{link}{link_fragment}" if link_fragment else None
def cache_pollution_get(config: dict) -> dict:
location = None
if config["location"]["method"] == "automatic":
location = utils.auto_locate(config["location"]["cache_dir"])
elif config["location"]["method"] == "manual":
location = config["location"]
else:
sys.stderr.write("Unknown Method!\n")
exit(1)
token = config["tokens"]["openweather"]
prepared_link = prepare_link(location, token)
cache_path = pathlib.PosixPath(f"{config['pollution']['cache_dir']}/pollution-{datetime.now().strftime('%F')}.json")
if not cache_path.is_file():
def callback(metadata: dict) -> dict:
metadata["icons"] = config["pollution"]["icons"]
return metadata
utils.fetch_save(prepared_link, str(cache_path), callback)
return cache_path.read_text()
if __name__ == "__main__":
CONFIG = json.loads(pathlib.PosixPath(os.path.expandvars("$XDG_CONFIG_HOME/eww/ewwrc")).read_text())
CONFIG["pollution"]["cache_dir"] = os.path.expandvars(CONFIG["pollution"]["cache_dir"])
CONFIG["location"]["cache_dir"] = os.path.expandvars(CONFIG["location"]["cache_dir"])
pathlib.PosixPath(CONFIG["pollution"]["cache_dir"]).mkdir(parents=True, exist_ok=True)
sys.stdout.write(cache_pollution_get(CONFIG) + "\n")
sys.stdout.flush()
# vim:filetype=python
================================================
FILE: src/shell/uptime.awk
================================================
#!/usr/bin/env --split-string=awk --file
{
if ($0 ~ "hours") sub("hours", "h", $0)
if ($0 ~ "hour") sub("hour", "h", $0)
if ($0 ~ "minutes") sub("minutes", "m", $0)
if ($0 ~ "minute") sub("minute", "m", $0)
if ($0 ~ "seconds") sub("seconds", "s", $0)
if ($0 ~ "second") sub("second", "s", $0)
if ($0 ~ "days") sub("days", "d", $0)
if ($0 ~ "day") sub("day", "d", $0)
if ($0 ~ "weeks") sub("weeks", "w", $0)
if ($0 ~ "week") sub("week", "w", $0)
gsub(",", "", $0)
print $2$3" "$4$5" "$6$7
}
# vim:filetype=awk
================================================
FILE: src/shell/utils.py
================================================
"""Utility module. Shared across almost all of the python scripts / modules."""
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
import json
import os
import pathlib
import random
import re
import sys
import time
import typing
import unicodedata
from wand.image import COLORSPACE_TYPES, Image
from html.parser import HTMLParser
from io import StringIO
import dbus
import gi
# supress GIO warnings
gi.require_version("Gtk", "3.0")
gi.require_version("GdkPixbuf", "2.0")
import requests
from gi.repository import GdkPixbuf, Gio, GLib, Gtk
class PangoStripper(HTMLParser):
def __init__(self):
super().__init__()
self.reset()
self.strict = False
self.convert_charrefs = True
self.text = StringIO()
def handle_data(self, d):
self.text.write(d)
def get_data(self):
return self.text.getvalue()
def contains_pango(string: str) -> bool:
"""Checks if a string contains HTML tags or not. Since a pango string has to have at least two tags
Arguments:
string: The Pango markup format string.
Returns:
A bool value i.e. whether a has pango markup or not.
"""
return any(item in string for item in ["<span>", "</a>", "</span>"])
def strip_pango_tags(pango: str) -> str:
"""Removes HTML tags like <span>, <span align='left'>, etc.
Arguments:
pango: The Pango format string that needs to be stripped of its tags.
Returns:
A str without the tags.
"""
stripper = PangoStripper()
stripper.feed(pango)
return stripper.get_data()
def create_parents_file(file_path: str):
'''A replication of [ -f "$FILE_PATH" ] || mkdir --parents "$FILE_PATH"
Arguments:
file_path: The location of the file.
'''
pathlib.PosixPath(os.path.dirname(file_path)).mkdir(
parents=True, exist_ok=True)
pathlib.PosixPath(file_path).touch(exist_ok=True)
def watcher(file_path: str, callback: typing.Callable, interval: int, initial: bool = True):
"""A file watcher function that executes a callback function if any change is made to a file.
Arguments:
file_path: The file location that needs to be monitored.
callback: A callback function that would be invoked when any change is noticed.
interval: The time rate at which the file will be checked for changes.
initial: Initially execute the callback once before entering the watch loop.
"""
try:
old = pathlib.PosixPath(file_path).read_text()
if initial:
callback(old)
while not time.sleep(interval):
new = pathlib.PosixPath(file_path).read_text()
if new != old:
callback(new)
old = new
except KeyboardInterrupt:
sys.stdout.write("Closed.\n")
except FileNotFoundError:
sys.stderr.write("The path does not exist!\n")
except Exception as excep:
sys.stderr.write(f"{excep}\n")
def get_rand_quote(file_path: str, default_quote: str) -> str:
"""Get a random quote or, rather a random line.
Arguments:
file_path: The location of the file.
default_quote: Fallback quote if the file doesn't exist r, is empty.
"""
loaded_quotes: str = pathlib.PosixPath(file_path).read_text().strip()
return random.choice(loaded_quotes.splitlines()) if loaded_quotes else default_quote
def file_matched_index_rm(file_path: str, pattern: str):
"""Removes line from a file if a pattern matches that line.
Arguments:
file_path: The location of the file.
pattern: Pattern to match the line that needs to be removed.
"""
posix_file_path = pathlib.PosixPath(file_path)
lines = posix_file_path.read_text().splitlines()
# skip the line if pattern matches
rm_index_lines = [
lines[index]
for index in range(len(lines))
if not re.search(pattern, lines[index])
]
if len(lines) != len(rm_index_lines):
posix_file_path.write_text("\n".join(rm_index_lines))
def file_rm_line(file_path: str, position: int | bool | range = True):
"""Ranged line removal, indexed line removal and stack-like (pop / reverse pop) line removal.
Arguments:
file_path: The location of the file.
position: If the value is of type:
range: then that the lines starting from that range will be removed.
int: then that specific file line number will be removed.
bool: True will pop and False will pop from the end.
"""
file = pathlib.PosixPath(file_path)
match str(type(position)):
case "<class 'int'>":
file_contents = file.read_text().splitlines()
# no need to run the loop if all you need to do is remove the first line
if position == 0:
file_rm_line(file_path, position=True)
return
elif position == len(file_contents) - 1:
file_rm_line(file_path, position=False)
return
line_removed_contents = []
# skip the line that matches the position value.
for index in range(len(file_contents)):
if index != position:
line_removed_contents += [file_contents[index]]
file.write_text("\n".join(line_removed_contents))
# filter falsey and truthy and use the actual bool class signature
case "<class 'bool'>":
file_contents = file.read_text().splitlines()
file_contents = file_contents[1:] if position else file_contents[:-1]
file.write_text("\n".join(file_contents))
case "<class 'range'>":
if not position:
file.write_text("")
return
file_contents = file.read_text().splitlines()
write_contents = []
# keep on skipping the lines if they are in the range.
for index in range(len(file_contents)):
if index not in position:
write_contents += [file_contents[index]]
file.write_text("\n".join(write_contents))
def prettify_name(name: str) -> str:
"""Transforms 'Hello-World' -> 'Hello World', 'notify-send++lol' -> 'Notify Send Lol'
Arguments:
name: The string that needs to be prettified.
Returns:
A prettified str.
"""
return " ".join(
item.capitalize()
for item in name.replace("-", " ").replace("_", " ").split(" ")
)
def file_add_line(file_path: str, write_contents: str, limit: int, top: bool = True):
"""Functions like sliding window algorithm <https://towardsdev.com/sliding-window-algorithm-145f8e201a64>
That is after the file hits a certain line limit, lines from the behind will be dropped (older entries)
and THEN the newer ones will be entered.
Arguments:
file_path: The location of the file.
write_contents: The contents that needs to be written to the file.
limit: The line limit.
top: Adds new entry at the beginning of the file if True, at the end otherwise.
"""
file = pathlib.PosixPath(file_path)
file_contents = file.read_text().splitlines()
if len(file_contents) == limit:
file_contents = file_contents[:-1]
file_contents = (
[write_contents] + file_contents if top else file_contents + [write_contents]
)
file.write_text("\n".join(file_contents))
def parse_and_print_stats(file_contents: str) -> dict:
"""Looks the words CRITICAL, LOW and NORMAL and calcuates its frequency.
Arguments:
file_contents: the string that needs to be calculated for frequency.
Returns:
Individual frequency of the words in dict format.
{"CRITICAL": 10.00, "NORMAL": 85.00, "LOW": 5.00}
"""
stats = {"critical": 0, "low": 0, "normal": 0, "total": 0}
for line in file_contents.splitlines():
if "CRITICAL" in line:
stats["critical"] += 1
stats["total"] += 1
elif "LOW" in line:
stats["low"] += 1
stats["total"] += 1
elif "NORMAL" in line:
stats["normal"] += 1
stats["total"] += 1
# handle division / zero
stats["critical"] = (
stats["critical"] * 100 /
stats["total"] if stats["critical"] > 0 else 0
)
stats["normal"] = (
stats["normal"] * 100 / stats["total"] if stats["normal"] > 0 else 0
)
stats["low"] = stats["low"] * 100 / \
stats["total"] if stats["low"] > 0 else 0
return stats
def has_non_english_chars(string: str) -> dict:
"""Check if there is any CJK / Cyrillic characters in the given string.
Arguments:
string: the string that needs to be checked.
Returns:
A dict containing True / False for keys representing if such characters exist or not.
{"CJK": True, "CYR": False} for string value: "おはようございます means Good Morning!"
"""
return {
"CJK": any(unicodedata.category(char) == "Lo" for char in string),
"CYR": any(unicodedata.category(char) == "Lu" for char in string),
}
def unwrap(value: dbus.Array
| dbus.Boolean
| dbus.Byte
| dbus.Dictionary
| dbus.Double
| dbus.Int16
| dbus.ByteArray
| dbus.Int32
| dbus.Int64
| dbus.Signature
| dbus.UInt16
| dbus.UInt32
| dbus.UInt64
| dbus.String) -> str | int | list | tuple | float | dict | bool | bytes:
"""Try to trivially translate a dictionary's elements into nice string formatting.
Arguments:
value: A type out of:
dbus.Boolean,
dbus.Byte,
dbus.Dictionary,
dbus.Double,
dbus.Int16,
dbus.ByteArray,
dbus.Int32,
dbus.Int64,
dbus.Signature,
dbus.UInt16,
dbus.UInt32,
dbus.UInt64 and dbus.String
Returns:
A str or int or list or tuple or float or dict or bool or bytes depending on the value.
"""
if isinstance(value, dbus.ByteArray):
return "".join([str(byte) for byte in value])
if isinstance(value, (dbus.Array, list, tuple)):
return [unwrap(item) for item in value]
if isinstance(value, (dbus.Dictionary, dict)):
return dict([(unwrap(x), unwrap(y)) for x, y in value.items()])
if isinstance(value, (dbus.Signature, dbus.String)):
return str(value)
if isinstance(value, dbus.Boolean):
return bool(value)
if isinstance(
value,
(dbus.Int16, dbus.UInt16, dbus.Int32,
dbus.UInt32, dbus.Int64, dbus.UInt64),
):
return int(value)
if isinstance(value, dbus.Byte):
return bytes([int(value)])
return value
def save_img_byte(px_args: typing.Iterable, save_path: str):
"""Converts image data to an image file.
See <https://docs.gtk.org/gdk-pixbuf/ctor.Pixbuf.new_from_bytes.html> for the whole description.
Arguments:
px_args: Should contain an iterable in the following format.
[image_width, image_height, rowstride, has_alpha, bits_per_sample, _, image_bytes]
save_path: the filepath where this pixbuf should be saved to.
"""
# https://specifications.freedesktop.org/notification-spec/latest/ar01s08.html
# https://specifications.freedesktop.org/notification-spec/latest/ar01s05.html
GdkPixbuf.Pixbuf.new_from_bytes(
width=px_args[0],
height=px_args[1],
has_alpha=px_args[3],
data=GLib.Bytes(px_args[6]),
colorspace=GdkPixbuf.Colorspace.RGB,
rowstride=px_args[2],
bits_per_sample=px_args[4],
).savev(save_path, "png")
def get_gtk_icon_path(icon_name: str, size: int = 128) -> str:
"""Returns the icon path by the specified name from your current icon theme.
Recursively search for lower sizes until 32x32 and
return a fallback if the requested path does not exists.
Arguments:
icon_name: Icon name as per the icon naming specification:
<https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html>
size: the pixel size (widthxheight -> heightxheight -> size) of the requested icon.
"""
if size < 32:
return os.path.expandvars("$XDG_CONFIG_HOME/eww/assets/bell.png")
if info := Gtk.IconTheme.get_default().lookup_icon(icon_name, size, 0):
return info.get_filename()
return get_gtk_icon_path(icon_name, size - 1)
def get_mime_icon_path(mimetype: str, size: int = 32) -> str:
"""Gets the default icon path from the current GTK icon theme for the specified mime type.
Arguments:
mimetype: The file type like png, json, etc.
size: The of the returned icon
Returns:
A str that is the path to the requested icon.
"""
icon = Gio.content_type_get_icon(mimetype)
theme = Gtk.IconTheme.get_default()
if info := theme.choose_icon(icon.get_names(), size, 0):
return info.get_filename()
def get_location() -> dict | None:
try:
response = requests.get('https://api64.ipify.org?format=json').json()
ip_address = response["ip"]
response = requests.get(f'https://ipapi.co/{ip_address}/json/').json()
return {
"latitude": response.get("latitude"),
"longitude": response.get("longitude"),
"city": response.get("city"),
"country": response.get("country_name"),
"lang": response.get("languages").split(",")[0],
}
except requests.exceptions.ConnectionError:
return None
def auto_locate(cache_dir: str) -> dict | None:
cache_posix_path = pathlib.PosixPath(f"{cache_dir}/location.json")
if not cache_posix_path.is_file(): # assuming the directory exists
fetched_location = get_location()
if not fetched_location:
return None
cache_posix_path.write_text(json.dumps(fetched_location))
return fetched_location
return json.loads(cache_posix_path.read_text())
def fetch_save(link: str, save_path: str, callback: typing.Callable = None) -> bool:
try:
data = requests.get(link)
if data.status_code == 200:
metadata = data.json()
if callback:
metadata = callback(metadata)
pathlib.PosixPath(save_path).write_text(json.dumps(metadata))
return True
return False
except requests.exceptions.ConnectionError:
return False
def img_dark_bright_col(filepath: str, colors: int = 10) -> tuple:
with Image(filename=filepath) as image:
image.quantize(
number_colors=colors,
colorspace_type=COLORSPACE_TYPES[21],
dither=True, measure_error=False, treedepth=8)
return tuple(
"#%02X%02X%02X" % (item.red_int8, item.green_int8, item.blue_int8)
for item in image.histogram)
if __name__ == "__main__":
match sys.argv[1]:
case "histogram":
image_path = sys.argv[2]
histogram_colors = int(sys.argv[3])
sys.stdout.write(json.dumps(img_dark_bright_col(image_path, histogram_colors)) + "\n")
sys.stdout.flush()
# vim:filetype=python
================================================
FILE: src/shell/weather.py
================================================
import json
import os
import pathlib
import sys
from datetime import datetime
import utils
def prepare_link(options: dict, token: str) -> str | None:
link = f"https://api.openweathermap.org/data/2.5/weather?appid={token}"
link_fragment = ""
if options["latitude"] and options["longitude"]:
# always give priority to lat and long
link_fragment += f"&lat={options['latitude']}&lon={options['longitude']}"
else:
if options["city"]:
link_fragment += f"&q={options['city']}"
if not options["country_code"]:
return
if options["zip"] and not options["city"]:
link_fragment += f"&zip={options['zip']}"
link_fragment += f",{options['country_code']}"
if options["lang"]:
# https://openweathermap.org/current#multi
link_fragment += f"&lang={options['lang']}"
if options["units"]:
# standard, metric, imperial
link_fragment += f"&units={options['units']}"
return f"{link}{link_fragment}" if link_fragment else None
def assign_glyph(icon_name: str, icons: dict) -> str:
try:
return os.path.expandvars(icons[icon_name])
except KeyError:
return os.path.expandvars(icons["default"])
def day_night(path_frag: str, time_of_day: str, date_time: datetime) -> pathlib.PosixPath:
return pathlib.PosixPath(f"{path_frag}/weather-{date_time.strftime('%F')}-{time_of_day}.json")
def cache_and_get(config: dict, fallback: str) -> pathlib.PosixPath:
now = datetime.now()
date_path = day_night(config["weather"]["cache_dir"], "day", now)
if now.hour > 15 or now.hour < 4:
date_path = day_night(config["weather"]["cache_dir"], "night", now)
if config["location"]["method"] == "automatic":
if location_data := utils.auto_locate(config["location"]["cache_dir"]):
config["weather"] |= location_data
prepared_link = prepare_link(config["weather"], config["tokens"]["openweather"])
def callback(metadata: dict) -> dict:
for index in range(len(metadata["weather"])):
metadata["weather"][index]["glyph"] = assign_glyph(metadata["weather"][0]["icon"], config["weather"]["icons"])
metadata["weather"][index]["image"] = assign_glyph(metadata["weather"][0]["icon"], config["weather"]["images"])
metadata["weather"][index]["image_colors"] = utils.img_dark_bright_col(metadata["weather"][index]["image"])
return metadata
if not date_path.is_file() and not utils.fetch_save(prepared_link, str(date_path), callback):
return fallback
return json.loads(date_path.read_text())
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.stderr.write("No such option!")
# NOTE: Change these only if you know what you are doing.
CONFIG_PATH = os.path.expandvars("$XDG_CONFIG_HOME/eww/ewwrc")
FALLBACK = {
"weather": [
{
"main": "NA",
"glyph": "",
"image": "$XDG_CONFIG_HOME/eww/assets/01.jpg",
"icon": "03d"
}
],
"main": {
"temp": "NA",
"feels_like": "NA",
"temp_min": "NA",
"temp_max": "NA",
"pressure": "NA",
"humidity": "NA"
},
"sys": {
"country": "NA"
},
"name": "NA"
}
CONFIG = json.loads(pathlib.PosixPath(CONFIG_PATH).read_text())
CONFIG["weather"]["cache_dir"] = os.path.expandvars(CONFIG["weather"]["cache_dir"])
CONFIG["location"]["cache_dir"] = os.path.expandvars(CONFIG["location"]["cache_dir"])
pathlib.PosixPath(CONFIG["weather"]["cache_dir"]).mkdir(parents=True, exist_ok=True)
pathlib.PosixPath(CONFIG["location"]["cache_dir"]).mkdir(parents=True, exist_ok=True)
match sys.argv[1]:
case "fetch":
_metadata = cache_and_get(CONFIG, FALLBACK)
sys.stdout.write(json.dumps(_metadata) + "\n")
sys.stdout.flush()
case "gist":
_metadata = cache_and_get(CONFIG, FALLBACK)
_box = []
for index in range(len(_metadata["weather"])):
_box += [_metadata["weather"][index][sys.argv[2]]]
sys.stdout.write(", ".join(_box) if len(_box) > 2 else " and ".join(_box))
sys.stdout.write("\n")
sys.stdout.flush()
================================================
FILE: src/shell/workspaces.zsh
================================================
#!/usr/bin/env zsh
# Authored By dharmx <dharmx.dev@gmail.com> under:
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#
# Permissions of this strong copyleft license are conditioned on
# making available complete source code of licensed works and
# modifications, which include larger works using a licensed work,
# under the same license. Copyright and license notices must be
# preserved. Contributors provide an express grant of patent rights.
#
# Read the complete license here:
# <https://github.com/dharmx/vile/blob/main/LICENSE.txt>
# Gist
# Controller script (from MVC pattern) for the vertigo widget.
# Gives out node_state (window_state?) and desktop_state (workspace_state?)
# read these https://specifications.freedesktop.org/wm-spec/wm-spec-1.3.html#idm46435614881776
# although you could guess what these mean by their prefixes and names
# Types:
# - State
# - Tag
# - Layout
names=(STATE_FOCUSED STATE_OCCUPIED STATE_URGENT STATE_EMPTY TAG_HIDDEN TAG_STICKY TAG_PRIVATE TAG_LOCKED TAG_MARKED TAG_EMPTY LAYOUT_MONOCLE LAYOUT_TILED LAYOUT_FULLSCREEN LAYOUT_PSEUDO_TILED LAYOUT_FLOATING LAYOUT_EMPTY)
# NOTE: layouts include monocle as well and the rest are just node states. The names are not entirely misleading as
# NOTE: the STATE_* indicates desktop_state and LAYOUT_* indicates node_state hence the following todo.
# TODO: Clarify the diff between node_state and desktop_state items in the names array (rename).
pushd "$XDG_CONFIG_HOME/eww"
index=1 # IKR? ZSH arrays start with 1
jq --raw-output --compact-output '.desktops|values[][]' "./ewwrc" | while read -r icon
do
# load the glyphs from the config and eval them into env vars
eval "${names[$index]}='$icon'"
index=$((index+1))
done
function _make_button() {
# --- --- --- -----------------------------------------
# | 1 | 2 | 3 | |
# --- --- --- -----------------------------------------
# 1, 2 and 3 are the workspaces that are in the form of a button
# this yuck literal represents that one workspace button, which is
# then combined in a box
# param $1: workspace label eg 1 / 2 / 3 ...
# param $2: states out of urgent / occupied / focused / empty
# param $3: actual workspace value as defined by the WM
echo "{\"class\":\"vertigo-button vertigo-workspace vertigo-workspace-$2\",\"tooltip\":\"workspace: $1 state: $2\",\"onclick\":\"bspc desktop --focus $3\",\"label\":\"$1\"}"
}
function _wrap_desktop_yuck() {
# combined
local buffered='['
alias query="bspc query --names --desktops --desktop"
# newlined str -> spaced str -> array, eg: "1\n2\n3" -> "1 2 3" -> (1 2 3)
local _focused=(${$(query .focused)//$'\n'/ })
local _urgent=(${$(query .urgent)//$'\n'/ })
local _occupied=(${$(query .occupied)//$'\n'/ })
local _local=(${$(query .local)//$'\n'/ })
seq ${#_local} | while read -r index; do
local current=${_local[$index]}
local state="local"
# ie -> [current in _occupied] -> returns a value greater than the
# length of _occupied if it does not exist
# if it exists then the index number is returned (neat)
# you'll get the rest right?
# translation of the line below: has(current, _occupied) < len(_occupied)
if [[ ${_occupied[(ie)$current]} -le ${#_occupied} ]]; then
# another thing to notice are priorities
# i.e. occupied.focused is preferred over occupied.occupied
if [[ ${_focused[(ie)$current]} -le ${#_focused} ]]; then
_local[$index]="$STATE_FOCUSED" && state="focused"
else
_local[$index]="$STATE_OCCUPIED" && state="occupied"
fi
elif [[ ${_urgent[(ie)$current]} -le ${#_urgent} ]]; then
_local[$index]="$STATE_URGENT" && state="urgent"
elif [[ ${_focused[(ie)$current]} -le ${#_focused} ]]; then
_local[$index]="$STATE_FOCUSED" && state="focused"
else
_local[$index]="$STATE_EMPTY" && state="local"
fi
buffered+=$(_make_button $_local[$index] $state $index)
buffered+=","
done
buffered="${buffered::-1}]"
echo "$buffered"
unalias query
}
function _make_label() {
# this is another functionality that this script provides i.e. the current node_state (focused)
# it will indicate whether the node / window is tiled or, floating, etc.
# param $1: node_label
# param $2: node_state
# param $3: node_state
echo "{\"onmiddleclick\":\"bspc desktop --layout next\",\"class\":\"vertigo-button vertigo-node-button vertigo-node-button-$3\",\"tooltip\":\"node: $2\",\"label\":\"$1\"}"
}
function _wrap_node_yuck() {
# gets the current focused node state and makes a label for it accordingly
# which will then be evaluated by eww and rendered on the widget
alias query="bspc query --nodes --node"
# TODO: is there a way to not use jq?
monocle=$(bspc query --tree --desktop | jq --raw-output .layout)
if [ $(query .focused.tiled) ]; then
# this behaviour has been adapted from polybar i.e. if a desktop is not empty
# then it will be checked whether that desktop is in monocle layout or not
# otherwise, it will show that the layout is empty (like if the desktop is in tiled instead)
[ $monocle = monocle ] \
&& echo $(_make_label "$LAYOUT_MONOCLE" "monocle" "monocle") \
|| echo $(_make_label "$LAYOUT_TILED" "tiled" "tiled")
elif [ $(query .focused.floating) ]; then
echo $(_make_la
gitextract_e3k5oh14/
├── .github/
│ ├── README.md
│ └── workflows/
│ └── stale.yml
├── .gitignore
├── LICENSE
├── eww.scss
├── requirements.txt
├── src/
│ ├── scss/
│ │ ├── _base.scss
│ │ ├── _override.scss
│ │ ├── avatar/
│ │ │ ├── _init.scss
│ │ │ ├── _mpd.scss
│ │ │ ├── _override.scss
│ │ │ ├── _pctl.scss
│ │ │ ├── _quick.scss
│ │ │ └── _userinfo.scss
│ │ ├── bolt/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── chrono/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── clime/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── disclose/
│ │ │ ├── _cardimage.scss
│ │ │ ├── _cardprog.scss
│ │ │ ├── _cardradial.scss
│ │ │ ├── _cardscr.scss
│ │ │ ├── _dnd.scss
│ │ │ ├── _empty.scss
│ │ │ ├── _init.scss
│ │ │ ├── _modifiers.scss
│ │ │ ├── _override.scss
│ │ │ ├── _stats.scss
│ │ │ └── _urgency.scss
│ │ ├── horizon/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── lumin/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── melody/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── ocular/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── origin/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ ├── power/
│ │ │ ├── _init.scss
│ │ │ └── _override.scss
│ │ └── vertigo/
│ │ ├── _info.scss
│ │ ├── _init.scss
│ │ ├── _node.scss
│ │ ├── _override.scss
│ │ └── _state.scss
│ ├── shell/
│ │ ├── cache.py
│ │ ├── combine.zsh
│ │ ├── github.sh
│ │ ├── handlers.py
│ │ ├── logger.py
│ │ ├── mpdaemon.py
│ │ ├── playerctl.py
│ │ ├── pollution.py
│ │ ├── uptime.awk
│ │ ├── utils.py
│ │ ├── weather.py
│ │ └── workspaces.zsh
│ └── yuck/
│ ├── _env.yuck
│ ├── _lib.yuck
│ ├── avatar/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── lib/
│ │ ├── _init.yuck
│ │ ├── _mpd.yuck
│ │ ├── _pctl.yuck
│ │ ├── _quick.yuck
│ │ └── _small.yuck
│ ├── bolt/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── chrono/
│ │ ├── _env.yuck
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── clime/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── disclose/
│ │ ├── _dnd.yuck
│ │ ├── _env.yuck
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ ├── _stats.yuck
│ │ └── cards/
│ │ ├── _cardimage.yuck
│ │ ├── _cardprog.yuck
│ │ ├── _cardradial.yuck
│ │ └── _cardscr.yuck
│ ├── horizon/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── lumin/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── melody/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── ocular/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ ├── origin/
│ │ ├── _init.yuck
│ │ └── _layout.yuck
│ ├── power/
│ │ ├── _init.yuck
│ │ ├── _layout.yuck
│ │ └── _modules.yuck
│ └── vertigo/
│ ├── _env.yuck
│ ├── _init.yuck
│ ├── _label.yuck
│ ├── _layout.yuck
│ ├── _modules.yuck
│ └── _reveal.yuck
└── themes/
└── radium.scss
SYMBOL INDEX (65 symbols across 8 files)
FILE: src/shell/cache.py
class Urgency (line 48) | class Urgency:
function console_write (line 65) | def console_write(string: str):
class Eavesdropper (line 70) | class Eavesdropper:
method __init__ (line 90) | def __init__(
method _message_callback (line 106) | def _message_callback(
method eavesdrop (line 178) | def eavesdrop(
FILE: src/shell/handlers.py
function redir_to_handlers (line 40) | def redir_to_handlers(formats, attributes: dict) -> str:
function shot_handler (line 172) | def shot_handler(formats, attributes: dict) -> str:
function Spotify_handler (line 195) | def Spotify_handler(formats, attributes: dict) -> str:
function default_handler (line 208) | def default_handler(formats, attributes: dict) -> str:
function notify_send_handler (line 230) | def notify_send_handler(formats, attributes: dict) -> str:
function brightness_handler (line 247) | def brightness_handler(formats, attributes: dict) -> str:
function volume_handler (line 261) | def volume_handler(formats, attributes: dict) -> str:
function todo_handler (line 276) | def todo_handler(formats, attributes: dict) -> str:
function shot_icon_handler (line 303) | def shot_icon_handler(formats, attributes: dict) -> str:
FILE: src/shell/logger.py
function master_callback (line 123) | def master_callback(details: dict):
FILE: src/shell/mpdaemon.py
class MPDHandler (line 30) | class MPDHandler:
method __init__ (line 32) | def __init__(self, prefix: str, cache, default):
method _validatepath (line 51) | def _validatepath(self, path: str) -> str:
method _embeddedcover (line 61) | def _embeddedcover(self, key: str) -> str | bytes:
method get (line 79) | def get(self, key: str) -> str:
method create (line 90) | def create(self, key: str) -> bool:
method metadatajson (line 116) | def metadatajson(self, tojson=True) -> str | dict:
method cacheplaylist (line 153) | def cacheplaylist(self):
method cachedatatbase (line 157) | def cachedatatbase(self):
method subscribe (line 167) | def subscribe(self, interval: float = 1.0) -> str:
method close (line 187) | def close(self):
FILE: src/shell/playerctl.py
function on_metadata (line 38) | def on_metadata(*args):
function on_play_pause (line 92) | def on_play_pause(player, *_):
function init_player (line 102) | def init_player(name):
function player_null_check (line 121) | def player_null_check(player_manager) -> bool:
function on_name_appeared_vanished (line 147) | def on_name_appeared_vanished(player_manager, name):
function gen_hex_path_encode (line 159) | def gen_hex_path_encode(unique_path_name: list) -> str:
function fetch_save_cover (line 171) | def fetch_save_cover(link: str, save_path: str) -> bool:
function cache_and_get (line 190) | def cache_and_get(metadata: dict) -> str:
function get_bright_dark_from_cover (line 227) | def get_bright_dark_from_cover(image_path: str) -> dict:
FILE: src/shell/pollution.py
function prepare_link (line 9) | def prepare_link(options: dict, token: str) -> str | None:
function cache_pollution_get (line 17) | def cache_pollution_get(config: dict) -> dict:
FILE: src/shell/utils.py
class PangoStripper (line 45) | class PangoStripper(HTMLParser):
method __init__ (line 46) | def __init__(self):
method handle_data (line 53) | def handle_data(self, d):
method get_data (line 56) | def get_data(self):
function contains_pango (line 60) | def contains_pango(string: str) -> bool:
function strip_pango_tags (line 72) | def strip_pango_tags(pango: str) -> str:
function create_parents_file (line 86) | def create_parents_file(file_path: str):
function watcher (line 97) | def watcher(file_path: str, callback: typing.Callable, interval: int, in...
function get_rand_quote (line 123) | def get_rand_quote(file_path: str, default_quote: str) -> str:
function file_matched_index_rm (line 134) | def file_matched_index_rm(file_path: str, pattern: str):
function file_rm_line (line 155) | def file_rm_line(file_path: str, position: int | bool | range = True):
function prettify_name (line 200) | def prettify_name(name: str) -> str:
function file_add_line (line 215) | def file_add_line(file_path: str, write_contents: str, limit: int, top: ...
function parse_and_print_stats (line 237) | def parse_and_print_stats(file_contents: str) -> dict:
function has_non_english_chars (line 273) | def has_non_english_chars(string: str) -> dict:
function unwrap (line 289) | def unwrap(value: dbus.Array
function save_img_byte (line 344) | def save_img_byte(px_args: typing.Iterable, save_path: str):
function get_gtk_icon_path (line 367) | def get_gtk_icon_path(icon_name: str, size: int = 128) -> str:
function get_mime_icon_path (line 385) | def get_mime_icon_path(mimetype: str, size: int = 32) -> str:
function get_location (line 401) | def get_location() -> dict | None:
function auto_locate (line 417) | def auto_locate(cache_dir: str) -> dict | None:
function fetch_save (line 429) | def fetch_save(link: str, save_path: str, callback: typing.Callable = No...
function img_dark_bright_col (line 443) | def img_dark_bright_col(filepath: str, colors: int = 10) -> tuple:
FILE: src/shell/weather.py
function prepare_link (line 10) | def prepare_link(options: dict, token: str) -> str | None:
function assign_glyph (line 37) | def assign_glyph(icon_name: str, icons: dict) -> str:
function day_night (line 44) | def day_night(path_frag: str, time_of_day: str, date_time: datetime) -> ...
function cache_and_get (line 48) | def cache_and_get(config: dict, fallback: str) -> pathlib.PosixPath:
Condensed preview — 112 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (301K chars).
[
{
"path": ".github/README.md",
"chars": 33175,
"preview": "<div align=\"center\">\n\n[](https://github.com/dharmx/vile)\n\n[ 2007 Free "
},
{
"path": "eww.scss",
"chars": 464,
"preview": "@import \"themes/radium\";\n@import \"src/scss/base\";\n\n@import \"src/scss/avatar/init\";\n@import \"src/scss/disclose/init\";\n@im"
},
{
"path": "requirements.txt",
"chars": 86,
"preview": "dbus-python==1.2.18\nPyGObject==3.42.2\npython-mpd2==3.0.5\nrequests==2.32.4\nWand==0.6.8\n"
},
{
"path": "src/scss/_base.scss",
"chars": 177,
"preview": "* {\n all: unset;\n transition: 200ms ease-out;\n}\n\ntooltip {\n font-family: Phosphor, Dosis;\n background-color: $base15"
},
{
"path": "src/scss/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/avatar/_init.scss",
"chars": 556,
"preview": ".avatar-layout-box {\n font-family: Phosphor, Dosis, \"Iosevka Nerd Font\", sans-serif;\n background-color: $shade10;\n pa"
},
{
"path": "src/scss/avatar/_mpd.scss",
"chars": 2623,
"preview": ".avatar-mpd-box {\n font-family: Phosphor, Dosis, \"Iosevka Nerd Font\", sans-serif;\n border-radius: 1em;\n background-re"
},
{
"path": "src/scss/avatar/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/avatar/_pctl.scss",
"chars": 838,
"preview": ".avatar-pctl-box {\n font-family: Phosphor, Dosis, \"Iosevka Nerd Font\", sans-serif;\n border-radius: 1em;\n background-r"
},
{
"path": "src/scss/avatar/_quick.scss",
"chars": 1971,
"preview": ".ava-quick-box {\n font-family: Phosphor, monoMMM_5;\n background-color: $shade09;\n font-size: 15;\n border-radius: 1em"
},
{
"path": "src/scss/avatar/_userinfo.scss",
"chars": 1109,
"preview": ".avatar-profile-user-box {\n background: linear-gradient(45deg, rgba(16, 19, 23, 1.0) 20%, $base01 100%);\n padding: 2em"
},
{
"path": "src/scss/bolt/_init.scss",
"chars": 2771,
"preview": ".bolt-layout-box {\n font-family: Phosphor, Dosis;\n background-color: $shade08;\n color: $base05;\n padding: 2em;\n bor"
},
{
"path": "src/scss/bolt/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/chrono/_init.scss",
"chars": 6162,
"preview": ".chrono-layout-box {\n font-family: Phosphor, \"Caviar Dreams\";\n background-color: $shade10;\n padding-top: 0.7em;\n fon"
},
{
"path": "src/scss/chrono/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/clime/_init.scss",
"chars": 404,
"preview": ".clime-layout-box {\n font-family: \"Caviar Dreams\", Phosphor;\n font-size: 17;\n opacity: 0.8;\n}\n\n.clime-img {\n font-si"
},
{
"path": "src/scss/clime/_override.scss",
"chars": 0,
"preview": ""
},
{
"path": "src/scss/disclose/_cardimage.scss",
"chars": 1665,
"preview": ".disclose-cardimage-eventbox {\n background: linear-gradient(45deg, $base02 20%, $base01 100%);\n border-radius: 0.5em;\n"
},
{
"path": "src/scss/disclose/_cardprog.scss",
"chars": 2324,
"preview": ".disclose-cardprog-eventbox {\n background: linear-gradient(45deg, $base02 20%, $base01 100%);\n border-radius: 0.5em;\n}"
},
{
"path": "src/scss/disclose/_cardradial.scss",
"chars": 1544,
"preview": ".disclose-cardradial-eventbox {\n background: linear-gradient(45deg, $base02 20%, $base01 100%);\n border-radius: 0.5em;"
},
{
"path": "src/scss/disclose/_cardscr.scss",
"chars": 1611,
"preview": ".disclose-cardscr-eventbox {\n background: linear-gradient(45deg, $base02 20%, $base01 100%);\n border-radius: 0.5em;\n}\n"
},
{
"path": "src/scss/disclose/_dnd.scss",
"chars": 1418,
"preview": ".disclose-dnd-box {\n background-image: linear-gradient(to bottom left, rgba(0, 0, 0, 1.0), rgba(30, 33, 40, 0.5)), url("
},
{
"path": "src/scss/disclose/_empty.scss",
"chars": 302,
"preview": ".disclose-empty-banner {\n padding-top: 8em;\n}\n\n.disclose-empty-box {\n padding: 1em 1em 10em 0;\n}\n\n.disclose-empty-labe"
},
{
"path": "src/scss/disclose/_init.scss",
"chars": 839,
"preview": ".disclose-layout-box {\n background-color: $shade10;\n font-family: Dosis, Phosphor, \"Iosevka Nerd Font\", sans-serif;\n "
},
{
"path": "src/scss/disclose/_modifiers.scss",
"chars": 218,
"preview": ".shot-image-bord-dashed {\n border-style: dashed;\n}\n\n.Spotify-rectangle {\n margin: 0.3em;\n border-radius: 0.2em;\n bor"
},
{
"path": "src/scss/disclose/_override.scss",
"chars": 128,
"preview": ".disclose-cardprog-separator,\n.disclose-cardradial-separator,\n.disclose-cardimage-separator {\n opacity: 0.0;\n}\n\n// vim:"
},
{
"path": "src/scss/disclose/_stats.scss",
"chars": 1252,
"preview": ".disclose-stats-crit-box,\n.disclose-stats-norm-box,\n.disclose-stats-low-box {\n background-color: $shade06;\n border-rad"
},
{
"path": "src/scss/disclose/_urgency.scss",
"chars": 186,
"preview": ".disclose-cardimage-summary-box-CRITICAL {\n background-color: darken($base11, 10%);\n}\n\n.disclose-cardimage-summary-box-"
},
{
"path": "src/scss/horizon/_init.scss",
"chars": 160,
"preview": ".horizon-layout-box {\n font-family: Phosphor, Dosis;\n background-color: rgba(#000, 0.0);\n color: rgba($base05, 0.75);"
},
{
"path": "src/scss/horizon/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/lumin/_init.scss",
"chars": 2012,
"preview": ".lumin-layout-box {\n font-family: Phosphor, Dosis;\n background-color: rgba(#000, 0.0);\n color: rgba($base05, 0.75);\n}"
},
{
"path": "src/scss/lumin/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/melody/_init.scss",
"chars": 867,
"preview": ".melody-layout-box {\n font-family: Phosphor, Dosis;\n background-color: rgba(#000, 0.0);\n color: rgba($base05, 0.75);\n"
},
{
"path": "src/scss/melody/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/ocular/_init.scss",
"chars": 849,
"preview": ".ocular-layout-box {\n font-family: Phosphor, \"Poiret One\";\n background-color: rgba(#000, 0.0);\n color: $base12;\n}\n\n.o"
},
{
"path": "src/scss/ocular/_override.scss",
"chars": 553,
"preview": "// exclude eww-ocular in picom shadows exclude section\n// this is an example to override the default ocular style\n// and"
},
{
"path": "src/scss/origin/_init.scss",
"chars": 314,
"preview": ".origin-layout-box {\n font-family: Phosphor;\n background-color: rgba(#000, 0.0);\n color: rgba($base05, 0.7);\n}\n\n.orig"
},
{
"path": "src/scss/origin/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/power/_init.scss",
"chars": 1562,
"preview": ".power-layout-box {\n font-family: Phosphor;\n background-repeat: no-repeat;\n background-size: contain;\n padding: 5em;"
},
{
"path": "src/scss/power/_override.scss",
"chars": 16,
"preview": "\n// vim:ft=scss\n"
},
{
"path": "src/scss/vertigo/_info.scss",
"chars": 3504,
"preview": ".vertigo-battery-button {\n background-color: $base11;\n border-radius: 50% 0 0 0;\n font-size: 25;\n padding: 0.57em 0 "
},
{
"path": "src/scss/vertigo/_init.scss",
"chars": 248,
"preview": ".vertigo-layout-box {\n // background-color: $base00;\n background-color: $shade10;\n font-family: Phosphor, Dosis, sans"
},
{
"path": "src/scss/vertigo/_node.scss",
"chars": 502,
"preview": ".vertigo-node-button {\n padding: 0.57em 0 0.58em 0;\n font-size: 25;\n color: $base02;\n}\n\n.vertigo-node-button-tiled { "
},
{
"path": "src/scss/vertigo/_override.scss",
"chars": 2926,
"preview": "// exclude eww-vertigo in picom shadows exclude section\n// this is an example to override the default vertigo style\n// a"
},
{
"path": "src/scss/vertigo/_state.scss",
"chars": 956,
"preview": ".vertigo-search-button {\n padding: 0.57em 0 0.57em 0;\n background-color: $base09;\n font-size: 25;\n color: $base02;\n}"
},
{
"path": "src/shell/cache.py",
"chars": 8209,
"preview": "\"\"\"A DBus eavesdropper for org.freedesktop.Notifications\ninterface.\n\nThis is created mainly to cache the raw image data "
},
{
"path": "src/shell/combine.zsh",
"chars": 1775,
"preview": "#!/usr/bin/env zsh\n\nCACHE_PATH=\"$XDG_CACHE_HOME/eww/dunst/notifications.txt\"\nQUOTE_PATH=\"$XDG_CACHE_HOME/eww/dunst/quote"
},
{
"path": "src/shell/github.sh",
"chars": 751,
"preview": "#!/bin/bash\n\nCONFIG=\"$XDG_CONFIG_HOME/eww/ewwrc\"\nCACHE_DIR=$(jq --raw-output .github.cache_dir \"$CONFIG\")\neval \"CACHE_DI"
},
{
"path": "src/shell/handlers.py",
"chars": 11845,
"preview": "\"\"\"This file is tightly integrated with logger.py and won't work without it.\nUnlike the files cache.py and utils.py.\n\nTh"
},
{
"path": "src/shell/logger.py",
"chars": 10176,
"preview": "\"\"\"Script for logging desktop notifications in the form of YUCK literal.\n\nGeneral idea is to have a file log the notific"
},
{
"path": "src/shell/mpdaemon.py",
"chars": 8457,
"preview": "\"\"\"Script to cache and fetch the current track details for MPD\"\"\"\n\n# Authored By dharmx <dharmx.dev@gmail.com> under:\n# "
},
{
"path": "src/shell/playerctl.py",
"chars": 10151,
"preview": "\"\"\"Script that interacts with playerctl to manipulate all MPRIS players.\nHere it is mostly being used for getting the cu"
},
{
"path": "src/shell/pollution.py",
"chars": 1801,
"preview": "from datetime import datetime\nimport utils\nimport json\nimport os\nimport sys\nimport pathlib\n\n\ndef prepare_link(options: d"
},
{
"path": "src/shell/uptime.awk",
"chars": 540,
"preview": "#!/usr/bin/env --split-string=awk --file\n\n{\n if ($0 ~ \"hours\") sub(\"hours\", \"h\", $0)\n if ($0 ~ \"hour\") sub(\"hour\", \"h\""
},
{
"path": "src/shell/utils.py",
"chars": 16002,
"preview": "\"\"\"Utility module. Shared across almost all of the python scripts / modules.\"\"\"\n\n# Authored By dharmx <dharmx.dev@gmail."
},
{
"path": "src/shell/weather.py",
"chars": 4382,
"preview": "import json\nimport os\nimport pathlib\nimport sys\nfrom datetime import datetime\n\nimport utils\n\n\ndef prepare_link(options: "
},
{
"path": "src/shell/workspaces.zsh",
"chars": 7926,
"preview": "#!/usr/bin/env zsh\n\n# Authored By dharmx <dharmx.dev@gmail.com> under:\n# GNU GENERAL PUBLIC LICENSE\n# Version 3, 29 June"
},
{
"path": "src/yuck/_env.yuck",
"chars": 1972,
"preview": "(defpoll mpd_progress :interval \"1s\" `mpc | grep \"%)\" | awk '{print $4}' | tr -d '(%)'`)\n(defpoll mpd_current :interval "
},
{
"path": "src/yuck/_lib.yuck",
"chars": 2126,
"preview": "(defwidget _sundialinfo [class halign ?hexpand ?prefix]\n (label :class \"${class}-sundial-label\" :halign halign :hexpand"
},
{
"path": "src/yuck/avatar/_init.yuck",
"chars": 269,
"preview": "(include \"./src/yuck/avatar/lib/_init.yuck\")\n(include \"./src/yuck/avatar/_layout.yuck\")\n\n(defwindow avatar :stacking \"fg"
},
{
"path": "src/yuck/avatar/_layout.yuck",
"chars": 4043,
"preview": "(defwidget avatar_layout []\n (box :orientation \"vertical\"\n :space-evenly false\n :class \"avatar-layout-box\"\n"
},
{
"path": "src/yuck/avatar/lib/_init.yuck",
"chars": 202,
"preview": "(include \"./src/yuck/avatar/lib/_mpd.yuck\")\n(include \"./src/yuck/avatar/lib/_pctl.yuck\")\n(include \"./src/yuck/avatar/lib"
},
{
"path": "src/yuck/avatar/lib/_mpd.yuck",
"chars": 4120,
"preview": "(defwidget avatar_mpd [\n current duration progress icon separator album \n title artist like like_icon prev prev_icon n"
},
{
"path": "src/yuck/avatar/lib/_pctl.yuck",
"chars": 2298,
"preview": "(defwidget avatar_pctl [\n icon separator album player pause_icon play_icon\n title artist prev prev_icon next \n next_i"
},
{
"path": "src/yuck/avatar/lib/_quick.yuck",
"chars": 2570,
"preview": "(defwidget _avaquick [ocvol ocmic allhead alllbl allcmd auhead aucmd aulbl aulvl mihead micmd milbl milvl scup scdn mphe"
},
{
"path": "src/yuck/avatar/lib/_small.yuck",
"chars": 549,
"preview": "(defwidget avatar_tile [icon main ?style_label ?style_icon ?M ?L ?R ?class ?box_class ?class_main ?class_icon]\n (eventb"
},
{
"path": "src/yuck/bolt/_init.yuck",
"chars": 275,
"preview": "(include \"./src/yuck/bolt/_modules.yuck\")\n(include \"./src/yuck/bolt/_layout.yuck\")\n\n(defwindow bolt :stacking \"bg\"\n :wi"
},
{
"path": "src/yuck/bolt/_layout.yuck",
"chars": 1651,
"preview": "(defwidget bolt_layout []\n (box :space-evenly false\n :class \"bolt-layout-box\"\n :spacing 20\n :orientat"
},
{
"path": "src/yuck/bolt/_modules.yuck",
"chars": 4102,
"preview": "(defwidget _boltdate [day short_pretty]\n (box :hexpand true \n :halign \"start\" \n :orientation \"vertical\" \n "
},
{
"path": "src/yuck/chrono/_env.yuck",
"chars": 97,
"preview": "(defpoll air :interval \"12h\" \"./.venv/bin/python ./src/shell/pollution.py\")\n\n; vim:filetype=yuck\n"
},
{
"path": "src/yuck/chrono/_init.yuck",
"chars": 312,
"preview": "(include \"./src/yuck/chrono/_env.yuck\")\n(include \"./src/yuck/chrono/_modules.yuck\")\n(include \"./src/yuck/chrono/_layout."
},
{
"path": "src/yuck/chrono/_layout.yuck",
"chars": 3806,
"preview": "(defwidget chrono_layout []\n (scroll\n (box :space-evenly false\n :class \"chrono-layout-box\"\n :spacing"
},
{
"path": "src/yuck/chrono/_modules.yuck",
"chars": 13233,
"preview": "(defwidget _psundial [halign ?hexpand prefix]\n (box :space-evenly false :class \"chrono-sundial-box\" :spacing 5\n (lab"
},
{
"path": "src/yuck/clime/_init.yuck",
"chars": 275,
"preview": "(include \"./src/yuck/clime/_modules.yuck\")\n(include \"./src/yuck/clime/_layout.yuck\")\n\n(defwindow clime :stacking \"bg\"\n "
},
{
"path": "src/yuck/clime/_layout.yuck",
"chars": 497,
"preview": "(defwidget clime_layout []\n (_miniweather :min {weather.main.temp_min}\n :max {weather.main.temp_max}\n "
},
{
"path": "src/yuck/clime/_modules.yuck",
"chars": 1782,
"preview": "(defwidget _miniweather [min max feels category unit temp city country \n icon min_text max_text]\n (box :space-evenly f"
},
{
"path": "src/yuck/disclose/_dnd.yuck",
"chars": 1567,
"preview": "(defwidget _dnd [total total_label label footer state action waiting_icon_off waiting_icon_on waiting]\n (box :vexpand t"
},
{
"path": "src/yuck/disclose/_env.yuck",
"chars": 425,
"preview": "(defpoll disclose_stats :interval \"5s\" \"./.venv/bin/python ./src/shell/logger.py stats\")\n(deflisten disclose_sub \"./src/"
},
{
"path": "src/yuck/disclose/_init.yuck",
"chars": 578,
"preview": "(include \"./src/yuck/disclose/_env.yuck\")\n\n(include \"./src/yuck/disclose/cards/_cardimage.yuck\")\n(include \"./src/yuck/di"
},
{
"path": "src/yuck/disclose/_layout.yuck",
"chars": 1480,
"preview": "(defwidget disclose_layout []\n (box :orientation \"vertical\"\n :space-evenly false\n :class \"disclose-layout-b"
},
{
"path": "src/yuck/disclose/_stats.yuck",
"chars": 2185,
"preview": "(defwidget _dstats [\n critical\n criticon\n\n normal\n normicon\n\n low\n lowicon\n\n level\n thickness\n "
},
{
"path": "src/yuck/disclose/cards/_cardimage.yuck",
"chars": 3669,
"preview": "(defwidget _cardimage [\n summary\n body\n\n ?limit_summary\n ?limit_body\n\n appname\n timestamp\n urgency\n"
},
{
"path": "src/yuck/disclose/cards/_cardprog.yuck",
"chars": 4423,
"preview": "(defwidget _cardprog [\n summary\n body\n\n ?limit_summary\n ?limit_body\n\n appname\n timestamp\n urgency\n "
},
{
"path": "src/yuck/disclose/cards/_cardradial.yuck",
"chars": 3405,
"preview": "(defwidget _cardradial [\n summary\n body\n\n ?limit_summary\n ?limit_body\n\n appname\n timestamp\n urgency"
},
{
"path": "src/yuck/disclose/cards/_cardscr.yuck",
"chars": 2144,
"preview": "(defwidget _cardscr [\n summary\n ?limit_summary\n\n close\n ?close_action\n\n image\n image_width\n image_h"
},
{
"path": "src/yuck/horizon/_init.yuck",
"chars": 282,
"preview": "(include \"./src/yuck/lumin/_modules.yuck\")\n(include \"./src/yuck/lumin/_layout.yuck\")\n\n(defwindow horizon :stacking \"bg\"\n"
},
{
"path": "src/yuck/horizon/_layout.yuck",
"chars": 115,
"preview": "(defwidget horizon_layout []\n (box :space-evenly false :class \"lumin-layout-box\" :spacing 35 \"\"))\n\n;; vim:ft=yuck\n"
},
{
"path": "src/yuck/horizon/_modules.yuck",
"chars": 16,
"preview": "\n;; vim:ft=yuck\n"
},
{
"path": "src/yuck/lumin/_init.yuck",
"chars": 276,
"preview": "(include \"./src/yuck/lumin/_modules.yuck\")\n(include \"./src/yuck/lumin/_layout.yuck\")\n\n(defwindow lumin :stacking \"bg\"\n "
},
{
"path": "src/yuck/lumin/_layout.yuck",
"chars": 1298,
"preview": "(defwidget lumin_layout []\n (box :space-evenly false :class \"lumin-layout-box\" :spacing 35\n (_luminapps\n :one \""
},
{
"path": "src/yuck/lumin/_modules.yuck",
"chars": 2128,
"preview": "(defwidget _luminapps [one two three four five six icon_one icon_two icon_three icon_four icon_five icon_six]\n (box :sp"
},
{
"path": "src/yuck/melody/_init.yuck",
"chars": 284,
"preview": "(include \"./src/yuck/melody/_modules.yuck\")\n(include \"./src/yuck/melody/_layout.yuck\")\n\n(defwindow melody :stacking \"bg\""
},
{
"path": "src/yuck/melody/_layout.yuck",
"chars": 1017,
"preview": "(defwidget melody_layout []\n (box :class \"melody-layout-box\"\n :space-evenly false\n :spacing 20\n (box :sp"
},
{
"path": "src/yuck/melody/_modules.yuck",
"chars": 1343,
"preview": "(defwidget _melodyapps [\n one two three four five six\n one_icon two_icon three_icon four_icon five_icon six_icon\n]\n ("
},
{
"path": "src/yuck/ocular/_init.yuck",
"chars": 271,
"preview": "(include \"./src/yuck/ocular/_modules.yuck\")\n(include \"./src/yuck/ocular/_layout.yuck\")\n\n(defwindow ocular :stacking \"bg\""
},
{
"path": "src/yuck/ocular/_layout.yuck",
"chars": 1484,
"preview": "(defwidget ocular_layout []\n (box :space-evenly false\n :class \"ocular-layout-box\"\n :halign \"center\"\n "
},
{
"path": "src/yuck/ocular/_modules.yuck",
"chars": 1801,
"preview": "(defwidget _infobattery [battery status one two three four five six seven charge ?class]\n (box :class \"ocular-battery-b"
},
{
"path": "src/yuck/origin/_init.yuck",
"chars": 233,
"preview": "(include \"./src/yuck/origin/_layout.yuck\")\n\n(defwindow origin :stacking \"bg\"\n :windowtype \"normal\"\n :wm-ignore true\n "
},
{
"path": "src/yuck/origin/_layout.yuck",
"chars": 589,
"preview": "(defwidget origin_layout []\n (box :space-evenly false\n :class \"origin-layout-box\"\n :spacing 20\n (_profil"
},
{
"path": "src/yuck/power/_init.yuck",
"chars": 245,
"preview": "(include \"./src/yuck/power/_modules.yuck\")\n(include \"./src/yuck/power/_layout.yuck\")\n\n(defwindow power :stacking \"fg\"\n "
},
{
"path": "src/yuck/power/_layout.yuck",
"chars": 1881,
"preview": "(defwidget power_layout []\n (box :class \"power-layout-box\"\n :space-evenly false\n :orientation \"vertical\"\n "
},
{
"path": "src/yuck/power/_modules.yuck",
"chars": 789,
"preview": "(defwidget _powermenu [shutdown shutdown_icon reboot reboot_icon logout \n logout_icon lock lock_ic"
},
{
"path": "src/yuck/vertigo/_env.yuck",
"chars": 451,
"preview": "(deflisten vertigo_workspaces \"./src/shell/workspaces.zsh subscribe_desktop\")\n(deflisten vertigo_nodes \"./src/shell/work"
},
{
"path": "src/yuck/vertigo/_init.yuck",
"chars": 432,
"preview": "(include \"./src/yuck/vertigo/_env.yuck\")\n(include \"./src/yuck/vertigo/_label.yuck\")\n(include \"./src/yuck/vertigo/_reveal"
},
{
"path": "src/yuck/vertigo/_label.yuck",
"chars": 439,
"preview": "(defwidget _label [vexpand text ?tooltip ?valign ?button-class ?label-class ?M ?L ?R]\n (button :onmiddleclick M\n "
},
{
"path": "src/yuck/vertigo/_layout.yuck",
"chars": 2280,
"preview": "(defwidget vertigo_layout []\n (box :orientation \"vertical\"\n :space-evenly false\n :class \"vertigo-layout-box"
},
{
"path": "src/yuck/vertigo/_modules.yuck",
"chars": 716,
"preview": "(defwidget _time [time ?tooltip ?M ?L ?R ?button-class]\n (button :onmiddleclick M \n :onclick L \n :onr"
},
{
"path": "src/yuck/vertigo/_reveal.yuck",
"chars": 2097,
"preview": "(defwidget _revealex [revealon]\n (revealer :reveal revealon\n :transition \"slidedown\"\n :class \"ver"
},
{
"path": "themes/radium.scss",
"chars": 626,
"preview": "$base00: #101317;\n$base01: #171C21;\n$base02: #1c2026;\n$base03: #20252b;\n\n$base04: #949494;\n$base05: #d4d4d5;\n$base06: #f"
}
]
About this extraction
This page contains the full source code of the dharmx/vile GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 112 files (273.0 KB), approximately 77.1k tokens, and a symbol index with 65 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.