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 ================================================
[![banner](./readme/banner.png)](https://github.com/dharmx/vile) [![issues](https://img.shields.io/github/issues/dharmx/vile?color=%23f87070&style=for-the-badge)](https://github.com/dharmx/vile/issues) [![size](https://img.shields.io/github/repo-size/dharmx/vile?color=70c0ba&style=for-the-badge)](github.com/dharmx/vile) [![stars](https://img.shields.io/github/stars/dharmx/vile?color=c397d8&style=for-the-badge)](https://github.com/dharmx/vile/stargazers) [![commits](https://img.shields.io/github/commit-activity/m/dharmx/vile?color=%2379dcaa&style=for-the-badge)](https://github.com/dharmx/vile/commits)
# 👋 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 Obviously. ## 🚒 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) - MAKE IT STOP! - [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 ![demo](./readme/demo.png) ## 🤔 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. Why not have them in src.scss then? 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 😉. ![transparent](./readme/trans.png) 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 (if you dare.). ```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" ? "" : ""}) ``` ![smile](./readme/smile.png) ### 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 = "%s\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). ![firefox card](./readme/firefox.png) ### 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`. - logger.py: 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===::' ... ``` - combine.bash: 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`. - covidstate.py: 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": { : { "id": "81", "country": , "confirmed": 44174650, "active": null, "deaths": 526772, "recovered": null, ... ``` - github.sh: 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": , "node_id": , "name": "dharmx", "full_name": "dharmx/dharmx", "private": false, "owner": { "login": "dharmx", ... ``` - pollution.py: Do the same as `github.sh`. Following is a sample. ```json { "coord": { "lon": , "lat": }, "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 ... ``` - weather.py: 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": , "lat": }, "weather": [ { "id": 721, "main": "Haze", "description": "haze", "icon": "50d", ... ``` - workspaces.zsh: 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": "北" } ] ``` - mpdaemon.py: 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" } ``` - playerctl.py: 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, ... ``` - uptime.awk: 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 | |---------| | ![avatar](./screenie/avatar.png) | | **Description**: Adaptive and dynamic music player daemon and playerctl frontends. | | Note that this is still incomplete. | | Bolt | |---------| | ![bolt](./screenie/bolt.png) | | **Description**: Beautiful integrated bar mini-dashboard. | | Disclose | |---------| | ![disclose](./screenie/disclose.png) | | **Description**: Feature-Rich and Hacky notification manager. | | Vertigo | |---------| | ![vertigo](./screenie/vertigo.png) | | **Description**: BSPWM Specific bar. See the [**Hacking**](https://github.com/dharmx/vile#hacking) section to add support for your WM. | | Chrono One | Chrono Two | |---------|---------| | ![chrono one](./screenie/chrono-one.png) | ![chrono two](./screenie/chrono-two.png) | | **Description**: Calendar, Cool radial clock and a beautiful weather card. | **Description**: Extensive weather information and Air pollution information. | | Lumin | |---------| | ![lumin](./screenie/lumin.png) | | **Description**: Shows time and searches stuff on [duckduckgo](duckduckgo.com). | | Clime | |---------| | ![clime](./screenie/clime.png) | | **Description**: Minimal weather info. | | Origin | |---------| | ![origin](./screenie/origin.png) | | **Description**: Shows current logged username and hostname. | | Melody | |---------| | ![melody](./screenie/melody.png) | | **Description**: Shows current playing audio track with essential application icons. | | Ocular | |---------| | ![ocular](./screenie/ocular.png) | | **Description**: A moving seconds clock with added Ram, CPU, Temperatue and Battery monitor. | ## Samples
A sample dunstrc configuration. ```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 = "%s\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 = "%s\n%b" [microphone] appname = "microphone" summary = "*" set_stack_tag = "microphone" format = "%s\n%b" [audiojack] appname = "audiojack" summary = "*" set_stack_tag = "audiojack" format = "%s\n%b" [brightness] appname = "brightness" summary = "*" set_stack_tag = "brightness" format = "%s\n%b" [shot] appname = "shot" summary = "*" set_stack_tag = "shot" format = "%s\n%b" [shot_icon] appname = "shot_icon" summary = "*" set_stack_tag = "shot_icon" format = "%s\n%b" [bar] appname = "bar" summary = "*" set_stack_tag = "bar" format = "%s\n%b" [nightmode] appname = "nightmode" summary = "*" set_stack_tag = "nightmode" format = "%s\n%b" [sxhkd] appname = "sxhkd" summary = "*" set_stack_tag = "sxhkd" format = "%s\n%b" [layouts] appname = "layouts" summary = "*" set_stack_tag = "layouts" format = "%s\n%b" [bspwm] appname = "bspwm" summary = "*" set_stack_tag = "bspwm" format = "%s\n%b" [todo] appname = "todo" summary = "*" set_stack_tag = "todo" format = "%s\n%b" new_icon = custom-to-do background = "#161b20" foreground = "#c397d8" [picom] appname = "picom" summary = "*" set_stack_tag = "picom" format = "%s\n%b" [spotify] appname = "spotify" summary = "*" set_stack_tag = "spotify" format = "%s\n%b" [mpd] appname = "mpd" summary = "*" set_stack_tag = "mpd" format = "%s\n%b" [firefox] appname = firefox new_icon = firefox-default [network] appname = network new_icon = network summary = "*" format = "%s\n%b" # vim:filetype=dosini ```
A sample eww.yuck configuration. ```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 ```
A sample ewwrc configuration. ```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": "" } ] } ```
A sample _override.scss configuration. ```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 ``` ![transparent vertigo](./screenie/trans-vertigo.png)
# ⚠ UNDER CONSTRUCTION ⚠
================================================ 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. 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. Copyright (C) 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 . 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: Copyright (C) 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 . 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 . ================================================ 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, is a really nice manual. Give it a read. """ # Authored By dharmx under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # 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: tasks done and are remaining. The fragments and 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # # 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # 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 ["", "", ""]) def strip_pango_tags(pango: str) -> str: """Removes HTML tags like , , 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 "": 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 "": 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 "": 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 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 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: 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 under: # GNU GENERAL PUBLIC LICENSE # Version 3, 29 June 2007 # # Copyright (C) 2007 Free Software Foundation, Inc. # 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: # # 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_label "$LAYOUT_FLOATING" "float" "float") elif [ $(query .focused.fullscreen) ]; then echo $(_make_label "$LAYOUT_FULLSCREEN" "full" "full") elif [ $(query .focused.pseudo_tiled) ]; then echo $(_make_label "$LAYOUT_PSEUDO_TILED" "pseudo" "pseudo") else # this behaviour has been adapted from polybar i.e. if a desktop is 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_EMPTY" "other" "other") fi unalias query } function subscribe_node() { # echo the focused node state if the WM state changes i.e. focus desktop / remove node / add node # (meaning focus to another desktop / close a window / open a window) # i.e. it continuously feeds the current state of the focused node / window into # a listener variable in a yuck file. _wrap_node_yuck && bspc subscribe \ desktop_layout \ node_state \ node_remove \ node_add \ desktop_focus | while read -r _ do; _wrap_node_yuck done } function subscribe_desktop() { # similar to subscribe_node this feeds the current desktop states # if any desktop number has been increased / decreased # if any node / window has been moved to a different desktop _wrap_desktop_yuck && bspc subscribe \ desktop_add \ desktop_remove \ desktop_focus \ node_transfer | while read -r _ do; _wrap_desktop_yuck done } function create() { # gets current total number of desktops and then add one to it # i.e. dynamically increase the workspace amount. local workspaces=(${$(bspc query --names --desktops --desktop .local)//$'\n'/ }) workspaces+=$((${#workspaces} + 1)) bspc monitor -d $workspaces[*] } function remove() { # opposite of the create function as defined above local workspaces=(${$(bspc query --names --desktops --desktop .local)//$'\n'/ }) unset 'workspaces[-1]' bspc monitor -d $workspaces[*] } case $1 in subscribe_desktop) subscribe_desktop ;; subscribe_node) subscribe_node ;; create) create ;; remove) remove ;; *) echo "Invalid option!" ;; esac popd unset index ${names[*]} names # redundant but clean ^_^ # vim:ft=zsh ================================================ FILE: src/yuck/_env.yuck ================================================ (defpoll mpd_progress :interval "1s" `mpc | grep "%)" | awk '{print $4}' | tr -d '(%)'`) (defpoll mpd_current :interval "1s" `mpc | grep "#" | awk '{print $3}' | sed 's|/.*||g'`) (defpoll mpd_duration :interval "10s" `mpc --format=%time% current`) (deflisten mpd_sub "./.venv/bin/python ./src/shell/mpdaemon.py") (defpoll mpd_level :interval "0.3s" `mpc volume 2>/dev/stdout | awk -F: '{gsub("%| ", "", $2); print $2}'`) (deflisten pctl_sub "./.venv/bin/python ./src/shell/playerctl.py") (defpoll hostname :interval "1000s" "hostnamectl hostname") (defpoll username :interval "1000s" "echo $USER") (defpoll weather :interval "500s" "./.venv/bin/python ./src/shell/weather.py fetch") (defpoll weather_gist :interval "20h" :run-while false "./.venv/bin/python ./src/shell/weather.py gist description") (defpoll net :interval "100s" `nmcli -terse -fields SIGNAL,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`) (defpoll ssid :interval "100s" `nmcli -terse -fields SSID,ACTIVE device wifi | awk --field-separator ':' '{if($2=="yes")print$1}'`) (defvar vertigo_volume_toggle "pamixer --toggle-mute") (defvar profile "./assets/profile.png") (defpoll dunst :interval "1s" "[ $(dunstctl is-paused) = false ] && echo  || echo ") (defpoll redshift :interval "1s" "pidof redshift &>/dev/null && echo  || echo ") (defpoll volume_status :interval "1s" "[ $(pamixer --get-volume-human) = muted ] && echo 了 || echo 醴") (defpoll volume_level :interval "1s" "pamixer --get-volume") (defpoll mic_level :interval "1s" `pamixer --source 1 --get-volume`) (defpoll mic_status :interval "1s" `[ $(pamixer --source 1 --get-volume-human) = muted ] && echo  || echo `) (defpoll time :interval "1s" `date +'{"hour":"%H","min":"%M","sec":"%S","pretty":"%a, %e %b","day":"%A","month":"%B","dom":"%e","year":"%Y","day_num":"%d","month_num":"%m","year_num":"%y"}'`) (defpoll uptime :interval "48h" "uptime --pretty | ./src/shell/uptime.awk") ; vim:filetype=yuck ================================================ FILE: src/yuck/_lib.yuck ================================================ (defwidget _sundialinfo [class halign ?hexpand ?prefix] (label :class "${class}-sundial-label" :halign halign :hexpand hexpand :text "${prefix}${time.hour >= 2 && time.hour <= 4 ? "Early Morning" : time.hour <= 5 ? "Dawn" : time.hour >= 6 && (time.hour <= 8 && time.min <= 59) ? "Morning" : time.hour >= 9 && (time.hour <= 11 && time.min <= 59) ? "Late Morning" : time.hour == 12 && time.min <= 29 ? "Midday" : time.hour >= 12 && time.hour <= 16 ? "Afternoon" : time.hour > 16 && time.hour <= 17 ? "Late Afternoon" : (time.hour >= 17 && time.min <= 1) || (time.hour <= 18 && time.min <= 20) ? "Early Evening" : time.hour >= 18 && time.hour <= 19 ? "Dusk" : time.hour > 19 && time.hour <= 21 ? "Late Evening" : time.hour > 21 ? "Night" : "Midnight"}")) (defwidget _profile [path size ?tooltip ?button-class ?image-class ?M ?L ?R] (button :onmiddleclick M :onclick L :onrightclick R :timeout "2s" :tooltip tooltip :class "vertigo-button ${button-class}" (image :path path :image-width size :class "vertigo-image ${image-class}"))) (defwidget _infobatnolbl [battery status one two three four five six seven charge ?class] (box :class "lumin-battery-box ${class}" :space-evenly false :spacing 8 (label :class "lumin-battery-icon ${class}" :text {status == 'Charging' ? charge : battery < 15 ? seven : battery < 30 ? six : battery < 45 ? five : battery < 60 ? four : battery < 75 ? three : battery < 95 ? two : one}))) (defwidget _infonetnolbl [strength offline excellent good okay slow ?class] (box :class "lumin-network-box ${class}" :space-evenly false :spacing 8 (label :class "lumin-network-icon ${class}" :text {strength == "" ? offline : strength < 26 ? slow : strength < 51 ? okay : strength < 76 ? good : excellent}))) ; vim:filetype=yuck ================================================ FILE: src/yuck/avatar/_init.yuck ================================================ (include "./src/yuck/avatar/lib/_init.yuck") (include "./src/yuck/avatar/_layout.yuck") (defwindow avatar :stacking "fg" :windowtype "normal" :wm-ignore true :geometry (geometry :width "26%" :height "100%" :anchor "right center") (avatar_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/avatar/_layout.yuck ================================================ (defwidget avatar_layout [] (box :orientation "vertical" :space-evenly false :class "avatar-layout-box" (box :space-evenly false :class "avatar-headers" (label :text "AVATAR" :class "avatar-headers-label" :halign "start" :hexpand true) (button :onclick "eww close avatar" :class "avatar-headers-close" "署")) (scroll :class "avatar-scroll" :height 1000 :hscroll false :vscroll true (box :space-evenly false :class "avatar-box-inner" :orientation "vertical" :vexpand true :hexpand true :spacing 20 (_avaquick :ocvol "pamixer --set-volume $(printf %d {})" :ocmic "pamixer --source 1 --set-volume $(printf %d {})" :allhead "All" :alllbl "" :allcmd "pamixer --toggle-mute; pamixer --source 1 --toggle-mute; mpc volume 0" :auhead "Sink" :aucmd "pamixer --toggle-mute" :aulbl volume_status :mihead "Source" :micmd "pamixer --source 1 --toggle-mute" :milbl mic_status :scup `mpc volume $((${mpd_sub.x.volume}+5))` :scdn `mpc volume $((${mpd_sub.x.volume}-5))` :mphead "Mpd" :mpcmd {mpd_sub.x.volume == "0" ? "mpc volume 30" : "mpc volume 0"} :mplbl {mpd_sub.status == "play" ? "" : ""} :mplvl mpd_level :aulvl volume_level :milvl mic_level) (avatar_pctl :icon "" :separator "ﭲ" :album "${pctl_sub['xesam:album']}" :title "${pctl_sub['xesam:title']}" :artist "${pctl_sub['xesam:artist']}" :prev "playerctl previous" :prev_icon "" :next "playerctl next" :next_icon "" :player "${pctl_sub.player}" :minimal "playerctld shift" :minimal_icon "" :pause_icon "" :play_icon "") (avatar_mpd :current mpd_current :duration mpd_duration :progress mpd_progress :command "mpc seek {}%" :icon "" :separator "ﭲ" :album "${mpd_sub.album}" :title "${mpd_sub.title}" :artist "${mpd_sub.artist}" :like "dunstify MPD Liked" :like_icon "" :prev "mpc prev" :prev_icon "" :next "mpc next" :next_icon "" :minimal "dunstify MPD minimal" :minimal_icon "" :pause_icon "" :play_icon "") (_mpdx :repeatc {mpd_sub.x.repeat == "1" ? "ava-mpdx-repeat-on" : "ava-mpdx-repeat-off"} :randomc {mpd_sub.x.random == "1" ? "ava-mpdx-random-on" : "ava-mpdx-random-off"} :singlec {mpd_sub.x.single == "1" ? "ava-mpdx-single-on" : "ava-mpdx-single-off"} :consumec {mpd_sub.x.consume == "1" ? "ava-mpdx-consume-on" : "ava-mpdx-consume-off"} :xfadec {mpd_sub.x.xfade == "0" ? "ava-mpdx-xfade-off" : "ava-mpdx-xfade-on"} :repeatlbl "" :randomlbl "" :singlelbl "" :consumelbl "" :xfadelbl "" :shufflelbl "" :shufflecmd "mpc shuffle" :randomcmd "mpc random" :repeatcmd "mpc repeat" :singlecmd "mpc single" :consumecmd "mpc consume" :xfadecmd {mpd_sub.x.xfade == "0" ? "mpc crossfade 2" : "mpc crossfade 0"}))))) ; vim:filetype=yuck ================================================ FILE: src/yuck/avatar/lib/_init.yuck ================================================ (include "./src/yuck/avatar/lib/_mpd.yuck") (include "./src/yuck/avatar/lib/_pctl.yuck") (include "./src/yuck/avatar/lib/_small.yuck") (include "./src/yuck/avatar/lib/_quick.yuck") ; vim:filetype=yuck ================================================ FILE: src/yuck/avatar/lib/_mpd.yuck ================================================ (defwidget avatar_mpd [ current duration progress icon separator album title artist like like_icon prev prev_icon next next_icon minimal minimal_icon play_icon pause_icon command] (box :orientation "vertical" :class "avatar-mpd-box" :space-evenly false :spacing 20 :style " background-image: radial-gradient( circle farthest-side at left, ${mpd_sub.bright} 48%, rgba(30, 33, 40, 0.7) 80%), url(\"${mpd_sub.file}\" ); color: ${mpd_sub.dark} " (box :class "avatar-mpd-header-box" :space-evenly false (box :hexpand true :space-evenly false (label :class "avatar-mpd-icon" :text icon) (label :class "avatar-mpd-name" :text "MPD") (label :class "avatar-mpd-separator" :text separator) (label :class "avatar-mpd-album ${album == "" ? "avatar-mpd-album-null" : ""}" :style "color: ${mpd_sub.dark}" :text album :limit-width 30)) (button :onclick minimal :class "avatar-mpd-minimal-box" :halign "end" (label :class "avatar-mpd-minimal" :text minimal_icon))) (box :orientation "vertical" :class "avatar-title-artist-box" :space-evenly false :halign "start" (label :class "avatar-mpd-title" :halign "start" :text title :wrap true :xalign 0.0 :limit-width 30) (label :class "avatar-mpd-artist" :text artist :halign "start" :limit-width 30)) (box :class "avatar-mpd-controls" :space-evenly false :spacing 20 (button :onclick like :class "avatar-mpd-button-like" (label :class "avatar-mpd-label-like" :text like_icon)) (button :onclick prev :class "avatar-mpd-button-prev" (label :class "avatar-mpd-label-prev" :text prev_icon)) (button :onclick "mpc toggle" :class "avatar-mpd-button-playback" (label :class "avatar-mpd-label-playback" :text "${mpd_sub.status == "play" ? play_icon : pause_icon}")) (button :onclick next :class "avatar-mpd-button-next" (label :class "avatar-mpd-label-next" :text next_icon))) (scale :class "avatar-mpd-progress" :value progress :onchange command :min 0 :max 100 :active true) (box :class "avatar-mpd-footer" :space-evenly false (label :class "avatar-mpd-label-current" :text current :hexpand true :halign "start") (label :class "avatar-mpd-label-duration" :text duration :halign "end")))) (defwidget _mpdx [shufflelbl repeatlbl randomlbl singlelbl consumelbl xfadelbl shufflecmd randomcmd repeatcmd singlecmd consumecmd xfadecmd randomc repeatc singlec consumec xfadec] (box :width 450 :space-evenly false :class "ava-mpdx-box" :halign "center" :hexpand true :spacing 30 :orientation "vertical" (box :space-evenly false :class "ava-mpdx-shuffle-repeat-random" :halign "center" :vexpand true :spacing 30 (button :onclick shufflecmd :class "ava-mpdx-btn ava-mpdx-btn-shuffle" shufflelbl) (button :onclick repeatcmd :class "ava-mpdx-btn ava-mpdx-btn-repeat ${repeatc}" repeatlbl) (button :onclick randomcmd :class "ava-mpdx-btn ava-mpdx-btn-random ${randomc}" randomlbl)) (box :space-evenly false :class "ava-mpdx-single-consume-xfade" :halign "center" :vexpand true :spacing 30 (button :onclick singlecmd :class "ava-mpdx-btn ava-mpdx-btn-single ${singlec}" singlelbl) (button :onclick consumecmd :class "ava-mpdx-btn ava-mpdx-btn-consume ${consumec}" consumelbl) (button :onclick xfadecmd :class "ava-mpdx-btn ava-mpdx-btn-xfade ${xfadec}" xfadelbl)))) ; vim:filetype=yuck ================================================ FILE: src/yuck/avatar/lib/_pctl.yuck ================================================ (defwidget avatar_pctl [ icon separator album player pause_icon play_icon title artist prev prev_icon next next_icon minimal minimal_icon] (box :orientation "vertical" :class "avatar-pctl-box" :space-evenly false :spacing 20 :style " background-image: radial-gradient( circle farthest-side at left, ${pctl_sub.bright} 55%, rgba(30, 33, 40, 0.7) 80%), url(\"${pctl_sub['mpris:artUrl']}\"); color: ${pctl_sub.dark} " (box :class "avatar-pctl-header-box" :space-evenly false (box :hexpand true :space-evenly false (label :class "avatar-pctl-icon" :text icon) (label :class "avatar-pctl-name" :text player) (label :class "avatar-pctl-separator" :text separator) (label :class "avatar-pctl-album ${album == "" ? "avatar-pctl-album-null" : ""}" :text album :limit-width 30)) (button :onclick minimal :class "avatar-pctl-minimal-box" :halign "end" (label :class "avatar-pctl-minimal" :text minimal_icon))) (box :orientation "vertical" :class "avatar-title-artist-box" :space-evenly false :halign "start" (label :class "avatar-pctl-title" :halign "start" :text title :wrap true :xalign 0.0 :limit-width 30) (label :class "avatar-pctl-artist" :text artist :halign "start" :limit-width 30)) (box :class "avatar-pctl-controls" :space-evenly false :spacing 20 (button :onclick prev :class "avatar-pctl-button-prev" (label :class "avatar-pctl-label-prev" :text prev_icon)) (button :onclick "playerctl play-pause &" :class "avatar-pctl-button-playback" (label :class "avatar-pctl-label-playback" :text {pctl_sub.status == "Playing" ? play_icon : pause_icon})) (button :onclick next :class "avatar-pctl-button-next" (label :class "avatar-pctl-label-next" :text next_icon))))) ; vim:filetype=yuck ================================================ FILE: src/yuck/avatar/lib/_quick.yuck ================================================ (defwidget _avaquick [ocvol ocmic allhead alllbl allcmd auhead aucmd aulbl aulvl mihead micmd milbl milvl scup scdn mphead mpcmd mplbl mplvl] (box :class "ava-quick-box" :space-evenly false :spacing 25 :halign "center" :orientation "vertical" (box :class "ava-quick-scale-box" :orientation "vertical" :space-evenly false :spacing 25 :space-evenly false (box :class "ava-quick-au-scale-box" :space-evenly false :spacing 20 (scale :flipped true :hexpand true :width 200 :class "ava-quick-vol" :min 0.0 :max 100.0 :value aulvl :onchange ocvol) (label :text aulvl :class "ava-au-scale-lbl")) (box :class "ava-quick-mi-scale-box" :space-evenly false :spacing 20 (label :text milvl :class "ava-mi-scale-lbl") (scale :hexpand true :width 200 :class "ava-quick-mic" :min 0.0 :max 100.0 :value milvl :onchange ocmic))) (label :text "" :class "ava-sep") (box :space-evenly false :orientation "vertical" :spacing 10 (box :class "ava-quick-btn-box" :space-evenly false :spacing 10 (box :orientation "vertical" :class "ava-au-btn-box" :space-evenly false :width 200 :height 200 (label :halign "start" :class "ava-au-head" :text auhead) (button :vexpand true :hexpand true :halign "center" :valign "center" :onclick aucmd :class "ava-btn-au" aulbl)) (box :orientation "vertical" :class "ava-mi-btn-box" :space-evenly false :width 200 :height 200 (label :halign "start" :class "ava-mi-head" :text mihead) (button :vexpand true :hexpand true :halign "center" :valign "center" :onclick micmd :class "ava-btn-mi" milbl))) (box :class "ava-quick-btn-box" :space-evenly false :spacing 10 (box :orientation "vertical" :class "ava-mp-btn-box" :space-evenly false :width 200 :height 200 (label :halign "start" :class "ava-mp-head" :text mphead) (eventbox :vexpand true :hexpand true :halign "center" :valign "center" :class "ava-mpd-ebox" :onclick mpcmd :onscroll "[ {} = up ] && ${scup}; [ {} = down ] && ${scdn}" (circular-progress :value mplvl :thickness 10 :class "ava-mpd-radial" (label :text mplbl :class "ava-mpd-label")))) (box :orientation "vertical" :class "ava-all-btn-box" :space-evenly false :width 200 :height 200 (label :halign "start" :class "ava-all-head" :text allhead) (button :vexpand true :hexpand true :halign "center" :valign "center" :onclick allcmd :class "ava-btn-all" alllbl)))))) ; vim:ft=yuck ================================================ FILE: src/yuck/avatar/lib/_small.yuck ================================================ (defwidget avatar_tile [icon main ?style_label ?style_icon ?M ?L ?R ?class ?box_class ?class_main ?class_icon] (eventbox :class "avatar-eventbox ${class}" :onclick L :onmiddleclick M :onrightclick R (box :class "avatar-card-box ${box_class}" :space-evenly false; (label :style style_label :text icon :class "avatar-icon ${class_icon}") (label :style style_icon :text main :class "avatar-main ${class_main}")))) ; vim:filetype=yuck ================================================ FILE: src/yuck/bolt/_init.yuck ================================================ (include "./src/yuck/bolt/_modules.yuck") (include "./src/yuck/bolt/_layout.yuck") (defwindow bolt :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x 90 :y -15 :width "23%" :height "30%" :anchor "left bottom") (bolt_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/bolt/_layout.yuck ================================================ (defwidget bolt_layout [] (box :space-evenly false :class "bolt-layout-box" :spacing 20 :orientation "vertical" (box :hexpand true :space-evenly false :class "bolt-date-bat-pctl" :spacing 25 (box :orientation "vertical" :space-evenly false :class "bolt-date-bat" :spacing 10 (_boltdate :day {time.day} :short_pretty "${time.day_num} ${time.month}, ${time.year}") (_fluidbat :class {EWW_BATTERY.BAT0.capacity > 95 ? "bolt-bat-full" : EWW_BATTERY.BAT0.capacity > 50 ? "bolt-bat-norm" : EWW_BATTERY.BAT0.capacity > 20 ? "bolt-bat-warn" : "bolt-bat-crit"} :label "Battery" :icon_full "" :icon_norm "" :icon_crit "")) (_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 "" :status_cmd "playerctl play-pause" :status_icon {pctl_sub["status"] == "Playing" ? "" : ""})) (box :hexpand true :space-evenly false :class "bolt-uptime-wifi" :spacing 20 (_boltuptime :label "Uptime" :uptime uptime) (_boltwifi :label "WiFi" :icon {net == "" ? "" : net < 26 ? "" : net < 51 ? "" : net < 76 ? "" : ""} :ssid ssid)))) ;; vim:ft=yuck ================================================ FILE: src/yuck/bolt/_modules.yuck ================================================ (defwidget _boltdate [day short_pretty] (box :hexpand true :halign "start" :orientation "vertical" :space-evenly false :class "bolt-date-box" :width 200 (label :halign "start" :text short_pretty :class "bolt-date-pretty") (label :halign "start" :text day :class "bolt-date-day"))) (defwidget _fluidbat [label icon_full icon_crit icon_norm class] (overlay :class "bolt-bat-overlay" (progress :width 180 :class "bolt-bat-prog ${class}" :value {EWW_BATTERY.BAT0.capacity > 95 ? 100 : EWW_BATTERY.BAT0.capacity}) (box :valign "center" :spacing 5 :space-evenly false :class "bolt-bat-prog-box" (box :halign "start" :hexpand true :orientation "vertical" :space-evenly false :class "bolt-bat-label-box" (label :halign "start" :text label :class "bolt-bat-label") (label :halign "start" :text "${EWW_BATTERY.BAT0.capacity > 95 ? 100 : EWW_BATTERY.BAT0.capacity}%" :class "bolt-bat-status-label")) (label :halign "end" :text {EWW_BATTERY.BAT0.capacity > 95 ? icon_full : EWW_BATTERY.BAT0.capacity < 21 ? icon_crit : icon_norm} :class "bolt-bat-icon")))) (defwidget _boltpctl [cover label title artist volume volume_icon status_cmd status_icon] (box :hexpand true :halign "start" :orientation "vertical" :space-evenly false :class "bolt-pctl-box" :style "background-image: radial-gradient(circle farthest-side at bottom, rgba(23, 28, 33, 0.7) 100%), url(\"${pctl_sub['mpris:artUrl']}\")" :width 200 :height 200 (box :space-evenly false :orientation "vertical" :class "bolt-pctl-label-title-artist" (label :halign "start" :text label :class "bolt-pctl-label") (label :halign "start" :limit-width 20 :wrap true :xalign 0.0 :text title :class "bolt-pctl-title") (label :halign "start" :limit-width 20 :text artist :class "bolt-pctl-artist")) (box :vexpand true :valign "end" :hexpand true :space-evenly false :class "bolt-pctl-status-volume-box" (box :space-evenly false :spacing 5 :class "bolt-pctl-volume" (label :text volume_icon :class "bolt-pctl-volume-icon") (label :text volume :class "bolt-pctl-volume-label")) (button :hexpand true :halign "end" :onclick status_cmd :class "bolt-pctl-status" status_icon)))) (defwidget _boltuptime [label uptime] (box :space-evenly false :class "bolt-uptime-box" :spacing 8 :halign "start" (label :text "" :class "bolt-uptime-hl") (box :valign "center" :orientation "vertical" :class "bolt-uptime-label-value" :space-evenly false (label :halign "start" :class "bolt-uptime-label" :text label) (label :limit-width 15 :halign "start" :class "bolt-uptime-value" :text uptime)))) (defwidget _boltwifi [label icon ssid] (box :valign "center" :height 100 :valign "center" :hexpand true :space-evenly false :class "bolt-wifi-box" (box :valign "center" :hexpand true :orientation "vertical" :space-evenly false :class "bolt-wifi-label-ssid" (label :halign "start" :class "bolt-wifi-label" :text label) (label :halign "start" :class "bolt-wifi-ssid" :text ssid)) (label :vexpand false :valign "center" :halign "end" :class "bolt-wifi-icon" :text icon))) ; vim:ft=yuck ================================================ FILE: src/yuck/chrono/_env.yuck ================================================ (defpoll air :interval "12h" "./.venv/bin/python ./src/shell/pollution.py") ; vim:filetype=yuck ================================================ FILE: src/yuck/chrono/_init.yuck ================================================ (include "./src/yuck/chrono/_env.yuck") (include "./src/yuck/chrono/_modules.yuck") (include "./src/yuck/chrono/_layout.yuck") (defwindow chrono :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :width "26%" :height "100%" :anchor "right center") (chrono_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/chrono/_layout.yuck ================================================ (defwidget chrono_layout [] (scroll (box :space-evenly false :class "chrono-layout-box" :spacing 20 :orientation "vertical" (box :space-evenly false :class "chrono-headers" (label :text "CHRONO" :class "chrono-headers-label" :halign "start" :hexpand true) (button :onclick "eww close chrono" :class "chrono-headers-close" "署")) (_ptime :hour {time.hour} :minute {time.min} :secs {time.sec} :uptime uptime) (_pcalen :day {time.day_icon} :month {time.month_icon} :year {time.year}) (_weather :glyph {weather.weather[0].glyph} :main {weather.weather[0].main} :image {weather.weather[0].image} :temp {round(weather.main.temp, 0)} :feels {round(weather.main.feels_like, 0)} :bright_col {weather.weather[0].image_colors[8]} :sundial "" :overlay {weather.weather[0].image_colors[2]} :textcol {weather.weather[0].image_colors[2]} :unit "°" :pressure {weather.main.pressure} :pressure_icon "" :pressure_unit "hPa" ; hecto-Pascal (Pressure Unit) :location "${weather.name}, ${weather.sys.country}" :location_icon "" :max {round(weather.main.temp_max, 0)} :max_icon "" :min {round(weather.main.temp_min, 0)} :min_icon "") (_weatherextras :header "Weather Info." :description "${weather_gist}." :humidity {weather.main.humidity} :humidity_icon "" :humidity_label "Humidity" :humidity_unit "%" :visibility {weather.visibility} :visibility_icon "" :visibility_label "Visibility" :visibility_unit "meters" :wind "${weather.wind.speed}m / ${weather.wind.deg}s" :wind_icon "" :wind_label "Wind Speed" :wind_unit "" :cloud {weather.clouds.all} :cloud_icon "" :cloud_label "Clouds" :cloud_unit "%") (_airpollution :aqi {air.list[0].main.aqi} :aqi_label "Air Quality Index" :aqi_icon { air.list[0].main.aqi == 1 ? air.icons.good : air.list[0].main.aqi == 2 ? air.icons.fair : air.list[0].main.aqi == 3 ? air.icons.moderate : air.list[0].main.aqi == 4 ? air.icons.poor : air.icons.very_poor} :comp_label "Components" :co {air.list[0].components.co} :co_label "Carbon Monoxide" :no_label "Nitrogen Monoxide" :no {air.list[0].components.no} :no2_label "Nitrogen Dioxide" :no2 {air.list[0].components.no2} :o3_label "Ozone" :o3 {air.list[0].components.o3} :so2_label "Sulphur Dioxide" :so2 {air.list[0].components.so2} :pm2_5_label "Fine particles matter (2.5)" :pm2_5 {air.list[0].components.pm2_5} :pm10_label "Coarse particulate matter (10)" :pm10 {air.list[0].components.pm10} :nh3_label "Ammonia" :nh3 {air.list[0].components.nh3} :unit "μg/m³")))) ;; vim:ft=yuck ================================================ FILE: src/yuck/chrono/_modules.yuck ================================================ (defwidget _psundial [halign ?hexpand prefix] (box :space-evenly false :class "chrono-sundial-box" :spacing 5 (label :text prefix :class "chrono-sundial-prefix") (label :class "chrono-sundial-label" :halign halign :hexpand hexpand :text {time.hour >= 2 && time.hour <= 4 ? "Early Morning" : time.hour <= 5 ? "Dawn" : time.hour >= 6 && (time.hour <= 8 && time.min <= 59) ? "Morning" : time.hour >= 9 && (time.hour <= 11 && time.min <= 59) ? "Late Morning" : time.hour == 12 && time.min <= 29 ? "Midday" : time.hour >= 12 && time.hour <= 16 ? "Afternoon" : time.hour > 16 && time.hour <= 17 ? "Late Afternoon" : (time.hour >= 17 && time.min <= 1) || (time.hour <= 18 && time.min <= 20) ? "Early Evening" : time.hour >= 18 && time.hour <= 19 ? "Dusk" : time.hour > 19 && time.hour <= 21 ? "Late Evening" : time.hour > 21 ? "Night" : "Midnight"}))) (defwidget _weather [glyph main temp feels sundial unit image max min max_icon min_icon overlay textcol bright_col pressure pressure_icon pressure_unit location location_icon] (box :space-evenly false :class "chrono-weather-box" :style " background-image: radial-gradient(circle farthest-side at bottom, ${overlay} 100%), url('${image}'); color: ${textcol}; " :halign "center" :valign "start" :height 350 :width 455 (box :space-evenly false :orientation "vertical" :class "chrono-weather-main-sundial-glyph" :halign "start" :hexpand true :valign "center" :vexpand true :spacing 80 (label :text glyph :class "chrono-weather-glyph") (box :halign "start" :orientation "vertical" :class "chrono-weather-main-sundial" :spacing -10 (label :class "chrono-weather-main" :valign "end" :halign "start" :text main) (_psundial :halign "start" :prefix sundial))) (box :space-evenly false :orientation "vertical" :class "chrono-weather-info-box" :valign "center" :spacing 80 :hexpand true :halign "end" (box :orientation "vertical" :class "chrono-weather-temp-feels" :spacing -15 :space-evenly false (label :text "${temp}${unit}" :halign "end" :class "chrono-weather-temp") (label :halign "end" :text "Feels like ${feels}${unit}" :class "chrono-weather-feels")) (box :space-evenly false :spacing 20 :halign "end" :class "chrono-weather-info-box" (box :orientation "vertical" :class "chrono-weather-cloud-pressure-location" :halign "end" :spacing 10 (box :space-evenly false :class "chrono-weather-location" :spacing 5 (label :text location_icon :class "chrono-weather-location-icon") (label :text location :class "chrono-weather-location-label")) (box :space-evenly false :class "chrono-weather-pressure" :spacing 5 (label :text pressure_icon :class "chrono-weather-pressure-icon") (label :text "${pressure} ${pressure_unit}" :class "chrono-weather-pressure-label"))) (box :orientation "vertical" :class "chrono-weather-max-min-humid" :halign "end" :spacing 10 (box :space-evenly false :class "chrono-weather-max" :spacing 5 (label :text max_icon :class "chrono-weather-max-icon") (label :text "${max}${unit}" :class "chrono-weather-max-label")) (box :space-evenly false :class "chrono-weather-min" :spacing 5 (label :text min_icon :class "chrono-weather-min-icon") (label :text "${min}${unit}" :class "chrono-weather-min-label"))))))) (defwidget _weatherextras [header description visibility visibility_icon visibility_label visibility_unit humidity humidity_icon humidity_label humidity_unit wind wind_icon wind_label wind_unit cloud cloud_icon cloud_label cloud_unit] (box :space-evenly false :class "chrono-weather-extra" :width 455 :halign "center" :orientation "vertical" :spacing 15 (box :space-evenly false :orientation "vertical" (label :text header :class "chrono-weather-extra-header") (label :text "Description: ${description}" :class "chrono-weather-extra-description")) (box :class "chrono-weather-visible-humid" :valign "center" :vexpand true :spacing 20 (box :space-evenly false :class "chrono-weather-humid" :spacing 5 :orientation "vertical" (box :space-evenly false :class "chrono-weather-humid-label-icon" :spacing 5 :halign "center" (label :text humidity_icon :class "chrono-weather-humid-icon") (label :text humidity_label :class "chrono-weather-humid-text")) (label :text "${humidity}${humidity_unit}" :class "chrono-weather-humid-label")) (box :space-evenly false :class "chrono-weather-visible" :spacing 5 :orientation "vertical" (box :space-evenly false :class "chrono-weather-visible-label-icon" :spacing 5 :halign "center" (label :text visibility_icon :class "chrono-weather-visible-icon") (label :text visibility_label :class "chrono-weather-visible-text")) (label :text "${visibility} ${visibility_unit}" :class "chrono-weather-visible-label"))) (box :class "chrono-weather-wind-cloud" :valign "center" :vexpand true :spacing 20 (box :space-evenly false :class "chrono-weather-cloud" :spacing 5 :orientation "vertical" (box :space-evenly false :class "chrono-weather-cloud-label-icon" :spacing 5 :halign "center" (label :text cloud_icon :class "chrono-weather-cloud-icon") (label :text cloud_label :class "chrono-weather-cloud-text")) (label :text "${cloud}${cloud_unit}" :class "chrono-weather-cloud-label")) (box :space-evenly false :class "chrono-weather-wind" :spacing 5 :orientation "vertical" (box :space-evenly false :class "chrono-weather-wind-label-icon" :spacing 5 :halign "center" (label :text wind_icon :class "chrono-weather-wind-icon") (label :text wind_label :class "chrono-weather-wind-text")) (label :text "${wind} ${wind_unit}" :class "chrono-weather-wind-label"))))) (defwidget _pcalen [day month year] (box :space-evenly false :orientation "vertical" :class "chrono-calen-box" :width 455 :halign "center" (label :class "chrono-calen-label" :text {time.pretty}) (calendar :class "chrono-calen" :halign "center" :active false :day day :month month :year year :show-details false :show-heading false :show-day-names true))) (defwidget _ptime [hour minute uptime secs] (box :space-evenly false :class "chrono-time-box" :width 455 :height 150 :halign "center" :spacing 25 (box :class "chrono-time-radial-box" :space-evenly false :hexpand true :halign "center" :spacing 20 (overlay (circular-progress :value {minute * 100 / 60} :valign "center" :vexpand true :thickness 15 :start-at 40 :class "chrono-prog chrono-prog-minute" minute) (circular-progress :value {secs * 100 / 60} :valign "center" :vexpand true :start-at 90 :thickness 15 :class "chrono-prog chrono-prog-second" secs))) (label :text "" :class "chrono-sep" :halign "center") (box :space-evenly false :orientation "vertical" :class "chrono-time-label-box" :hexpand true :halign "center" (label :halign "end" :text "${hour}:${minute}" :class "chrono-time-label") (label :halign "center" :text uptime :class "chrono-uptime-label")))) (defwidget _airpollution [aqi aqi_label aqi_icon comp_label co co_label no_label no no2_label no2 o3_label o3 so2_label so2 pm2_5_label pm2_5 pm10_label pm10 nh3_label nh3 unit] (box :orientation "vertical" :halign "center" :class "chrono-air-box" :space-evenly false :spacing 20 :width 455 :height 250 (box :space-evenly false :halign "center" :class "chrono-aqi-box" :spacing 20 (circular-progress :class "chrono-aqi-radial chrono-air-radial-${aqi}" :thickness 20 :value { aqi == 1 ? 100 : aqi == 2 ? 80 : aqi == 3 ? 60 : aqi == 4 ? 40 : 20} aqi_icon) (box :orientation "vertical" :class "chrono-aqi-inner chrono-aqi-inner-${aqi}" :valign "center" :spacing 5 :space-evenly false (label :class "chrono-air-aqi-label" :text aqi_label) (label :class "chrono-air-aqi-quality" :text { aqi == 1 ? "Good" : aqi == 2 ? "Fair" : aqi == 3 ? "Moderate" : aqi == 4 ? "Poor" : "Very Poor"}))) (label :text "" :class "chrono-air-separator") (label :text comp_label :halign "center" :class "chrono-info-label") (box :class "chrono-air-info" :space-evenly false :halign "center" :spacing 40 (box :orientation "vertical" :class "chrono-air-col-one" :space-evenly false :spacing 10 (box :orientation "vertical" :class "chrono-air-co-box" (label :text co_label :class "chrono-air-co-label") (label :text "${co} ${unit}" :class "chrono-air-co-value")) (box :orientation "vertical" :class "chrono-air-no-box" (label :text no_label :class "chrono-air-no-label") (label :text "${no} ${unit}" :class "chrono-air-no-value")) (box :orientation "vertical" :class "chrono-air-no2-box" (label :text no2_label :class "chrono-air-no2-label") (label :text "${no2} ${unit}" :class "chrono-air-no2-value")) (box :orientation "vertical" :class "chrono-air-o3-box" (label :text co_label :class "chrono-air-o3-label") (label :text "${co} ${unit}" :class "chrono-air-o3-value"))) (box :orientation "vertical" :class "chrono-air-col-one" :space-evenly false :spacing 10 (box :orientation "vertical" :class "chrono-air-so2-box" (label :text so2_label :class "chrono-air-so2-label") (label :text "${so2} ${unit}" :class "chrono-air-so2-value")) (box :orientation "vertical" :class "chrono-air-pm2_5-box" (label :text pm2_5_label :class "chrono-air-pm2_5-label") (label :text "${pm2_5} ${unit}" :class "chrono-air-pm2_5-value")) (box :orientation "vertical" :class "chrono-air-pm10-box" (label :text pm10_label :class "chrono-air-pm10-label") (label :text "${pm10} ${unit}" :class "chrono-air-pm10-value")) (box :orientation "vertical" :class "chrono-air-nh3-box" (label :text nh3_label :class "chrono-air-nh3-label") (label :text "${nh3} ${unit}" :class "chrono-air-nh3-value")))))) ; vim:filetype=yuck ================================================ FILE: src/yuck/clime/_init.yuck ================================================ (include "./src/yuck/clime/_modules.yuck") (include "./src/yuck/clime/_layout.yuck") (defwindow clime :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x -70 :y 20 :width "12%" :height "5%" :anchor "top right") (clime_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/clime/_layout.yuck ================================================ (defwidget clime_layout [] (_miniweather :min {weather.main.temp_min} :max {weather.main.temp_max} :min_text "Min temp." :max_text "Max temp." :feels {weather.main.feels_like} :category {weather.weather[0].main} :unit "°" :temp {weather.main.temp} :city {weather.name} :country {weather.sys.country} :icon {weather.weather[0].glyph})) ================================================ FILE: src/yuck/clime/_modules.yuck ================================================ (defwidget _miniweather [min max feels category unit temp city country icon min_text max_text] (box :space-evenly false :orientation "vertical" :spacing 20 :class "clime-layout-box" (box :space-evenly false :class "clime-upper-box" :spacing 30 (label :text icon :hexpand true :halign "start" :class "clime-img") (label :text "${round(temp,0)}${unit}" :class "clime-temp" :halign "end")) (box :space-evenly false :orientation "vertical" :halign "start" :class "clime-middle-box" (label :halign "start" :text "${city}, ${country}" :class "clime-city") (label :halign "start" :text category :class "clime-category") (label :halign "start" :text "Feels like ${round(feels,0)}${unit}" :class "clime-feels")) (box :space-evenly false :class "clime-lower-box" (box :space-evenly false :class "clime-max-box" :orientation "vertical" :hexpand true (label :hexpand true :halign "start" :text max_text :class "clime-max-label") (label :hexpand true :halign "start" :text "${round(max,0)}${unit}" :class "clime-max")) (box :space-evenly false :class "clime-max-box" :orientation "vertical" (label :hexpand true :halign "end" :text min_text :class "clime-max-label") (label :halign "start" :text "${round(min,0)}${unit}" :class "clime-min"))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/_dnd.yuck ================================================ (defwidget _dnd [total total_label label footer state action waiting_icon_off waiting_icon_on waiting] (box :vexpand true :hexpand true :class "disclose-dnd-box" :space-evenly false (box :class "disclose-dnd-labels" :hexpand true :orientation "vertical" :space-evenly false (label :halign "start" :class "disclose-dnd-header" :text label) (label :halign "start" :class "disclose-dnd-footer" :text footer) (box :halign "center" :valign "center" :orientation "vertical" :vexpand true :class "disclose-dnd-box-inner" :space-evenly false (label :class "disclose-dnd-total" :text total) (label :class "disclose-dnd-total-label" :text total_label)) (box :space-evenly false :class "disclose-dnd-waiting-toggle" (button :onclick action :hexpand true :halign "start" :valign "end" :class "disclose-dnd-toggle disclose-dnd-toggle-${state}" state) (box :space-evenly false :class "disclose-dnd-waiting-icon-label ${waiting == 0 ? "" : "disclose-dnd-waiting-padding"}" (label :class "disclose-dnd-waiting-icon ${waiting == 0 ? "" : "disclose-dnd-waiting-margin"}" :text {waiting == 0 ? waiting_icon_off : waiting_icon_on}) (label :class "disclose-dnd-waiting-label" :text {waiting == 0 ? "" : waiting})))))) ;; vim:filetype=yuck ================================================ FILE: src/yuck/disclose/_env.yuck ================================================ (defpoll disclose_stats :interval "5s" "./.venv/bin/python ./src/shell/logger.py stats") (deflisten disclose_sub "./src/shell/combine.zsh sub") (defpoll disclose_dnd_state :interval "1s" "dunstctl is-paused") (defpoll dunst_displayed :interval "10s" "dunstctl count displayed") (defpoll dunst_history :interval "10s" "dunstctl count history") (defpoll dunst_waiting :interval "10s" "dunstctl count waiting") ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/_init.yuck ================================================ (include "./src/yuck/disclose/_env.yuck") (include "./src/yuck/disclose/cards/_cardimage.yuck") (include "./src/yuck/disclose/cards/_cardprog.yuck") (include "./src/yuck/disclose/cards/_cardscr.yuck") (include "./src/yuck/disclose/cards/_cardradial.yuck") (include "./src/yuck/disclose/_stats.yuck") (include "./src/yuck/disclose/_dnd.yuck") (include "./src/yuck/disclose/_layout.yuck") (defwindow disclose :stacking "fg" :windowtype "normal" :wm-ignore true :geometry (geometry :width "26%" :height "100%" :anchor "right center") (disclose_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/_layout.yuck ================================================ (defwidget disclose_layout [] (box :orientation "vertical" :space-evenly false :class "disclose-layout-box" (box :space-evenly false :class "disclose-headers" :spacing 6 (label :text "DISCLOSE" :class "disclose-headers-label" :halign "start" :hexpand true) (button :onclick "./src/shell/combine.zsh cls" :class "disclose-headers-clear" "") (button :onclick "eww close disclose" :class "disclose-headers-close" "署")) (scroll :hscroll false :vscroll true :vexpand true :hexpand true :class "disclose-scroll" (literal :content disclose_sub)) (label :class "disclose-separator" :text "") (box :space-evenly false :class "disclose-misc-box" (_dstats :critical "${disclose_stats.critical}" :criticon "" :low "${disclose_stats.low}" :normicon "" :normal "${disclose_stats.normal}" :lowicon "靖" :level "2" :thickness 10) (_dnd :total "${disclose_stats.total}" :footer "Dunst Bell" :total_label "Total" :action "dunstctl set-paused toggle" :state "${disclose_dnd_state == "true" ? "ON" : "OFF"}" :label "Don't Disturb." :waiting_icon_on "" :waiting_icon_off "" :waiting dunst_waiting)))) ;; vim:filetype=yuck ================================================ FILE: src/yuck/disclose/_stats.yuck ================================================ (defwidget _dstats [ critical criticon normal normicon low lowicon level thickness ] (box :space-evenly false :orientation "vertical" :class "disclose-stats" :spacing 10 (box :space-evenly false :class "disclose-stats-crit-box" (circular-progress :value critical :thickness thickness :class "disclose-stats-crit" (label :class "disclose-stats-crit-label" :text criticon)) (label :class "disclose-stats-separator" :text "") (box :hexpand true :halign "center" :orientation "vertical" :class "disclose-stats-crit-info-box" (label :halign "start" :class "disclose-stats-crit-info-value" :text "${round(critical, level)}%") (label :halign "start" :class "disclose-stats-crit-info-label" :text "Critical"))) (box :space-evenly false :class "disclose-stats-norm-box" (circular-progress :value normal :thickness thickness :class "disclose-stats-norm" (label :class "disclose-stats-norm-label" :text normicon)) (label :class "disclose-stats-separator" :text "") (box :hexpand true :halign "center" :orientation "vertical" :class "disclose-stats-norm-info-box" (label :halign "start" :class "disclose-stats-norm-info-value" :text "${round(normal, level)}%") (label :halign "start" :class "disclose-stats-norm-info-label" :text "Normal"))) (box :space-evenly false :class "disclose-stats-low-box" (circular-progress :value low :thickness thickness :class "disclose-stats-low" (label :class "disclose-stats-low-label" :text lowicon)) (label :class "disclose-stats-separator" :text "") (box :hexpand true :orientation "vertical" :halign "center" :class "disclose-stats-low-info-box" (label :halign "start" :class "disclose-stats-low-info-value" :text "${round(low, level)}%") (label :halign "start" :class "disclose-stats-low-info-label" :text "Low"))))) ;; vim:filetype=yuck ================================================ FILE: src/yuck/disclose/cards/_cardimage.yuck ================================================ (defwidget _cardimage [ summary body ?limit_summary ?limit_body appname timestamp urgency icon icon_width icon_height close ?close_action ?style ?class image image_width image_height ] (eventbox :class "disclose-cardimage-eventbox disclose-cardimage-eventbox-${urgency} disclose-cardimage-eventbox-${appname}" (box :orientation "vertical" :space-evenly false :class "disclose-cardimage-container-box disclose-cardimage-container-box-${urgency} disclose-cardimage-container-box-${appname}" (box :class "disclose-cardimage-summary-box disclose-cardimage-summary-box-${urgency} disclose-cardimage-summary-box-${appname}" :space-evenly false :spacing 6 (box :style "background-image: url('${icon}')" :width icon_width :height icon_height :space-evenly false :class "disclose-cardimage-icon disclose-cardimage-icon-${urgency} disclose-cardimage-icon-${appname}") (label :text appname :hexpand true :halign "start" :class "disclose-cardimage-appname-label disclose-cardimage-appname-label-${urgency} disclose-cardimage-appname-label-${appname}") (button :class "disclose-cardimage-close-button disclose-cardimage-close-button-${urgency} disclose-cardimage-close-button-${appname}" :onclick close_action :timeout "2s" (label :text close :class "disclose-cardimage-close-icon disclose-cardimage-close-icon-${urgency} disclose-cardimage-close-icon-${appname}"))) (box :class "disclose-cardimage-separator disclose-cardimage-separator-${urgency} disclose-cardimage-separator-${appname}" :space-evenly false) (box :class "disclose-cardimage-body-box disclose-cardimage-body-box-${urgency} disclose-cardimage-body-box-${appname}" :space-evenly false (box :halign "center" :valign "center" :class "disclose-cardimage-image-box disclose-cardimage-image-box-${urgency} disclose-cardimage-image-box-${appname}" (box :style "background-image: url('${image}');${style}" :hexpand false :vexpand false :width image_width :height image_height :space-evenly false :class "disclose-cardimage-image disclose-cardimage-image-${urgency} disclose-cardimage-image-${appname} ${class}")) (box :hexpand true :vexpand true :valign "center" :orientation "vertical" :spacing 5 :class "disclose-cardimage-body-outer disclose-cardimage-body-outer-${urgency} disclose-cardimage-body-outer-${appname}" :space-evenly false (label :text summary :limit-width {limit_summary != "" ? limit_summary : 25} :halign "start" :class "disclose-cardimage-summary-label disclose-cardimage-summary-label-${urgency} disclose-cardimage-summary-label-${appname}") (label :text body :halign "start" :limit-width {limit_body != "" ? limit_body : 110} :xalign 0.0 :wrap true :class "disclose-cardimage-body-label disclose-cardimage-body-${urgency} disclose-cardimage-body-${appname}") (label :text timestamp :halign "end" :class "disclose-cardimage-timestamp disclose-cardimage-timestamp-${urgency} disclose-cardimage-timestamp-${appname}")))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/cards/_cardprog.yuck ================================================ (defwidget _cardprog [ summary body ?limit_summary ?limit_body appname timestamp urgency progress icon icon_width icon_height close ?close_action ?style image image_width image_height ] (eventbox :class "disclose-cardprog-eventbox disclose-cardprog-eventbox-${urgency} disclose-cardprog-eventbox-${appname}" (box :orientation "vertical" :space-evenly false :class "disclose-cardprog-container-box disclose-cardprog-container-box-${urgency} disclose-cardprog-container-box-${appname}" (box :class "disclose-cardprog-summary-box disclose-cardprog-summary-box-${urgency} disclose-cardprog-summary-box-${appname}" :space-evenly false :spacing 6 (box :style "background-image: url('${icon}')" :width icon_width :height icon_height :space-evenly false :class "disclose-cardprog-icon disclose-cardprog-icon-${urgency} disclose-cardprog-icon-${appname}") (label :text appname :hexpand true :halign "start" :class "disclose-cardprog-appname-label disclose-cardprog-appname-label-${urgency} disclose-cardprog-appname-label-${appname}") (button :class "disclose-cardprog-close-button disclose-cardprog-close-button-${urgency} disclose-cardprog-close-button-${appname}" :onclick close_action :timeout "2s" (label :text close :class "disclose-cardprog-close-icon disclose-cardprog-close-icon-${urgency} disclose-cardprog-close-icon-${appname}"))) (box :class "disclose-cardprog-separator disclose-cardprog-separator-${urgency} disclose-cardprog-separator-${appname}" :space-evenly false) (box :class "disclose-cardprog-body-box disclose-cardprog-body-box-${urgency} disclose-cardprog-body-box-${appname}" :space-evenly false (box :halign "center" :valign "center" :class "disclose-cardprog-image-box disclose-cardprog-image-box-${urgency} disclose-cardprog-image-box-${appname}" (box :style "background-image: url('${image}');${style}" :hexpand false :vexpand false :width image_width :height image_height :space-evenly false :class "disclose-cardprog-image disclose-cardprog-image-${urgency} disclose-cardprog-image-${appname}")) (box :spacing 1 :hexpand true :vexpand true :valign "center" :orientation "vertical" :class "disclose-cardprog-body-outer disclose-cardprog-body-outer-${urgency} disclose-cardprog-body-outer-${appname}" :space-evenly false (box :class "disclose-cardprog-summary-body-box disclose-cardprog-summary-body-box-${urgency} disclose-cardprog-summary-body-box-${appname}" (label :limit-width {limit_summary != "" ? limit_summary : 25} :text summary :halign "start" :class "disclose-cardprog-summary-label disclose-cardprog-summary-label-${urgency} disclose-cardprog-summary-label-${appname}") (label :text timestamp :halign "end" :class "disclose-cardprog-timestamp disclose-cardprog-timestamp-${urgency} disclose-cardprog-timestamp-${appname}")) (label :limit-width {limit_body != "" ? limit_body : 110} :text body :halign "start" :wrap true :xalign 0.0 :class "disclose-cardprog-body-label disclose-cardprog-body-${urgency} disclose-cardprog-body-${appname}") (box :spacing 15 :class "disclose-cardprog-scale-box disclose-cardprog-scale-box-${urgency} disclose-cardprog-scale-box-${appname}" :space-evenly false (scale :hexpand true :class "disclose-cardprog-scale disclose-cardprog-scale-${urgency} disclose-cardprog-scale-${appname}" :min 0 :max 100 :active false :value progress) (label :class "disclose-cardprog-value-label disclose-cardprog-value-label-${urgency} disclose-cardprog-value-label-${appname}" :text progress))))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/cards/_cardradial.yuck ================================================ (defwidget _cardradial [ summary body ?limit_summary ?limit_body appname timestamp urgency close ?close_action progress thickness total done ] (eventbox :class "disclose-cardradial-eventbox disclose-cardradial-eventbox-${urgency} disclose-cardradial-eventbox-${appname}" (box :orientation "vertical" :space-evenly false :class "disclose-cardradial-container-box disclose-cardradial-container-box-${urgency} disclose-cardradial-container-box-${appname}" (box :class "disclose-cardradial-summary-box disclose-cardradial-summary-box-${urgency} disclose-cardradial-summary-box-${appname}" :space-evenly false (label :text appname :hexpand true :halign "start" :class "disclose-cardradial-appname-label disclose-cardradial-appname-label-${urgency} disclose-cardradial-appname-label-${appname}") (button :class "disclose-cardradial-close-button disclose-cardradial-close-button-${urgency} disclose-cardradial-close-button-${appname}" :onclick close_action :timeout "2s" (label :text close :class "disclose-cardradial-close-icon disclose-cardradial-close-icon-${urgency} disclose-cardradial-close-icon-${appname}"))) (box :class "disclose-cardradial-separator disclose-cardradial-separator-${urgency} disclose-cardradial-separator-${appname}" :space-evenly false) (box :class "disclose-cardradial-body-box disclose-cardradial-body-box-${urgency} disclose-cardradial-body-box-${appname}" :space-evenly false (box :halign "center" :valign "center" :class "disclose-cardradial-circle-box disclose-cardradial-circle-box-${urgency} disclose-cardradial-circle-box-${appname}" (circular-progress :value progress :thickness thickness :class "disclose-cardradial-circle disclose-cardradial-circle-${urgency} disclose-cardradial-circle-${appname}" (label :class "disclose-cardradial-tasks disclose-cardradial-tasks-${urgency} disclose-cardradial-tasks-${appname}" :text "${done}/${total}"))) (box :hexpand true :vexpand true :valign "center" :spacing 5 :orientation "vertical" :class "disclose-cardradial-body-outer disclose-cardradial-body-outer-${urgency} disclose-cardradial-body-outer-${appname}" :space-evenly false (label :limit-width {limit_summary != "" ? limit_summary : 25} :text summary :halign "start" :class "disclose-cardradial-summary-label disclose-cardradial-summary-label-${urgency} disclose-cardradial-summary-label-${appname}") (label :limit-width {limit_body != "" ? limit_body : 110} :text body :xalign 0.0 :halign "start" :wrap true :class "disclose-cardradial-body-label disclose-cardradial-body-${urgency} disclose-cardradial-body-${appname}") (label :text timestamp :halign "end" :class "disclose-cardradial-timestamp disclose-cardradial-timestamp-${urgency} disclose-cardradial-timestamp-${appname}")))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/disclose/cards/_cardscr.yuck ================================================ (defwidget _cardscr [ summary ?limit_summary close ?close_action image image_width image_height timestamp urgency delete open ] (eventbox :class "disclose-cardscr-eventbox disclose-cardscr-eventbox-${urgency}" (box :orientation "vertical" :space-evenly false :class "disclose-cardscr-container-box disclose-cardscr-container-box-${urgency}" (box :space-evenly false :class "disclose-cardscr-summary-box disclose-cardscr-summary-box-${urgency}" (label :hexpand true :limit-width {limit_summary != "" ? limit_summary : 25} :halign "start" :class "disclose-cardscr-summary-label disclose-cardscr-summary-label-${urgency}" :text summary) (label :class "disclose-cardscr-timestamp disclose-cardscr-timestamp-${urgency}" :text timestamp) (button :class "disclose-cardscr-close-button disclose-cardscr-close-button-${urgency}" :onclick close_action :timeout "2s" (label :text close :class "disclose-cardscr-close-icon disclose-cardscr-close-icon-${urgency}"))) (box :class "disclose-cardscr-image" :style "background-image: url('${image}')" :width image_width :height image_height :space-evenly false) (box :spacing 20 :space-evenly true :class "disclose-cardscr-action-box disclose-cardscr-action-box-${urgency}" :hexpand true :halign "center" (button :class "disclose-cardscr-open-button disclose-cardscr-open-button-${urgency}" :onclick open :timeout "2s" (label :text "Open" :class "disclose-cardscr-open-label disclose-cardscr-open-label-${urgency}")) (button :class "disclose-cardscr-delete-button disclose-cardscr-delete-button-${urgency}" :onclick delete :timeout "2s" (label :text "Delete" :class "disclose-cardscr-delete-label disclose-cardscr-delete-label-${urgency}")))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/horizon/_init.yuck ================================================ (include "./src/yuck/lumin/_modules.yuck") (include "./src/yuck/lumin/_layout.yuck") (defwindow horizon :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x 200 :y 50 :width "30%" :height "25%" :anchor "left center") (horizon_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/horizon/_layout.yuck ================================================ (defwidget horizon_layout [] (box :space-evenly false :class "lumin-layout-box" :spacing 35 "")) ;; vim:ft=yuck ================================================ FILE: src/yuck/horizon/_modules.yuck ================================================ ;; vim:ft=yuck ================================================ FILE: src/yuck/lumin/_init.yuck ================================================ (include "./src/yuck/lumin/_modules.yuck") (include "./src/yuck/lumin/_layout.yuck") (defwindow lumin :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x 200 :y 50 :width "30%" :height "25%" :anchor "left center") (lumin_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/lumin/_layout.yuck ================================================ (defwidget lumin_layout [] (box :space-evenly false :class "lumin-layout-box" :spacing 35 (_luminapps :one "$BROWSER https://www.youtube.com &" :icon_one "" :two "$BROWSER https://open.spotify.com &" :icon_two "" :three "$BROWSER https://web.whatsapp.com &" :icon_three "" :four "$BROWSER https://www.reddit.com &" :icon_four "" :five "$BROWSER https://github.com &" :icon_five "" :six "$BROWSER https://discord.com/app &" :icon_six "") (box :orientation "vertical" :space-evenly false :spacing 20 (_sundialinfo :class "lumin" :halign "start") (label :class "lumin-day-label" :text {time.day} :halign "start") (box :space-evenly false :spacing 10 (_lumininfo) (label :width 2 :class "lumin-separator" "") (label :class "lumin-date-label" :halign "end" :text "${time.dom} ${time.month} ${time.year} / ${time.hour}:${time.min}")) (_search :engine "$BROWSER https://duckduckgo.com &" :command "$BROWSER https://duckduckgo.com/?q={} &" :placeholder "Search..." :timeout "5s" :icon "") ;  (_luminquote :icon "" :quote "All the space without you in it, is empty." :auth " Iain Thomas")))) ;; vim:ft=yuck ================================================ FILE: src/yuck/lumin/_modules.yuck ================================================ (defwidget _luminapps [one two three four five six icon_one icon_two icon_three icon_four icon_five icon_six] (box :space-evenly false :class "lumin-apps-box" :orientation "vertical" :spacing 30 (button :onclick one :class "lumin-app-btn lumin-app-btn-one" icon_one) (button :onclick two :class "lumin-app-btn lumin-app-btn-two" icon_two) (button :onclick three :class "lumin-app-btn lumin-app-btn-three" icon_three) (button :onclick four :class "lumin-app-btn lumin-app-btn-four" icon_four) (button :onclick five :class "lumin-app-btn lumin-app-btn-five" icon_five) (button :onclick six :class "lumin-app-btn lumin-app-btn-six" icon_six))) (defwidget _lumininfo [?class] (box :space-evenly false :spacing 10 :class "lumin-info-box" (_infobatnolbl :battery {EWW_BATTERY.BAT0.capacity} :status {EWW_BATTERY.BAT0.status} :charge "" :one "" :two "" :three "" :four "" :five "" :six "" :seven "") (_infonetnolbl :strength net :offline "" :excellent "" :good "" :okay "" :slow ""))) (defwidget _luminquote [icon quote auth] (box :space-evenly false :class "lumin-quote-box" :spacing 10 (label :text icon :class "lumin-quote-icon") (box :orientation "vertical" :class "lumin-quote-box-inner" (label :text quote :class "lumin-quote") (label :halign "start" :text auth :class "lumin-quote-auth")))) (defwidget _search [engine command placeholder timeout icon] (box :space-evenly false :class "lumin-search-box" (input :onaccept command :class "lumin-search" :hexpand true :timeout timeout :value placeholder) (button :onclick engine :class "lumin-search-button" :timeout timeout icon))) ;; vim:ft=yuck ================================================ FILE: src/yuck/melody/_init.yuck ================================================ (include "./src/yuck/melody/_modules.yuck") (include "./src/yuck/melody/_layout.yuck") (defwindow melody :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x -70 :y -70 :width "27%" :height "10%" :anchor "bottom right") (melody_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/melody/_layout.yuck ================================================ (defwidget melody_layout [] (box :class "melody-layout-box" :space-evenly false :spacing 20 (box :space-evenly false :class "melody-layout-box" :orientation "vertical" :spacing 30 (_melodyplayer :title {pctl_sub['xesam:title']} :artist {pctl_sub['xesam:artist']}) (_melodyapps :one "pushd ~;neovide;popd" :two "pushd ~;shotwell;popd" :three "pushd ~;nemo;popd" :four "pushd ~;gimp;popd" :five "pushd ~;st;popd" :six "qalculate-gtk &" :one_icon "" :two_icon "" :three_icon "" :four_icon "" :five_icon "" :six_icon "")) (_melodycover :status {pctl_sub.status} :bright {pctl_sub.bright} :dark {pctl_sub.dark} :cover_path {pctl_sub['mpris:artUrl']}))) ;; vim:ft=yuck ================================================ FILE: src/yuck/melody/_modules.yuck ================================================ (defwidget _melodyapps [ one two three four five six one_icon two_icon three_icon four_icon five_icon six_icon ] (box :space-evenly false :class "melody-apps-box" :spacing 50 (button :class "melody-apps-box-one" :onclick one one_icon) (button :class "melody-apps-box-two" :onclick two two_icon) (button :class "melody-apps-box-three" :onclick three three_icon) (button :class "melody-apps-box-four" :onclick four four_icon) (button :class "melody-apps-box-five" :onclick five five_icon) (button :class "melody-apps-box-six" :onclick six six_icon))) (defwidget _melodyplayer [title artist] (box :class "melody-player" :space-evenly false :orientation "vertical" :spacing 5 :halign "end" (label :halign "end" :limit-width 20 :class "melody-artist" :text artist) (label :halign "end" :limit-width 40 :class "melody-title" :text title))) (defwidget _melodycover [cover_path status bright dark] (box :space-evenly false :class "melody-cover-box" :orientation "vertical" (box :space-evenly false :class "melody-cover melody-cover-${status}" :style `background-image: url("${cover_path}")`) (label :class "melody-cover-label" :text {status} :style "color: ${bright}; background-color: ${dark}"))) ;; vim:ft=yuck ================================================ FILE: src/yuck/ocular/_init.yuck ================================================ (include "./src/yuck/ocular/_modules.yuck") (include "./src/yuck/ocular/_layout.yuck") (defwindow ocular :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :y -10 :width "20%" :height "25%" :anchor "center") (ocular_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/ocular/_layout.yuck ================================================ (defwidget ocular_layout [] (box :space-evenly false :class "ocular-layout-box" :halign "center" :orientation "vertical" :spacing 20 (box :class "ocular-date-sundial-box" :space-evenly false :spacing 15 :halign "center" (_sundialinfo :class "ocular" :halign "center") (label :class "ocular-date-label" :text {time.pretty})) (box :space-evenly false :spacing 45 (_radialtime :hour {time.hour} :min {time.min} :sec {time.sec}) (box :space-evenly false :orientation "vertical" :spacing 15 (_infobattery :battery {EWW_BATTERY.BAT0.capacity} :status {EWW_BATTERY.BAT0.status} :charge "" :one "" :two "" :three "" :four "" :five "" :six "" :seven "") (_infonetwork :strength net :offline "" :excellent "" :good "" :okay "" :slow "") (_infogeneric :level {EWW_RAM.used_mem_perc} :icon "") (_infogeneric :level {EWW_CPU.avg} :icon "") (_infotemp :level {EWW_TEMPS.COMPOSITE} :icon ""))))) ;; vim:ft=yuck ================================================ FILE: src/yuck/ocular/_modules.yuck ================================================ (defwidget _infobattery [battery status one two three four five six seven charge ?class] (box :class "ocular-battery-box ${class}" :space-evenly false :spacing 8 (label :class "ocular-battery-icon ${class}" :text {status == 'Charging' ? charge : battery < 15 ? seven : battery < 30 ? six : battery < 45 ? five : battery < 60 ? four : battery < 75 ? three : battery < 95 ? two : one}) (label :class "ocular-battery-label ${class}" :text "${battery}%"))) (defwidget _infonetwork [strength offline excellent good okay slow ?class] (box :class "ocular-network-box ${class}" :space-evenly false :spacing 8 (label :class "ocular-network-icon ${class}" :text {strength == "" ? offline : strength < 26 ? slow : strength < 51 ? okay : strength < 76 ? good : excellent}) (label :class "ocular-network-label ${class}" :text "${strength == "" ? 0 : strength}%"))) (defwidget _infogeneric [level icon ?class] (box :class "ocular-generic-box" :space-evenly false :spacing 8 (label :class "ocular-generic-icon ${class}" :text icon) (label :class "ocular-generic-label ${class}" :text "${round(level, 0)}%"))) (defwidget _infotemp [level icon ?class] (box :class "ocular-temp-box" :space-evenly false :spacing 8 (label :class "ocular-temp-icon ${class}" :text icon) (label :class "ocular-temp-label ${class}" :text "${round(level, 0)}°C"))) (defwidget _radialtime [hour min sec] (circular-progress :value {sec * 100 / 60} :valign "center" :vexpand true :thickness 25 :class "ocular-time-radial" "${hour}:${min}")) ;; vim:ft=yuck ================================================ FILE: src/yuck/origin/_init.yuck ================================================ (include "./src/yuck/origin/_layout.yuck") (defwindow origin :stacking "bg" :windowtype "normal" :wm-ignore true :geometry (geometry :x 60 :y 60 :width "13%" :height "5%" :anchor "top left") (origin_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/origin/_layout.yuck ================================================ (defwidget origin_layout [] (box :space-evenly false :class "origin-layout-box" :spacing 20 (_profile :path "./assets/profile.png" :size 50 :tooltip "profile" :button-class "origin-profile-button" :image-class "origin-profile-image") (box :valign "center" :orientation "vertical" :space-evenly false :class "origin-info-box" (label :halign "start" :class "origin-greet" :text "Hey, ${username}.") (label :halign "start" :class "origin-hostname" :text "${username}@${hostname}")))) ;; vim:ft=yuck ================================================ FILE: src/yuck/power/_init.yuck ================================================ (include "./src/yuck/power/_modules.yuck") (include "./src/yuck/power/_layout.yuck") (defwindow power :stacking "fg" :windowtype "normal" :wm-ignore true :geometry (geometry :width "100%" :height "100%") (power_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/power/_layout.yuck ================================================ (defwidget power_layout [] (box :class "power-layout-box" :space-evenly false :orientation "vertical" :style "background-image: url('/home/dharmx/Pictures/walls/radium/output-1659958155.png')" (box :valign "start" :space-evenly false :spacing 25 (_sundialinfo :class "power" :halign "end" :hexpand true) (_infobatnolbl :battery {EWW_BATTERY.BAT0.capacity} :status {EWW_BATTERY.BAT0.status} :charge "" :one "" :two "" :three "" :four "" :five "" :six "" :seven "" :class "power-info-bat") (_infonetnolbl :strength net :offline "" :excellent "" :good "" :okay "" :slow "" :class "power-info-net") (label :text "|" :class "power-separator") (button :onclick "eww close power" :class "power-close-button" "")) (box :space-evenly false :hexpand true :vexpand true (box :spacing 15 :space-evenly false :valign "end" :halign "start" (label :text "" :class "power-label-icon") (label :text "${time.hour} ${time.min}" :class "power-label power-label-time")) (_powermenu :shutdown "sudo -A poweroff" :reboot "sudo -A reboot" :logout "sudo -A loginctl kill-session self" :lock "~/.bin/util/i3lock.sh maker" :sleep "sudo -A systemctl suspend" :shutdown_icon "" :reboot_icon "" :logout_icon "" :lock_icon "" :sleep_icon "")))) ; vim:filetype=yuck ================================================ FILE: src/yuck/power/_modules.yuck ================================================ (defwidget _powermenu [shutdown shutdown_icon reboot reboot_icon logout logout_icon lock lock_icon sleep sleep_icon] (box :vexpand true :hexpand true :space-evenly false :class "power-box" :valign "end" :halign "end" :spacing 5 (button :class "power-shutdown-button" :onclick "${shutdown} && eww close power" shutdown_icon) (button :class "power-reboot-button" :onclick "${reboot} && eww close power" reboot_icon) (button :class "power-logout-button" :onclick "${logout} && eww close power" logout_icon) (button :class "power-lock-button" :onclick "${lock} && eww close power" lock_icon) (button :class "power-sleep-button" :onclick "${sleep} && eww close power" sleep_icon))) ; vim:filetype=yuck ================================================ FILE: src/yuck/vertigo/_env.yuck ================================================ (deflisten vertigo_workspaces "./src/shell/workspaces.zsh subscribe_desktop") (deflisten vertigo_nodes "./src/shell/workspaces.zsh subscribe_node") (defvar vertigo_open false) (defvar vertigo_revealex false) (defvar vertigo_revealnd false) (defvar vertigo_remove "./src/shell/workspaces.zsh remove") (defvar vertigo_create "./src/shell/workspaces.zsh create") (defpoll vertigo_config :interval "5000h" :run-while false "cat ewwrc") ;; vim:ft=yuck ================================================ FILE: src/yuck/vertigo/_init.yuck ================================================ (include "./src/yuck/vertigo/_env.yuck") (include "./src/yuck/vertigo/_label.yuck") (include "./src/yuck/vertigo/_reveal.yuck") (include "./src/yuck/vertigo/_modules.yuck") (include "./src/yuck/vertigo/_layout.yuck") (defwindow vertigo :stacking "bg" :windowtype "dock" :geometry (geometry :width "4%" :height "100%" :anchor "left center") :reserve (struts :distance "4%" :side "left") (vertigo_layout)) ;; vim:ft=yuck ================================================ FILE: src/yuck/vertigo/_label.yuck ================================================ (defwidget _label [vexpand text ?tooltip ?valign ?button-class ?label-class ?M ?L ?R] (button :onmiddleclick M :onclick L :onrightclick R :vexpand vexpand :valign "${valign == "" ? "start" : valign}" :class "vertigo-button ${button-class}" :tooltip tooltip (label :text text :limit-width 2 :class "vertigo-label ${label-class}"))) ;; vim:ft=yuck ================================================ FILE: src/yuck/vertigo/_layout.yuck ================================================ (defwidget vertigo_layout [] (box :orientation "vertical" :space-evenly false :class "vertigo-layout-box" (box :space-evenly false :orientation "vertical" :spacing 10 (eventbox :onhover "eww update vertigo_revealnd=true" :onhoverlost "eww update vertigo_revealnd=false" (box :space-evenly false :orientation "vertical" :class "" (button :onmiddleclick {vertigo_nodes.onmiddleclick} :class {vertigo_nodes.class} :tooltip {vertigo_nodes.tooltip} {vertigo_nodes.label}) (_revealnd :revealon vertigo_revealnd :config vertigo_config))) (_label :text "" :tooltip "find" :vexpand false :button-class "vertigo-search-button" :L "pushd ~;rofi -show;popd")) (eventbox :onscroll '[ {} = up ] || bspc desktop -f next; [ {} = down ] || bspc desktop -f prev' :vexpand true (scroll :height 370 (box :orientation 'vertical' :class 'vertigo-box vertigo-desktop' :space-evenly false :tooltip 'workspaces' (for workspace in vertigo_workspaces (button :class {workspace.class} :tooltip {workspace.tooltip} :onclick {workspace.onclick} {workspace.label}))))) (eventbox :onhover "eww update vertigo_revealex=true" :onhoverlost "eww update vertigo_revealex=false" (box :space-evenly false :orientation "vertical" (_vertigobat :critical "暑" :full "" :battery {EWW_BATTERY.BAT0.capacity}) (_time :time time :tooltip "time ${time.hour}:${time.min}" :button-class "vertigo-time-button" :L "eww open --toggle bolt") (_revealex :revealon vertigo_revealex) (label :text "" :class "vertigo-separator"))) (_profile :M "eww update vertigo_revealex=${!vertigo_revealex}" :L "eww open --toggle avatar" :path profile :image-class "vertigo-profile-image" :button-class "vertigo-profile-button" :size "50" :tooltip "profile"))) ;; vim:ft=yuck ================================================ FILE: src/yuck/vertigo/_modules.yuck ================================================ (defwidget _time [time ?tooltip ?M ?L ?R ?button-class] (button :onmiddleclick M :onclick L :onrightclick R :class "vertigo-button ${button-class}" :tooltip tooltip (box :orientation "vertical" :space-evenly false (label :text {time.hour} :class "vertigo-time-format-first") (label :text {time.min} :class "vertigo-time-format-second")))) (defwidget _vertigobat [critical full battery] (_label :text {battery < 16 ? critical : battery > 94 ? full : battery} :tooltip "capacity: ${battery}" :vexpand true :valign "end" :button-class "vertigo-battery-button")) ;; vim:ft=yuck ================================================ FILE: src/yuck/vertigo/_reveal.yuck ================================================ (defwidget _revealex [revealon] (revealer :reveal revealon :transition "slidedown" :class "vertigo-revealer" (box :orientation "vertical" :class "vertigo-reveal-box" :space-evenly false (_label :text volume_status :L vertigo_volume_toggle :tooltip "volume: ${volume_level}" :vexpand false :button-class "vertigo-volume-button ${volume_status == "" ? "vertigo-volume-on" : "vertigo-volume-off"}") (_label :text redshift :tooltip "nightmode" :vexpand false :L "[ $(pidof redshift) ] && pkill redshift || redshift &" :button-class "vertigo-nightmode-button ${redshift == "" ? "vertigo-nightmode-on" : "vertigo-nightmode-off"}") (_label :text "賂" :tooltip "node" :button-class "vertigo-workspace-plus-button" :vexpand false :L vertigo_create :R vertigo_remove) (_label :text dunst :tooltip "notify" :vexpand false :button-class "vertigo-notify-button ${dunst == "" ? "vertigo-notify-on" : "vertigo-notify-off"}" :L "[ $(dunstctl is-paused) = false ] && dunstctl set-paused true || dunstctl set-paused false" :M "eww open --toggle disclose") (_label :text "朗" :vexpand false :tooltip "todo" :button-class "vertigo-todo-button")))) (defwidget _revealnd [revealon config] (revealer :reveal revealon :transition "slidedown" :class "vertigo-revealer" (scroll :height 110 :vexpand true (box :vexpand true :orientation "vertical" :class "vertigo-reveal-box" :space-evenly false (for layout in {config.layouts} (_label :text {layout.icon} :tooltip {layout.label} :vexpand false :button-class "vertigo-${layout.label}" :L {layout.command})))))) ;; vim:ft=yuck ================================================ FILE: themes/radium.scss ================================================ $base00: #101317; $base01: #171C21; $base02: #1c2026; $base03: #20252b; $base04: #949494; $base05: #d4d4d5; $base06: #ffffff; $base07: #54ced6; $base08: #70c0ba; $base09: #7ab0df; $base10: #b77ee0; $base11: #f87070; $base12: #36c692; $base13: #ffe59e; $base14: #79dcaa; $base15: #c397d8; $shade00: #3d464e; $shade01: #2b3238; $shade02: #24292e; $shade03: #1f2429; $shade04: #1c2126; $shade05: #191e23; $shade06: #161b20; $shade07: #151a1f; $shade08: #13181d; $shade09: #11161b; $shade10: #0e1115; $shade11: #0c0f13; $shade12: #0a0d11; $normal: #273a4e; $critical: #471d1d; $low: #0c2d21; $other: #2c1033; // vim:ft=scss