diff --git a/.github/README.md b/.github/README.md deleted file mode 100644 index 94afab2..0000000 --- a/.github/README.md +++ /dev/null @@ -1,146 +0,0 @@ - - - -
- - Rice Preview - -
- -
- - -

- - - - - - -

- -
- -## Hi there! Thanks for dropping by! :blue_heart: - AlphaTechnolog's WIP AwesomeWM Rice - -Welcome! This is the repository for my awesomewm rice using [decay](https://github.com/decaycs) (decayce variant) - -> WIP cuz notifications aren't configured yet (btw WIP = Work In Progress) - -## ‎ Notice! ⚠ī¸ - -If you like this configuration, please give me a star in this repo, it will make me more happy! 😁 -> If you want, you can visit [more of my repos](https://github.com/AlphaTechnolog?tab=repositories) or go to [my profile](https://github.com/AlphaTechnolog) -> Ah, and gimme credits if you will use my config for showcase :3 - -> See other branches to go to others/olders rices. - -## ‎ Information ℹī¸ - -Here are some details about my setup: - - - -- **OS:** [Void Linux](https://voidlinux.org) -- **WM:** [AwesomeWM](https://github.com/awesomeWM/awesome) -- **Terminal:** [kitty](https://github.com/kovidgoyal/kitty) -- **Shell:** [hilbish](https://github.com/Rosettea/Hilbish) -- **Editor:** [neovim](https://github.com/neovim/neovim) -- **NeovimConfig**: [nvcodark](https://github.com/AlphaTechnolog/nvcodark) (I'm using the remake that is present in the dev branch, instructions aren't ready yet, main branch is broken) -- **Compositor:** [picom](https://github.com/yshui/picom) -- **Application Launcher:** [rofi](https://github.com/davatorium/rofi) - -## ‎ Setup ✏ī¸ - -### Clone the repository - -First clone the repository - -```sh -git clone -b awesomewm https://github.com/AlphaTechnolog/dotfiles -cd dotfiles -``` - -### Requirements ✅ - -Then make sure you have the next requirements installed - -This is in testing phase btw, if you think i miss some pkg, please tell me it opening an [issue](https://github.com/AlphaTechnolog/dotfiles/issues/new) - -#### Fonts - -| **font** | **utility** | -|----------|-------------| -|[Product Sans (Google Sans)](https://www.cufonfonts.com/font/google-sans)|Main UI Font| -|[Iosevka Nerd Font](https://nerdfonts.com/font-downloads)|Some icons, others are rendered using svg| -|[CaskaydiaCove Nerd Font](https://nerdfonts.com/font-downloads)|Terminal font| - -#### Dependencies - -| **dependency** | **utility** | -|----------------|-------------| -|awesomeWM|The window manager (Use the GIT version)| -|picom|The compositor, i'm using the [Arian8j's picom fork](https://github.com/Arian8j2/picom)| -|[hilbish](../cfg/hilbish)|The shell| -|bat|Enhanced cat| -|exa|Enhanced ls (using for tree too)| -|rofi|Apps launcher| -|playerctl|Remotely music management (needs to use dbus, use dbus-run-session if your session isn't started with dbus)| -|light|Manage the brightness using the cli| -|pulseaudio|Well, just the audio manager| -|pactl|Manage pulseaudio using the cli| - -### Copy the configs - -**WARNING**: Configuration files may be overrided. - -```sh -cp -r ./cfg/* ~/.config -cp -r ./bin/* ~/.local/bin -``` - -### Galery - -#### The Desktop - -![desktop](./assets/galery/desktop.png) - -#### Actions Sidebar - -![sidebar](./assets/galery/sidebar.png) - -#### Task preview (using bling) - -![task-preview](./assets/galery/task-preview.png) - -#### Tags Preview (using bling) - -![tags-preview](./assets/galery/tags-preview.png) - -### Enjoy ❤ī¸ - -That's all! Now enjoy with this configuration! - -## ‎ Tips 😎 - -### Some keyboards shortcuts - -| **shortcut** | **meaning** | -|--------------|-------------| -|super + shift + return|Open rofi| -|super + m|Maximize window| -|super + {j,k}|Move Window Focus| -|super + {h,l}|Resize the window| -|super + shift + q|Quit AwesomeWM| -|super + ctrl + r|Restart AwesomeWM| -|super + w|Close window| -|super + Tab|Switch layouts| - -> In the most of the cases, exists mouse based keybindings (but i really prefer the shortcuts lol) - -### Bling - -You can use the official bling module, but I made some modifications in the source code -of bling to add multimonitor support in some parts, it's recommended to use my own version (for this dotfiles at least), -but anyway you can use another version or modification of the bling module if you want diff --git a/.github/assets/galery/desktop.png b/.github/assets/galery/desktop.png deleted file mode 100644 index 25c7d07..0000000 Binary files a/.github/assets/galery/desktop.png and /dev/null differ diff --git a/.github/assets/galery/sidebar.png b/.github/assets/galery/sidebar.png deleted file mode 100644 index 69b510b..0000000 Binary files a/.github/assets/galery/sidebar.png and /dev/null differ diff --git a/.github/assets/galery/tags-preview.png b/.github/assets/galery/tags-preview.png deleted file mode 100644 index dbb6bd8..0000000 Binary files a/.github/assets/galery/tags-preview.png and /dev/null differ diff --git a/.github/assets/galery/task-preview.png b/.github/assets/galery/task-preview.png deleted file mode 100644 index 9ff94d8..0000000 Binary files a/.github/assets/galery/task-preview.png and /dev/null differ diff --git a/.github/assets/neofetch.png b/.github/assets/neofetch.png deleted file mode 100644 index b9ada47..0000000 Binary files a/.github/assets/neofetch.png and /dev/null differ diff --git a/README.md b/README.md new file mode 100644 index 0000000..22d8555 --- /dev/null +++ b/README.md @@ -0,0 +1,29 @@ +# AlphaTechnolog's dotfiles! + +First of all, thanks for dropping by! here is my dotfiles repo, configurations that i'm making (rices) +for make my own setup and feel comfy while i'm working (and beeing productive ofc). + +In this repo, I'm sharing with you my rices, and offering you tips/instructions on how this things works +(but in fact, i don't really know how this works, cuz i don't know what I'm doing :/ so good luck :3 lmao). + +> Configurations are in other branches. + +# [1. DkWM](https://github.com/AlphaTechnolog/dotfiles/tree/dkwm) + +![dkwm](./assets/dkwm.png) + +# [2. AwesomeWM](https://github.com/AlphaTechnolog/dotfiles/tree/awesomewm) + +![awesomewm](./assets/awesomewm.png) + +# [3. BspWM](https://github.com/AlphaTechnolog/dotfiles/tree/bspwm) + +![bspwm](./assets/bspwm.png) + +# 4. Openbox + +> Comming soon. + +# Enjoy! + +Enjoy with my configs, and remember, if you like at least one of this conf. Please, Smash the star button! diff --git a/.github/assets/banner.png b/assets/awesomewm.png similarity index 100% rename from .github/assets/banner.png rename to assets/awesomewm.png diff --git a/assets/bspwm.png b/assets/bspwm.png new file mode 100644 index 0000000..200d987 Binary files /dev/null and b/assets/bspwm.png differ diff --git a/assets/dkwm.png b/assets/dkwm.png new file mode 100644 index 0000000..9659555 Binary files /dev/null and b/assets/dkwm.png differ diff --git a/bin/sfetch b/bin/sfetch deleted file mode 100755 index b46ef10..0000000 Binary files a/bin/sfetch and /dev/null differ diff --git a/bin/sys-fetch b/bin/sys-fetch deleted file mode 100755 index 5f8e4e3..0000000 --- a/bin/sys-fetch +++ /dev/null @@ -1,63 +0,0 @@ -#!/bin/bash -# Author: https://github.com/AlphaTechnolog - -clear - -user="${USER}" -shell="$(basename ${SHELL})" -distro=$(. /etc/os-release ; echo "$ID") -wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")" -kernel="$(uname -r | cut -d '-' -f1)" -ram="$(free -t | awk 'NR == 2 {printf("%.2f%"), $3/$2*100}')" - -white='\033[37m' -cyan='\033[36m' -blue='\033[34m' -blue='\033[36m' -yellow='\033[33m' -green='\033[32m' -magenta='\033[35m' -red='\033[31m' -bold='\033[1m' -end='\033[0m' - -len () { - echo $@ | wc -c -} - -repeat_by_len () { - local str=$1 - local char=$2 - local len=$(len $str) - local i=1 - - while [[ $i -lt $len ]]; do - printf "$char" - i=$(expr $i + 1) - done -} - -if [[ $distro == 'void' || $distro == 'Void' ]]; then -printf '%b' " -${bold}${green} ▄▄▄▄▄▄ ${end}${bold}${blue}${user}${cyan}@${magenta}$(cat /etc/hostname)${end} -${bold}${green}${cyan} ▄${green} ▀███████▄ ${end}${green}$(repeat_by_len "${user}@$(cat /etc/hostname)" "─") -${bold}${green}${cyan}███${white} ▄▄▄${green} ▀███ ${end} -${bold}${green}${cyan}███${white} █████${green} ███ ${end}${bold}${green}os ${green} ī„… ${magenta}${green}${distro}${end} -${bold}${green}${cyan}███${white} ▀███▀${green} ███ ${end}${bold}${yellow}sh ${green} ī„… ${magenta}${blue}${shell}${end} -${bold}${green}${cyan}████▄▄▄▄▄${green} ▀██ ${end}${bold}${magenta}wm ${green} ī„… ${magenta}${yellow}${wm}${end} -${bold}${green}${cyan} ▀███████▀ ${end}${bold}${blue}ram ${green}ī„… ${magenta}${green}${ram}${end} - -" -else -printf '%b' " -${bold}${blue} ██ ${end}${bold}${blue}${user}${cyan}@${purple}$(cat /etc/hostname)${end} -${bold}${blue} ████ ${end}${green}$(repeat_by_len "${user}@$(cat /etc/hostname)" "─") -${bold}${blue} ▀████ ${end} -${bold}${blue} ██▄ ████ ${end}${bold}${purple} ${blue}os ${green} ī„… ${magenta}${cyan}${distro}${end} -${bold}${blue} ██████████ ${end}${bold}${purple}  ${blue}sh ${green} ī„… ${magenta}${cyan}${shell}${end} -${bold}${blue} ████▀ ▀████ ${end}${bold}${purple} ${blue}wm ${green} ī„… ${magenta}${cyan}${wm}${end} -${bold}${blue} ████▀ ▀████ ${end}${bold}${purple} ${blue}kr ${green} ī„… ${magenta}${cyan}${kernel}${end} -${bold}${blue}▀▀▀ ▀▀▀ ${end}${bold}${purple}î‰Ļ ${blue}ram ${green}ī„… ${magenta}${cyan}${ram}${end} - -" -fi diff --git a/cfg/awesome/assets/actions/music/fallback.png b/cfg/awesome/assets/actions/music/fallback.png deleted file mode 100644 index 1dae900..0000000 Binary files a/cfg/awesome/assets/actions/music/fallback.png and /dev/null differ diff --git a/cfg/awesome/assets/actions/music/next.svg b/cfg/awesome/assets/actions/music/next.svg deleted file mode 100755 index b686de6..0000000 --- a/cfg/awesome/assets/actions/music/next.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/music/pause.svg b/cfg/awesome/assets/actions/music/pause.svg deleted file mode 100755 index 3c2bbb0..0000000 --- a/cfg/awesome/assets/actions/music/pause.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/music/play.svg b/cfg/awesome/assets/actions/music/play.svg deleted file mode 100755 index 273db2c..0000000 --- a/cfg/awesome/assets/actions/music/play.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/music/previous.svg b/cfg/awesome/assets/actions/music/previous.svg deleted file mode 100755 index 01a2f38..0000000 --- a/cfg/awesome/assets/actions/music/previous.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/powerbuttons/reboot.svg b/cfg/awesome/assets/actions/powerbuttons/reboot.svg deleted file mode 100755 index 3122e29..0000000 --- a/cfg/awesome/assets/actions/powerbuttons/reboot.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/powerbuttons/shutdown.svg b/cfg/awesome/assets/actions/powerbuttons/shutdown.svg deleted file mode 100755 index 8ac0928..0000000 --- a/cfg/awesome/assets/actions/powerbuttons/shutdown.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/actions/user/pfp.png b/cfg/awesome/assets/actions/user/pfp.png deleted file mode 100644 index 74b2bcc..0000000 Binary files a/cfg/awesome/assets/actions/user/pfp.png and /dev/null differ diff --git a/cfg/awesome/assets/autostart.sh b/cfg/awesome/assets/autostart.sh deleted file mode 100755 index 281b2e7..0000000 --- a/cfg/awesome/assets/autostart.sh +++ /dev/null @@ -1,12 +0,0 @@ -cd $(dirname $0) - -function exe () { - local cmd=$@ - if ! pgrep -x $cmd; then - $cmd & - fi -} - -exe picom --config=./picom/picom.conf -b -exe nm-applet -exe volumeicon diff --git a/cfg/awesome/assets/dock-pinned/code.svg b/cfg/awesome/assets/dock-pinned/code.svg deleted file mode 100644 index 486fd3c..0000000 --- a/cfg/awesome/assets/dock-pinned/code.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/cfg/awesome/assets/dock-pinned/firefox.svg b/cfg/awesome/assets/dock-pinned/firefox.svg deleted file mode 100644 index b6c17b0..0000000 --- a/cfg/awesome/assets/dock-pinned/firefox.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/cfg/awesome/assets/dock-pinned/kitty.svg b/cfg/awesome/assets/dock-pinned/kitty.svg deleted file mode 100644 index 48bb6e9..0000000 --- a/cfg/awesome/assets/dock-pinned/kitty.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/cfg/awesome/assets/dock-pinned/thunar.svg b/cfg/awesome/assets/dock-pinned/thunar.svg deleted file mode 100644 index 1206b7e..0000000 --- a/cfg/awesome/assets/dock-pinned/thunar.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/cfg/awesome/assets/icons/gear-solid.svg b/cfg/awesome/assets/icons/gear-solid.svg deleted file mode 100644 index 9a64fbd..0000000 --- a/cfg/awesome/assets/icons/gear-solid.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/cfg/awesome/assets/icons/rocket.svg b/cfg/awesome/assets/icons/rocket.svg deleted file mode 100755 index a231656..0000000 --- a/cfg/awesome/assets/icons/rocket.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/cfg/awesome/assets/menu.png b/cfg/awesome/assets/menu.png deleted file mode 100644 index bd41da2..0000000 Binary files a/cfg/awesome/assets/menu.png and /dev/null differ diff --git a/cfg/awesome/assets/picom/picom.conf b/cfg/awesome/assets/picom/picom.conf deleted file mode 100644 index 7513ff5..0000000 --- a/cfg/awesome/assets/picom/picom.conf +++ /dev/null @@ -1,77 +0,0 @@ -#no-dnd-shadow = true; -#no-dock-shadow = true; -shadow = true; - -shadow-radius = 10; -shadow-offset-x = -10; -shadow-offset-y = -10; -shadow-opacity = 0.35; -shadow-red = 0.0; -shadow-green = 0.0; -shadow-blue = 0.0; - -shadow-exclude = [ -# "name = 'Dunst'", - "class_g = 'Plank'", - "class_g ?= 'Notify-osd'", - "class_g = 'spectrwm'", - "class_g = 'dmenu'", - "class_g = 'Easystroke'", - "class_g = 'Rofi'", - "class_g = 'GLava'", - "class_g = '_HERBST_FRAME'", -# "!_NET_WM_STATE@:a *= 'ABOVE'", -# "!focused", - #"_GTK_FRAME_EXTENTS@:c" - ]; - -transition = true; -transition-offset = 25; -transition-direction = "smart-x"; -transition-timing-function = "ease-out-cubic"; -transition-step = 0.028; -transition-rule = []; -fading = true; -fade-delta = 4; -fade-in-step = 0.05; -fade-out-step = 0.05; -shadow-ignore-shaped = false; -frame-opacity = 1.0; -inactive-opacity-override = false; -opacity-rule = [ - "10:class_g = 'Bspwm'", - "10:class_i = 'presel_feedback'", - "35:class_g = 'eww-powermenu-close'", - ]; - -wintypes : -{ - popup_menu = - { - opacity = 1.0; - }; - dropdown_menu = - { - opacity = 1.0 - }; - dnd = - { - shadow = false; - }; - dock = - { - shadow = true; - }; - tooltip = - { - fade = true; - shadow = true; - opacity = 1.0; - focus = true; - }; -}; - -corner-radius = 7; -rounded-corners-exclude = [ - "class_g = 'awesome'", -]; diff --git a/cfg/awesome/assets/shapes/triangle.png b/cfg/awesome/assets/shapes/triangle.png deleted file mode 100755 index 8e60ca0..0000000 Binary files a/cfg/awesome/assets/shapes/triangle.png and /dev/null differ diff --git a/cfg/awesome/assets/titlebar/circle.png b/cfg/awesome/assets/titlebar/circle.png deleted file mode 100644 index 8dd5153..0000000 Binary files a/cfg/awesome/assets/titlebar/circle.png and /dev/null differ diff --git a/cfg/awesome/assets/titlebar/square.png b/cfg/awesome/assets/titlebar/square.png deleted file mode 100644 index b41c743..0000000 Binary files a/cfg/awesome/assets/titlebar/square.png and /dev/null differ diff --git a/cfg/awesome/assets/titlebar/triangle.png b/cfg/awesome/assets/titlebar/triangle.png deleted file mode 100644 index 60e8ebc..0000000 Binary files a/cfg/awesome/assets/titlebar/triangle.png and /dev/null differ diff --git a/cfg/awesome/assets/wallpaper.png b/cfg/awesome/assets/wallpaper.png deleted file mode 100644 index d7f6d6d..0000000 Binary files a/cfg/awesome/assets/wallpaper.png and /dev/null differ diff --git a/cfg/awesome/autostart.lua b/cfg/awesome/autostart.lua deleted file mode 100644 index d2b8160..0000000 --- a/cfg/awesome/autostart.lua +++ /dev/null @@ -1,12 +0,0 @@ --- autostart, just runs `autostart.sh` - -local awful = require "awful" -local gfs = require "gears.filesystem" - -local sh_path = gfs.get_configuration_dir() .. "assets/autostart.sh" - -local function load_autostart() - awful.spawn("bash " .. sh_path) -end - -load_autostart() \ No newline at end of file diff --git a/cfg/awesome/bling/.editorconfig b/cfg/awesome/bling/.editorconfig deleted file mode 100644 index 33997d4..0000000 --- a/cfg/awesome/bling/.editorconfig +++ /dev/null @@ -1,24 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = tab -trim_trailing_whitespace = true - -[*.lua] -indent_size = 4 -indent_style = space -max_line_length = 80 - -[*.yml] -indent_size = 2 -indent_style = space - -[*.{html,css}] -indent_size = 2 -indent_style = space - -[*.md] -trim_trailing_whitespace = false diff --git a/cfg/awesome/bling/AUTHORS.md b/cfg/awesome/bling/AUTHORS.md deleted file mode 100644 index 471cad5..0000000 --- a/cfg/awesome/bling/AUTHORS.md +++ /dev/null @@ -1,10 +0,0 @@ -The following developers have contributed major code to bling: - - * [Nooo37](https://github.com/Nooo37) - * [JavaCafe01](https://github.com/JavaCafe01) - * [Grumph](https://github.com/Grumph) - * [Bysmutheye](https://github.com/Bysmutheye) - * [HumblePresent](https://github.com/HumblePresent) - * [Kasper24](https://github.com/Kasper24) - * [undefinedDarkness](https://github.com/undefinedDarkness) - * [eylles](https://github.com/eylles) diff --git a/cfg/awesome/bling/CODEOWNERS b/cfg/awesome/bling/CODEOWNERS deleted file mode 100644 index 50f5c5c..0000000 --- a/cfg/awesome/bling/CODEOWNERS +++ /dev/null @@ -1,2 +0,0 @@ -/module/* @Nooo37 -/widget/* @JavaCafe01 diff --git a/cfg/awesome/bling/LICENSE b/cfg/awesome/bling/LICENSE deleted file mode 100644 index f8bc52d..0000000 --- a/cfg/awesome/bling/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2021 BlingCorp - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/cfg/awesome/bling/README.md b/cfg/awesome/bling/README.md deleted file mode 100644 index fd46651..0000000 --- a/cfg/awesome/bling/README.md +++ /dev/null @@ -1,41 +0,0 @@ -

- -

-

- -All documentation, instructions, and previews are [here](https://blingcorp.github.io/bling/). - -## Features - -- Layouts - - mstab (master-slave tab layout) - - centered - - vertical - - horizontal - - equalarea -- Modules - - Flash Focus - - Tabbed container - - Tiled Wallpaper - - Wallpaper Easy Setup - - Window Swallowing - - Scratchpad -- Signals - - Playerctl -- Widgets - - Tag Preview - - Task Preview - -All naming credit goes to [JavaCafe01](https://github.com/JavaCafe01). - -### Dependencies - -In order to use the `tabbed` modules `pick` function, you need to install `xwininfo`. - -## Contributing - -Contributions are welcome 💛 - -Before requesting changes, makes sure that your editor has an "editorconfig" extension installed, this will use our code style everytime when you edit in the `bling` folder. - -When adding a layout/module/signal/widget, please add theme variables for customization and add the according documentation under `docs`. diff --git a/cfg/awesome/bling/bling-dev-1.rockspec b/cfg/awesome/bling/bling-dev-1.rockspec deleted file mode 100644 index 575d3f0..0000000 --- a/cfg/awesome/bling/bling-dev-1.rockspec +++ /dev/null @@ -1,63 +0,0 @@ -package = "bling" -version = "dev-1" - -source = { - url = "git://github.com/BlingCorp/bling", - branch = "master", -} - -description = { - summary = "Utilities for the AwesomeWM", - detailed = [[ - This module extends the Awesome window manager with alternative layouts, - flash focus, tabbing, a simple tiling wallpaper generator, a declarative - wallpaper setter, window swallowing and a playerctl signal. - ]], - homepage = "https://github.com/BlingCorp/bling", - license = "MIT", -} - -dependencies = { - "lua >= 5.1", -} - -build = { - type = "builtin", - modules = { - ["bling"] = "init.lua", - ["bling.helpers"] = "helpers/init.lua", - ["bling.helpers.client"] = "helpers/client.lua", - ["bling.helpers.color"] = "helpers/color.lua", - ["bling.helpers.filesystem"] = "helpers/filesystem.lua", - ["bling.helpers.shape"] = "helpers/shape.lua", - ["bling.helpers.time"] = "helpers/time.lua", - ["bling.layout"] = "layout/init.lua", - ["bling.layout.centered"] = "layout/centered.lua", - ["bling.layout.deck"] = "layout/deck.lua", - ["bling.layout.equalarea"] = "layout/equalarea.lua", - ["bling.layout.horizontal"] = "layout/horizontal.lua", - ["bling.layout.mstab"] = "layout/mstab.lua", - ["bling.layout.vertical"] = "layout/vertical.lua", - ["bling.module"] = "module/init.lua", - ["bling.module.flash_focus"] = "module/flash_focus.lua", - ["bling.module.scratchpad"] = "module/scratchpad.lua", - ["bling.module.tabbed"] = "module/tabbed.lua", - ["bling.module.tiled_wallpaper"] = "module/tiled_wallpaper.lua", - ["bling.module.wallpaper"] = "module/wallpaper.lua", - ["bling.module.window_swallowing"] = "module/window_swallowing.lua", - ["bling.signal"] = "signal/init.lua", - ["bling.signal.playerctl"] = "signal/playerctl/init.lua", - ["bling.signal.playerctl.playerctl_cli"] = "signal/playerctl/playerctl_cli.lua", - ["bling.signal.playerctl.playerctl_lib"] = "signal/playerctl/playerctl_lib.lua", - ["bling.widget"] = "widget/init.lua", - ["bling.widget.tabbar.boxes"] = "widget/tabbar/boxes.lua", - ["bling.widget.tabbar.default"] = "widget/tabbar/default.lua", - ["bling.widget.tabbar.modern"] = "widget/tabbar/modern.lua", - ["bling.widget.tabbed_misc"] = "widget/tabbed_misc/init.lua", - ["bling.widget.tabbed_misc.custom_tasklist"] = "widget/tabbed_misc/custom_tasklist.lua", - ["bling.widget.tabbed_misc.titlebar_indicator"] = "widget/tabbed_misc/titlebar_indicator.lua", - ["bling.widget.tag_preview"] = "widget/tag_preview.lua", - ["bling.widget.task_preview"] = "widget/task_preview.lua", - ["bling.widget.window_switcher"] = "widget/window_switcher.lua", - }, -} diff --git a/cfg/awesome/bling/docs/.nojekyll b/cfg/awesome/bling/docs/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/cfg/awesome/bling/docs/_sidebar.md b/cfg/awesome/bling/docs/_sidebar.md deleted file mode 100644 index 9216d34..0000000 --- a/cfg/awesome/bling/docs/_sidebar.md +++ /dev/null @@ -1,23 +0,0 @@ -- [Home](home.md) - -- [Layouts](layouts/layout.md) - -- Modules - - [Flash Focus](module/flash.md) - - [Tabbed](module/tabbed.md) - - [Tiled Wallpaper](module/twall.md) - - [Wallpaper Easy Setup](module/wall.md) - - [Window Swallowing](module/swal.md) - - [Scratchpad](module/scratch.md) - -- Signals - - [Playerctl](signals/pctl.md) - -- Widgets - - [Tag Preview](widgets/tag_preview.md) - - [Task Preview](widgets/task_preview.md) - - [Tabbed Misc](widgets/tabbed_misc.md) - - [Window Switcher](widgets/window_switcher.md) - -- Extra - - [Theme Variable Template](theme.md) diff --git a/cfg/awesome/bling/docs/home.md b/cfg/awesome/bling/docs/home.md deleted file mode 100644 index 6a35a11..0000000 --- a/cfg/awesome/bling/docs/home.md +++ /dev/null @@ -1,34 +0,0 @@ -#
🌟 Bling - Utilities for AwesomeWM 🌟
- -## Why - -[AwesomeWM](https://awesomewm.org/) is literally what it stands for, an awesome window manager. - -Its unique selling point has always been the widget system, which allows for fancy buttons, sliders, bars, dashboards and anything you can imagine. But that feature can be a curse. Most modules focus on the widget side of things which leave the actual window managing part of AwesomeWM underdeveloped compared to, for example, [xmonad](https://xmonad.org/) even though it's probably just as powerfull in that area. - -This project focuses on that problem - adding new layouts and modules that make use of the widget system, but primarily focus on the new window managing features. - -## Installation -- clone this repo into your `~/.config/awesome` folder - - `git clone https://github.com/BlingCorp/bling.git ~/.config/awesome/bling` -- require the module in your `rc.lua`, and make sure it's under the beautiful module initialization - -```lua --- other imports - -local beautiful = require("beautiful") - --- other configuration stuff here - -beautiful.init("some_theme.lua") -local bling = require("bling") -``` - -## Contributors -A special thanks to all our contributors... - - - - - -Made with [contributors-img](https://contrib.rocks). diff --git a/cfg/awesome/bling/docs/index.html b/cfg/awesome/bling/docs/index.html deleted file mode 100644 index ea8d732..0000000 --- a/cfg/awesome/bling/docs/index.html +++ /dev/null @@ -1,28 +0,0 @@ - - - - - Bling Docs - - - - - - - -
- - - - - - diff --git a/cfg/awesome/bling/docs/javacafe.css b/cfg/awesome/bling/docs/javacafe.css deleted file mode 100644 index 18962da..0000000 --- a/cfg/awesome/bling/docs/javacafe.css +++ /dev/null @@ -1,1069 +0,0 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto+Mono|Source+Sans+Pro:300,400,600"); - -* { - -webkit-font-smoothing: antialiased; - -webkit-overflow-scrolling: touch; - -webkit-tap-highlight-color: #ffffff; - -webkit-text-size-adjust: none; - -webkit-touch-callout: none; - box-sizing: border-box; -} - -body:not(.ready) { - overflow: hidden; -} - -body:not(.ready) [data-cloak], -body:not(.ready) .app-nav, -body:not(.ready) > nav { - display: none; -} - -::-webkit-scrollbar, -::-webkit-scrollbar-track, -::-webkit-scrollbar-track-piece { - background: transparent !important; - -webkit-box-shadow: none !important; - -moz-box-shadow: none !important; - box-shadow: none !important; - border: none !important; - width: 8px !important; -} -::-webkit-scrollbar-thumb { - background:#29343d !important; - width:8px !important; - border: none !important; - border-radius: 2px !important; -} - - -div#app { - font-size: 30px; - font-weight: lighter; - margin: 40vh auto; - text-align: center; -} - -div#app:empty::before { - content: 'Loading...'; -} - -.emoji { - height: 1.2rem; - vertical-align: middle; -} - -.progress { - background-color: var(--theme-color, #7ed491); - height: 2px; - left: 0px; - position: fixed; - right: 0px; - top: 0px; - transition: width 0.2s, opacity 0.4s; - width: 0%; - z-index: 999999; -} - -.search a:hover { - color: var(--theme-color, #7ed491); -} - -.search .search-keyword { - color: var(--theme-color, #7ed491); - font-style: normal; - font-weight: bold; -} - -html, -body { - height: 100%; -} - -body { - -moz-osx-font-smoothing: grayscale; - -webkit-font-smoothing: antialiased; - color: #34495e; - font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; - font-size: 15px; - letter-spacing: 0; - margin: 0; - overflow-x: hidden; -} - -img { - max-width: 65%; -} - -a[disabled] { - cursor: not-allowed; - opacity: 0.6; -} - -kbd { - border: solid 1px #ccc; - border-radius: 3px; - display: inline-block; - font-size: 12px !important; - line-height: 12px; - margin-bottom: 3px; - padding: 3px 5px; - vertical-align: middle; -} - -li input[type='checkbox'] { - margin: 0 0.2em 0.25em 0; - vertical-align: middle; -} - -.app-nav { - margin: 25px 60px 0 0; - position: absolute; - right: 0; - text-align: right; - z-index: 10; -/* navbar dropdown */ -} - -.app-nav.no-badge { - margin-right: 25px; -} - -.app-nav p { - margin: 0; -} - -.app-nav > a { - margin: 0 1rem; - padding: 5px 0; -} - -.app-nav ul, -.app-nav li { - display: inline-block; - list-style: none; - margin: 0; -} - -.app-nav a { - color: inherit; - font-size: 16px; - text-decoration: none; - transition: color 0.3s; -} - -.app-nav a:hover { - color: var(--theme-color, #7ed491); -} - -.app-nav a.active { - border-bottom: 2px solid var(--theme-color, #7ed491); - color: var(--theme-color, #7ed491); -} - -.app-nav li { - display: inline-block; - margin: 0 1rem; - padding: 5px 0; - position: relative; - cursor: pointer; -} - -.app-nav li ul { - background-color: #fff; - border: 1px solid #ddd; - border-bottom-color: #ccc; - border-radius: 4px; - box-sizing: border-box; - display: none; - max-height: calc(100vh - 61px); - overflow-y: auto; - padding: 10px 0; - position: absolute; - right: -15px; - text-align: left; - top: 100%; - white-space: nowrap; -} - -.app-nav li ul li { - display: block; - font-size: 14px; - line-height: 1rem; - margin: 0; - margin: 8px 14px; - white-space: nowrap; -} - -.app-nav li ul a { - display: block; - font-size: inherit; - margin: 0; - padding: 0; -} - -.app-nav li ul a.active { - border-bottom: 0; -} - -.app-nav li:hover ul { - display: block; -} - -.github-corner { - border-bottom: 0; - position: fixed; - right: 0; - text-decoration: none; - top: 0; - z-index: 1; -} - -.github-corner:hover .octo-arm { - -webkit-animation: octocat-wave 560ms ease-in-out; - animation: octocat-wave 560ms ease-in-out; -} - -.github-corner svg { - color: #fff; - fill: var(--theme-color, #7ed491); - height: 80px; - width: 80px; -} - -main { - display: block; - position: relative; - width: 100vw; - height: 100%; - z-index: 0; -} - -main.hidden { - display: none; -} - -.anchor { - display: inline-block; - text-decoration: none; - transition: all 0.3s; -} - -.anchor span { - color: #FFFFFF; -} - -.anchor:hover { - text-decoration: underline; -} - -.sidebar { - border-right: 1px solid rgba(0,0,0,0.07); - overflow-y: auto; - padding: 40px 0 0; - position: absolute; - top: 0; - bottom: 0; - left: 0; - transition: transform 250ms ease-out; - width: 300px; - z-index: 20; -} - -.sidebar > h1 { - margin: 0 auto 1rem; - font-size: 1.5rem; - font-weight: 300; - text-align: center; -} - -.sidebar > h1 a { - color: inherit; - text-decoration: none; -} - -.sidebar > h1 .app-nav { - display: block; - position: static; -} - -.sidebar .sidebar-nav { - line-height: 2em; - padding-bottom: 40px; -} - -.sidebar li.collapse .app-sub-sidebar { - display: none; -} - -.sidebar ul { - margin: 0 0 0 15px; - padding: 0; -} - -.sidebar li > p { - font-weight: 700; - margin: 0; -} - -.sidebar ul, -.sidebar ul li { - list-style: none; -} - -.sidebar ul li a { - border-bottom: none; - display: block; -} - -.sidebar ul li ul { - padding-left: 20px; -} - -.sidebar::-webkit-scrollbar { - width: 4px; -} - -.sidebar::-webkit-scrollbar-thumb { - background: transparent; - border-radius: 4px; -} - -.sidebar:hover::-webkit-scrollbar-thumb { - background: rgba(136,136,136,0.4); -} - -.sidebar:hover::-webkit-scrollbar-track { - background: rgba(136,136,136,0.1); -} - -.sidebar-toggle { - background-color: transparent; - background-color: #1a2026; - border: 0; - outline: none; - padding: 10px; - position: absolute; - bottom: 0; - left: 0; - text-align: center; - transition: opacity 0.3s; - width: 284px; - z-index: 30; - cursor: pointer; -} - -.sidebar-toggle:hover .sidebar-toggle-button { - opacity: 0.4; -} - -.sidebar-toggle span { - background-color: var(--theme-color, #7ed491); - display: block; - margin-bottom: 4px; - width: 16px; - height: 2px; -} - -body.sticky .sidebar, -body.sticky .sidebar-toggle { - position: fixed; -} - -.content { - padding-top: 60px; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 300px; - transition: left 250ms ease; -} - -.markdown-section { - margin: 0 auto; - max-width: 80%; - padding: 30px 15px 40px 15px; - position: relative; -} - -.markdown-section > * { - box-sizing: border-box; - font-size: inherit; -} - -.markdown-section > :first-child { - margin-top: 0 !important; -} - -.markdown-section hr { - border: none; - border-bottom: 1px solid #eee; - margin: 2em 0; -} - -.markdown-section iframe { - border: 1px solid #eee; -/* fix horizontal overflow on iOS Safari */ - width: 1px; - min-width: 100%; -} - -.markdown-section table { - border-collapse: collapse; - border-spacing: 0; - display: block; - margin-bottom: 1rem; - overflow: auto; - width: 100%; -} - -.markdown-section th { - border: 1px solid #29343d; - color: #9fb4c4; - background-color: #13181c; - font-weight: bold; - padding: 6px 13px; -} - -.markdown-section td { - border: 1px solid #29343d; - color: #9fb4c4; - background-color: #13181c; - padding: 6px 13px; -} - -.markdown-section tr { - border-top: 1px solid #303436; -} - -.markdown-section tr:nth-child(2n) { - background-color: #FFFFFF; -} - -.markdown-section p.tip { - background-color: #f8f8f8; - border-bottom-right-radius: 2px; - border-left: 4px solid #f66; - border-top-right-radius: 2px; - margin: 2em 0; - padding: 12px 24px 12px 30px; - position: relative; -} - -.markdown-section p.tip:before { - background-color: #f66; - border-radius: 100%; - color: #fff; - content: '!'; - font-family: 'Dosis', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; - font-size: 14px; - font-weight: bold; - left: -12px; - line-height: 20px; - position: absolute; - height: 20px; - width: 20px; - text-align: center; - top: 14px; -} - -.markdown-section p.tip code { - background-color: #eaeaea; -} - -.markdown-section p.tip em { - color: #eaeaea; -} - -.markdown-section p.warn { - background: #eaeaea; - border-radius: 2px; - padding: 1rem; -} - -.markdown-section ul.task-list > li { - list-style-type: none; -} - -body.close .sidebar { - transform: translateX(-300px); -} - -body.close .sidebar-toggle { - width: auto; -} - -body.close .content { - left: 0; -} - -@media print { - .github-corner, - .sidebar-toggle, - .sidebar, - .app-nav { - display: none; - } -} - -@media screen and (max-width: 768px) { - .github-corner, - .sidebar-toggle, - .sidebar { - position: fixed; - } - - .app-nav { - margin-top: 16px; - } - - .app-nav li ul { - top: 30px; - } - - main { - height: auto; - overflow-x: hidden; - } - - .sidebar { - left: -300px; - transition: transform 250ms ease-out; - } - - .content { - left: 0; - max-width: 100vw; - position: static; - padding-top: 20px; - transition: transform 250ms ease; - } - - .app-nav, - .github-corner { - transition: transform 250ms ease-out; - } - - .sidebar-toggle { - background-color: transparent; - width: auto; - padding: 30px 30px 10px 10px; - } - - body.close .sidebar { - transform: translateX(300px); - } - - body.close .sidebar-toggle { - background-color: rgba(255,255,255,0.8); - transition: 1s background-color; - width: 284px; - padding: 10px; - } - - body.close .content { - transform: translateX(300px); - } - - body.close .app-nav, - body.close .github-corner { - display: none; - } - - .github-corner:hover .octo-arm { - -webkit-animation: none; - animation: none; - } - - .github-corner .octo-arm { - -webkit-animation: octocat-wave 560ms ease-in-out; - animation: octocat-wave 560ms ease-in-out; - } -} - -@-webkit-keyframes octocat-wave { - 0%, 100% { - transform: rotate(0); - } - 20%, 60% { - transform: rotate(-25deg); - } - 40%, 80% { - transform: rotate(10deg); - } -} - -@keyframes octocat-wave { - 0%, 100% { - transform: rotate(0); - } - 20%, 60% { - transform: rotate(-25deg); - } - 40%, 80% { - transform: rotate(10deg); - } -} - -section.cover { - align-items: center; - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - height: 100vh; - width: 100vw; - display: none; -} - -section.cover.show { - display: flex; -} - -section.cover.has-mask .mask { - background-color: #fff; - opacity: 0.8; - position: absolute; - top: 0; - height: 100%; - width: 100%; -} - -section.cover .cover-main { - flex: 1; - margin: -20px 16px 0; - text-align: center; - position: relative; -} - -section.cover a { - color: inherit; - text-decoration: none; -} - -section.cover a:hover { - text-decoration: none; -} - -section.cover p { - line-height: 1.5rem; - margin: 1em 0; -} - -section.cover h1 { - color: inherit; - font-size: 2.5rem; - font-weight: 300; - margin: 0.625rem 0 2.5rem; - position: relative; - text-align: center; -} - -section.cover h1 a { - display: block; -} - -section.cover h1 small { - bottom: -0.4375rem; - font-size: 1rem; - position: absolute; -} - -section.cover blockquote { - font-size: 1.5rem; - text-align: center; -} - -section.cover ul { - line-height: 1.8; - list-style-type: none; - margin: 1em auto; - max-width: 500px; - padding: 0; -} - -section.cover .cover-main > p:last-child a { - border-color: var(--theme-color, #7ed491); - border-radius: 2rem; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - color: var(--theme-color, #7ed491); - display: inline-block; - font-size: 1.05rem; - letter-spacing: 0.1rem; - margin: 0.5rem 1rem; - padding: 0.75em 2rem; - text-decoration: none; - transition: all 0.15s ease; -} - -section.cover .cover-main > p:last-child a:last-child { - background-color: var(--theme-color, #7ed491); - color: #fff; -} - -section.cover .cover-main > p:last-child a:last-child:hover { - color: inherit; - opacity: 0.8; -} - -section.cover .cover-main > p:last-child a:hover { - color: inherit; -} - -section.cover blockquote > p > a { - border-bottom: 2px solid var(--theme-color, #7ed491); - transition: color 0.3s; -} - -section.cover blockquote > p > a:hover { - color: var(--theme-color, #7ed491); -} - -body { - background-color: #181e24; -} - -/* sidebar */ -.sidebar { - background-color: #1a2026; - color: #fff; -} - -.sidebar > h1 a { - font-weight: bold; -} - -.sidebar li { - margin: 6px 0 6px 0; -} - -.sidebar ul li a { - color: #eaeaea; - font-size: 14px; - font-weight: normal; - overflow: hidden; - text-decoration: none; - text-overflow: ellipsis; - white-space: nowrap; -} - -.sidebar ul li a:hover { - text-decoration: underline; -} - -.sidebar ul li ul { - padding: 0; -} - -.sidebar ul li.active > a { - border-right: 2px solid; - color: var(--theme-color, #7ed491); - font-weight: 600; -} - -.app-sub-sidebar li::before { - content: '-'; - padding-right: 4px; - float: left; -} - -/* markdown content found on pages */ -.markdown-section h1, -.markdown-section h2, -.markdown-section h3, -.markdown-section h4, -.markdown-section strong { - color: #eaeaea; - font-weight: 600; -} - -.markdown-section a { - color: var(--theme-color, #7ed491); - font-weight: 600; -} - -.markdown-section h1 { - font-size: 2rem; - margin: 0 0 1rem; -} - -.markdown-section h2 { - font-size: 1.75rem; - margin: 45px 0 0.8rem; -} - -.markdown-section h3 { - font-size: 1.5rem; - margin: 40px 0 0.6rem; -} - -.markdown-section h4 { - font-size: 1.25rem; -} - -.markdown-section h5 { - font-size: 1rem; -} - -.markdown-section h6 { - color: #777; - font-size: 1rem; -} - -.markdown-section figure, -.markdown-section p { - margin: 1.2em 0; -} - -.markdown-section p, -.markdown-section ul, -.markdown-section ol { - line-height: 1.6rem; - word-spacing: 0.05rem; -} - -.markdown-section ul, -.markdown-section ol { - padding-left: 1.5rem; -} - -.markdown-section blockquote { - border-left: 4px solid var(--theme-color, #7ed491); - color: #858585; - margin: 2em 0; - padding-left: 20px; -} - -.markdown-section blockquote p { - font-weight: 600; - margin-left: 0; -} - -.markdown-section iframe { - margin: 1em 0; -} - -.markdown-section em { - color: #7f8c8d; -} - -.markdown-section code, -.markdown-section pre, -.markdown-section output::after { - font-family: 'Roboto Mono', Monaco, courier, monospace; -} - -.markdown-section code, -.markdown-section pre { - color: #575D74; - background-color: #13181c -} - -.markdown-section pre, -.markdown-section output { - margin: 1.2em 0; - position: relative; -} - -.markdown-section pre > code, -.markdown-section output { - border-radius: 2px; - display: block; -} - -.markdown-section pre > code, -.markdown-section output::after { - -moz-osx-font-smoothing: initial; - -webkit-font-smoothing: initial; -} - -.markdown-section code { - border-radius: 2px; - color: #3b4b58 - margin: 0 2px; - padding: 3px 5px; - white-space: pre-wrap; -} - -.markdown-section > :not(h1):not(h2):not(h3):not(h4):not(h5):not(h6) code { - font-size: 0.8rem; -} - -.markdown-section pre { - padding: 0 1.4rem; - line-height: 1.5rem; - overflow: auto; - word-wrap: normal; -} - -.markdown-section pre > code { - color: #eaeaea; - font-size: 0.8rem; - padding: 2.2em 5px; - line-height: inherit; - margin: 0 2px; - max-width: inherit; - overflow: inherit; - white-space: inherit; -} - -.markdown-section output { - padding: 1.7rem 1.4rem; - border: 1px dotted #ccc; -} - -.markdown-section output > :first-child { - margin-top: 0; -} - -.markdown-section output > :last-child { - margin-bottom: 0; -} - -.markdown-section code::after, -.markdown-section code::before, -.markdown-section output::after, -.markdown-section output::before { - letter-spacing: 0.05rem; -} - -.markdown-section pre::after, -.markdown-section output::after { - color: #ccc; - font-size: 0.6rem; - font-weight: 600; - height: 15px; - line-height: 15px; - padding: 5px 10px 0; - position: absolute; - right: 0; - text-align: right; - top: 0; -} - -.markdown-section pre::after, -.markdown-section output::after { - content: attr(data-lang); -} - -.markdown-section p, .markdown-section ul, .markdown-section ol { - color: #eaeaea; -} - -/* code highlight */ -.token.comment { - color: #575D74; -} - -.token.prolog, -.token.doctype, -.token.cdata { - color: #8e908c; -} - -.token.namespace { - opacity: 0.7; -} - -.token.boolean { - color: #FCC5A3 -} - -.token.number { - color: #FCC5A3; -} - -.token.punctuation { - color: #fca3ab; -} - -.token.property { - color: #d7c1ed; -} - -.token.tag { - color: #2973b7; -} - -.token.string { - color: var(--theme-color, #93cfab); -} - -.token.selector { - color: #6679cc; -} - -.token.attr-name { - color: #2973b7; -} - -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: #22a2c9; -} - -.token.attr-value, -.token.control, -.token.directive, -.token.unit { - color: var(--theme-color, #7ed491); -} - -.token.keyword { - color: #d7c1ed -} - -.token.function { - color: #bac8ef; -} - -.token.statement { - color: #fca2aa; -} - -.token.regex, -.token.atrule { - color: #22a2c9; -} - -.token.placeholder, -.token.variable { - color: #3d8fd1; -} - -.token.deleted { - text-decoration: line-through; -} - -.token.inserted { - border-bottom: 1px dotted #202746; - text-decoration: none; -} - -.token.italic { - font-style: italic; -} - -.token.bold { - font-weight: bold; -} - -.token.important { - color: #ccaced; -} - -.token.entity { - cursor: help; -} - -code .token { - -moz-osx-font-smoothing: initial; - -webkit-font-smoothing: initial; - min-height: 1.5rem; - position: relative; - left: auto; -} \ No newline at end of file diff --git a/cfg/awesome/bling/docs/layouts/layout.md b/cfg/awesome/bling/docs/layouts/layout.md deleted file mode 100644 index 85fc547..0000000 --- a/cfg/awesome/bling/docs/layouts/layout.md +++ /dev/null @@ -1,65 +0,0 @@ -## 📎 Layouts - -Choose layouts from the list below and add them to to your `awful.layouts` list in your `rc.lua`. - -Everyone of them supports multiple master clients and master width factor making them easy to use. - -The mstab layout uses the tab theme from the tabbed module. - -```lua -bling.layout.mstab -bling.layout.centered -bling.layout.vertical -bling.layout.horizontal -bling.layout.equalarea -bling.layout.deck -``` - -### Theme Variables - -```lua --- mstab -theme.mstab_bar_disable = false -- disable the tabbar -theme.mstab_bar_ontop = false -- whether you want to allow the bar to be ontop of clients -theme.mstab_dont_resize_slaves = false -- whether the tabbed stack windows should be smaller than the - -- currently focused stack window (set it to true if you use - -- transparent terminals. False if you use shadows on solid ones -theme.mstab_bar_padding = "default" -- how much padding there should be between clients and your tabbar - -- by default it will adjust based on your useless gaps. - -- If you want a custom value. Set it to the number of pixels (int) -theme.mstab_border_radius = 0 -- border radius of the tabbar -theme.mstab_bar_height = 40 -- height of the tabbar -theme.mstab_tabbar_position = "top" -- position of the tabbar (mstab currently does not support left,right) -theme.mstab_tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") - -- defaults to the tabbar_style so only change if you want a - -- different style for mstab and tabbed -``` - -### Previews - -#### Mstab (dynamic tabbing layout) - -![](https://imgur.com/HZRgApE.png) - -*screenshot by [JavaCafe01](https://github.com/JavaCafe01)* - -#### Centered - -![](https://media.discordapp.net/attachments/769673106842845194/780095998239834142/unknown.png) - -*screenshot by [HeavyRain266](https://github.com/HeavyRain266)* - -#### Equal area - -![](https://imgur.com/JCFFywv.png) - -*screenshot by [bysmutheye](https://github.com/bysmutheye)* - -#### Deck - -The left area shows the deck layout in action. In this screenshot it is used together with [layout machi](https://github.com/xinhaoyuan/layout-machi) and its sublayout support. - -![](https://cdn.discordapp.com/attachments/635625954219261982/877957824225894430/unknown.png) - -*screenshot by [JavaCafe01](https://github.com/JavaCafe01)* - diff --git a/cfg/awesome/bling/docs/module/flash.md b/cfg/awesome/bling/docs/module/flash.md deleted file mode 100644 index a12b78d..0000000 --- a/cfg/awesome/bling/docs/module/flash.md +++ /dev/null @@ -1,33 +0,0 @@ -## đŸ”Ļ Flash Focus - -Flash focus does an opacity animation effect on a client when it is focused. - - -### Usage - -There are two ways in which you can use this module. You can enable it by calling the `enable()` function: -```lua -bling.module.flash_focus.enable() -``` -This connects to the focus signal of a client, which means that the flash focus will activate however you focus the client. - -The other way is to call the function itself like this: `bling.module.flash_focus.flashfocus(someclient)`. This allows you to activate on certain keybinds like so: -```lua -awful.key({modkey}, "Up", - function() - awful.client.focus.bydirection("up") - bling.module.flash_focus.flashfocus(client.focus) - end, {description = "focus up", group = "client"}) -``` - -### Theme Variables -```lua -theme.flash_focus_start_opacity = 0.6 -- the starting opacity -theme.flash_focus_step = 0.01 -- the step of animation -``` - -### Preview - -![](https://imgur.com/5txYrlV.gif) - -*gif by [JavaCafe01](https://github.com/JavaCafe01)* diff --git a/cfg/awesome/bling/docs/module/scratch.md b/cfg/awesome/bling/docs/module/scratch.md deleted file mode 100644 index 54f8ddd..0000000 --- a/cfg/awesome/bling/docs/module/scratch.md +++ /dev/null @@ -1,75 +0,0 @@ -## 🍃 Scratchpad - -An easy way to create multiple scratchpads. - -### A... what? - -You can think about a scratchpad as a window whose visibility can be toggled, but still runs in the background without being visible (or minimized) most of the time. Many people use it to have one terminal in which to perform minor tasks, but it is the most useful for windows which only need a couple seconds in between your actual activity, such as music players or chat applications. - -### Rubato Animation Support - -#### Awestore is now deprecated from Bling, we are switching to Rubato. - -Please go over to the [rubato](https://github.com/andOrlando/rubato) repository for installation instructions. Give it a star as well! The animations are completely optional, and if you choose not to use it, you do not need rubato installed. - -### Usage - -To initalize a scratchpad you can do something like the following: - -```lua -local bling = require("bling") -local rubato = require("rubato") -- Totally optional, only required if you are using animations. - --- These are example rubato tables. You can use one for just y, just x, or both. --- The duration and easing is up to you. Please check out the rubato docs to learn more. -local anim_y = rubato.timed { - pos = 1090, - rate = 60, - easing = rubato.quadratic, - intro = 0.1, - duration = 0.3, - awestore_compat = true -- This option must be set to true. -} - -local anim_x = rubato.timed { - pos = -970, - rate = 60, - easing = rubato.quadratic, - intro = 0.1, - duration = 0.3, - awestore_compat = true -- This option must be set to true. -} - -local term_scratch = bling.module.scratchpad { - command = "wezterm start --class spad", -- How to spawn the scratchpad - rule = { instance = "spad" }, -- The rule that the scratchpad will be searched by - sticky = true, -- Whether the scratchpad should be sticky - autoclose = true, -- Whether it should hide itself when losing focus - floating = true, -- Whether it should be floating (MUST BE TRUE FOR ANIMATIONS) - geometry = {x=360, y=90, height=900, width=1200}, -- The geometry in a floating state - reapply = true, -- Whether all those properties should be reapplied on every new opening of the scratchpad (MUST BE TRUE FOR ANIMATIONS) - dont_focus_before_close = false, -- When set to true, the scratchpad will be closed by the toggle function regardless of whether its focused or not. When set to false, the toggle function will first bring the scratchpad into focus and only close it on a second call - rubato = {x = anim_x, y = anim_y} -- Optional. This is how you can pass in the rubato tables for animations. If you don't want animations, you can ignore this option. -} -``` - -Once initalized, you can use the object (which in this case is named `term_scratch`) like this: - -```lua -term_scratch:toggle() -- toggles the scratchpads visibility -term_scratch:turn_on() -- turns the scratchpads visibility on -term_scratch:turn_off() -- turns the scratchpads visibility off -``` - -You can also connect to signals as you are used to for further customization. For example like that: - -```lua -term_scratch:connect_signal("turn_on", function(c) naughty.notify({title = "Turned on!"}) end) -``` - -The following signals are currently available. `turn_on`, `turn_off` and `inital_apply` pass the client on which they operated as an argument: - -- `turn_on` fires when the scratchpad is turned on on a tag that it wasn't present on before -- `turn_off` fires when the scratchpad is turned off on a tag -- `spawn` fires when the scratchpad is launched with the given command -- `inital_apply` fires after `spawn`, when a corresponding client has been found and the properties have been applied diff --git a/cfg/awesome/bling/docs/module/swal.md b/cfg/awesome/bling/docs/module/swal.md deleted file mode 100644 index 0b3fed6..0000000 --- a/cfg/awesome/bling/docs/module/swal.md +++ /dev/null @@ -1,25 +0,0 @@ -## 😋 Window Swallowing - -Can your window manager swallow? It probably can... - -### Usage - -To activate and deactivate window swallowing here are the following functions. If you want to activate it, just call the `start` function once in your `rc.lua`. -```lua -bling.module.window_swallowing.start() -- activates window swallowing -bling.module.window_swallowing.stop() -- deactivates window swallowing -bling.module.window_swallowing.toggle() -- toggles window swallowing -``` - -### Theme Variables -```lua -theme.parent_filter_list = {"firefox", "Gimp"} -- class names list of parents that should not be swallowed -theme.child_filter_list = { "Dragon" } -- class names list that should not swallow their parents -theme.swallowing_filter = true -- whether the filters above should be active -``` - -### Preview - -![](https://media.discordapp.net/attachments/635625813143978012/769180910683684864/20-10-23-14-40-32.gif) - -*gif by [Nooo37](https://github.com/Nooo37)* diff --git a/cfg/awesome/bling/docs/module/tabbed.md b/cfg/awesome/bling/docs/module/tabbed.md deleted file mode 100644 index e705357..0000000 --- a/cfg/awesome/bling/docs/module/tabbed.md +++ /dev/null @@ -1,66 +0,0 @@ -## 📑 Tabbed - -Tabbed implements a tab container. There are also different themes for the tabs. - -### Usage - -You should bind these functions to keys in order to use the tabbed module effectively: -```lua -bling.module.tabbed.pick() -- picks a client with your cursor to add to the tabbing group -bling.module.tabbed.pop() -- removes the focused client from the tabbing group -bling.module.tabbed.iter() -- iterates through the currently focused tabbing group -bling.module.tabbed.pick_with_dmenu() -- picks a client with a dmenu application (defaults to rofi, other options can be set with a string parameter like "dmenu") -bling.module.tabbed.pick_by_direction(dir) -- picks a client based on direction ("up", "down", "left" or "right") -``` - -### Theme Variables - -```lua --- For tabbed only -theme.tabbed_spawn_in_tab = false -- whether a new client should spawn into the focused tabbing container - --- For tabbar in general -theme.tabbar_ontop = false -theme.tabbar_radius = 0 -- border radius of the tabbar -theme.tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") -theme.tabbar_font = "Sans 11" -- font of the tabbar -theme.tabbar_size = 40 -- size of the tabbar -theme.tabbar_position = "top" -- position of the tabbar -theme.tabbar_bg_normal = "#000000" -- background color of the focused client on the tabbar -theme.tabbar_fg_normal = "#ffffff" -- foreground color of the focused client on the tabbar -theme.tabbar_bg_focus = "#1A2026" -- background color of unfocused clients on the tabbar -theme.tabbar_fg_focus = "#ff0000" -- foreground color of unfocused clients on the tabbar -theme.tabbar_bg_focus_inactive = nil -- background color of the focused client on the tabbar when inactive -theme.tabbar_fg_focus_inactive = nil -- foreground color of the focused client on the tabbar when inactive -theme.tabbar_bg_normal_inactive = nil -- background color of unfocused clients on the tabbar when inactive -theme.tabbar_fg_normal_inactive = nil -- foreground color of unfocused clients on the tabbar when inactive -theme.tabbar_disable = false -- disable the tab bar entirely - --- the following variables are currently only for the "modern" tabbar style -theme.tabbar_color_close = "#f9929b" -- chnges the color of the close button -theme.tabbar_color_min = "#fbdf90" -- chnges the color of the minimize button -theme.tabbar_color_float = "#ccaced" -- chnges the color of the float button -``` - -### Preview - -Modern theme: - - - -*screenshot by [JavaCafe01](https://github.com/JavaCafe01)* - -### Signals -The tabbed module emits a few signals for the purpose of integration, -```lua --- bling::tabbed::update -- triggered whenever a tabbed object is updated --- tabobj -- the object that caused the update --- bling::tabbed::client_added -- triggered whenever a new client is added to a tab group --- tabobj -- the object that the client was added to --- client -- the client that added --- bling::tabbed::client_removed -- triggered whenever a client is removed from a tab group --- tabobj -- the object that the client was removed from --- client -- the client that was removed --- bling::tabbed::changed_focus -- triggered whenever a tab group's focus is changed --- tabobj -- the modified tab group -``` diff --git a/cfg/awesome/bling/docs/module/twall.md b/cfg/awesome/bling/docs/module/twall.md deleted file mode 100644 index 69c09c3..0000000 --- a/cfg/awesome/bling/docs/module/twall.md +++ /dev/null @@ -1,26 +0,0 @@ -## đŸŦ Tiled Wallpaper - -### Usage - -The function to set an automatically created tiled wallpaper can be called the following way (you don't need to set every option in the table): -```lua -awful.screen.connect_for_each_screen(function(s) -- that way the wallpaper is applied to every screen - bling.module.tiled_wallpaper("x", s, { -- call the actual function ("x" is the string that will be tiled) - fg = "#ff0000", -- define the foreground color - bg = "#00ffff", -- define the background color - offset_y = 25, -- set a y offset - offset_x = 25, -- set a x offset - font = "Hack", -- set the font (without the size) - font_size = 14, -- set the font size - padding = 100, -- set padding (default is 100) - zickzack = true -- rectangular pattern or criss cross - }) -end) -``` - -### Preview - -![](https://media.discordapp.net/attachments/702548913999314964/773887721294135296/tiled-wallpapers.png?width=1920&height=1080) - -*screenshots by [Nooo37](https://github.com/Nooo37)* - diff --git a/cfg/awesome/bling/docs/module/wall.md b/cfg/awesome/bling/docs/module/wall.md deleted file mode 100644 index cdab6cc..0000000 --- a/cfg/awesome/bling/docs/module/wall.md +++ /dev/null @@ -1,142 +0,0 @@ -## 🎇 Wallpaper Easy Setup - -This is a simple-to-use, extensible, declarative wallpaper manager. - -### Practical Examples - -```lua --- A default Awesome wallpaper -bling.module.wallpaper.setup() - --- A slideshow with pictures from different sources changing every 30 minutes -bling.module.wallpaper.setup { - wallpaper = {"/images/my_dog.jpg", "/images/my_cat.jpg"}, - change_timer = 1800 -} - --- A random wallpaper with images from multiple folders -bling.module.wallpaper.setup { - set_function = bling.module.wallpaper.setters.random, - wallpaper = {"/path/to/a/folder", "/path/to/another/folder"}, - change_timer = 631, -- prime numbers are better for timers - position = "fit", - background = "#424242" -} - --- wallpapers based on a schedule, like awesome-glorious-widgets dynamic wallpaper --- https://github.com/manilarome/awesome-glorious-widgets/tree/master/dynamic-wallpaper -bling.module.wallpaper.setup { - set_function = bling.module.wallpaper.setters.simple_schedule, - wallpaper = { - ["06:22:00"] = "morning-wallpaper.jpg", - ["12:00:00"] = "noon-wallpaper.jpg", - ["17:58:00"] = "night-wallpaper.jpg", - ["24:00:00"] = "midnight-wallpaper.jpg", - }, - position = "maximized", -} - --- random wallpapers, from different folder depending on time of the day -bling.module.wallpaper.setup { - set_function = bling.module.wallpaper.setters.simple_schedule, - wallpaper = { - ["09:00:00"] = "~/Pictures/safe_for_work", - ["18:00:00"] = "~/Pictures/personal", - }, - schedule_set_function = bling.module.wallpaper.setters.random - position = "maximized", - recursive = false, - change_timer = 600 -} - --- setup for multiple screens at once --- the 'screen' argument can be a table of screen objects -bling.module.wallpaper.setup { - set_function = bling.module.wallpaper.setters.random, - screen = screen, -- The awesome 'screen' variable is an array of all screen objects - wallpaper = {"/path/to/a/folder", "/path/to/another/folder"}, - change_timer = 631 -} -``` -### Details - -The setup function will do 2 things: call the set-function when awesome requests a wallpaper, and manage a timer to call `set_function` periodically. - -Its argument is a args table that is passed to ohter functions (setters and wallpaper functions), so you define everything with setup. - -The `set_function` is a function called every times a wallpaper is needed. - -The module provides some setters: - -* `bling.module.wallpaper.setters.awesome_wallpaper`: beautiful.theme_assets.wallpaper with defaults from beautiful. -* `bling.module.wallpaper.setters.simple`: slideshow from the `wallpaper` argument. -* `bling.module.wallpaper.setters.random`: same as simple but in a random way. -* `bling.module.wallpaper.setters.simple_schedule`: takes a table of `["HH:MM:SS"] = wallpaper` arguments, where wallpaper is the `wallpaper` argument used by `schedule_set_function`. - -A wallpaper is one of the following elements: - -* a color -* an image -* a folder containing images -* a function that sets a wallpaper -* everything gears.wallpaper functions can manage (cairo surface, cairo pattern string) -* a list containing any of the elements above - -To set up for multiple screens, two possible methods are: -* Call the `setup` function for each screen, passing the appropriate configuration and `screen` arg -* Call the `setup` function once, passing a table of screens as the `screen` arg. This applies the same configuration to all screens in the table -_Note_: Multiple screen setup only works for the `simple` and `random` setters - -```lua --- This is a valid wallpaper definition -bling.module.wallpaper.setup { - wallpaper = { -- a list - "black", "#112233", -- colors - "wall1.jpg", "wall2.png", -- files - "/path/to/wallpapers", -- folders - -- cairo patterns - "radial:600,50,100:105,550,900:0,#2200ff:0.5,#00ff00:1,#101010", - -- or functions that set a wallpaper - function(args) bling.module.tiled_wallpaper("\\o/", args.screen) end, - bling.module.wallpaper.setters.awesome_wallpaper, - }, - change_timer = 10, -} -``` -The provided setters `simple` and `random` will use 2 internal functions that you can use to write your own setter: - -* `bling.module.wallpaper.prepare_list`: return a list of wallpapers directly usable by `apply` (for now, it just explores folders) -* `bling.module.wallpaper.apply`: a wrapper for gears.wallpaper functions, using the args table of setup - -Here are the defaults: - -```lua --- Default parameters -bling.module.wallpaper.setup { - screen = nil, -- the screen to apply the wallpaper, as seen in gears.wallpaper functions - screens = nil, -- an array of screens to apply the wallpaper on. If 'screen' is also provided, this is overridden - change_timer = nil, -- the timer in seconds. If set, call the set_function every change_timer seconds - set_function = nil, -- the setter function - - -- parameters used by bling.module.wallpaper.prepare_list - wallpaper = nil, -- the wallpaper object, see simple or simple_schedule documentation - image_formats = {"jpg", "jpeg", "png", "bmp"}, -- when searching in folder, consider these files only - recursive = true, -- when searching in folder, search also in subfolders - - -- parameters used by bling.module.wallpaper.apply - position = nil, -- use a function of gears.wallpaper when applicable ("centered", "fit", "maximized", "tiled") - background = beautiful.bg_normal or "black", -- see gears.wallpaper functions - ignore_aspect = false, -- see gears.wallpaper.maximized - offset = {x = 0, y = 0}, -- see gears.wallpaper functions - scale = 1, -- see gears.wallpaper.centered - - -- parameters that only apply to bling.module.wallpaper.setter.awesome (as a setter or as a wallpaper function) - colors = { -- see beautiful.theme_assets.wallpaper - bg = beautiful.bg_color, -- the actual default is this color but darkened or lightned - fg = beautiful.fg_color, - alt_fg = beautiful.fg_focus - } -} -``` - -Check documentation in [module/wallpaper.lua](module/wallpaper.lua) for more details. diff --git a/cfg/awesome/bling/docs/signals/pctl.md b/cfg/awesome/bling/docs/signals/pctl.md deleted file mode 100644 index 89a0709..0000000 --- a/cfg/awesome/bling/docs/signals/pctl.md +++ /dev/null @@ -1,240 +0,0 @@ -## đŸŽĩ Playerctl - -This is a signal module in which you can connect to certain bling signals to grab playerctl info. Currently, this is what it supports: - -- Song title and artist -- Album art (the path this module downloaded the art to) -- If playing or not -- Position -- Song length -- If there are no players on - -This module relies on `playerctl` and `curl`. If you have this module disabled, you won't need those programs. With this module, you can create a widget like below without worrying about the backend. - -![](https://user-images.githubusercontent.com/33443763/107377569-fa807900-6a9f-11eb-93c1-174c58eb7bf1.png) - -*screenshot by [javacafe](https://github.com/JavaCafe01)* - -### Usage - -To enable: `playerctl = bling.signal.playerctl.lib/cli()` - -To disable: `playerctl:disable()` - -#### Playerctl_lib Signals - -**Note**: When connecting to signals with the new `playerctl` module, the object itself is always given to you as the first parameter. - -```lua --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- new (bool) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- player_name (string) --- playback_status --- playing (boolean) --- player_name (string) --- seeked --- position (number) --- player_name (string) --- volume --- volume (number) --- player_name (string) --- loop_status --- loop_status (string) --- player_name (string) --- shuffle --- shuffle (boolean) --- player_name (string) --- exit --- player_name (string) --- no_players --- (No parameters) -``` - -#### Playerctl_cli Signals - -```lua --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- playback_status --- playing (boolean) --- volume --- volume (number) --- loop_status --- loop_status (string) --- shuffle --- shuffle (bool) --- no_players --- (No parameters) -``` - -#### Playerctl Functions - -With this library we also give the user a way to interact with Playerctl, such as playing, pausing, seeking, etc. - -Here are the functions provided: - -```lua --- disable() --- pause(player) --- play(player) --- stop(player) --- play_pause(player) --- previous(player) --- next(player) --- set_loop_status(loop_status, player) --- cycle_loop_status(player) --- set_position(position, player) --- set_shuffle(shuffle, player) --- cycle_shuffle(player) --- set_volume(volume, player) --- get_manager() --- get_active_player() --- get_player_of_name(name) -``` - -### Example Implementation - -Lets say we have an imagebox. If I wanted to set the imagebox to show the album art, all I have to do is this: - -```lua -local art = wibox.widget { - image = "default_image.png", - resize = true, - forced_height = dpi(80), - forced_width = dpi(80), - widget = wibox.widget.imagebox -} - -local name_widget = wibox.widget { - markup = 'No players', - align = 'center', - valign = 'center', - widget = wibox.widget.textbox -} - -local title_widget = wibox.widget { - markup = 'Nothing Playing', - align = 'center', - valign = 'center', - widget = wibox.widget.textbox -} - -local artist_widget = wibox.widget { - markup = 'Nothing Playing', - align = 'center', - valign = 'center', - widget = wibox.widget.textbox -} - --- Get Song Info -local playerctl = bling.signal.playerctl.lib() -playerctl:connect_signal("metadata", - function(_, title, artist, album_path, album, new, player_name) - -- Set art widget - art:set_image(gears.surface.load_uncached(album_path)) - - -- Set player name, title and artist widgets - name_widget:set_markup_silently(player_name) - title_widget:set_markup_silently(title) - artist_widget:set_markup_silently(artist) -end) -``` - -Thats all! You don't even have to worry about updating the widgets, the signals will handle that for you. - -Here's another example in which you get a notification with the album art, title, and artist whenever the song changes. - -```lua -local naughty = require("naughty") -local playerctl = bling.signal.playerctl.lib() - -playerctl:connect_signal("metadata", - function(_, title, artist, album_path, album, new, player_name) - if new == true then - naughty.notify({title = title, text = artist, image = album_path}) - end -end) -``` - -We can also link a playerctl function to a button click! - -```lua -local playerctl = bling.signal.playerctl.lib() -button:buttons(gears.table.join( - awful.button({}, 1, function() - playerctl:play_pause() - end) -)) -``` - -### Theme Variables and Configuration - -By default, this module will output signals from the most recently active player. If you wish to customize the behavior furthur, the following configuration options are available depending on the selected backend. Here is a summary of the two backends and which configuration options they support. - -| Option | playerctl_cli | playerctl_lib | -| ------------------- | ------------------ | ------------------ | -| ignore | :heavy_check_mark: | :heavy_check_mark: | -| player | :heavy_check_mark: | :heavy_check_mark: | -| update_on_activity | | :heavy_check_mark: | -| interval | :heavy_check_mark: | :heavy_check_mark: | -| debounce_delay | :heavy_check_mark: | :heavy_check_mark: | - -- `ignore`: This option is either a string with a single name or a table of strings containing names of players that will be ignored by this module. It is empty by default. - -- `player`: This option is either a string with a single name or a table of strings containing names of players this module will emit signals for. It also acts as a way to prioritize certain players over others with players listed earlier in the table being preferred over players listed later. The special name `%any` can be used once to match any player not found in the list. It is empty by default. - -- `update_on_activity`: This option is a boolean that, when true, will cause the module to output signals from the most recently active player while still adhering to the player priority specified with the `player` option. If `false`, the module will output signals from the player that started first, again, while still adhering to the player priority. It is `true` by default. - -- `interval`: This option is a number specifying the update interval for fetching the player position. It is 1 by default. - -- `debounce_delay`: This option is a number specifying the debounce timer interval. If a new metadata signal gets emitted before debounce_delay has passed, the last signal will be dropped. -This is to help with some players sending multiple signals. It is `0.35` by default. - -These options can be set through a call to `bling.signal.playerctl.lib/cli()` or these theme variables: - -```lua -theme.playerctl_ignore = {} -theme.playerctl_player = {} -theme.playerctl_update_on_activity = true -theme.playerctl_position_update_interval = 1 -``` - -#### Example Configurations - -```lua --- Prioritize ncspot over all other players and ignore firefox players (e.g. YouTube and Twitch tabs) completely -playerctl = bling.signal.playerctl.lib { - ignore = "firefox", - player = {"ncspot", "%any"} -} - --- OR in your theme file: --- Same config as above but with theme variables -theme.playerctl_ignore = "firefox" -theme.playerctl_player = {"ncspot", "%any"} - --- Prioritize vlc over all other players and deprioritize spotify -theme.playerctl_backend = "playerctl_lib" -theme.playerctl_player = {"vlc", "%any", "spotify"} - --- Disable priority of most recently active players -theme.playerctl_update_on_activity = false - --- Only emit the position signal every 2 seconds -theme.playerctl_position_update_interval = 2 -``` diff --git a/cfg/awesome/bling/docs/theme.md b/cfg/awesome/bling/docs/theme.md deleted file mode 100644 index 0d1d0b3..0000000 --- a/cfg/awesome/bling/docs/theme.md +++ /dev/null @@ -1,117 +0,0 @@ -```lua ---[[ Bling theme variables template -This file has all theme variables of the bling module. -Every variable has a small comment on what it does. -You might just want to copy that whole part into your theme.lua and start adjusting from there. ---]] - - --- window swallowing -theme.dont_swallow_classname_list = {"firefox", "Gimp"} -- list of class names that should not be swallowed -theme.dont_swallow_filter_activated = true -- whether the filter above should be active - --- flash focus -theme.flash_focus_start_opacity = 0.6 -- the starting opacity -theme.flash_focus_step = 0.01 -- the step of animation - --- playerctl signal -theme.playerctl_backend = "playerctl_cli" -- backend to use -theme.playerctl_ignore = {} -- list of players to be ignored -theme.playerctl_player = {} -- list of players to be used in priority order -theme.playerctl_update_on_activity = true -- whether to prioritize the most recently active players or not -theme.playerctl_position_update_interval = 1 -- the update interval for fetching the position from playerctl - --- tabbed -theme.tabbed_spawn_in_tab = false -- whether a new client should spawn into the focused tabbing container - --- tabbar general -theme.tabbar_ontop = false -theme.tabbar_radius = 0 -- border radius of the tabbar -theme.tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") -theme.tabbar_font = "Sans 11" -- font of the tabbar -theme.tabbar_size = 40 -- size of the tabbar -theme.tabbar_position = "top" -- position of the tabbar -theme.tabbar_bg_normal = "#000000" -- background color of the focused client on the tabbar -theme.tabbar_fg_normal = "#ffffff" -- foreground color of the focused client on the tabbar -theme.tabbar_bg_focus = "#1A2026" -- background color of unfocused clients on the tabbar -theme.tabbar_fg_focus = "#ff0000" -- foreground color of unfocused clients on the tabbar -theme.tabbar_bg_focus_inactive = nil -- background color of the focused client on the tabbar when inactive -theme.tabbar_fg_focus_inactive = nil -- foreground color of the focused client on the tabbar when inactive -theme.tabbar_bg_normal_inactive = nil -- background color of unfocused clients on the tabbar when inactive -theme.tabbar_fg_normal_inactive = nil -- foreground color of unfocused clients on the tabbar when inactive -theme.tabbar_disable = false -- disable the tab bar entirely - --- mstab -theme.mstab_bar_disable = false -- disable the tabbar -theme.mstab_bar_ontop = false -- whether you want to allow the bar to be ontop of clients -theme.mstab_dont_resize_slaves = false -- whether the tabbed stack windows should be smaller than the - -- currently focused stack window (set it to true if you use - -- transparent terminals. False if you use shadows on solid ones -theme.mstab_bar_padding = "default" -- how much padding there should be between clients and your tabbar - -- by default it will adjust based on your useless gaps. - -- If you want a custom value. Set it to the number of pixels (int) -theme.mstab_border_radius = 0 -- border radius of the tabbar -theme.mstab_bar_height = 40 -- height of the tabbar -theme.mstab_tabbar_position = "top" -- position of the tabbar (mstab currently does not support left,right) -theme.mstab_tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") - -- defaults to the tabbar_style so only change if you want a - -- different style for mstab and tabbed - --- the following variables are currently only for the "modern" tabbar style -theme.tabbar_color_close = "#f9929b" -- chnges the color of the close button -theme.tabbar_color_min = "#fbdf90" -- chnges the color of the minimize button -theme.tabbar_color_float = "#ccaced" -- chnges the color of the float button - --- tag preview widget -theme.tag_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.tag_preview_client_border_radius = 0 -- Border radius of each client in the widget (With AA) -theme.tag_preview_client_opacity = 0.5 -- Opacity of each client -theme.tag_preview_client_bg = "#000000" -- The bg color of each client -theme.tag_preview_client_border_color = "#ffffff" -- The border color of each client -theme.tag_preview_client_border_width = 3 -- The border width of each client -theme.tag_preview_widget_bg = "#000000" -- The bg color of the widget -theme.tag_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.tag_preview_widget_border_width = 3 -- The border width of the widget -theme.tag_preview_widget_margin = 0 -- The margin of the widget - --- task preview widget -theme.task_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.task_preview_widget_bg = "#000000" -- The bg color of the widget -theme.task_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.task_preview_widget_border_width = 3 -- The border width of the widget -theme.task_preview_widget_margin = 0 -- The margin of the widget - --- tabbed misc widget(s) -theme.bling_tabbed_misc_titlebar_indicator = { - layout_spacing = dpi(4), - icon_size = dpi(20), - icon_margin = dpi(4), - bg_color_focus = "#ff0000", - bg_color = "#00000000", - icon_shape = function(cr, w, h) - gears.shape.rounded_rect(cr, w, h, 0) - end, - layout = wibox.layout.fixed.horizontal -} - --- window switcher widget -theme.window_switcher_widget_bg = "#000000" -- The bg color of the widget -theme.window_switcher_widget_border_width = 3 -- The border width of the widget -theme.window_switcher_widget_border_radius = 0 -- The border radius of the widget -theme.window_switcher_widget_border_color = "#ffffff" -- The border color of the widget -theme.window_switcher_clients_spacing = 20 -- The space between each client item -theme.window_switcher_client_icon_horizontal_spacing = 5 -- The space between client icon and text -theme.window_switcher_client_width = 150 -- The width of one client widget -theme.window_switcher_client_height = 250 -- The height of one client widget -theme.window_switcher_client_margins = 10 -- The margin between the content and the border of the widget -theme.window_switcher_thumbnail_margins = 10 -- The margin between one client thumbnail and the rest of the widget -theme.thumbnail_scale = false -- If set to true, the thumbnails fit policy will be set to "fit" instead of "auto" -theme.window_switcher_name_margins = 10 -- The margin of one clients title to the rest of the widget -theme.window_switcher_name_valign = "center" -- How to vertically align one clients title -theme.window_switcher_name_forced_width = 200 -- The width of one title -theme.window_switcher_name_font = "sans 11" -- The font of all titles -theme.window_switcher_name_normal_color = "#ffffff" -- The color of one title if the client is unfocused -theme.window_switcher_name_focus_color = "#ff0000" -- The color of one title if the client is focused -theme.window_switcher_icon_valign = "center" -- How to vertically align the one icon -theme.window_switcher_icon_width = 40 -- The width of one icon -``` diff --git a/cfg/awesome/bling/docs/widgets/tabbed_misc.md b/cfg/awesome/bling/docs/widgets/tabbed_misc.md deleted file mode 100644 index 89c4557..0000000 --- a/cfg/awesome/bling/docs/widgets/tabbed_misc.md +++ /dev/null @@ -1,117 +0,0 @@ -## 🧱 Tabbed Miscellaneous - -This comprises a few widgets to better represent tabbed groups (from the tabbed module) in your desktop. -The widgets currently included are: -- Titlebar Indicator -- Tasklist - -![Preview Image](https://i.imgur.com/ZeYSrxY.png) - -## Titlebar Indicator - -### Usage - -To use the task list indicator: -**NOTE:** Options can be set as theme vars under the table `theme.bling_tabbed_misc_titlebar_indicator` - -```lua -bling.widget.tabbed_misc.titlebar_indicator(client, { - layout = wibox.layout.fixed.vertical, - layout_spacing = dpi(5), -- Set spacing in between items - icon_size = dpi(24), -- Set icon size - icon_margin = 0, -- Set icon margin - fg_color = "#cccccc", -- Normal color for text - fg_color_focus = "#ffffff", -- Color for focused text - bg_color_focus = "#282828", -- Color for the focused items - bg_color = "#1d2021", -- Color for normal / unfocused items - icon_shape = gears.shape.circle -- Set icon shape, -}) -``` - -a widget_template option is also available: -```lua -bling.widget.tabbed_misc.titlebar_indicator(client, { - widget_template = { - { - widget = awful.widget.clienticon, - id = 'icon_role' - }, - widget = wibox.container.margin, - margins = 2, - id = 'bg_role', - update_callback = function(self, client, group) - if client == group.clients[group.focused_idx] then - self.margins = 5 - end - end - } -}) -``` - -### Example Implementation - -You normally embed the widget in your titlebar... -```lua -awful.titlebar(c).widget = { - { -- Left - bling.widget.tabbed_misc.titlebar_indicator(c), - layout = wibox.layout.fixed.horizontal - }, - { -- Middle - { -- Title - align = "center", - widget = awful.titlebar.widget.titlewidget(c) - }, - buttons = buttons, - layout = wibox.layout.flex.horizontal - }, - { -- Right - awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.closebutton (c), - layout = wibox.layout.fixed.horizontal - }, - layout = wibox.layout.align.horizontal - } -``` - -## Tasklist -The module exports a function that can be added to your tasklist as a `update_callback` - -### Usage -```lua -awful.widget.tasklist({ - screen = s, - filter = awful.widget.tasklist.filter.currenttags, - layout = { - spacing = dpi(10), - layout = wibox.layout.fixed.vertical, - }, - style = { - bg_normal = "#00000000", - }, - widget_template = { - { - { - widget = wibox.widget.imagebox, - id = "icon_role", - align = "center", - valign = "center", - }, - width = dpi(24), - height = dpi(24), - widget = wibox.container.constraint, - }, - widget = wibox.container.background, -- IT MUST BE A CONTAINER WIDGET AS THAT IS WHAT THE FUNCTION EXPECTS - update_callback = require("bling.widget.tabbed_misc").custom_tasklist, - id = "background_role", - }, -}) -``` - -If you need to do something else, it can be used like so -```lua -update_callback = function(self, client, index, clients) - require("bling.widget.tabbed_misc").custom_tasklist(self, client, index, clients) - require("naughty").notify({ text = "Tasklist was updated" }) -end -``` diff --git a/cfg/awesome/bling/docs/widgets/tag_preview.md b/cfg/awesome/bling/docs/widgets/tag_preview.md deleted file mode 100644 index bdf033d..0000000 --- a/cfg/awesome/bling/docs/widgets/tag_preview.md +++ /dev/null @@ -1,155 +0,0 @@ -## 🔍 Tag Preview - -This is a popup widget that will show a preview of a specified tag that illustrates the position, size, content, and icon of all clients. - -![](https://imgur.com/zFdvs4K.gif) - -*gif by [javacafe](https://github.com/JavaCafe01)* - -### Usage - -To enable: - -```lua -bling.widget.tag_preview.enable { - show_client_content = false, -- Whether or not to show the client content - x = 10, -- The x-coord of the popup - y = 10, -- The y-coord of the popup - scale = 0.25, -- The scale of the previews compared to the screen - honor_padding = false, -- Honor padding when creating widget size - honor_workarea = false, -- Honor work area when creating widget size - placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y) - awful.placement.top_left(c, { - margins = { - top = 30, - left = 30 - } - }) - end, - background_widget = wibox.widget { -- Set a background image (like a wallpaper) for the widget - image = beautiful.wallpaper, - horizontal_fit_policy = "fit", - vertical_fit_policy = "fit", - widget = wibox.widget.imagebox - } -} -``` - -Here are the signals available: - -```lua --- bling::tag_preview::update -- first line is the signal --- t (tag) -- indented lines are function parameters --- bling::tag_preview::visibility --- s (screen) --- v (boolean) -``` - -By default, the widget is not visible. You must implement when it will update and when it will show. - -### Example Implementation - -We can trigger the widget to show the specific tag when hovering over it in the taglist. The code shown below is the example taglist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.taglist.html). Basically, we are going to update the widget and toggle it through the taglist's `create_callback`. (The bling addons are commented) -```lua -s.mytaglist = awful.widget.taglist { - screen = s, - filter = awful.widget.taglist.filter.all, - style = { - shape = gears.shape.powerline - }, - layout = { - spacing = -12, - spacing_widget = { - color = '#dddddd', - shape = gears.shape.powerline, - widget = wibox.widget.separator, - }, - layout = wibox.layout.fixed.horizontal - }, - widget_template = { - { - { - { - { - { - id = 'index_role', - widget = wibox.widget.textbox, - }, - margins = 4, - widget = wibox.container.margin, - }, - bg = '#dddddd', - shape = gears.shape.circle, - widget = wibox.container.background, - }, - { - { - id = 'icon_role', - widget = wibox.widget.imagebox, - }, - margins = 2, - widget = wibox.container.margin, - }, - { - id = 'text_role', - widget = wibox.widget.textbox, - }, - layout = wibox.layout.fixed.horizontal, - }, - left = 18, - right = 18, - widget = wibox.container.margin - }, - id = 'background_role', - widget = wibox.container.background, - -- Add support for hover colors and an index label - create_callback = function(self, c3, index, objects) --luacheck: no unused args - self:get_children_by_id('index_role')[1].markup = ' '..index..' ' - self:connect_signal('mouse::enter', function() - - -- BLING: Only show widget when there are clients in the tag - if #c3:clients() > 0 then - -- BLING: Update the widget with the new tag - awesome.emit_signal("bling::tag_preview::update", c3) - -- BLING: Show the widget - awesome.emit_signal("bling::tag_preview::visibility", s, true) - end - - if self.bg ~= '#ff0000' then - self.backup = self.bg - self.has_backup = true - end - self.bg = '#ff0000' - end) - self:connect_signal('mouse::leave', function() - - -- BLING: Turn the widget off - awesome.emit_signal("bling::tag_preview::visibility", s, false) - - if self.has_backup then self.bg = self.backup end - end) - end, - update_callback = function(self, c3, index, objects) --luacheck: no unused args - self:get_children_by_id('index_role')[1].markup = ' '..index..' ' - end, - }, - buttons = taglist_buttons -} -``` - -### Theme Variables - -```lua -theme.tag_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.tag_preview_client_border_radius = 0 -- Border radius of each client in the widget (With AA) -theme.tag_preview_client_opacity = 0.5 -- Opacity of each client -theme.tag_preview_client_bg = "#000000" -- The bg color of each client -theme.tag_preview_client_border_color = "#ffffff" -- The border color of each client -theme.tag_preview_client_border_width = 3 -- The border width of each client -theme.tag_preview_widget_bg = "#000000" -- The bg color of the widget -theme.tag_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.tag_preview_widget_border_width = 3 -- The border width of the widget -theme.tag_preview_widget_margin = 0 -- The margin of the widget -``` - -NOTE: I recommend to only use the widget border radius theme variable when not using shadows with a compositor, as anti-aliased rounding with the outer widgets made with AwesomeWM rely on the actual bg being transparent. If you want rounding with shadows on the widget, use a compositor like [jonaburg's fork](https://github.com/jonaburg/picom). diff --git a/cfg/awesome/bling/docs/widgets/task_preview.md b/cfg/awesome/bling/docs/widgets/task_preview.md deleted file mode 100644 index 30a85f8..0000000 --- a/cfg/awesome/bling/docs/widgets/task_preview.md +++ /dev/null @@ -1,152 +0,0 @@ -## 🔍 Task Preview - -This is a popup widget that will show a preview of the specified client. It is supposed to mimic the small popup that Windows has when hovering over the application icon. - -![](https://user-images.githubusercontent.com/33443763/124705653-d7b98b80-deaa-11eb-8091-42bbe62365be.png) - -*image by [javacafe](https://github.com/JavaCafe01)* - -### Usage - -To enable: - -```lua -bling.widget.task_preview.enable { - x = 20, -- The x-coord of the popup - y = 20, -- The y-coord of the popup - height = 200, -- The height of the popup - width = 200, -- The width of the popup - placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y) - awful.placement.bottom(c, { - margins = { - bottom = 30 - } - }) - end -} -``` - -To allow for more customization, there is also a `widget_structure` property (as seen in some default awesome widgets) which is optional. An example is as follows - -```lua -bling.widget.task_preview.enable { - x = 20, -- The x-coord of the popup - y = 20, -- The y-coord of the popup - height = 200, -- The height of the popup - width = 200, -- The width of the popup - placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y) - awful.placement.bottom(c, { - margins = { - bottom = 30 - } - }) - end, - -- Your widget will automatically conform to the given size due to a constraint container. - widget_structure = { - { - { - { - id = 'icon_role', - widget = awful.widget.clienticon, -- The client icon - }, - { - id = 'name_role', -- The client name / title - widget = wibox.widget.textbox, - }, - layout = wibox.layout.flex.horizontal - }, - widget = wibox.container.margin, - margins = 5 - }, - { - id = 'image_role', -- The client preview - resize = true, - valign = 'center', - halign = 'center', - widget = wibox.widget.imagebox, - }, - layout = wibox.layout.fixed.vertical - } -} -``` - -Here are the signals available: - -```lua --- bling::task_preview::visibility -- first line is the signal --- s (screen) -- indented lines are function parameters --- v (boolean) --- c (client) -``` - -By default, the widget is not visible. You must implement when it will update and when it will show. - -### Example Implementation - -We can trigger the widget to show the specific client when hovering over it in the tasklist. The code shown below is the example icon only tasklist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.tasklist.html). Basically, we are going to toggle the widget through the tasklist's `create_callback`. (The bling addons are commented) -```lua -s.mytasklist = awful.widget.tasklist { - screen = s, - filter = awful.widget.tasklist.filter.currenttags, - buttons = tasklist_buttons, - layout = { - spacing_widget = { - { - forced_width = 5, - forced_height = 24, - thickness = 1, - color = '#777777', - widget = wibox.widget.separator - }, - valign = 'center', - halign = 'center', - widget = wibox.container.place, - }, - spacing = 1, - layout = wibox.layout.fixed.horizontal - }, - -- Notice that there is *NO* wibox.wibox prefix, it is a template, - -- not a widget instance. - widget_template = { - { - wibox.widget.base.make_widget(), - forced_height = 5, - id = 'background_role', - widget = wibox.container.background, - }, - { - { - id = 'clienticon', - widget = awful.widget.clienticon, - }, - margins = 5, - widget = wibox.container.margin - }, - nil, - create_callback = function(self, c, index, objects) --luacheck: no unused args - self:get_children_by_id('clienticon')[1].client = c - - -- BLING: Toggle the popup on hover and disable it off hover - self:connect_signal('mouse::enter', function() - awesome.emit_signal("bling::task_preview::visibility", s, - true, c) - end) - self:connect_signal('mouse::leave', function() - awesome.emit_signal("bling::task_preview::visibility", s, - false, c) - end) - end, - layout = wibox.layout.align.vertical, - }, -} -``` - -### Theme Variables -```lua -theme.task_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.task_preview_widget_bg = "#000000" -- The bg color of the widget -theme.task_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.task_preview_widget_border_width = 3 -- The border width of the widget -theme.task_preview_widget_margin = 0 -- The margin of the widget -``` - -NOTE: I recommend to only use the widget border radius theme variable when not using shadows with a compositor, as anti-aliased rounding with the outer widgets made with AwesomeWM rely on the actual bg being transparent. If you want rounding with shadows on the widget, use a compositor like [jonaburg's fork](https://github.com/jonaburg/picom). diff --git a/cfg/awesome/bling/docs/widgets/window_switcher.md b/cfg/awesome/bling/docs/widgets/window_switcher.md deleted file mode 100644 index 8f48257..0000000 --- a/cfg/awesome/bling/docs/widgets/window_switcher.md +++ /dev/null @@ -1,67 +0,0 @@ -## 🎨 Window Switcher - -A popup with client previews that allows you to switch clients similar to the alt-tab menu in MacOS, GNOME, and Windows. - -![](https://user-images.githubusercontent.com/70270606/133311802-8aef1012-346f-4f4c-843d-10d9de54ffeb.png) - -*image by [No37](https://github.com/Nooo37)* - -### Usage - -To enable: - -```lua -bling.widget.window_switcher.enable { - type = "thumbnail", -- set to anything other than "thumbnail" to disable client previews - - -- keybindings (the examples provided are also the default if kept unset) - hide_window_switcher_key = "Escape", -- The key on which to close the popup - minimize_key = "n", -- The key on which to minimize the selected client - unminimize_key = "N", -- The key on which to unminimize all clients - kill_client_key = "q", -- The key on which to close the selected client - cycle_key = "Tab", -- The key on which to cycle through all clients - previous_key = "Left", -- The key on which to select the previous client - next_key = "Right", -- The key on which to select the next client - vim_previous_key = "h", -- Alternative key on which to select the previous client - vim_next_key = "l", -- Alternative key on which to select the next client - - cycleClientsByIdx = awful.client.focus.byidx, -- The function to cycle the clients - filterClients = awful.widget.tasklist.filter.currenttags, -- The function to filter the viewed clients -} -``` - -To run the window swicher you have to emit this signal from within your configuration (usually using a keybind). - -```lua -awesome.emit_signal("bling::window_switcher::turn_on") -``` - -For example: -```lua - awful.key({Mod1}, "Tab", function() - awesome.emit_signal("bling::window_switcher::turn_on") - end, {description = "Window Switcher", group = "bling"}) -``` - -### Theme Variables -```lua -theme.window_switcher_widget_bg = "#000000" -- The bg color of the widget -theme.window_switcher_widget_border_width = 3 -- The border width of the widget -theme.window_switcher_widget_border_radius = 0 -- The border radius of the widget -theme.window_switcher_widget_border_color = "#ffffff" -- The border color of the widget -theme.window_switcher_clients_spacing = 20 -- The space between each client item -theme.window_switcher_client_icon_horizontal_spacing = 5 -- The space between client icon and text -theme.window_switcher_client_width = 150 -- The width of one client widget -theme.window_switcher_client_height = 250 -- The height of one client widget -theme.window_switcher_client_margins = 10 -- The margin between the content and the border of the widget -theme.window_switcher_thumbnail_margins = 10 -- The margin between one client thumbnail and the rest of the widget -theme.thumbnail_scale = false -- If set to true, the thumbnails fit policy will be set to "fit" instead of "auto" -theme.window_switcher_name_margins = 10 -- The margin of one clients title to the rest of the widget -theme.window_switcher_name_valign = "center" -- How to vertically align one clients title -theme.window_switcher_name_forced_width = 200 -- The width of one title -theme.window_switcher_name_font = "sans 11" -- The font of all titles -theme.window_switcher_name_normal_color = "#ffffff" -- The color of one title if the client is unfocused -theme.window_switcher_name_focus_color = "#ff0000" -- The color of one title if the client is focused -theme.window_switcher_icon_valign = "center" -- How to vertically align the one icon -theme.window_switcher_icon_width = 40 -- The width of one icon -``` diff --git a/cfg/awesome/bling/helpers/client.lua b/cfg/awesome/bling/helpers/client.lua deleted file mode 100644 index 0e14c51..0000000 --- a/cfg/awesome/bling/helpers/client.lua +++ /dev/null @@ -1,127 +0,0 @@ -local awful = require("awful") -local gears = require("gears") - -local _client = {} - ---- Turn off passed client --- Remove current tag from window's tags --- --- @param c A client -function _client.turn_off(c, current_tag) - if current_tag == nil then - current_tag = c.screen.selected_tag - end - local ctags = {} - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c.sticky = false -end - ---- Turn on passed client (add current tag to window's tags) --- --- @param c A client -function _client.turn_on(c) - local current_tag = c.screen.selected_tag - ctags = { current_tag } - for k, tag in pairs(c:tags()) do - if tag ~= current_tag then - table.insert(ctags, tag) - end - end - c:tags(ctags) - c:raise() - client.focus = c -end - ---- Sync two clients --- --- @param to_c The client to which to write all properties --- @param from_c The client from which to read all properties -function _client.sync(to_c, from_c) - if not from_c or not to_c then - return - end - if not from_c.valid or not to_c.valid then - return - end - if from_c.modal then - return - end - to_c.floating = from_c.floating - to_c.maximized = from_c.maximized - to_c.above = from_c.above - to_c.below = from_c.below - to_c:geometry(from_c:geometry()) - -- TODO: Should also copy over the position in a tiling layout -end - ---- Checks whether the passed client is a childprocess of a given process ID --- --- @param c A client --- @param pid The process ID --- @return True if the passed client is a childprocess of the given PID otherwise false -function _client.is_child_of(c, pid) - -- io.popen is normally discouraged. Should probably be changed - if not c or not c.valid then - return false - end - if tostring(c.pid) == tostring(pid) then - return true - end - local pid_cmd = [[pstree -T -p -a -s ]] - .. tostring(c.pid) - .. [[ | sed '2q;d' | grep -o '[0-9]*$' | tr -d '\n']] - local handle = io.popen(pid_cmd) - local parent_pid = handle:read("*a") - handle:close() - return tostring(parent_pid) == tostring(pid) - or tostring(parent_pid) == tostring(c.pid) -end - ---- Finds all clients that satisfy the passed rule --- --- @param rule The rule to be searched for --- @retrun A list of clients that match the given rule -function _client.find(rule) - local function matcher(c) - return awful.rules.match(c, rule) - end - local clients = client.get() - local findex = gears.table.hasitem(clients, client.focus) or 1 - local start = gears.math.cycle(#clients, findex + 1) - - local matches = {} - for c in awful.client.iterate(matcher, start) do - matches[#matches + 1] = c - end - - return matches -end - ---- Gets the next client by direction from the focused one --- --- @param direction it the direction as a string ("up", "down", "left" or "right") --- @retrun the client in the given direction starting at the currently focused one, nil otherwise -function _client.get_by_direction(direction) - local sel = client.focus - if not sel then - return nil - end - local cltbl = sel.screen:get_clients() - local geomtbl = {} - for i, cl in ipairs(cltbl) do - geomtbl[i] = cl:geometry() - end - local target = gears.geometry.rectangle.get_in_direction( - direction, - geomtbl, - sel:geometry() - ) - return cltbl[target] -end - -return _client diff --git a/cfg/awesome/bling/helpers/color.lua b/cfg/awesome/bling/helpers/color.lua deleted file mode 100644 index 4042360..0000000 --- a/cfg/awesome/bling/helpers/color.lua +++ /dev/null @@ -1,158 +0,0 @@ -local tonumber = tonumber -local string = string -local math = math -local floor = math.floor -local max = math.max -local min = math.min -local abs = math.abs -local format = string.format - -local _color = {} - ---- Try to guess if a color is dark or light. --- --- @string color The color with hexadecimal HTML format `"#RRGGBB"`. --- @treturn bool `true` if the color is dark, `false` if it is light. -function _color.is_dark(color) - -- Try to determine if the color is dark or light - local numeric_value = 0 - for s in color:gmatch("[a-fA-F0-9][a-fA-F0-9]") do - numeric_value = numeric_value + tonumber("0x" .. s) - end - return (numeric_value < 383) -end - -function _color.is_opaque(color) - if type(color) == "string" then - color = _color.hex_to_rgba(color) - end - - return color.a < 0.01 -end - ---- Lighten a color. --- --- @string color The color to lighten with hexadecimal HTML format `"#RRGGBB"`. --- @int[opt=26] amount How much light from 0 to 255. Default is around 10%. --- @treturn string The lighter color -function _color.lighten(color, amount) - amount = amount or 26 - local c = { - r = tonumber("0x" .. color:sub(2, 3)), - g = tonumber("0x" .. color:sub(4, 5)), - b = tonumber("0x" .. color:sub(6, 7)), - } - - c.r = c.r + amount - c.r = c.r < 0 and 0 or c.r - c.r = c.r > 255 and 255 or c.r - c.g = c.g + amount - c.g = c.g < 0 and 0 or c.g - c.g = c.g > 255 and 255 or c.g - c.b = c.b + amount - c.b = c.b < 0 and 0 or c.b - c.b = c.b > 255 and 255 or c.b - - return string.format("#%02x%02x%02x", c.r, c.g, c.b) -end - ---- Darken a color. --- --- @string color The color to darken with hexadecimal HTML format `"#RRGGBB"`. --- @int[opt=26] amount How much dark from 0 to 255. Default is around 10%. --- @treturn string The darker color -function _color.darken(color, amount) - amount = amount or 26 - return _color.lighten(color, -amount) -end - --- Returns a value that is clipped to interval edges if it falls outside the interval -function _color.clip(num, min_num, max_num) - return max(min(num, max_num), min_num) -end - --- Converts the given hex color to rgba -function _color.hex_to_rgba(color) - color = color:gsub("#", "") - return { r = tonumber("0x" .. color:sub(1, 2)), - g = tonumber("0x" .. color:sub(3, 4)), - b = tonumber("0x" .. color:sub(5, 6)), - a = #color == 8 and tonumber("0x" .. color:sub(7, 8)) or 255 } -end - --- Converts the given rgba color to hex -function _color.rgba_to_hex(color) - local r = _color.clip(color.r or color[1], 0, 255) - local g = _color.clip(color.g or color[2], 0, 255) - local b = _color.clip(color.b or color[3], 0, 255) - local a = _color.clip(color.a or color[4] or 255, 0, 255) - return "#" .. format("%02x%02x%02x%02x", - floor(r), - floor(g), - floor(b), - floor(a)) -end - --- Converts the given hex color to hsv -function _color.hex_to_hsv(color) - local color = _color.hex2rgb(color) - local C_max = max(color.r, color.g, color.b) - local C_min = min(color.r, color.g, color.b) - local delta = C_max - C_min - local H, S, V - if delta == 0 then - H = 0 - elseif C_max == color.r then - H = 60 * (((color.g - color.b) / delta) % 6) - elseif C_max == color.g then - H = 60 * (((color.b - color.r) / delta) + 2) - elseif C_max == color.b then - H = 60 * (((color.r - color.g) / delta) + 4) - end - if C_max == 0 then - S = 0 - else - S = delta / C_max - end - V = C_max - - return { h = H, - s = S * 100, - v = V * 100 } -end - --- Converts the given hsv color to hex -function _color.hsv_to_hex(H, S, V) - S = S / 100 - V = V / 100 - if H > 360 then H = 360 end - if H < 0 then H = 0 end - local C = V * S - local X = C * (1 - abs(((H / 60) % 2) - 1)) - local m = V - C - local r_, g_, b_ = 0, 0, 0 - if H >= 0 and H < 60 then - r_, g_, b_ = C, X, 0 - elseif H >= 60 and H < 120 then - r_, g_, b_ = X, C, 0 - elseif H >= 120 and H < 180 then - r_, g_, b_ = 0, C, X - elseif H >= 180 and H < 240 then - r_, g_, b_ = 0, X, C - elseif H >= 240 and H < 300 then - r_, g_, b_ = X, 0, C - elseif H >= 300 and H < 360 then - r_, g_, b_ = C, 0, X - end - local r, g, b = (r_ + m) * 255, (g_ + m) * 255, (b_ + m) * 255 - return ("#%02x%02x%02x"):format(floor(r), floor(g), floor(b)) -end - -function _color.multiply(color, amount) - return { _color.clip(color.r * amount, 0, 255), - _color.clip(color.g * amount, 0, 255), - _color.clip(color.b * amount, 0, 255), - 255 } -end - -return _color diff --git a/cfg/awesome/bling/helpers/filesystem.lua b/cfg/awesome/bling/helpers/filesystem.lua deleted file mode 100644 index f06139a..0000000 --- a/cfg/awesome/bling/helpers/filesystem.lua +++ /dev/null @@ -1,62 +0,0 @@ -local Gio = require("lgi").Gio -local awful = require("awful") -local string = string - -local _filesystem = {} - ---- Get a list of files from a given directory. --- @string path The directory to search. --- @tparam[opt] table exts Specific extensions to limit the search to. eg:`{ "jpg", "png" }` --- If ommited, all files are considered. --- @bool[opt=false] recursive List files from subdirectories --- @staticfct bling.helpers.filesystem.get_random_file_from_dir -function _filesystem.list_directory_files(path, exts, recursive) - recursive = recursive or false - local files, valid_exts = {}, {} - - -- Transforms { "jpg", ... } into { [jpg] = #, ... } - if exts then - for i, j in ipairs(exts) do - valid_exts[j:lower()] = i - end - end - - -- Build a table of files from the path with the required extensions - local file_list = Gio.File.new_for_path(path):enumerate_children( - "standard::*", - 0 - ) - if file_list then - for file in function() - return file_list:next_file() - end do - local file_type = file:get_file_type() - if file_type == "REGULAR" then - local file_name = file:get_display_name() - if - not exts - or valid_exts[file_name:lower():match(".+%.(.*)$") or ""] - then - table.insert(files, file_name) - end - elseif recursive and file_type == "DIRECTORY" then - local file_name = file:get_display_name() - files = gears.table.join( - files, - list_directory_files(file_name, exts, recursive) - ) - end - end - end - - return files -end - -function _filesystem.save_image_async_curl(url, filepath, callback) - awful.spawn.with_line_callback(string.format("curl -L -s %s -o %s", url, filepath), - { - exit=callback - }) -end - -return _filesystem diff --git a/cfg/awesome/bling/helpers/icon_theme.lua b/cfg/awesome/bling/helpers/icon_theme.lua deleted file mode 100644 index c4d4583..0000000 --- a/cfg/awesome/bling/helpers/icon_theme.lua +++ /dev/null @@ -1,142 +0,0 @@ -local lgi = require("lgi") -local Gio = lgi.Gio -local Gtk = lgi.require("Gtk", "3.0") -local gobject = require("gears.object") -local gtable = require("gears.table") -local setmetatable = setmetatable -local ipairs = ipairs - -local icon_theme = { mt = {} } - -local name_lookup = -{ - ["jetbrains-studio"] = "android-studio" -} - -local function get_icon_by_pid_command(self, client, apps) - local pid = client.pid - if pid ~= nil then - local handle = io.popen(string.format("ps -p %d -o comm=", pid)) - local pid_command = handle:read("*a"):gsub("^%s*(.-)%s*$", "%1") - handle:close() - - for _, app in ipairs(apps) do - local executable = app:get_executable() - if executable and executable:find(pid_command, 1, true) then - return self:get_gicon_path(app:get_icon()) - end - end - end -end - -local function get_icon_by_icon_name(self, client, apps) - local icon_name = client.icon_name and client.icon_name:lower() or nil - if icon_name ~= nil then - for _, app in ipairs(apps) do - local name = app:get_name():lower() - if name and name:find(icon_name, 1, true) then - return self:get_gicon_path(app:get_icon()) - end - end - end -end - -local function get_icon_by_class(self, client, apps) - if client.class ~= nil then - local class = name_lookup[client.class] or client.class:lower() - - -- Try to remove dashes - local class_1 = class:gsub("[%-]", "") - - -- Try to replace dashes with dot - local class_2 = class:gsub("[%-]", ".") - - -- Try to match only the first word - local class_3 = class:match("(.-)-") or class - class_3 = class_3:match("(.-)%.") or class_3 - class_3 = class_3:match("(.-)%s+") or class_3 - - local possible_icon_names = { class, class_3, class_2, class_1 } - for _, app in ipairs(apps) do - local id = app:get_id():lower() - for _, possible_icon_name in ipairs(possible_icon_names) do - if id and id:find(possible_icon_name, 1, true) then - return self:get_gicon_path(app:get_icon()) - end - end - end - end -end - -function icon_theme:get_client_icon_path(client) - local apps = Gio.AppInfo.get_all() - - return get_icon_by_pid_command(self, client, apps) or - get_icon_by_icon_name(self, client, apps) or - get_icon_by_class(self, client, apps) or - client.icon or - self:choose_icon({"window", "window-manager", "xfwm4-default", "window_list" }) -end - -function icon_theme:choose_icon(icons_names) - local icon_info = self.gtk_theme:choose_icon(icons_names, self.icon_size, 0); - if icon_info then - local icon_path = icon_info:get_filename() - if icon_path then - return icon_path - end - end - - return "" -end - -function icon_theme:get_gicon_path(gicon) - if gicon == nil then - return "" - end - - local icon_info = self.gtk_theme:lookup_by_gicon(gicon, self.icon_size, 0); - if icon_info then - local icon_path = icon_info:get_filename() - if icon_path then - return icon_path - end - end - - return "" -end - -function icon_theme:get_icon_path(icon_name) - local icon_info = self.gtk_theme:lookup_icon(icon_name, self.icon_size, 0) - if icon_info then - local icon_path = icon_info:get_filename() - if icon_path then - return icon_path - end - end - - return "" -end - -local function new(theme_name, icon_size) - local ret = gobject{} - gtable.crush(ret, icon_theme, true) - - ret.name = theme_name or nil - ret.icon_size = icon_size or 48 - - if theme_name then - ret.gtk_theme = Gtk.IconTheme.new() - Gtk.IconTheme.set_custom_theme(ret.gtk_theme, theme_name); - else - ret.gtk_theme = Gtk.IconTheme.get_default() - end - - return ret -end - -function icon_theme.mt:__call(...) - return new(...) -end - -return setmetatable(icon_theme, icon_theme.mt) \ No newline at end of file diff --git a/cfg/awesome/bling/helpers/init.lua b/cfg/awesome/bling/helpers/init.lua deleted file mode 100644 index f2c898e..0000000 --- a/cfg/awesome/bling/helpers/init.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - client = require(... .. ".client"), - color = require(... .. ".color"), - filesystem = require(... .. ".filesystem"), - shape = require(... .. ".shape"), - time = require(... .. ".time"), -} diff --git a/cfg/awesome/bling/helpers/shape.lua b/cfg/awesome/bling/helpers/shape.lua deleted file mode 100644 index fedc544..0000000 --- a/cfg/awesome/bling/helpers/shape.lua +++ /dev/null @@ -1,30 +0,0 @@ -local gears = require("gears") - -local shape = {} - --- Create rounded rectangle shape (in one line) - -function shape.rrect(radius) - return function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, radius) - end -end - --- Create partially rounded rect - -function shape.prrect(radius, tl, tr, br, bl) - return function(cr, width, height) - gears.shape.partially_rounded_rect( - cr, - width, - height, - tl, - tr, - br, - bl, - radius - ) - end -end - -return shape diff --git a/cfg/awesome/bling/helpers/time.lua b/cfg/awesome/bling/helpers/time.lua deleted file mode 100644 index 5ab0f25..0000000 --- a/cfg/awesome/bling/helpers/time.lua +++ /dev/null @@ -1,24 +0,0 @@ -local time = {} - ---- Parse a time string to seconds (from midnight) --- --- @string time The time (`HH:MM:SS`) --- @treturn int The number of seconds since 00:00:00 -function time.hhmmss_to_seconds(time) - hour_sec = tonumber(string.sub(time, 1, 2)) * 3600 - min_sec = tonumber(string.sub(time, 4, 5)) * 60 - get_sec = tonumber(string.sub(time, 7, 8)) - return (hour_sec + min_sec + get_sec) -end - ---- Get time difference in seconds. --- --- @tparam string base The time to compare from (`HH:MM:SS`). --- @tparam string base The time to compare to (`HH:MM:SS`). --- @treturn int Number of seconds between the two times. -function time.time_diff(base, compare) - local diff = time.hhmmss_to_seconds(base) - time.hhmmss_to_seconds(compare) - return diff -end - -return time diff --git a/cfg/awesome/bling/icons/layouts/centered.png b/cfg/awesome/bling/icons/layouts/centered.png deleted file mode 100644 index 5e4d07f..0000000 Binary files a/cfg/awesome/bling/icons/layouts/centered.png and /dev/null differ diff --git a/cfg/awesome/bling/icons/layouts/deck.png b/cfg/awesome/bling/icons/layouts/deck.png deleted file mode 100644 index 829d0c2..0000000 Binary files a/cfg/awesome/bling/icons/layouts/deck.png and /dev/null differ diff --git a/cfg/awesome/bling/icons/layouts/equalarea.png b/cfg/awesome/bling/icons/layouts/equalarea.png deleted file mode 100644 index 47164a9..0000000 Binary files a/cfg/awesome/bling/icons/layouts/equalarea.png and /dev/null differ diff --git a/cfg/awesome/bling/icons/layouts/horizontal.png b/cfg/awesome/bling/icons/layouts/horizontal.png deleted file mode 100644 index 217f4eb..0000000 Binary files a/cfg/awesome/bling/icons/layouts/horizontal.png and /dev/null differ diff --git a/cfg/awesome/bling/icons/layouts/mstab.png b/cfg/awesome/bling/icons/layouts/mstab.png deleted file mode 100644 index 4372846..0000000 Binary files a/cfg/awesome/bling/icons/layouts/mstab.png and /dev/null differ diff --git a/cfg/awesome/bling/icons/layouts/vertical.png b/cfg/awesome/bling/icons/layouts/vertical.png deleted file mode 100644 index 3561673..0000000 Binary files a/cfg/awesome/bling/icons/layouts/vertical.png and /dev/null differ diff --git a/cfg/awesome/bling/images/bling_banner-2x.png b/cfg/awesome/bling/images/bling_banner-2x.png deleted file mode 100644 index 9e2ab30..0000000 Binary files a/cfg/awesome/bling/images/bling_banner-2x.png and /dev/null differ diff --git a/cfg/awesome/bling/images/bling_banner.png b/cfg/awesome/bling/images/bling_banner.png deleted file mode 100644 index 43de6c9..0000000 Binary files a/cfg/awesome/bling/images/bling_banner.png and /dev/null differ diff --git a/cfg/awesome/bling/init.lua b/cfg/awesome/bling/init.lua deleted file mode 100644 index 23c0acf..0000000 --- a/cfg/awesome/bling/init.lua +++ /dev/null @@ -1,11 +0,0 @@ ---[[ - Bling - Layouts, widgets and utilities for Awesome WM ---]] -return { - layout = require(... .. ".layout"), - module = require(... .. ".module"), - helpers = require(... .. ".helpers"), - signal = require(... .. ".signal"), - widget = require(... .. ".widget"), -} diff --git a/cfg/awesome/bling/layout/centered.lua b/cfg/awesome/bling/layout/centered.lua deleted file mode 100644 index 7929dd8..0000000 --- a/cfg/awesome/bling/layout/centered.lua +++ /dev/null @@ -1,80 +0,0 @@ -local awful = require("awful") -local math = math - -local mylayout = {} - -mylayout.name = "centered" - -function mylayout.arrange(p) - local area = p.workarea - local t = p.tag or screen[p.screen].selected_tag - local nmaster = math.min(t.master_count, #p.clients) - local nslaves = #p.clients - nmaster - - local master_area_width = area.width * t.master_width_factor - if t.master_count == 0 then master_area_width = 0 end - local slave_width = 0.5 * (area.width - master_area_width) - local master_area_x = area.x + slave_width - - - -- Special case: few slaves -> make masters take more space - unless requested otherwise! - if nslaves < 2 and t.master_fill_policy ~= "master_width_factor" then - master_area_x = area.x - - if nslaves == 1 then - slave_width = area.width - master_area_width - else - master_area_width = area.width - end - end - - - -- iterate through masters - for idx = 1, nmaster do - local c = p.clients[idx] - local g - g = { - x = master_area_x, - y = area.y + (nmaster - idx) * (area.height / nmaster), - width = master_area_width, - height = area.height / nmaster, - } - p.geometries[c] = g - end - - - -- iterate through slaves - local number_of_left_sided_slaves = math.floor(nslaves / 2) - local number_of_right_sided_slaves = nslaves - number_of_left_sided_slaves - local left_iterator = 0 - local right_iterator = 0 - - for idx = 1, nslaves do - local c = p.clients[idx + nmaster] - local g - if idx % 2 == 0 then - g = { - x = area.x, - y = area.y - + left_iterator - * (area.height / number_of_left_sided_slaves), - width = slave_width, - height = area.height / number_of_left_sided_slaves, - } - left_iterator = left_iterator + 1 - else - g = { - x = master_area_x + master_area_width, - y = area.y - + right_iterator - * (area.height / number_of_right_sided_slaves), - width = slave_width, - height = area.height / number_of_right_sided_slaves, - } - right_iterator = right_iterator + 1 - end - p.geometries[c] = g - end -end - -return mylayout diff --git a/cfg/awesome/bling/layout/deck.lua b/cfg/awesome/bling/layout/deck.lua deleted file mode 100644 index e0500b9..0000000 --- a/cfg/awesome/bling/layout/deck.lua +++ /dev/null @@ -1,37 +0,0 @@ -local mylayout = {} - -mylayout.name = "deck" - -function mylayout.arrange(p) - local area = p.workarea - local t = p.tag or screen[p.screen].selected_tag - local client_count = #p.clients - - if client_count == 1 then - local c = p.clients[1] - local g = { - x = area.x, - y = area.y, - width = area.width, - height = area.height, - } - p.geometries[c] = g - return - end - - local xoffset = area.width * 0.1 / (client_count - 1) - local yoffset = area.height * 0.1 / (client_count - 1) - - for idx = 1, client_count do - local c = p.clients[idx] - local g = { - x = area.x + (idx - 1) * xoffset, - y = area.y + (idx - 1) * yoffset, - width = area.width - (xoffset * (client_count - 1)), - height = area.height - (yoffset * (client_count - 1)), - } - p.geometries[c] = g - end -end - -return mylayout diff --git a/cfg/awesome/bling/layout/equalarea.lua b/cfg/awesome/bling/layout/equalarea.lua deleted file mode 100644 index 37e972d..0000000 --- a/cfg/awesome/bling/layout/equalarea.lua +++ /dev/null @@ -1,77 +0,0 @@ -local math = math -local screen = screen -local mylayout = {} -mylayout.name = "equalarea" - -local function divide(p, g, low, high, cls, mwfact, mcount) - if low == high then - p.geometries[cls[low]] = g - else - local masters = math.max(0, math.min(mcount, high) - low + 1) - local numblock = high - low + 1 - local slaves = numblock - masters - local smalldiv - if numblock > 5 and (numblock % 5) == 0 then - smalldiv = math.floor(numblock / 5) - else - if (numblock % 3) == 0 then - smalldiv = math.floor(numblock / 3) - else - smalldiv = math.floor(numblock / 2) - end - end - local bigdiv = numblock - smalldiv - local smallmasters = math.min(masters, smalldiv) - local bigmasters = masters - smallmasters - local smallg = {} - local bigg = {} - smallg.x = g.x - smallg.y = g.y - if g.width > (g.height * 1.3) then - smallg.height = g.height - bigg.height = g.height - bigg.width = math.floor( - g.width - * (bigmasters * (mwfact - 1) + bigdiv) - / (slaves + mwfact * masters) - ) - smallg.width = g.width - bigg.width - bigg.y = g.y - bigg.x = g.x + smallg.width - else - smallg.width = g.width - bigg.width = g.width - bigg.height = math.floor( - g.height - * (bigmasters * (mwfact - 1) + bigdiv) - / (slaves + mwfact * masters) - ) - smallg.height = g.height - bigg.height - bigg.x = g.x - bigg.y = g.y + smallg.height - end - divide(p, smallg, low, high - bigdiv, cls, mwfact, mcount) - divide(p, bigg, low + smalldiv, high, cls, mwfact, mcount) - end - return -end - -function mylayout.arrange(p) - local t = p.tag or screen[p.screen].selected_tag - local wa = p.workarea - local cls = p.clients - - if #cls == 0 then - return - end - local mwfact = t.master_width_factor * 2 - local mcount = t.master_count - local g = {} - g.height = wa.height - g.width = wa.width - g.x = wa.x - g.y = wa.y - divide(p, g, 1, #cls, cls, mwfact, mcount) -end - -return mylayout diff --git a/cfg/awesome/bling/layout/horizontal.lua b/cfg/awesome/bling/layout/horizontal.lua deleted file mode 100644 index 23f9c9e..0000000 --- a/cfg/awesome/bling/layout/horizontal.lua +++ /dev/null @@ -1,56 +0,0 @@ -local math = math - -local mylayout = {} - -mylayout.name = "horizontal" - -function mylayout.arrange(p) - local area = p.workarea - local t = p.tag or screen[p.screen].selected_tag - local mwfact = t.master_width_factor - local nmaster = math.min(t.master_count, #p.clients) - local nslaves = #p.clients - nmaster - - local master_area_height = area.height * mwfact - local slave_area_height = area.height - master_area_height - - -- Special case: no slaves - if nslaves == 0 then - master_area_height = area.height - slave_area_height = 0 - end - - -- Special case: no masters - if nmaster == 0 then - master_area_height = 0 - slave_area_height = area.height - end - - -- itearte through masters - for idx = 1, nmaster do - local c = p.clients[idx] - local g = { - x = area.x + (idx - 1) * (area.width / nmaster), - y = area.y, - width = area.width / nmaster, - height = master_area_height, - } - p.geometries[c] = g - end - - -- iterate through slaves - for idx = 1, nslaves do - local c = p.clients[idx + nmaster] - local g = { - x = area.x, - y = area.y - + master_area_height - + (idx - 1) * (slave_area_height / nslaves), - width = area.width, - height = slave_area_height / nslaves, - } - p.geometries[c] = g - end -end - -return mylayout diff --git a/cfg/awesome/bling/layout/init.lua b/cfg/awesome/bling/layout/init.lua deleted file mode 100644 index de30ed6..0000000 --- a/cfg/awesome/bling/layout/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -local beautiful = require("beautiful") -local gears = require("gears") - -local M = {} -local relative_lua_path = tostring(...) - -local function get_layout_icon_path(name) - local relative_icon_path = relative_lua_path - :match("^.*bling"):gsub("%.", "/") - .. "/icons/layouts/" .. name .. ".png" - - for p in package.path:gmatch('([^;]+)') do - p = p:gsub("?.*", "") - local absolute_icon_path = p .. relative_icon_path - if gears.filesystem.file_readable(absolute_icon_path) then - return absolute_icon_path - end - end -end - -local function get_icon(icon_raw) - if icon_raw ~= nil then - return gears.color.recolor_image(icon_raw, beautiful.fg_normal) - else - return nil - end -end - -local layouts = { - "mstab", - "vertical", - "horizontal", - "centered", - "equalarea", - "deck" -} - -for _, layout_name in ipairs(layouts) do - local icon_raw = get_layout_icon_path(layout_name) - if beautiful["layout_" .. layout_name] == nil then - beautiful["layout_" .. layout_name] = get_icon(icon_raw) - end - M[layout_name] = require(... .. "." .. layout_name) -end - -return M diff --git a/cfg/awesome/bling/layout/mstab.lua b/cfg/awesome/bling/layout/mstab.lua deleted file mode 100644 index 88ce0cb..0000000 --- a/cfg/awesome/bling/layout/mstab.lua +++ /dev/null @@ -1,236 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local wibox = require("wibox") -local beautiful = require("beautiful") - -local mylayout = {} - -mylayout.name = "mstab" - -local tabbar_disable = beautiful.mstab_bar_disable or false -local tabbar_ontop = beautiful.mstab_bar_ontop or false -local tabbar_padding = beautiful.mstab_bar_padding or "default" -local border_radius = beautiful.mstab_border_radius - or beautiful.border_radius - or 0 -local tabbar_position = beautiful.mstab_tabbar_position - or beautiful.tabbar_position - or "top" - -local bar_style = beautiful.mstab_tabbar_style - or beautiful.tabbar_style - or "default" -local bar = require( - tostring(...):match(".*bling") .. ".widget.tabbar." .. bar_style -) -local tabbar_size = bar.size - or beautiful.mstab_bar_height - or beautiful.tabbar_size - or 40 -local dont_resize_slaves = beautiful.mstab_dont_resize_slaves or false - --- The top_idx is the idx of the slave clients (excluding all master clients) --- that should be on top of all other slave clients ("the focused slave") --- by creating a variable outside of the arrange function, this layout can "remember" that client --- by creating it as a new property of every tag, this layout can be active on different tags and --- still have different "focused slave clients" -for idx, tag in ipairs(root.tags()) do - tag.top_idx = 1 -end - --- Haven't found a signal that is emitted when a new tag is added. That should work though --- since you can't use a layout on a tag that you haven't selected previously -tag.connect_signal("property::selected", function(t) - if not t.top_idx then - t.top_idx = 1 - end -end) - -function update_tabbar( - clients, - t, - top_idx, - area, - master_area_width, - slave_area_width -) - local s = t.screen - - -- create the list of clients for the tabbar - local clientlist = bar.layout() - for idx, c in ipairs(clients) do - -- focus with right click, kill with mid click, minimize with left click - local buttons = gears.table.join( - awful.button({}, 1, function() - c:raise() - client.focus = c - end), - awful.button({}, 2, function() - c:kill() - end), - awful.button({}, 3, function() - c.minimized = true - end) - ) - local client_box = bar.create(c, (idx == top_idx), buttons) - clientlist:add(client_box) - end - - -- if no tabbar exists, create one - if not s.tabbar then - s.tabbar = wibox({ - ontop = tabbar_ontop, - shape = function(cr, width, height) - gears.shape.rounded_rect(cr, width, height, border_radius) - end, - bg = bar.bg_normal, - visible = true, - }) - - -- Change visibility of the tab bar when layout, selected tag or number of clients (visible, master, slave) changes - local function adjust_visibility() - local name = awful.layout.getname( awful.layout.get( s ) ) - s.tabbar.visible = (name == mylayout.name) - end - - tag.connect_signal("property::selected", adjust_visibility) - tag.connect_signal("property::layout", adjust_visibility) - tag.connect_signal("tagged", adjust_visibility) - tag.connect_signal("untagged", adjust_visibility) - tag.connect_signal("property::master_count", adjust_visibility) - client.connect_signal("property::minimized", adjust_visibility) - end - - -- update the tabbar size and position (to support gap size change on the fly) - if tabbar_position == "top" then - s.tabbar.x = area.x + master_area_width + t.gap - s.tabbar.y = area.y + t.gap - s.tabbar.width = slave_area_width - 2 * t.gap - s.tabbar.height = tabbar_size - elseif tabbar_position == "bottom" then - s.tabbar.x = area.x + master_area_width + t.gap - s.tabbar.y = area.y + area.height - tabbar_size - t.gap - s.tabbar.width = slave_area_width - 2 * t.gap - s.tabbar.height = tabbar_size - elseif tabbar_position == "left" then - s.tabbar.x = area.x + master_area_width + t.gap - s.tabbar.y = area.y + t.gap - s.tabbar.width = tabbar_size - s.tabbar.height = area.height - 2 * t.gap - elseif tabbar_position == "right" then - s.tabbar.x = area.x - + master_area_width - + slave_area_width - - tabbar_size - - t.gap - s.tabbar.y = area.y + t.gap - s.tabbar.width = tabbar_size - s.tabbar.height = area.height - 2 * t.gap - end - - -- update clientlist - s.tabbar:setup({ layout = wibox.layout.flex.horizontal, clientlist }) -end - -function mylayout.arrange(p) - local area = p.workarea - local t = p.tag or screen[p.screen].selected_tag - local s = t.screen - local mwfact = t.master_width_factor - local nmaster = math.min(t.master_count, #p.clients) - local nslaves = #p.clients - nmaster - - local master_area_width = area.width * mwfact - local slave_area_width = area.width - master_area_width - - -- "default" means that it uses standard useless gap size - if tabbar_padding == "default" then - tabbar_padding = 2 * t.gap - end - - -- Special case: No masters -> full screen slave width - if nmaster == 0 then - master_area_width = 1 - slave_area_width = area.width - end - - -- Special case: One or zero slaves -> no tabbar (essentially tile right) - if nslaves <= 1 then - -- since update_tabbar isnt called that way we have to hide it manually - if s.tabbar then - s.tabbar.visible = false - end - -- otherwise just do tile right - awful.layout.suit.tile.right.arrange(p) - return - end - - -- Iterate through masters - for idx = 1, nmaster do - local c = p.clients[idx] - local g = { - x = area.x, - y = area.y + (idx - 1) * (area.height / nmaster), - width = master_area_width, - height = area.height / nmaster, - } - p.geometries[c] = g - end - - local tabbar_size_change = 0 - local tabbar_width_change = 0 - local tabbar_y_change = 0 - local tabbar_x_change = 0 - if not tabbar_disable then - if tabbar_position == "top" then - tabbar_size_change = tabbar_size + tabbar_padding - tabbar_y_change = tabbar_size + tabbar_padding - elseif tabbar_position == "bottom" then - tabbar_size_change = tabbar_size + tabbar_padding - elseif tabbar_position == "left" then - tabbar_width_change = tabbar_size + tabbar_padding - tabbar_x_change = tabbar_size + tabbar_padding - elseif tabbar_position == "right" then - tabbar_width_change = tabbar_size + tabbar_padding - end - end - - -- Iterate through slaves - -- (also creates a list of all slave clients for update_tabbar) - local slave_clients = {} - for idx = 1, nslaves do - local c = p.clients[idx + nmaster] - slave_clients[#slave_clients + 1] = c - if c == client.focus then - t.top_idx = #slave_clients - end - local g = { - x = area.x + master_area_width + tabbar_x_change, - y = area.y + tabbar_y_change, - width = slave_area_width - tabbar_width_change, - height = area.height - tabbar_size_change, - } - if not dont_resize_slaves and idx ~= t.top_idx then - g = { - x = area.x + master_area_width + slave_area_width / 4, - y = area.y + tabbar_size + area.height / 4, - width = slave_area_width / 2, - height = area.height / 4 - tabbar_size, - } - end - p.geometries[c] = g - end - - if not tabbar_disable then - update_tabbar( - slave_clients, - t, - t.top_idx, - area, - master_area_width, - slave_area_width - ) - end -end - -return mylayout diff --git a/cfg/awesome/bling/layout/vertical.lua b/cfg/awesome/bling/layout/vertical.lua deleted file mode 100644 index 8b6811e..0000000 --- a/cfg/awesome/bling/layout/vertical.lua +++ /dev/null @@ -1,56 +0,0 @@ -local math = math - -local mylayout = {} - -mylayout.name = "vertical" - -function mylayout.arrange(p) - local area = p.workarea - local t = p.tag or screen[p.screen].selected_tag - local mwfact = t.master_width_factor - local nmaster = math.min(t.master_count, #p.clients) - local nslaves = #p.clients - nmaster - - local master_area_width = area.width * mwfact - local slave_area_width = area.width - master_area_width - - -- Special case: no slaves - if nslaves == 0 then - master_area_width = area.width - slave_area_width = 0 - end - - -- Special case: no masters - if nmaster == 0 then - master_area_width = 0 - slave_area_width = area.width - end - - -- iterate through masters - for idx = 1, nmaster do - local c = p.clients[idx] - local g = { - x = area.x, - y = area.y + (idx - 1) * (area.height / nmaster), - width = master_area_width, - height = area.height / nmaster, - } - p.geometries[c] = g - end - - -- itearte through slaves - for idx = 1, nslaves do - local c = p.clients[idx + nmaster] - local g = { - x = area.x - + master_area_width - + (idx - 1) * (slave_area_width / nslaves), - y = area.y, - width = slave_area_width / nslaves, - height = area.height, - } - p.geometries[c] = g - end -end - -return mylayout diff --git a/cfg/awesome/bling/module/flash_focus.lua b/cfg/awesome/bling/module/flash_focus.lua deleted file mode 100644 index 7808cd9..0000000 --- a/cfg/awesome/bling/module/flash_focus.lua +++ /dev/null @@ -1,40 +0,0 @@ -local gears = require("gears") -local beautiful = require("beautiful") - -local op = beautiful.flash_focus_start_opacity or 0.6 -local stp = beautiful.flash_focus_step or 0.01 -local timeout = beautiful.flash_focus_timeout or stp - -local flashfocus = function(c) - if c and #c.screen.clients > 1 then - c.opacity = op - local q = op - local g = gears.timer({ - timeout = timeout, - call_now = false, - autostart = true, - }) - - g:connect_signal("timeout", function() - if not c.valid then - return - end - if q >= 1 then - c.opacity = 1 - g:stop() - else - c.opacity = q - q = q + stp - end - end) - end -end - -local enable = function() - client.connect_signal("focus", flashfocus) -end -local disable = function() - client.disconnect_signal("focus", flashfocus) -end - -return { enable = enable, disable = disable, flashfocus = flashfocus } diff --git a/cfg/awesome/bling/module/init.lua b/cfg/awesome/bling/module/init.lua deleted file mode 100644 index ed127f6..0000000 --- a/cfg/awesome/bling/module/init.lua +++ /dev/null @@ -1,8 +0,0 @@ -return { - window_swallowing = require(... .. ".window_swallowing"), - tiled_wallpaper = require(... .. ".tiled_wallpaper"), - wallpaper = require(... .. ".wallpaper"), - flash_focus = require(... .. ".flash_focus"), - tabbed = require(... .. ".tabbed"), - scratchpad = require(... .. ".scratchpad"), -} diff --git a/cfg/awesome/bling/module/scratchpad.lua b/cfg/awesome/bling/module/scratchpad.lua deleted file mode 100644 index 6ef011f..0000000 --- a/cfg/awesome/bling/module/scratchpad.lua +++ /dev/null @@ -1,374 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local naughty = require("naughty") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local capi = { awesome = awesome, client = client } -local ruled = capi.awesome.version ~= "v4.3" and require("ruled") or nil -local pairs = pairs - -local Scratchpad = { mt = {} } - ---- Called when the turn off animation has ended -local function on_animate_turn_off_end(self, tag) - -- When toggling off a scratchpad that's present on multiple tags - -- depsite still being unminizmied on the other tags it will become invisible - -- as it's position could be outside the screen from the animation - self.client:geometry({ - x = self.geometry.x + self.client.screen.geometry.x, - y = self.geometry.y + self.client.screen.geometry.y, - width = self.geometry.width, - height = self.geometry.height, - }) - - helpers.client.turn_off(self.client, tag) - - self.turning_off = false - - self:emit_signal("turn_off", self.client) -end - ---- The turn off animation -local function animate_turn_off(self, anim, axis) - self.screen_on_toggled_scratchpad = self.client.screen - self.tag_on_toggled_scratchpad = self.screen_on_toggled_scratchpad.selected_tag - - if self.client.floating == false then - -- Save the client geometry before floating it - local non_floating_x = self.client.x - local non_floating_y = self.client.y - local non_floating_width = self.client.width - local non_floating_height = self.client.height - - -- Can't animate non floating clients - self.client.floating = true - - -- Set the client geometry back to what it was before floating it - self.client:geometry({ - x = non_floating_x, - y = non_floating_y, - width = non_floating_width, - height = non_floating_height, - }) - end - - if axis == "x" then - anim.pos = self.client.x - else - anim.pos = self.client.y - end - - anim:set(anim:initial()) -end - --- Handles changing tag mid animation -local function abort_if_tag_was_switched(self) - -- Check for the following scenerio: - -- Toggle on scratchpad at tag 1 - -- Toggle on scratchpad at tag 2 - -- Toggle off scratchpad at tag 1 - -- Switch to tag 2 - -- Outcome: The client will remain on tag 1 and will instead be removed from tag 2 - if (self.turning_off) and (self.screen_on_toggled_scratchpad and - self.screen_on_toggled_scratchpad.selected_tag) ~= self.tag_on_toggled_scratchpad - then - if self.rubato.x then - self.rubato.x:abort() - end - if self.rubato.y then - self.rubato.y:abort() - end - on_animate_turn_off_end(self, self.tag_on_toggled_scratchpad) - self.screen_on_toggled_scratchpad.selected_tag = nil - self.tag_on_toggled_scratchpad = nil - end -end - ---- The turn on animation -local function animate_turn_on(self, anim, axis) - -- Check for the following scenerio: - -- Toggle on scratchpad at tag 1 - -- Toggle on scratchpad at tag 2 - -- The animation will instantly end - -- as the timer pos is already at the on position - -- from toggling on the scratchpad at tag 1 - if axis == "x" and anim.pos == self.geometry.x then - anim.pos = anim:initial() - else - if anim.pos == self.geometry.y then - anim.pos = anim:initial() - end - end - - if axis == "x" then - anim:set(self.geometry.x) - else - anim:set(self.geometry.y) - end -end - ---- Creates a new scratchpad object based on the argument --- --- @param args A table of possible arguments --- @return The new scratchpad object -function Scratchpad:new(args) - args = args or {} - if args.awestore then - naughty.notify({ - title = "Bling Error", - text = "Awestore is no longer supported! Please take a look at the scratchpad documentation and use rubato for animations instead.", - }) - end - - args.rubato = args.rubato or {} - - local ret = gears.object{} - gears.table.crush(ret, Scratchpad) - gears.table.crush(ret, args) - - if ret.rubato.x then - ret.rubato.x:subscribe(function(pos) - if ret.client and ret.client.valid then - ret.client.x = pos - end - abort_if_tag_was_switched(ret) - end) - - ret.rubato.x.ended:subscribe(function() - if ((ret.rubato.y and ret.rubato.y.state == false) or (ret.rubato.y == nil)) and ret.turning_off == true then - on_animate_turn_off_end(ret) - end - end) - end - if ret.rubato.y then - ret.rubato.y:subscribe(function(pos) - if ret.client and ret.client.valid then - ret.client.y = pos - end - abort_if_tag_was_switched(ret) - end) - - ret.rubato.y.ended:subscribe(function() - if ((ret.rubato.x and ret.rubato.x.state == false) or (ret.rubato.x == nil)) and ret.turning_off == true then - on_animate_turn_off_end(ret) - end - end) - end - - return ret -end - ---- Find all clients that satisfy the the rule --- --- @return A list of all clients that satisfy the rule -function Scratchpad:find() - return helpers.client.find(self.rule) -end - ---- Applies the objects scratchpad properties to a given client --- --- @param c A client to which to apply the properties -function Scratchpad:apply(c) - if not c or not c.valid then - return - end - c.floating = self.floating - c.sticky = self.sticky - c.fullscreen = false - c.maximized = false - c:geometry({ - x = self.geometry.x + awful.screen.focused().geometry.x, - y = self.geometry.y + awful.screen.focused().geometry.y, - width = self.geometry.width, - height = self.geometry.height, - }) - - if self.autoclose then - c:connect_signal("unfocus", function(c1) - c1.sticky = false -- client won't turn off if sticky - helpers.client.turn_off(c1) - end) - end -end - ---- Turns the scratchpad on -function Scratchpad:turn_on() - self.client = self:find()[1] - - local anim_x = self.rubato.x - local anim_y = self.rubato.y - - local in_anim = false - if (anim_x and anim_x.state == true) or (anim_y and anim_y.state == true) then - in_anim = true - end - - if self.client and not in_anim and self.client.first_tag and self.client.first_tag.selected then - self.client:raise() - capi.client.focus = self.client - return - end - if self.client and not in_anim then - -- if a client was found, turn it on - if self.reapply then - self:apply(self.client) - end - -- c.sticky was set to false in turn_off so it has to be reapplied anyway - self.client.sticky = self.sticky - - if anim_x then - animate_turn_on(self, anim_x, "x") - end - if anim_y then - animate_turn_on(self, anim_y, "y") - end - - helpers.client.turn_on(self.client) - self:emit_signal("turn_on", self.client) - - return - end - if not self.client then - -- if no client was found, spawn one, find the corresponding window, - -- apply the properties only once (until the next closing) - local pid = awful.spawn.with_shell(self.command) - if capi.awesome.version ~= "v4.3" then - ruled.client.append_rule({ - id = "scratchpad", - rule = self.rule, - properties = { - -- If a scratchpad is opened it should spawn at the current tag - -- the same way it will behave if the client was already open - tag = awful.screen.focused().selected_tag, - switch_to_tags = false, - -- Hide the client until the gemoetry rules are applied - hidden = true, - minimized = true, - }, - callback = function(c) - -- For a reason I can't quite get the gemotery rules will fail to apply unless we use this timer - gears.timer({ - timeout = 0.15, - autostart = true, - single_shot = true, - callback = function() - self.client = c - - self:apply(c) - c.hidden = false - c.minimized = false - -- Some clients fail to gain focus - c:activate({}) - - if anim_x then - animate_turn_on(self, anim_x, "x") - end - if anim_y then - animate_turn_on(self, anim_y, "y") - end - - self:emit_signal("inital_apply", c) - - -- Discord spawns 2 windows, so keep the rule until the 2nd window shows - if c.name ~= "Discord Updater" then - ruled.client.remove_rule("scratchpad") - end - -- In a case Discord is killed before the second window spawns - c:connect_signal("request::unmanage", function() - ruled.client.remove_rule("scratchpad") - end) - end, - }) - end, - }) - else - local function inital_apply(c1) - if helpers.client.is_child_of(c1, pid) then - self.client = c1 - - self:apply(c1) - if anim_x then - animate_turn_on(self, anim_x, "x") - end - if anim_y then - animate_turn_on(self, anim_y, "y") - end - self:emit_signal("inital_apply", c1) - client.disconnect_signal("manage", inital_apply) - end - end - client.connect_signal("manage", inital_apply) - end - end -end - ---- Turns the scratchpad off -function Scratchpad:turn_off() - self.client = self:find()[1] - - -- Get the tweens - local anim_x = self.rubato.x - local anim_y = self.rubato.y - - local in_anim = false - if (anim_x and anim_x.state == true) or (anim_y and anim_y.state == true) then - in_anim = true - end - - if self.client and not in_anim then - if anim_x then - self.turning_off = true - animate_turn_off(self, anim_x, "x") - end - if anim_y then - self.turning_off = true - animate_turn_off(self, anim_y, "y") - end - - if not anim_x and not anim_y then - helpers.client.turn_off(self.client) - self:emit_signal("turn_off", self.client) - end - end -end - ---- Turns the scratchpad off if it is focused otherwise it raises the scratchpad -function Scratchpad:toggle() - local is_turn_off = false - local c = self:find()[1] - if self.dont_focus_before_close then - if c then - if c.sticky and #c:tags() > 0 then - is_turn_off = true - else - local current_tag = c.screen.selected_tag - for k, tag in pairs(c:tags()) do - if tag == current_tag then - is_turn_off = true - break - else - is_turn_off = false - end - end - end - end - else - is_turn_off = capi.client.focus - and awful.rules.match(capi.client.focus, self.rule) - end - - if is_turn_off then - self:turn_off() - else - self:turn_on() - end -end - ---- Make the module callable without putting a `:new` at the end of it --- --- @param args A table of possible arguments --- @return The new scratchpad object -function Scratchpad.mt:__call(...) - return Scratchpad:new(...) -end - -return setmetatable(Scratchpad, Scratchpad.mt) diff --git a/cfg/awesome/bling/module/tabbed.lua b/cfg/awesome/bling/module/tabbed.lua deleted file mode 100644 index c53ec03..0000000 --- a/cfg/awesome/bling/module/tabbed.lua +++ /dev/null @@ -1,274 +0,0 @@ ---[[ - -This module currently works by adding a new property to each client that is tabbed. -That new property is called bling_tabbed. -So each client in a tabbed state has the property "bling_tabbed" which is a table. -Each client that is not tabbed doesn't have that property. -In the function themselves, the same object is refered to as "tabobj" which is why -you will often see something like: "local tabobj = some_client.bling_tabbed" at the beginning -of a function. - ---]] - -local awful = require("awful") -local wibox = require("wibox") -local gears = require("gears") -local beautiful = require("beautiful") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") - -local bar_style = beautiful.tabbar_style or "default" -local bar = require( - tostring(...):match(".*bling") .. ".widget.tabbar." .. bar_style -) - -tabbed = {} - --- helper function to connect to the (un)focus signals -local function update_tabbar_from(c) - if not c or not c.bling_tabbed then - return - end - tabbed.update_tabbar(c.bling_tabbed) -end - --- used to change focused tab relative to the currently focused one -tabbed.iter = function(idx) - if not idx then - idx = 1 - end - if not client.focus or not client.focus.bling_tabbed then - return - end - local tabobj = client.focus.bling_tabbed - local new_idx = (tabobj.focused_idx + idx) % #tabobj.clients - if new_idx == 0 then - new_idx = #tabobj.clients - end - tabbed.switch_to(tabobj, new_idx) -end - --- removes a given client from its tab object -tabbed.remove = function(c) - if not c or not c.bling_tabbed then - return - end - local tabobj = c.bling_tabbed - table.remove(tabobj.clients, tabobj.focused_idx) - if not beautiful.tabbar_disable then - awful.titlebar.hide(c, bar.position) - end - c.bling_tabbed = nil - c:disconnect_signal("focus", update_tabbar_from) - c:disconnect_signal("unfocus", update_tabbar_from) - awesome.emit_signal("bling::tabbed::client_removed", tabobj, c) - tabbed.switch_to(tabobj, 1) -end - --- removes the currently focused client from the tab object -tabbed.pop = function() - if not client.focus or not client.focus.bling_tabbed then - return - end - tabbed.remove(client.focus) -end - --- adds a client to a given tabobj -tabbed.add = function(c, tabobj) - if c.bling_tabbed then - tabbed.remove(c) - end - c:connect_signal("focus", update_tabbar_from) - c:connect_signal("unfocus", update_tabbar_from) - helpers.client.sync(c, tabobj.clients[tabobj.focused_idx]) - tabobj.clients[#tabobj.clients + 1] = c - tabobj.focused_idx = #tabobj.clients - -- calls update even though switch_to calls update again - -- but the new client needs to have the tabobj property - -- before a clean switch can happen - tabbed.update(tabobj) - awesome.emit_signal("bling::tabbed::client_added", tabobj, c) - tabbed.switch_to(tabobj, #tabobj.clients) -end - --- use xwininfo to select one client and make it tab in the currently focused tab -tabbed.pick = function() - if not client.focus then - return - end - -- this function uses xwininfo to grab a client window id which is then - -- compared to all other clients window ids - - local xwininfo_cmd = - [[ xwininfo | grep 'xwininfo: Window id:' | cut -d " " -f 4 ]] - awful.spawn.easy_async_with_shell(xwininfo_cmd, function(output) - for _, c in ipairs(client.get()) do - if tonumber(c.window) == tonumber(output) then - if not client.focus.bling_tabbed and not c.bling_tabbed then - tabbed.init(client.focus) - tabbed.add(c, client.focus.bling_tabbed) - end - if not client.focus.bling_tabbed and c.bling_tabbed then - tabbed.add(client.focus, c.bling_tabbed) - end - if client.focus.bling_tabbed and not c.bling_tabbed then - tabbed.add(c, client.focus.bling_tabbed) - end - -- TODO: Should also merge tabs when focus and picked - -- both are tab groups - end - end - end) -end - --- select a client by direction and make it tab in the currently focused tab -tabbed.pick_by_direction = function(direction) - local sel = client.focus - if not sel then - return - end - if not sel.bling_tabbed then - tabbed.init(sel) - end - local c = helpers.client.get_by_direction(direction) - if not c then - return - end - tabbed.add(c, sel.bling_tabbed) -end - --- use dmenu to select a client and make it tab in the currently focused tab -tabbed.pick_with_dmenu = function(dmenu_command) - if not client.focus then - return - end - - if not dmenu_command then - dmenu_command = "rofi -dmenu -i" - end - - -- get all clients from the current tag - -- ignores the case where multiple tags are selected - local t = awful.screen.focused().selected_tag - local list_clients = {} - local list_clients_string = "" - for idx, c in ipairs(t:clients()) do - if c.window ~= client.focus.window then - list_clients[#list_clients + 1] = c - if #list_clients ~= 1 then - list_clients_string = list_clients_string .. "\\n" - end - list_clients_string = list_clients_string - .. tostring(c.window) - .. " " - .. c.name - end - end - - if #list_clients == 0 then - return - end - -- calls the actual dmenu - local xprop_cmd = [[ echo -e "]] - .. list_clients_string - .. [[" | ]] - .. dmenu_command - .. [[ | awk '{ print $1 }' ]] - awful.spawn.easy_async_with_shell(xprop_cmd, function(output) - for _, c in ipairs(list_clients) do - if tonumber(c.window) == tonumber(output) then - if not client.focus.bling_tabbed then - tabbed.init(client.focus) - end - local tabobj = client.focus.bling_tabbed - tabbed.add(c, tabobj) - end - end - end) -end - --- update everything about one tab object -tabbed.update = function(tabobj) - local currently_focused_c = tabobj.clients[tabobj.focused_idx] - -- update tabobj of each client and other things - for idx, c in ipairs(tabobj.clients) do - if c.valid then - c.bling_tabbed = tabobj - helpers.client.sync(c, currently_focused_c) - -- the following handles killing a client while the client is tabbed - c:connect_signal("unmanage", function(c) - tabbed.remove(c) - end) - end - end - - -- Maybe remove if I'm the only one using it? - awesome.emit_signal("bling::tabbed::update", tabobj) - if not beautiful.tabbar_disable then - tabbed.update_tabbar(tabobj) - end -end - --- change focused tab by absolute index -tabbed.switch_to = function(tabobj, new_idx) - local old_focused_c = tabobj.clients[tabobj.focused_idx] - tabobj.focused_idx = new_idx - for idx, c in ipairs(tabobj.clients) do - if idx ~= new_idx then - helpers.client.turn_off(c) - else - helpers.client.turn_on(c) - c:raise() - if old_focused_c and old_focused_c.valid then - c:swap(old_focused_c) - end - helpers.client.sync(c, old_focused_c) - end - end - awesome.emit_signal("bling::tabbed::changed_focus", tabobj) - tabbed.update(tabobj) -end - -tabbed.update_tabbar = function(tabobj) - local flexlist = bar.layout() - local tabobj_focused_client = tabobj.clients[tabobj.focused_idx] - local tabobj_is_focused = (client.focus == tabobj_focused_client) - -- itearte over all tabbed clients to create the widget tabbed list - for idx, c in ipairs(tabobj.clients) do - local buttons = gears.table.join(awful.button({}, 1, function() - tabbed.switch_to(tabobj, idx) - end)) - local wid_temp = bar.create(c, (idx == tabobj.focused_idx), buttons, - not tabobj_is_focused) - flexlist:add(wid_temp) - end - -- add tabbar to each tabbed client (clients will be hided anyway) - for _, c in ipairs(tabobj.clients) do - local titlebar = awful.titlebar(c, { - bg = bar.bg_normal, - size = bar.size, - position = bar.position, - }) - titlebar:setup({ layout = wibox.layout.flex.horizontal, flexlist }) - end -end - -tabbed.init = function(c) - local tabobj = {} - tabobj.clients = { c } - c:connect_signal("focus", update_tabbar_from) - c:connect_signal("unfocus", update_tabbar_from) - tabobj.focused_idx = 1 - tabbed.update(tabobj) -end - -if beautiful.tabbed_spawn_in_tab then - client.connect_signal("manage", function(c) - local s = awful.screen.focused() - local previous_client = awful.client.focus.history.get(s, 1) - if previous_client and previous_client.bling_tabbed then - tabbed.add(c, previous_client.bling_tabbed) - end - end) -end - -return tabbed diff --git a/cfg/awesome/bling/module/tiled_wallpaper.lua b/cfg/awesome/bling/module/tiled_wallpaper.lua deleted file mode 100644 index 75014cf..0000000 --- a/cfg/awesome/bling/module/tiled_wallpaper.lua +++ /dev/null @@ -1,56 +0,0 @@ ---[[ - This module makes use of cairo surfaces - For documentation take a look at the C docs: - https://www.cairographics.org/ - They can be applied to lua by changing the naming conventions - and adjusting for the missing namespaces (and classes) - for example: - cairo_rectangle(cr, 1, 1, 1, 1) in C would be written as - cr:rectangle(1, 1, 1, 1) in lua - and - cairo_fill(cr) in C would be written as - cr:fill() in lua ---]] - -local cairo = require("lgi").cairo -local gears = require("gears") - -function create_tiled_wallpaper(str, s, args_table) - -- user input - args_table = args_table or {} - local fg = args_table.fg or "#ff0000" - local bg = args_table.bg or "#00ffff" - local offset_x = args_table.offset_x - local offset_y = args_table.offset_y - local font = args_table.font or "Hack" - local font_size = tonumber(args_table.font_size) or 16 - local zickzack_bool = args_table.zickzack or false - local padding = args_table.padding or 100 - - -- create cairo image wallpaper - local img = cairo.ImageSurface(cairo.Format.RGB24, padding, padding) - cr = cairo.Context(img) - - cr:set_source(gears.color(bg)) - cr:paint() - - cr:set_source(gears.color(fg)) - - cr:set_font_size(font_size) - cr:select_font_face(font) - - if zickzack_bool then - cr:set_source(gears.color(fg)) - cr:move_to(padding / 2 + font_size, padding / 2 + font_size) - cr:show_text(str) - end - - cr:set_source(gears.color(fg)) - cr:move_to(font_size, font_size) - cr:show_text(str) - - -- tile cairo image - gears.wallpaper.tiled(img, s, { x = offset_x, y = offset_y }) -end - -return create_tiled_wallpaper diff --git a/cfg/awesome/bling/module/wallpaper.lua b/cfg/awesome/bling/module/wallpaper.lua deleted file mode 100644 index e7bddf6..0000000 --- a/cfg/awesome/bling/module/wallpaper.lua +++ /dev/null @@ -1,362 +0,0 @@ ---------------------------------------------------------------------------- --- High-level declarative function for setting your wallpaper. --- --- --- An easy way to setup a complex wallpaper with slideshow, random, schedule, extensibility. --- --- @usage --- local wallpaper = require("wallpaper") --- -- A silly example --- wallpaper.setup { -- I want a wallpaper --- change_timer = 500, -- changing every 5 minutes --- set_function = wallpaper.setters.random, -- in a random way --- wallpaper = {"#abcdef", --- "~/Pictures", --- wallpaper.setters.awesome}, -- from this list (a color, a directory with pictures and the Awesome wallpaper) --- recursive = false, -- do not read subfolders of "~/Pictures" --- position = "centered", -- center it on the screen (for pictures) --- scale = 2, -- 2 time bigger (for pictures) --- } --- --- @author Grumph --- @copyright 2021 Grumph --- ---------------------------------------------------------------------------- - -local awful = require("awful") -local beautiful = require("beautiful") -local gears = require("gears") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") - -local setters = {} - ---- Apply a wallpaper. --- --- This function is a helper that will apply a wallpaper_object, --- either using gears.wallpaper.set or gears.wallpaper.* higher level functions when applicable. --- @param wallpaper_object A wallpaper object, either --- a `pattern` (see `gears.wallpaper.set`) --- a `surf` (see `gears.wallpaper.centered`) --- a function that actually sets the wallpaper. --- @tparam table args The argument table containing any of the arguments below. --- @int[opt=nil] args.screen The screen to use (as used in `gears.wallpaper` functions) --- @string[opt=nil or "centered"] args.position The `gears.wallpaper` position function to use. --- Must be set when wallpaper is a file. --- It can be `"centered"`, `"fit"`, `"tiled"` or `"maximized"`. --- @string[opt=beautiful.bg_normal or "black"] args.background See `gears.wallpaper`. --- @bool[opt=false] args.ignore_aspect See `gears.wallpaper`. --- @tparam[opt={x=0,y=0}] table args.offset See `gears.wallpaper`. --- @int[opt=1] args.scale See `gears.wallpaper`. -function apply(wallpaper_object, args) - args.background = args.background or beautiful.bg_normal or "black" - args.ignore_aspect = args.ignore_aspect or false -- false = keep aspect ratio - args.offset = args.offset or { x = 0, y = 0 } - args.scale = args.scale or 1 - local positions = { - ["centered"] = function(s) - gears.wallpaper.centered( - wallpaper_object, - s, - args.background, - args.scale - ) - end, - ["tiled"] = function(s) - gears.wallpaper.tiled(wallpaper_object, s, args.offset) - end, - ["maximized"] = function(s) - gears.wallpaper.maximized( - wallpaper_object, - s, - args.ignore_aspect, - args.offset - ) - end, - ["fit"] = function(s) - gears.wallpaper.fit(wallpaper_object, s, args.background) - end, - } - local call_func = nil - if - type(wallpaper_object) == "string" - and gears.filesystem.file_readable(wallpaper_object) - then - -- path of an image file, we use a position function - local p = args.position or "centered" - call_func = positions[p] - elseif type(wallpaper_object) == "function" then - -- function - wallpaper_object(args) - elseif - (not gears.color.ensure_pango_color(wallpaper_object, nil)) - and args.position - then - -- if the user sets a position function, wallpaper_object should be a cairo surface - call_func = positions[args.position] - else - gears.wallpaper.set(wallpaper_object) - end - if call_func then - call_func(args.screen) - end -end - ---- Converts `args.wallpaper` to a list of `wallpaper_objects` readable by `apply` function). --- --- @tparam table args The argument table containing the argument below. --- @param[opt=`beautiful.wallpaper_path` or `"black"`] args.wallpaper A wallpaper object. --- It can be a color or a cairo pattern (what `gears.wallpaper.set` understands), --- a cairo suface (set with gears.wallpaper.set if `args.position` is nil, or with --- `gears.wallpaper` position functions, see `args.position`), --- a function similar to args.set_function that will effectively set a wallpaper (usually --- with `gears.wallpaper` functions), --- a path to a file, --- path to a directory containing images, --- or a list with any of the previous choices. --- @tparam[opt=`{"jpg", "jpeg", "png", "bmp"}`] table args.image_formats A list of --- file extensions to filter when `args.wallpaper` is a directory. --- @bool[opt=true] args.recursive Either to recurse or not when `args.wallpaper` is a directory. --- @treturn table A list of `wallpaper_objects` (what `apply` can read). --- @see apply -function prepare_list(args) - args.image_formats = args.image_formats or { "jpg", "jpeg", "png", "bmp" } - args.recursive = args.recursive or true - - local wallpapers = (args.wallpaper or beautiful.wallpaper_path or "black") - local res = {} - if type(wallpapers) ~= "table" then - wallpapers = { wallpapers } - end - for _, w in ipairs(wallpapers) do - -- w is either: - -- - a directory path (string) - -- - an image path or a color (string) - -- - a cairo surface or a cairo pattern - -- - a function for setting the wallpaper - if type(w) == "string" and gears.filesystem.dir_readable(w) then - local file_list = helpers.filesystem.list_directory_files( - w, - args.image_formats, - args.recursive - ) - for _, f in ipairs(file_list) do - res[#res + 1] = w .. "/" .. f - end - else - res[#res + 1] = w - end - end - return res -end - -local simple_index = 0 ---- Set the next wallpaper in a list. --- --- @tparam table args See `prepare_list` and `apply` arguments --- @see apply --- @see prepare_list -function setters.simple(args) - local wallpapers = prepare_list(args) - simple_index = (simple_index % #wallpapers) + 1 - if type(args.screen) == 'table' then - for _,v in ipairs(args.screen) do - args.screen = v - apply(wallpapers[simple_index], args) - args.screen = nil - end - else - apply(wallpapers[simple_index], args) - end -end - ---- Set a random wallpaper from a list. --- --- @tparam table args See `prepare_list` and `apply` arguments --- @see apply --- @see prepare_list -function setters.random(args) - local wallpapers = prepare_list(args) - if type(args.screen) == 'table' then - for _,v in ipairs(args.screen) do - args.screen = v - apply(wallpapers[math.random(#wallpapers)], args) - args.screen = nil - end - else - apply(wallpapers[math.random(#wallpapers)], args) - end -end - -local simple_schedule_object = nil ---- A schedule setter. --- --- This simple schedule setter was freely inspired by [dynamic-wallpaper](https://github.com/manilarome/awesome-glorious-widgets/blob/master/dynamic-wallpaper/init.lua). --- @tparam table args The argument table containing any of the arguments below. --- @tparam table args.wallpaper The schedule table, with the form --- { --- ["HH:MM:SS"] = wallpaper, --- ["HH:MM:SS"] = wallpaper2, --- } --- The wallpapers definition can be anything the `schedule_set_function` can read --- (what you would place in `args.wallpaper` for this function), --- @tparam[opt=`setters.simple`] function args.wallpaper_set_function The set_function used by default -function setters.simple_schedule(args) - local function update_wallpaper() - local fake_args = gears.table.join(args, { - wallpaper = args.wallpaper[simple_schedule_object.closest_lower_time], - }) - simple_schedule_object.schedule_set_function(fake_args) - end - if not simple_schedule_object then - simple_schedule_object = {} - -- initialize the schedule object, so we don't do it for every call - simple_schedule_object.schedule_set_function = args.schedule_set_function - or setters.simple - -- we get the sorted time keys - simple_schedule_object.times = {} - for k in pairs(args.wallpaper) do - table.insert(simple_schedule_object.times, k) - end - table.sort(simple_schedule_object.times) - -- now we get the closest time which is below current time (the current applicable period) - local function update_timer() - local current_time = os.date("%H:%M:%S") - local next_time = simple_schedule_object.times[1] - simple_schedule_object.closest_lower_time = - simple_schedule_object.times[#simple_schedule_object.times] - for _, k in ipairs(simple_schedule_object.times) do - if k > current_time then - next_time = k - break - end - simple_schedule_object.closest_lower_time = k - end - simple_schedule_object.timer.timeout = helpers.time.time_diff( - next_time, - current_time - ) - if simple_schedule_object.timer.timeout < 0 then - -- the next_time is the day after, so we add 24 hours to the timer - simple_schedule_object.timer.timeout = simple_schedule_object.timer.timeout - + 86400 - end - simple_schedule_object.timer:again() - update_wallpaper() - end - simple_schedule_object.timer = gears.timer({ - callback = update_timer, - }) - update_timer() - else - -- if called again (usually when the change_timer is set), we just change the wallpaper depending on current parameters - update_wallpaper() - end -end - ---- Set the AWESOME wallpaper. --- --- @tparam table args The argument table containing the argument below. --- @param[opt=`beautiful.bg_normal`] args.colors.bg The bg color. --- If the default is used, the color is darkened if `beautiful.bg_normal` is light --- or lightned if `beautiful.bg_normal` is dark. --- @param[opt=`beautiful.fg_normal`] args.colors.fg The fg color. --- @param[opt=`beautiful.fg_focus`] args.colors.alt_fg The alt_fg color. --- --- see beautiful.theme_assets.wallpaper -function setters.awesome_wallpaper(args) - local colors = { - bg = beautiful.bg_normal, - fg = beautiful.fg_normal, - alt_fg = beautiful.bg_focus, - } - colors.bg = helpers.color.is_dark(beautiful.bg_normal) - and helpers.color.lighten(colors.bg) - or helpers.color.darken(colors.bg) - if type(args.colors) == "table" then - colors.bg = args.colors.bg or colors.bg - colors.fg = args.colors.fg or colors.fg - colors.alt_fg = args.colors.alt_fg or colors.alt_fg - end - -- Generate wallpaper: - if not args.screen then - for s in screen do - gears.wallpaper.set( - beautiful.theme_assets.wallpaper( - colors.bg, - colors.fg, - colors.alt_fg, - s - ) - ) - end - else - gears.wallpaper.set( - beautiful.theme_assets.wallpaper( - colors.bg, - colors.fg, - colors.alt_fg, - args.screen - ) - ) - end -end - ---- Setup a wallpaper. --- --- @tparam table args Parameters for the wallpaper. It may also contain all parameters your `args.set_function` needs --- @int[opt=nil] args.screen The screen to use (as used in `gears.wallpaper` functions) --- @int[opt=nil] args.change_timer Time in seconds for wallpaper changes --- @tparam[opt=`setters.awesome` or `setters.simple`] function args.set_function A function to set the wallpaper --- It takes args as parameter (the same args as the setup function). --- This function is called at `"request::wallpaper"` `screen` signals and at `args.change_timer` timeouts. --- There is no obligation, but for consistency, the function should use `args.wallpaper` as a feeder. --- If `args.wallpaper` is defined, the default function is `setters.simple`, else it will be `setters.awesome`. --- --- @usage --- local wallpaper = require("wallpaper") --- wallpaper.setup { --- change_timer = 631, -- Prime number is better --- set_function = wallpaper.setters.random, --- -- parameters for the random setter --- wallpaper = '/data/pictures/wallpapers', --- position = "maximized", --- } --- --- @see apply --- @see prepare_list --- @see setters.simple -function setup(args) - local config = args or {} - config.set_function = config.set_function - or (config.wallpaper and setters.simple or setters.awesome_wallpaper) - local function set_wallpaper(s) - if type(config.screen) ~= 'table' then - if config.screen and s and config.screen ~= s then return end - config.screen = s or config.screen - end - config.set_function(config) - end - - if config.change_timer and config.change_timer > 0 then - gears.timer({ - timeout = config.change_timer, - call_now = false, - autostart = true, - callback = function() - set_wallpaper() - end, - }) - end - if awesome.version == "v4.3" or awesome.version == "4.3" then - awful.screen.connect_for_each_screen(set_wallpaper) - else - screen.connect_signal("request::wallpaper", set_wallpaper) - end -end - -return { - setup = setup, - setters = setters, - apply = apply, - prepare_list = prepare_list, -} diff --git a/cfg/awesome/bling/module/window_swallowing.lua b/cfg/awesome/bling/module/window_swallowing.lua deleted file mode 100644 index 60950aa..0000000 --- a/cfg/awesome/bling/module/window_swallowing.lua +++ /dev/null @@ -1,128 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local beautiful = require("beautiful") - -local helpers = require(tostring(...):match(".*bling") .. ".helpers") - --- It might actually swallow too much, that's why there is a filter option by classname --- without the don't-swallow-list it would also swallow for example --- file pickers or new firefox windows spawned by an already existing one - -local window_swallowing_activated = false - --- you might want to add or remove applications here -local parent_filter_list = beautiful.parent_filter_list - or beautiful.dont_swallow_classname_list - or { "firefox", "Gimp", "Google-chrome" } -local child_filter_list = beautiful.child_filter_list - or beautiful.dont_swallow_classname_list or { } - --- for boolean values the or chain way to set the values breaks with 2 vars --- and always defaults to true so i had to do this to se the right value... -local swallowing_filter = true -local filter_vars = { beautiful.swallowing_filter, beautiful.dont_swallow_filter_activated } -for _, var in pairs(filter_vars) do - swallowing_filter = var -end - --- check if element exist in table --- returns true if it is -local function is_in_table(element, table) - local res = false - for _, value in pairs(table) do - if element:match(value) then - res = true - break - end - end - return res -end - --- if the swallowing filter is active checks the child and parent classes --- against their filters -local function check_swallow(parent, child) - local res = true - if swallowing_filter then - local prnt = not is_in_table(parent, parent_filter_list) - local chld = not is_in_table(child, child_filter_list) - res = ( prnt and chld ) - end - return res -end - --- async function to get the parent's pid --- recieves a child process pid and a callback function --- parent_pid in format "init(1)---ancestorA(pidA)---ancestorB(pidB)...---process(pid)" -function get_parent_pid(child_ppid, callback) - local ppid_cmd = string.format("pstree -A -p -s %s", child_ppid) - awful.spawn.easy_async(ppid_cmd, function(stdout, stderr, reason, exit_code) - -- primitive error checking - if stderr and stderr ~= "" then - callback(stderr) - return - end - local ppid = stdout - callback(nil, ppid) - end) -end - - --- the function that will be connected to / disconnected from the spawn client signal -local function manage_clientspawn(c) - -- get the last focused window to check if it is a parent window - local parent_client = awful.client.focus.history.get(c.screen, 1) - if not parent_client then - return - elseif parent_client.type == "dialog" or parent_client.type == "splash" then - return - end - - get_parent_pid(c.pid, function(err, ppid) - if err then - return - end - parent_pid = ppid - if - -- will search for "(parent_client.pid)" inside the parent_pid string - ( tostring(parent_pid):find("("..tostring(parent_client.pid)..")") ) - and check_swallow(parent_client.class, c.class) - then - c:connect_signal("unmanage", function() - if parent_client then - helpers.client.turn_on(parent_client) - helpers.client.sync(parent_client, c) - end - end) - - helpers.client.sync(c, parent_client) - helpers.client.turn_off(parent_client) - end - end) -end - --- without the following functions that module would be autoloaded by require("bling") --- a toggle window swallowing hotkey is also possible that way - -local function start() - client.connect_signal("manage", manage_clientspawn) - window_swallowing_activated = true -end - -local function stop() - client.disconnect_signal("manage", manage_clientspawn) - window_swallowing_activated = false -end - -local function toggle() - if window_swallowing_activated then - stop() - else - start() - end -end - -return { - start = start, - stop = stop, - toggle = toggle, -} diff --git a/cfg/awesome/bling/signal/init.lua b/cfg/awesome/bling/signal/init.lua deleted file mode 100644 index c513381..0000000 --- a/cfg/awesome/bling/signal/init.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - playerctl = require(... .. ".playerctl"), -} diff --git a/cfg/awesome/bling/signal/playerctl/init.lua b/cfg/awesome/bling/signal/playerctl/init.lua deleted file mode 100644 index 357b02c..0000000 --- a/cfg/awesome/bling/signal/playerctl/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -local awful = require("awful") -local gtimer = require("gears.timer") -local beautiful = require("beautiful") -local naughty = require("naughty") - --- Use CLI backend as default as it is supported on most if not all systems -local backend_config = beautiful.playerctl_backend or "playerctl_cli" -local backends = { - playerctl_cli = require(... .. ".playerctl_cli"), - playerctl_lib = require(... .. ".playerctl_lib"), -} - -local backend = nil - -local function enable_wrapper(args) - local open = naughty.action { name = "Open" } - - open:connect_signal("invoked", function() - awful.spawn("xdg-open https://blingcorp.github.io/bling/#/signals/pctl") - end) - - gtimer.delayed_call(function() - naughty.notify({ - title = "Bling Error", - text = "Global signals are deprecated! Please take a look at the playerctl documentation.", - app_name = "Bling Error", - app_icon = "system-error", - actions = { open } - }) - end) - - backend_config = (args and args.backend) or backend_config - backend = backends[backend_config](args) - return backend -end - -local function disable_wrapper() - backend:disable() -end - -return { - lib = backends.playerctl_lib, - cli = backends.playerctl_cli, - enable = enable_wrapper, - disable = disable_wrapper -} \ No newline at end of file diff --git a/cfg/awesome/bling/signal/playerctl/playerctl_cli.lua b/cfg/awesome/bling/signal/playerctl/playerctl_cli.lua deleted file mode 100644 index d091407..0000000 --- a/cfg/awesome/bling/signal/playerctl/playerctl_cli.lua +++ /dev/null @@ -1,348 +0,0 @@ --- Playerctl signals --- --- Provides: --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- playback_status --- playing (boolean) --- volume --- volume (number) --- loop_status --- loop_status (string) --- shuffle --- shuffle (bool) --- no_players --- (No parameters) - -local awful = require("awful") -local gobject = require("gears.object") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local gstring = require("gears.string") -local beautiful = require("beautiful") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local setmetatable = setmetatable -local tonumber = tonumber -local ipairs = ipairs -local type = type -local capi = { awesome = awesome } - -local playerctl = { mt = {} } - -function playerctl:disable() - self._private.metadata_timer:stop() - self._private.metadata_timer = nil - awful.spawn.with_shell("killall playerctl") -end - -function playerctl:pause(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " pause") - else - awful.spawn.with_shell(self._private.cmd .. "pause") - end -end - -function playerctl:play(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " play") - else - awful.spawn.with_shell(self._private.cmd .. "play") - end -end - -function playerctl:stop(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " stop") - else - awful.spawn.with_shell(self._private.cmd .. "stop") - end -end - -function playerctl:play_pause(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " play-pause") - else - awful.spawn.with_shell(self._private.cmd .. "play-pause") - end -end - -function playerctl:previous(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " previous") - else - awful.spawn.with_shell(self._private.cmd .. "previous") - end -end - -function playerctl:next(player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " next") - else - awful.spawn.with_shell(self._private.cmd .. "next") - end -end - -function playerctl:set_loop_status(loop_status, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " loop " .. loop_status) - else - awful.spawn.with_shell(self._private.cmd .. "loop " .. loop_status) - end -end - -function playerctl:cycle_loop_status(player) - local function set_loop_status(loop_status) - if loop_status == "None" then - self:set_loop_status("Track") - elseif loop_status == "Track" then - self:set_loop_status("Playlist") - elseif loop_status == "Playlist" then - self:set_loop_status("None") - end - end - - if player ~= nil then - awful.spawn.easy_async_with_shell("playerctl --player=" .. player .. " loop", function(stdout) - set_loop_status(stdout) - end) - else - set_loop_status(self._private.loop_status) - end -end - -function playerctl:set_position(position, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " position " .. position) - else - awful.spawn.with_shell(self._private.cmd .. "position " .. position) - end -end - -function playerctl:set_shuffle(shuffle, player) - shuffle = shuffle and "on" or "off" - - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " shuffle " .. shuffle) - else - awful.spawn.with_shell(self._private.cmd .. "shuffle " .. shuffle) - end -end - -function playerctl:cycle_shuffle(player) - if player ~= nil then - awful.spawn.easy_async_with_shell("playerctl --player=" .. player .. " shuffle", function(stdout) - local shuffle = stdout == "on" and true or false - self:set_shuffle(not self._private.shuffle) - end) - else - self:set_shuffle(not self._private.shuffle) - end -end - -function playerctl:set_volume(volume, player) - if player ~= nil then - awful.spawn.with_shell("playerctl --player=" .. player .. " volume " .. volume) - else - awful.spawn.with_shell(self._private.cmd .. "volume " .. volume) - end -end - -local function emit_player_metadata(self) - local metadata_cmd = self._private.cmd .. "metadata --format 'title_{{title}}artist_{{artist}}art_url_{{mpris:artUrl}}player_name_{{playerName}}album_{{album}}' -F" - - awful.spawn.with_line_callback(metadata_cmd, { - stdout = function(line) - local title = gstring.xml_escape(line:match('title_(.*)artist_')) or "" - local artist = gstring.xml_escape(line:match('artist_(.*)art_url_')) or "" - local art_url = line:match('art_url_(.*)player_name_') or "" - local player_name = line:match('player_name_(.*)album_') or "" - local album = gstring.xml_escape(line:match('album_(.*)')) or "" - - art_url = art_url:gsub('%\n', '') - if player_name == "spotify" then - art_url = art_url:gsub("open.spotify.com", "i.scdn.co") - end - - if self._private.metadata_timer - and self._private.metadata_timer.started - then - self._private.metadata_timer:stop() - end - - self._private.metadata_timer = gtimer { - timeout = self.debounce_delay, - autostart = true, - single_shot = true, - callback = function() - if title and title ~= "" then - if art_url ~= "" then - local art_path = os.tmpname() - helpers.filesystem.save_image_async_curl(art_url, art_path, function() - self:emit_signal("metadata", title, artist, art_path, album, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path) - end) - else - self:emit_signal("metadata", title, artist, "", album, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, "") - end - else - self:emit_signal("no_players") - capi.awesome.emit_signal("bling::playerctl::no_players") - end - end - } - - collectgarbage("collect") - end, - }) -end - -local function emit_player_position(self) - local position_cmd = self._private.cmd .. "position" - local length_cmd = self._private.cmd .. "metadata mpris:length" - - awful.widget.watch(position_cmd, self.interval, function(_, interval) - awful.spawn.easy_async_with_shell(length_cmd, function(length) - local length_sec = tonumber(length) -- in microseconds - local interval_sec = tonumber(interval) -- in seconds - if length_sec and interval_sec then - if interval_sec >= 0 and length_sec > 0 then - self:emit_signal("position", interval_sec, length_sec / 1000000) - capi.awesome.emit_signal("bling::playerctl::position", interval_sec, length_sec / 1000000) - end - end - end) - collectgarbage("collect") - end) -end - -local function emit_player_playback_status(self) - local status_cmd = self._private.cmd .. "status -F" - - awful.spawn.with_line_callback(status_cmd, { - stdout = function(line) - if line:find("Playing") then - self:emit_signal("playback_status", true) - capi.awesome.emit_signal("bling::playerctl::status", true) - else - self:emit_signal("playback_status", false) - capi.awesome.emit_signal("bling::playerctl::status", false) - end - end, - }) -end - -local function emit_player_volume(self) - local volume_cmd = self._private.cmd .. "volume -F" - - awful.spawn.with_line_callback(volume_cmd, { - stdout = function(line) - self:emit_signal("volume", tonumber(line)) - end, - }) -end - -local function emit_player_loop_status(self) - local loop_status_cmd = self._private.cmd .. "loop -F" - - awful.spawn.with_line_callback(loop_status_cmd, { - stdout = function(line) - self._private.loop_status = line - self:emit_signal("loop_status", line:lower()) - end, - }) -end - -local function emit_player_shuffle(self) - local shuffle_cmd = self._private.cmd .. "shuffle -F" - - awful.spawn.with_line_callback(shuffle_cmd, { - stdout = function(line) - if line:find("On") then - self._private.shuffle = true - self:emit_signal("shuffle", true) - else - self._private.shuffle = false - self:emit_signal("shuffle", false) - end - end, - }) -end - -local function parse_args(self, args) - if args.player then - self._private.cmd = self._private.cmd .. "--player=" - - if type(args.player) == "string" then - self._private.cmd = self._private.cmd .. args.player .. " " - elseif type(args.player) == "table" then - for index, player in ipairs(args.player) do - self._private.cmd = self._private.cmd .. player - if index < #args.player then - self._private.cmd = self._private.cmd .. "," - else - self._private.cmd = self._private.cmd .. " " - end - end - end - end - - if args.ignore then - self._private.cmd = self._private.cmd .. "--ignore-player=" - - if type(args.ignore) == "string" then - self._private.cmd = self._private.cmd .. args.ignore .. " " - elseif type(args.ignore) == "table" then - for index, player in ipairs(args.ignore) do - self._private.cmd = self._private.cmd .. player - if index < #args.ignore then - self._private.cmd = self._private.cmd .. "," - else - self._private.cmd = self._private.cmd .. " " - end - end - end - end -end - -local function new(args) - args = args or {} - - local ret = gobject{} - gtable.crush(ret, playerctl, true) - - ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1 - ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35 - - ret._private = {} - ret._private.metadata_timer = nil - ret._private.cmd = "playerctl " - parse_args(ret, args) - - emit_player_metadata(ret) - emit_player_position(ret) - emit_player_playback_status(ret) - emit_player_volume(ret) - emit_player_loop_status(ret) - emit_player_shuffle(ret) - - return ret -end - -function playerctl.mt:__call(...) - return new(...) -end - --- On startup instead of on playerctl object init to make it --- possible to have more than one of these running -awful.spawn.with_shell("killall playerctl") - -return setmetatable(playerctl, playerctl.mt) diff --git a/cfg/awesome/bling/signal/playerctl/playerctl_lib.lua b/cfg/awesome/bling/signal/playerctl/playerctl_lib.lua deleted file mode 100644 index 1df1e1f..0000000 --- a/cfg/awesome/bling/signal/playerctl/playerctl_lib.lua +++ /dev/null @@ -1,560 +0,0 @@ --- Playerctl signals --- --- Provides: --- metadata --- title (string) --- artist (string) --- album_path (string) --- album (string) --- new (bool) --- player_name (string) --- position --- interval_sec (number) --- length_sec (number) --- player_name (string) --- playback_status --- playing (boolean) --- player_name (string) --- seeked --- position (number) --- player_name (string) --- volume --- volume (number) --- player_name (string) --- loop_status --- loop_status (string) --- player_name (string) --- shuffle --- shuffle (boolean) --- player_name (string) --- exit --- player_name (string) --- no_players --- (No parameters) - -local awful = require("awful") -local gobject = require("gears.object") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local gstring = require("gears.string") -local beautiful = require("beautiful") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local setmetatable = setmetatable -local ipairs = ipairs -local pairs = pairs -local type = type -local capi = { awesome = awesome } - -local playerctl = { mt = {} } - -function playerctl:disable() - -- Restore default settings - self.ignore = {} - self.priority = {} - self.update_on_activity = true - self.interval = 1 - self.debounce_delay = 0.35 - - -- Reset timers - self._private.manager = nil - self._private.metadata_timer:stop() - self._private.metadata_timer = nil - self._private.position_timer:stop() - self._private.position_timer = nil - - -- Reset default values - self._private.last_position = -1 - self._private.last_length = -1 - self._private.last_player = nil - self._private.last_title = "" - self._private.last_artist = "" - self._private.last_artUrl = "" -end - -function playerctl:pause(player) - player = player or self._private.manager.players[1] - if player then - player:pause() - end -end - -function playerctl:play(player) - player = player or self._private.manager.players[1] - if player then - player:play() - end -end - -function playerctl:stop(player) - player = player or self._private.manager.players[1] - if player then - player:stop() - end -end - -function playerctl:play_pause(player) - player = player or self._private.manager.players[1] - if player then - player:play_pause() - end -end - -function playerctl:previous(player) - player = player or self._private.manager.players[1] - if player then - player:previous() - end -end - -function playerctl:next(player) - player = player or self._private.manager.players[1] - if player then - player:next() - end -end - -function playerctl:set_loop_status(loop_status, player) - player = player or self._private.manager.players[1] - if player then - player:set_loop_status(loop_status) - end -end - -function playerctl:cycle_loop_status(player) - player = player or self._private.manager.players[1] - if player then - if player.loop_status == "NONE" then - player:set_loop_status("TRACK") - elseif player.loop_status == "TRACK" then - player:set_loop_status("PLAYLIST") - elseif player.loop_status == "PLAYLIST" then - player:set_loop_status("NONE") - end - end -end - -function playerctl:set_position(position, player) - player = player or self._private.manager.players[1] - if player then - player:set_position(position * 1000000) - end -end - -function playerctl:set_shuffle(shuffle, player) - player = player or self._private.manager.players[1] - if player then - player:set_shuffle(shuffle) - end -end - -function playerctl:cycle_shuffle(player) - player = player or self._private.manager.players[1] - if player then - player:set_shuffle(not player.shuffle) - end -end - -function playerctl:set_volume(volume, player) - player = player or self._private.manager.players[1] - if player then - player:set_volume(volume) - end -end - -function playerctl:get_manager() - return self._private.manager -end - -function playerctl:get_active_player() - return self._private.manager.players[1] -end - -function playerctl:get_player_of_name(name) - for _, player in ipairs(self._private.manager.players[1]) do - if player.name == name then - return player - end - end - - return nil -end - -local function emit_metadata_signal(self, title, artist, artUrl, album, new, player_name) - title = gstring.xml_escape(title) - artist = gstring.xml_escape(artist) - album = gstring.xml_escape(album) - - -- Spotify client doesn't report its art URL's correctly... - if player_name == "spotify" then - artUrl = artUrl:gsub("open.spotify.com", "i.scdn.co") - end - - if artUrl ~= "" then - local art_path = os.tmpname() - helpers.filesystem.save_image_async_curl(artUrl, art_path, function() - self:emit_signal("metadata", title, artist, art_path, album, new, player_name) - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, art_path, player_name) - end) - else - capi.awesome.emit_signal("bling::playerctl::title_artist_album", title, artist, "", player_name) - self:emit_signal("metadata", title, artist, "", album, new, player_name) - end -end - -local function metadata_cb(self, player, metadata) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - local data = metadata.value - - local title = data["xesam:title"] or "" - local artist = data["xesam:artist"][1] or "" - for i = 2, #data["xesam:artist"] do - artist = artist .. ", " .. data["xesam:artist"][i] - end - local artUrl = data["mpris:artUrl"] or "" - local album = data["xesam:album"] or "" - - if player == self._private.manager.players[1] then - self._private.active_player = player - - -- Callback can be called even though values we care about haven't - -- changed, so check to see if they have - if - player ~= self._private.last_player - or title ~= self._private.last_title - or artist ~= self._private.last_artist - or artUrl ~= self._private.last_artUrl - then - if (title == "" and artist == "" and artUrl == "") then return end - - if self._private.metadata_timer ~= nil and self._private.metadata_timer.started then - self._private.metadata_timer:stop() - end - - self._private.metadata_timer = gtimer { - timeout = self.debounce_delay, - autostart = true, - single_shot = true, - callback = function() - emit_metadata_signal(self, title, artist, artUrl, album, true, player.player_name) - end - } - - -- Re-sync with position timer when track changes - self._private.position_timer:again() - self._private.last_player = player - self._private.last_title = title - self._private.last_artist = artist - self._private.last_artUrl = artUrl - end - end -end - -local function position_cb(self) - local player = self._private.manager.players[1] - if player then - - local position = player:get_position() / 1000000 - local length = (player.metadata.value["mpris:length"] or 0) / 1000000 - if position ~= self._private.last_position or length ~= self._private.last_length then - capi.awesome.emit_signal("bling::playerctl::position", position, length, player.player_name) - self:emit_signal("position", position, length, player.player_name) - self._private.last_position = position - self._private.last_length = length - end - end -end - -local function playback_status_cb(self, player, status) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - - -- Reported as PLAYING, PAUSED, or STOPPED - if status == "PLAYING" then - self:emit_signal("playback_status", true, player.player_name) - capi.awesome.emit_signal("bling::playerctl::status", true, player.player_name) - else - self:emit_signal("playback_status", false, player.player_name) - capi.awesome.emit_signal("bling::playerctl::status", false, player.player_name) - end - end -end - -local function seeked_cb(self, player, position) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("seeked", position / 1000000, player.player_name) - end -end - -local function volume_cb(self, player, volume) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("volume", volume, player.player_name) - end -end - -local function loop_status_cb(self, player, loop_status) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("loop_status", loop_status:lower(), player.player_name) - end -end - -local function shuffle_cb(self, player, shuffle) - if self.update_on_activity then - self._private.manager:move_player_to_top(player) - end - - if player == self._private.manager.players[1] then - self._private.active_player = player - self:emit_signal("shuffle", shuffle, player.player_name) - end -end - -local function exit_cb(self, player) - if player == self._private.manager.players[1] then - self:emit_signal("exit", player.player_name) - end -end - --- Determine if player should be managed -local function name_is_selected(self, name) - if self.ignore[name.name] then - return false - end - - if #self.priority > 0 then - for _, arg in pairs(self.priority) do - if arg == name.name or arg == "%any" then - return true - end - end - return false - end - - return true -end - --- Create new player and connect it to callbacks -local function init_player(self, name) - if name_is_selected(self, name) then - local player = self._private.lgi_Playerctl.Player.new_from_name(name) - self._private.manager:manage_player(player) - player.on_metadata = function(player, metadata) - metadata_cb(self, player, metadata) - end - player.on_playback_status = function(player, playback_status) - playback_status_cb(self, player, playback_status) - end - player.on_seeked = function(player, position) - seeked_cb(self, player, position) - end - player.on_volume = function(player, volume) - volume_cb(self, player, volume) - end - player.on_loop_status = function(player, loop_status) - loop_status_cb(self, player, loop_status) - end - player.on_shuffle = function(player, shuffle_status) - shuffle_cb(self, player, shuffle_status) - end - player.on_exit = function(player, shuffle_status) - exit_cb(self, player) - end - - -- Start position timer if its not already running - if not self._private.position_timer.started then - self._private.position_timer:again() - end - end -end - --- Determine if a player name comes before or after another according to the --- priority order -local function player_compare_name(self, name_a, name_b) - local any_index = math.huge - local a_match_index = nil - local b_match_index = nil - - if name_a == name_b then - return 0 - end - - for index, name in ipairs(self.priority) do - if name == "%any" then - any_index = (any_index == math.huge) and index or any_index - elseif name == name_a then - a_match_index = a_match_index or index - elseif name == name_b then - b_match_index = b_match_index or index - end - end - - if not a_match_index and not b_match_index then - return 0 - elseif not a_match_index then - return (b_match_index < any_index) and 1 or -1 - elseif not b_match_index then - return (a_match_index < any_index) and -1 or 1 - elseif a_match_index == b_match_index then - return 0 - else - return (a_match_index < b_match_index) and -1 or 1 - end -end - --- Sorting function used by manager if a priority order is specified -local function player_compare(self, a, b) - local player_a = self._private.lgi_Playerctl.Player(a) - local player_b = self._private.lgi_Playerctl.Player(b) - return player_compare_name(self, player_a.player_name, player_b.player_name) -end - -local function get_current_player_info(self, player) - local title = player:get_title() or "" - local artist = player:get_artist() or "" - local artUrl = player:print_metadata_prop("mpris:artUrl") or "" - local album = player:get_album() or "" - - emit_metadata_signal(self, title, artist, artUrl, album, false, player.player_name) - playback_status_cb(self, player, player.playback_status) - volume_cb(self, player, player.volume) - loop_status_cb(self, player, player.loop_status) - shuffle_cb(self, player, player.shuffle) -end - -local function start_manager(self) - self._private.manager = self._private.lgi_Playerctl.PlayerManager() - - if #self.priority > 0 then - self._private.manager:set_sort_func(function(a, b) - return player_compare(self, a, b) - end) - end - - -- Timer to update track position at specified interval - self._private.position_timer = gtimer { - timeout = self.interval, - callback = function() - position_cb(self) - end, - } - - -- Manage existing players on startup - for _, name in ipairs(self._private.manager.player_names) do - init_player(self, name) - end - - if self._private.manager.players[1] then - get_current_player_info(self, self._private.manager.players[1]) - end - - local _self = self - - -- Callback to manage new players - function self._private.manager:on_name_appeared(name) - init_player(_self, name) - end - - function self._private.manager:on_player_appeared(player) - if player == self.players[1] then - _self._private.active_player = player - end - end - - function self._private.manager:on_player_vanished(player) - if #self.players == 0 then - _self._private.metadata_timer:stop() - _self._private.position_timer:stop() - _self:emit_signal("no_players") - capi.awesome.emit_signal("bling::playerctl::no_players") - elseif player == _self._private.active_player then - _self._private.active_player = self.players[1] - get_current_player_info(_self, self.players[1]) - end - end -end - -local function parse_args(self, args) - self.ignore = {} - if type(args.ignore) == "string" then - self.ignore[args.ignore] = true - elseif type(args.ignore) == "table" then - for _, name in pairs(args.ignore) do - self.ignore[name] = true - end - end - - self.priority = {} - if type(args.player) == "string" then - self.priority[1] = args.player - elseif type(args.player) == "table" then - self.priority = args.player - end -end - -local function new(args) - args = args or {} - - local ret = gobject{} - gtable.crush(ret, playerctl, true) - - -- Grab settings from beautiful variables if not set explicitly - args.ignore = args.ignore or beautiful.playerctl_ignore - args.player = args.player or beautiful.playerctl_player - ret.update_on_activity = args.update_on_activity or - beautiful.playerctl_update_on_activity or true - ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1 - ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35 - parse_args(ret, args) - - ret._private = {} - - -- Metadata callback for title, artist, and album art - ret._private.last_player = nil - ret._private.last_title = "" - ret._private.last_artist = "" - ret._private.last_artUrl = "" - - -- Track position callback - ret._private.last_position = -1 - ret._private.last_length = -1 - - -- Grab playerctl library - ret._private.lgi_Playerctl = require("lgi").Playerctl - ret._private.manager = nil - ret._private.metadata_timer = nil - ret._private.position_timer = nil - - -- Ensure main event loop has started before starting player manager - gtimer.delayed_call(function() - start_manager(ret) - end) - - return ret -end - -function playerctl.mt:__call(...) - return new(...) -end - -return setmetatable(playerctl, playerctl.mt) diff --git a/cfg/awesome/bling/theme-var-template.lua b/cfg/awesome/bling/theme-var-template.lua deleted file mode 100644 index 13d0f5a..0000000 --- a/cfg/awesome/bling/theme-var-template.lua +++ /dev/null @@ -1,105 +0,0 @@ ---[[ Bling theme variables template - -This file has all theme variables of the bling module. -Every variable has a small comment on what it does. -You might just want to copy that whole part into your theme.lua and start adjusting from there. - ---]] --- LuaFormatter off --- window swallowing -theme.dont_swallow_classname_list = { "firefox", "Gimp" } -- list of class names that should not be swallowed -theme.dont_swallow_filter_activated = true -- whether the filter above should be active - --- flash focus -theme.flash_focus_start_opacity = 0.6 -- the starting opacity -theme.flash_focus_step = 0.01 -- the step of animation - --- playerctl signal -theme.playerctl_backend = "playerctl_cli" -- backend to use -theme.playerctl_ignore = {} -- list of players to be ignored -theme.playerctl_player = {} -- list of players to be used in priority order -theme.playerctl_update_on_activity = true -- whether to prioritize the most recently active players or not -theme.playerctl_position_update_interval = 1 -- the update interval for fetching the position from playerctl - --- tabbed -theme.tabbed_spawn_in_tab = false -- whether a new client should spawn into the focused tabbing container - --- tabbar general -theme.tabbar_disable = false -- disable the tab bar entirely -theme.tabbar_ontop = false -theme.tabbar_radius = 0 -- border radius of the tabbar -theme.tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") -theme.tabbar_font = "Sans 11" -- font of the tabbar -theme.tabbar_size = 40 -- size of the tabbar -theme.tabbar_position = "top" -- position of the tabbar -theme.tabbar_bg_normal = "#000000" -- background color of the focused client on the tabbar -theme.tabbar_fg_normal = "#ffffff" -- foreground color of the focused client on the tabbar -theme.tabbar_bg_focus = "#1A2026" -- background color of unfocused clients on the tabbar -theme.tabbar_fg_focus = "#ff0000" -- foreground color of unfocused clients on the tabbar -theme.tabbar_bg_focus_inactive = nil -- background color of the focused client on the tabbar when inactive -theme.tabbar_fg_focus_inactive = nil -- foreground color of the focused client on the tabbar when inactive -theme.tabbar_bg_normal_inactive = nil -- background color of unfocused clients on the tabbar when inactive -theme.tabbar_fg_normal_inactive = nil -- foreground color of unfocused clients on the tabbar when inactive - --- mstab -theme.mstab_bar_disable = false -- disable the tabbar -theme.mstab_bar_ontop = false -- whether you want to allow the bar to be ontop of clients -theme.mstab_dont_resize_slaves = false -- whether the tabbed stack windows should be smaller than the --- currently focused stack window (set it to true if you use --- transparent terminals. False if you use shadows on solid ones -theme.mstab_bar_padding = "default" -- how much padding there should be between clients and your tabbar --- by default it will adjust based on your useless gaps. --- If you want a custom value. Set it to the number of pixels (int) -theme.mstab_border_radius = 0 -- border radius of the tabbar -theme.mstab_bar_height = 40 -- height of the tabbar -theme.mstab_tabbar_position = "top" -- position of the tabbar (mstab currently does not support left,right) -theme.mstab_tabbar_style = "default" -- style of the tabbar ("default", "boxes" or "modern") --- defaults to the tabbar_style so only change if you want a --- different style for mstab and tabbed - --- the following variables are currently only for the "modern" tabbar style -theme.tabbar_color_close = "#f9929b" -- changes the color of the close button -theme.tabbar_color_min = "#fbdf90" -- changes the color of the minimize button -theme.tabbar_color_float = "#ccaced" -- changes the color of the float button - --- tag preview widget -theme.tag_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.tag_preview_client_border_radius = 0 -- Border radius of each client in the widget (With AA) -theme.tag_preview_client_opacity = 0.5 -- Opacity of each client -theme.tag_preview_client_bg = "#000000" -- The bg color of each client -theme.tag_preview_client_border_color = "#ffffff" -- The border color of each client -theme.tag_preview_client_border_width = 3 -- The border width of each client -theme.tag_preview_widget_bg = "#000000" -- The bg color of the widget -theme.tag_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.tag_preview_widget_border_width = 3 -- The border width of the widget -theme.tag_preview_widget_margin = 0 -- The margin of the widget - --- task preview widget -theme.task_preview_widget_border_radius = 0 -- Border radius of the widget (With AA) -theme.task_preview_widget_bg = "#000000" -- The bg color of the widget -theme.task_preview_widget_border_color = "#ffffff" -- The border color of the widget -theme.task_preview_widget_border_width = 3 -- The border width of the widget -theme.task_preview_widget_margin = 0 -- The margin of the widget - --- window switcher -theme.window_switcher_widget_bg = "#000000" -- The bg color of the widget -theme.window_switcher_widget_border_width = 3 -- The border width of the widget -theme.window_switcher_widget_border_radius = 0 -- The border radius of the widget -theme.window_switcher_widget_border_color = "#ffffff" -- The border color of the widget -theme.window_switcher_clients_spacing = 20 -- The space between each client item -theme.window_switcher_client_icon_horizontal_spacing = 5 -- The space between client icon and text -theme.window_switcher_client_width = 150 -- The width of one client widget -theme.window_switcher_client_height = 250 -- The height of one client widget -theme.window_switcher_client_margins = 10 -- The margin between the content and the border of the widget -theme.window_switcher_thumbnail_margins = 10 -- The margin between one client thumbnail and the rest of the widget -theme.thumbnail_scale = false -- If set to true, the thumbnails fit policy will be set to "fit" instead of "auto" -theme.window_switcher_name_margins = 10 -- The margin of one clients title to the rest of the widget -theme.window_switcher_name_valign = "center" -- How to vertically align one clients title -theme.window_switcher_name_forced_width = 200 -- The width of one title -theme.window_switcher_name_font = "Sans 11" -- The font of all titles -theme.window_switcher_name_normal_color = "#ffffff" -- The color of one title if the client is unfocused -theme.window_switcher_name_focus_color = "#ff0000" -- The color of one title if the client is focused -theme.window_switcher_icon_valign = "center" -- How to vertically align the one icon -theme.window_switcher_icon_width = 40 -- The width of one icon - --- LuaFormatter on diff --git a/cfg/awesome/bling/widget/app_launcher/init.lua b/cfg/awesome/bling/widget/app_launcher/init.lua deleted file mode 100644 index b74c2ab..0000000 --- a/cfg/awesome/bling/widget/app_launcher/init.lua +++ /dev/null @@ -1,1053 +0,0 @@ -local Gio = require("lgi").Gio -local awful = require("awful") -local gobject = require("gears.object") -local gtable = require("gears.table") -local gtimer = require("gears.timer") -local gfilesystem = require("gears.filesystem") -local wibox = require("wibox") -local beautiful = require("beautiful") -local color = require(tostring(...):match(".*bling") .. ".helpers.color") -local prompt = require(... .. ".prompt") -local dpi = beautiful.xresources.apply_dpi -local string = string -local table = table -local math = math -local ipairs = ipairs -local pairs = pairs -local root = root -local capi = { screen = screen, mouse = mouse } -local path = ... - -local app_launcher = { mt = {} } - -local terminal_commands_lookup = -{ - alacritty = "alacritty -e", - termite = "termite -e", - rxvt = "rxvt -e", - terminator = "terminator -e" -} - -local function string_levenshtein(str1, str2) - local len1 = string.len(str1) - local len2 = string.len(str2) - local matrix = {} - local cost = 0 - - -- quick cut-offs to save time - if (len1 == 0) then - return len2 - elseif (len2 == 0) then - return len1 - elseif (str1 == str2) then - return 0 - end - - -- initialise the base matrix values - for i = 0, len1, 1 do - matrix[i] = {} - matrix[i][0] = i - end - for j = 0, len2, 1 do - matrix[0][j] = j - end - - -- actual Levenshtein algorithm - for i = 1, len1, 1 do - for j = 1, len2, 1 do - if (str1:byte(i) == str2:byte(j)) then - cost = 0 - else - cost = 1 - end - - matrix[i][j] = math.min(matrix[i-1][j] + 1, matrix[i][j-1] + 1, matrix[i-1][j-1] + cost) - end - end - - -- return the last value - this is the Levenshtein distance - return matrix[len1][len2] -end - -local function case_insensitive_pattern(pattern) - -- find an optional '%' (group 1) followed by any character (group 2) - local p = pattern:gsub("(%%?)(.)", function(percent, letter) - if percent ~= "" or not letter:match("%a") then - -- if the '%' matched, or `letter` is not a letter, return "as is" - return percent .. letter - else - -- else, return a case-insensitive character class of the matched letter - return string.format("[%s%s]", letter:lower(), letter:upper()) - end - end) - - return p -end - -local function has_value(tab, val) - for index, value in pairs(tab) do - if val:find(case_insensitive_pattern(value)) then - return true - end - end - return false -end - -local function select_app(self, x, y) - local widgets = self._private.grid:get_widgets_at(x, y) - if widgets then - self._private.active_widget = widgets[1] - if self._private.active_widget ~= nil then - self._private.active_widget.selected = true - self._private.active_widget:get_children_by_id("background")[1].bg = self.app_selected_color - local name_widget = self._private.active_widget:get_children_by_id("name")[1] - if name_widget then - name_widget.markup = string.format("%s", self.app_name_selected_color, name_widget.text) - end - local generic_name_widget = self._private.active_widget:get_children_by_id("generic_name")[1] - if generic_name_widget then - generic_name_widget.markup = string.format("%s", self.app_name_selected_color, generic_name_widget.text) - end - end - end -end - -local function unselect_app(self) - if self._private.active_widget ~= nil then - self._private.active_widget.selected = false - self._private.active_widget:get_children_by_id("background")[1].bg = self.app_normal_color - local name_widget = self._private.active_widget:get_children_by_id("name")[1] - if name_widget then - name_widget.markup = string.format("%s", self.app_name_normal_color, name_widget.text) - end - local generic_name_widget = self._private.active_widget:get_children_by_id("generic_name")[1] - if generic_name_widget then - generic_name_widget.markup = string.format("%s", self.app_name_normal_color, generic_name_widget.text) - end - self._private.active_widget = nil - end -end - -local function create_app_widget(self, entry) - local icon = self.app_show_icon == true and - { - widget = wibox.widget.imagebox, - halign = self.app_icon_halign, - forced_width = self.app_icon_width, - forced_height = self.app_icon_height, - image = entry.icon - } or nil - - local name = self.app_show_name == true and - { - widget = wibox.widget.textbox, - id = "name", - font = self.app_name_font, - markup = entry.name - } or nil - - local generic_name = entry.generic_name ~= nil and self.app_show_generic_name == true and - { - widget = wibox.widget.textbox, - id = "generic_name", - font = self.app_name_font, - markup = entry.generic_name ~= "" and " (" .. entry.generic_name .. ")" or "" - } or nil - - local app = wibox.widget - { - widget = wibox.container.background, - id = "background", - forced_width = self.app_width, - forced_height = self.app_height, - shape = self.app_shape, - bg = self.app_normal_color, - { - widget = wibox.container.margin, - margins = self.app_content_padding, - { - -- Using this hack instead of container.place because that will fuck with the name/icon halign - layout = wibox.layout.align.vertical, - expand = "outside", - nil, - { - layout = wibox.layout.fixed.vertical, - spacing = self.app_content_spacing, - icon, - { - widget = wibox.container.place, - halign = self.app_name_halign, - { - layout = wibox.layout.fixed.horizontal, - spacing = self.app_name_generic_name_spacing, - name, - generic_name - } - } - }, - nil - } - } - } - - function app.spawn() - if entry.terminal == true then - if self.terminal ~= nil then - local terminal_command = terminal_commands_lookup[self.terminal] or self.terminal - awful.spawn(terminal_command .. " " .. entry.executable) - else - awful.spawn.easy_async("gtk-launch " .. entry.executable, function(stdout, stderr) - if stderr then - awful.spawn(entry.executable) - end - end) - end - else - awful.spawn(entry.executable) - end - - if self.hide_on_launch then - self:hide() - end - end - - app:connect_signal("mouse::enter", function(_self) - local widget = capi.mouse.current_wibox - if widget then - widget.cursor = "hand2" - end - - local app = _self - if app.selected then - app:get_children_by_id("background")[1].bg = self.app_selected_hover_color - else - local is_opaque = color.is_opaque(self.app_normal_color) - local is_dark = color.is_dark(self.app_normal_color) - local app_normal_color = color.hex_to_rgba(self.app_normal_color) - local hover_color = (is_dark or is_opaque) and - color.rgba_to_hex(color.multiply(app_normal_color, 2.5)) or - color.rgba_to_hex(color.multiply(app_normal_color, 0.5)) - app:get_children_by_id("background")[1].bg = self.app_normal_hover_color - end - end) - - app:connect_signal("mouse::leave", function(_self) - local widget = capi.mouse.current_wibox - if widget then - widget.cursor = "left_ptr" - end - - local app = _self - if app.selected then - app:get_children_by_id("background")[1].bg = self.app_selected_color - else - app:get_children_by_id("background")[1].bg = self.app_normal_color - end - end) - - app:connect_signal("button::press", function(_self, lx, ly, button, mods, find_widgets_result) - if button == 1 then - local app = _self - if self._private.active_widget == app or not self.select_before_spawn then - app.spawn() - else - -- Unmark the previous app - unselect_app(self) - - -- Mark this app - local pos = self._private.grid:get_widget_position(app) - select_app(self, pos.row, pos.col) - end - end - end) - - return app -end - -local function search(self, text) - unselect_app(self) - - local pos = self._private.grid:get_widget_position(self._private.active_widget) - - -- Reset all the matched entries - self._private.matched_entries = {} - -- Remove all the grid widgets - self._private.grid:reset() - - if text == "" then - self._private.matched_entries = self._private.all_entries - else - for index, entry in pairs(self._private.all_entries) do - text = text:gsub( "%W", "" ) - - -- Check if there's a match by the app name or app command - if string.find(entry.name:lower(), text:lower(), 1, true) ~= nil or - self.search_commands and string.find(entry.commandline, text:lower(), 1, true) ~= nil - then - table.insert(self._private.matched_entries, { - name = entry.name, - generic_name = entry.generic_name, - commandline = entry.commandline, - executable = entry.executable, - terminal = entry.terminal, - icon = entry.icon - }) - end - end - - -- Sort by string similarity - table.sort(self._private.matched_entries, function(a, b) - return string_levenshtein(text, a.name) < string_levenshtein(text, b.name) - end) - end - for index, entry in pairs(self._private.matched_entries) do - -- Only add the widgets for apps that are part of the first page - if #self._private.grid.children + 1 <= self._private.max_apps_per_page then - self._private.grid:add(create_app_widget(self, entry)) - end - end - - -- Recalculate the apps per page based on the current matched entries - self._private.apps_per_page = math.min(#self._private.matched_entries, self._private.max_apps_per_page) - - -- Recalculate the pages count based on the current apps per page - self._private.pages_count = math.ceil(math.max(1, #self._private.matched_entries) / math.max(1, self._private.apps_per_page)) - - -- Page should be 1 after a search - self._private.current_page = 1 - - -- This is an option to mimic rofi behaviour where after a search - -- it will reselect the app whose index is the same as the app index that was previously selected - -- and if matched_entries.length < current_index it will instead select the app with the greatest index - if self.try_to_keep_index_after_searching then - if self._private.grid:get_widgets_at(pos.row, pos.col) == nil then - local app = self._private.grid.children[#self._private.grid.children] - pos = self._private.grid:get_widget_position(app) - end - select_app(self, pos.row, pos.col) - -- Otherwise select the first app on the list - else - select_app(self, 1, 1) - end -end - -local function page_backward(self, direction) - if self._private.current_page > 1 then - self._private.current_page = self._private.current_page - 1 - elseif self.wrap_page_scrolling and #self._private.matched_entries >= self._private.max_apps_per_page then - self._private.current_page = self._private.pages_count - elseif self.wrap_app_scrolling then - local rows, columns = self._private.grid:get_dimension() - unselect_app(self) - select_app(self, math.min(rows, #self._private.grid.children % self.apps_per_row), columns) - return - else - return - end - - local pos = self._private.grid:get_widget_position(self._private.active_widget) - - -- Remove the current page apps from the grid - self._private.grid:reset() - - local max_app_index_to_include = self._private.apps_per_page * self._private.current_page - local min_app_index_to_include = max_app_index_to_include - self._private.apps_per_page - - for index, entry in pairs(self._private.matched_entries) do - -- Only add widgets that are between this range (part of the current page) - if index > min_app_index_to_include and index <= max_app_index_to_include then - self._private.grid:add(create_app_widget(self, entry)) - end - end - - local rows, columns = self._private.grid:get_dimension() - if self._private.current_page < self._private.pages_count then - if direction == "up" then - select_app(self, rows, columns) - else - -- Keep the same row from last page - select_app(self, pos.row, columns) - end - elseif self.wrap_page_scrolling then - if direction == "up" then - select_app(self, math.min(rows, #self._private.grid.children % self.apps_per_row), columns) - else - -- Keep the same row from last page - select_app(self, math.min(pos.row, #self._private.grid.children % self.apps_per_row), columns) - end - end -end - -local function page_forward(self, direction) - local min_app_index_to_include = 0 - local max_app_index_to_include = self._private.apps_per_page - - if self._private.current_page < self._private.pages_count then - min_app_index_to_include = self._private.apps_per_page * self._private.current_page - self._private.current_page = self._private.current_page + 1 - max_app_index_to_include = self._private.apps_per_page * self._private.current_page - elseif self.wrap_page_scrolling and #self._private.matched_entries >= self._private.max_apps_per_page then - self._private.current_page = 1 - min_app_index_to_include = 0 - max_app_index_to_include = self._private.apps_per_page - elseif self.wrap_app_scrolling then - unselect_app(self) - select_app(self, 1, 1) - return - else - return - end - - local pos = self._private.grid:get_widget_position(self._private.active_widget) - - -- Remove the current page apps from the grid - self._private.grid:reset() - - for index, entry in pairs(self._private.matched_entries) do - -- Only add widgets that are between this range (part of the current page) - if index > min_app_index_to_include and index <= max_app_index_to_include then - self._private.grid:add(create_app_widget(self, entry)) - end - end - - if self._private.current_page > 1 or self.wrap_page_scrolling then - if direction == "down" then - select_app(self, 1, 1) - else - local last_col_max_row = math.min(pos.row, #self._private.grid.children % self.apps_per_row) - if last_col_max_row ~= 0 then - select_app(self, last_col_max_row, 1) - else - select_app(self, pos.row, 1) - end - end - end -end - -local function scroll_up(self) - if #self._private.grid.children < 1 then - self._private.active_widget = nil - return - end - - local rows, columns = self._private.grid:get_dimension() - local pos = self._private.grid:get_widget_position(self._private.active_widget) - local is_bigger_than_first_app = pos.col > 1 or pos.row > 1 - - -- Check if the current marked app is not the first - if is_bigger_than_first_app then - unselect_app(self) - if pos.row == 1 then - select_app(self, rows, pos.col - 1) - else - select_app(self, pos.row - 1, pos.col) - end - else - page_backward(self, "up") - end -end - -local function scroll_down(self) - if #self._private.grid.children < 1 then - self._private.active_widget = nil - return - end - - local rows, columns = self._private.grid:get_dimension() - local pos = self._private.grid:get_widget_position(self._private.active_widget) - local is_less_than_max_app = self._private.grid:index(self._private.active_widget) < #self._private.grid.children - - -- Check if we can scroll down the app list - if is_less_than_max_app then - -- Unmark the previous app - unselect_app(self) - if pos.row == rows then - select_app(self, 1, pos.col + 1) - else - select_app(self, pos.row + 1, pos.col) - end - else - page_forward(self, "down") - end -end - -local function scroll_left(self) - if #self._private.grid.children < 1 then - self._private.active_widget = nil - return - end - - local pos = self._private.grid:get_widget_position(self._private.active_widget) - local is_bigger_than_first_column = pos.col > 1 - - -- Check if the current marked app is not the first - if is_bigger_than_first_column then - unselect_app(self) - select_app(self, pos.row, pos.col - 1) - else - page_backward(self, "left") - end -end - -local function scroll_right(self) - if #self._private.grid.children < 1 then - self._private.active_widget = nil - return - end - - local rows, columns = self._private.grid:get_dimension() - local pos = self._private.grid:get_widget_position(self._private.active_widget) - local is_less_than_max_column = pos.col < columns - - -- Check if we can scroll down the app list - if is_less_than_max_column then - -- Unmark the previous app - unselect_app(self) - - -- Scroll up to the max app if there are directly to the right of previous app - if self._private.grid:get_widgets_at(pos.row, pos.col + 1) == nil then - local app = self._private.grid.children[#self._private.grid.children] - pos = self._private.grid:get_widget_position(app) - select_app(self, pos.row, pos.col) - else - select_app(self, pos.row, pos.col + 1) - end - - else - page_forward(self, "right") - end -end - -local function reset(self) - self._private.grid:reset() - self._private.matched_entries = self._private.all_entries - self._private.apps_per_page = self._private.max_apps_per_page - self._private.pages_count = math.ceil(#self._private.all_entries / self._private.apps_per_page) - self._private.current_page = 1 - - for index, entry in pairs(self._private.all_entries) do - -- Only add the apps that are part of the first page - if index <= self._private.apps_per_page then - self._private.grid:add(create_app_widget(self, entry)) - else - break - end - end - - select_app(self, 1, 1) -end - -local function generate_apps(self) - self._private.all_entries = {} - self._private.matched_entries = {} - - local app_info = Gio.AppInfo - local apps = app_info.get_all() - if self.sort_alphabetically then - table.sort(apps, function(a, b) - local app_a_score = app_info.get_name(a):lower() - if has_value(self.favorites, app_info.get_name(a)) then - app_a_score = "aaaaaaaaaaa" .. app_a_score - end - local app_b_score = app_info.get_name(b):lower() - if has_value(self.favorites, app_info.get_name(b)) then - app_b_score = "aaaaaaaaaaa" .. app_b_score - end - - return app_a_score < app_b_score - end) - elseif self.reverse_sort_alphabetically then - table.sort(apps, function(a, b) - local app_a_score = app_info.get_name(a):lower() - if has_value(self.favorites, app_info.get_name(a)) then - app_a_score = "zzzzzzzzzzz" .. app_a_score - end - local app_b_score = app_info.get_name(b):lower() - if has_value(self.favorites, app_info.get_name(b)) then - app_b_score = "zzzzzzzzzzz" .. app_b_score - end - - return app_a_score > app_b_score - end) - else - table.sort(apps, function(a, b) - local app_a_favorite = has_value(self.favorites, app_info.get_name(a)) - local app_b_favorite = has_value(self.favorites, app_info.get_name(b)) - - if app_a_favorite and not app_b_favorite then - return true - elseif app_b_favorite and not app_a_favorite then - return false - elseif app_a_favorite and app_b_favorite then - return app_info.get_name(a):lower() < app_info.get_name(b):lower() - else - return false - end - end) - end - - local icon_theme = require(tostring(path):match(".*bling") .. ".helpers.icon_theme")(self.icon_theme, self.icon_size) - - for _, app in ipairs(apps) do - if app.should_show(app) then - local name = app_info.get_name(app) - local commandline = app_info.get_commandline(app) - local executable = app_info.get_executable(app) - local icon = icon_theme:get_gicon_path(app_info.get_icon(app)) - - -- Check if this app should be skipped, depanding on the skip_names / skip_commands table - if not has_value(self.skip_names, name) and not has_value(self.skip_commands, commandline) then - -- Check if this app should be skipped becuase it's iconless depanding on skip_empty_icons - if icon ~= "" or self.skip_empty_icons == false then - if icon == "" then - if self.default_app_icon_name ~= nil then - icon = icon_theme:get_icon_path(self.default_app_icon_name) - elseif self.default_app_icon_path ~= nil then - icon = self.default_app_icon_path - else - icon = icon_theme:choose_icon({"application-all", "application", "application-default-icon", "app"}) - end - end - - local desktop_app_info = Gio.DesktopAppInfo.new(app_info.get_id(app)) - local terminal = Gio.DesktopAppInfo.get_string(desktop_app_info, "Terminal") == "true" and true or false - local generic_name = Gio.DesktopAppInfo.get_string(desktop_app_info, "GenericName") or nil - - table.insert(self._private.all_entries, { - name = name, - generic_name = generic_name, - commandline = commandline, - executable = executable, - terminal = terminal, - icon = icon - }) - end - end - end - end -end - ---- Shows the app launcher -function app_launcher:show() - local screen = self.screen - if self.show_on_focused_screen then - screen = awful.screen.focused() - end - - screen.app_launcher = self._private.widget - screen.app_launcher.screen = screen - self._private.prompt:start() - - local animation = self.rubato - if animation ~= nil then - if self._private.widget.goal_x == nil then - self._private.widget.goal_x = self._private.widget.x - end - if self._private.widget.goal_y == nil then - self._private.widget.goal_y = self._private.widget.y - self._private.widget.placement = nil - end - - if animation.x then - animation.x.ended:unsubscribe() - animation.x:set(self._private.widget.goal_x) - gtimer { - timeout = 0.01, - call_now = false, - autostart = true, - single_shot = true, - callback = function() - screen.app_launcher.visible = true - end - } - end - if animation.y then - animation.y.ended:unsubscribe() - animation.y:set(self._private.widget.goal_y) - gtimer { - timeout = 0.01, - call_now = false, - autostart = true, - single_shot = true, - callback = function() - screen.app_launcher.visible = true - end - } - end - else - screen.app_launcher.visible = true - end - - self:emit_signal("bling::app_launcher::visibility", true) -end - ---- Hides the app launcher -function app_launcher:hide() - local screen = self.screen - if self.show_on_focused_screen then - screen = awful.screen.focused() - end - - if screen.app_launcher == nil or screen.app_launcher.visible == false then - return - end - - self._private.prompt:stop() - - local animation = self.rubato - if animation ~= nil then - if animation.x then - animation.x:set(animation.x:initial()) - end - if animation.y then - animation.y:set(animation.y:initial()) - end - - local anim_x_duration = (animation.x and animation.x.duration) or 0 - local anim_y_duration = (animation.y and animation.y.duration) or 0 - local turn_off_on_anim_x_end = (anim_x_duration >= anim_y_duration) and true or false - - if turn_off_on_anim_x_end then - animation.x.ended:subscribe(function() - if self.reset_on_hide == true then reset(self) end - screen.app_launcher.visible = false - screen.app_launcher = nil - animation.x.ended:unsubscribe() - end) - else - animation.y.ended:subscribe(function() - if self.reset_on_hide == true then reset(self) end - screen.app_launcher.visible = false - screen.app_launcher = nil - animation.y.ended:unsubscribe() - end) - end - else - if self.reset_on_hide == true then reset(self) end - screen.app_launcher.visible = false - screen.app_launcher = nil - end - - self:emit_signal("bling::app_launcher::visibility", false) -end - ---- Toggles the app launcher -function app_launcher:toggle() - local screen = self.screen - if self.show_on_focused_screen then - screen = awful.screen.focused() - end - - if screen.app_launcher and screen.app_launcher.visible then - self:hide() - else - self:show() - end -end - --- Returns a new app launcher -local function new(args) - args = args or {} - - args.terminal = args.terminal or nil - args.favorites = args.favorites or {} - args.search_commands = args.search_commands == nil and true or args.search_commands - args.skip_names = args.skip_names or {} - args.skip_commands = args.skip_commands or {} - args.skip_empty_icons = args.skip_empty_icons ~= nil and args.skip_empty_icons or false - args.sort_alphabetically = args.sort_alphabetically == nil and true or args.sort_alphabetically - args.reverse_sort_alphabetically = args.reverse_sort_alphabetically ~= nil and args.reverse_sort_alphabetically or false - args.select_before_spawn = args.select_before_spawn == nil and true or args.select_before_spawn - args.hide_on_left_clicked_outside = args.hide_on_left_clicked_outside == nil and true or args.hide_on_left_clicked_outside - args.hide_on_right_clicked_outside = args.hide_on_right_clicked_outside == nil and true or args.hide_on_right_clicked_outside - args.hide_on_launch = args.hide_on_launch == nil and true or args.hide_on_launch - args.try_to_keep_index_after_searching = args.try_to_keep_index_after_searching ~= nil and args.try_to_keep_index_after_searching or false - args.reset_on_hide = args.reset_on_hide == nil and true or args.reset_on_hide - args.save_history = args.save_history == nil and true or args.save_history - args.wrap_page_scrolling = args.wrap_page_scrolling == nil and true or args.wrap_page_scrolling - args.wrap_app_scrolling = args.wrap_app_scrolling == nil and true or args.wrap_app_scrolling - - args.default_app_icon_name = args.default_app_icon_name or nil - args.default_app_icon_path = args.default_app_icon_path or nil - args.icon_theme = args.icon_theme or nil - args.icons_size = args.icons_size or nil - - args.type = args.type or "dock" - args.show_on_focused_screen = args.show_on_focused_screen == nil and true or args.show_on_focused_screen - args.screen = args.screen or capi.screen.primary - args.placement = args.placement or awful.placement.centered - args.rubato = args.rubato or nil - args.shirnk_width = args.shirnk_width ~= nil and args.shirnk_width or false - args.shrink_height = args.shrink_height ~= nil and args.shrink_height or false - args.background = args.background or "#000000" - args.shape = args.shape or nil - - args.prompt_height = args.prompt_height or dpi(100) - args.prompt_margins = args.prompt_margins or dpi(0) - args.prompt_paddings = args.prompt_paddings or dpi(30) - args.prompt_shape = args.prompt_shape or nil - args.prompt_color = args.prompt_color or beautiful.fg_normal or "#FFFFFF" - args.prompt_border_width = args.prompt_border_width or beautiful.border_width or dpi(0) - args.prompt_border_color = args.prompt_border_color or beautiful.border_color or args.prompt_color - args.prompt_text_halign = args.prompt_text_halign or "left" - args.prompt_text_valign = args.prompt_text_valign or "center" - args.prompt_icon_text_spacing = args.prompt_icon_text_spacing or dpi(10) - args.prompt_show_icon = args.prompt_show_icon == nil and true or args.prompt_show_icon - args.prompt_icon_font = args.prompt_icon_font or beautiful.font - args.prompt_icon_color = args.prompt_icon_color or beautiful.bg_normal or "#000000" - args.prompt_icon = args.prompt_icon or "ī€‚" - args.prompt_icon_markup = args.prompt_icon_markup or string.format("%s", args.prompt_icon_color, args.prompt_icon) - args.prompt_text = args.prompt_text or "Search: " - args.prompt_start_text = args.prompt_start_text or "" - args.prompt_font = args.prompt_font or beautiful.font - args.prompt_text_color = args.prompt_text_color or beautiful.bg_normal or "#000000" - args.prompt_cursor_color = args.prompt_cursor_color or beautiful.bg_normal or "#000000" - - args.apps_per_row = args.apps_per_row or 5 - args.apps_per_column = args.apps_per_column or 3 - args.apps_margin = args.apps_margin or dpi(30) - args.apps_spacing = args.apps_spacing or dpi(30) - - args.expand_apps = args.expand_apps == nil and true or args.expand_apps - args.app_width = args.app_width or dpi(300) - args.app_height = args.app_height or dpi(120) - args.app_shape = args.app_shape or nil - args.app_normal_color = args.app_normal_color or beautiful.bg_normal or "#000000" - args.app_normal_hover_color = args.app_normal_hover_color or (color.is_dark(args.app_normal_color) or color.is_opaque(args.app_normal_color)) and - color.rgba_to_hex(color.multiply(color.hex_to_rgba(args.app_normal_color), 2.5)) or - color.rgba_to_hex(color.multiply(color.hex_to_rgba(args.app_normal_color), 0.5)) - args.app_selected_color = args.app_selected_color or beautiful.fg_normal or "#FFFFFF" - args.app_selected_hover_color = args.app_selected_hover_color or (color.is_dark(args.app_normal_color) or color.is_opaque(args.app_normal_color)) and - color.rgba_to_hex(color.multiply(color.hex_to_rgba(args.app_selected_color), 2.5)) or - color.rgba_to_hex(color.multiply(color.hex_to_rgba(args.app_selected_color), 0.5)) - args.app_content_padding = args.app_content_padding or dpi(10) - args.app_content_spacing = args.app_content_spacing or dpi(10) - args.app_show_icon = args.app_show_icon == nil and true or args.app_show_icon - args.app_icon_halign = args.app_icon_halign or "center" - args.app_icon_width = args.app_icon_width or dpi(70) - args.app_icon_height = args.app_icon_height or dpi(70) - args.app_show_name = args.app_show_name == nil and true or args.app_show_name - args.app_name_generic_name_spacing = args.app_name_generic_name_spacing or dpi(0) - args.app_name_halign = args.app_name_halign or "center" - args.app_name_font = args.app_name_font or beautiful.font - args.app_name_normal_color = args.app_name_normal_color or beautiful.fg_normal or "#FFFFFF" - args.app_name_selected_color = args.app_name_selected_color or beautiful.bg_normal or "#000000" - args.app_show_generic_name = args.app_show_generic_name ~= nil and args.app_show_generic_name or false - - local ret = gobject({}) - ret._private = {} - ret._private.text = "" - - gtable.crush(ret, app_launcher) - gtable.crush(ret, args) - - -- Calculate the grid width and height - local grid_width = ret.shirnk_width == false - and dpi((ret.app_width * ret.apps_per_column) + ((ret.apps_per_column - 1) * ret.apps_spacing)) - or nil - local grid_height = ret.shrink_height == false - and dpi((ret.app_height * ret.apps_per_row) + ((ret.apps_per_row - 1) * ret.apps_spacing)) - or nil - - -- These widgets need to be later accessed - ret._private.prompt = prompt - { - prompt = ret.prompt_text, - text = ret.prompt_start_text, - font = ret.prompt_font, - reset_on_stop = ret.reset_on_hide, - bg_cursor = ret.prompt_cursor_color, - history_path = ret.save_history == true and gfilesystem.get_cache_dir() .. "/history" or nil, - changed_callback = function(text) - if text == ret._private.text then - return - end - - if ret._private.search_timer ~= nil and ret._private.search_timer.started then - ret._private.search_timer:stop() - end - - ret._private.search_timer = gtimer { - timeout = 0.05, - autostart = true, - single_shot = true, - callback = function() - search(ret, text) - end - } - - ret._private.text = text - end, - keypressed_callback = function(mod, key, cmd) - if key == "Escape" then - ret:hide() - end - if key == "Return" then - if ret._private.active_widget ~= nil then - ret._private.active_widget.spawn() - end - end - if key == "Up" then - scroll_up(ret) - end - if key == "Down" then - scroll_down(ret) - end - if key == "Left" then - scroll_left(ret) - end - if key == "Right" then - scroll_right(ret) - end - end - } - ret._private.grid = wibox.widget - { - layout = wibox.layout.grid, - forced_width = grid_width, - forced_height = grid_height, - orientation = "horizontal", - homogeneous = true, - expand = ret.expand_apps, - spacing = ret.apps_spacing, - forced_num_rows = ret.apps_per_row, - buttons = - { - awful.button({}, 4, function() scroll_up(ret) end), - awful.button({}, 5, function() scroll_down(ret) end) - } - } - ret._private.widget = awful.popup - { - type = args.type, - visible = false, - ontop = true, - placement = ret.placement, - shape = ret.shape, - bg = ret.background, - widget = - { - layout = wibox.layout.fixed.vertical, - { - widget = wibox.container.margin, - margins = ret.prompt_margins, - { - widget = wibox.container.background, - forced_height = ret.prompt_height, - shape = ret.prompt_shape, - bg = ret.prompt_color, - fg = ret.prompt_text_color, - border_width = ret.prompt_border_width, - border_color = ret.prompt_border_color, - { - widget = wibox.container.margin, - margins = ret.prompt_paddings, - { - widget = wibox.container.place, - halign = ret.prompt_text_halign, - valign = ret.prompt_text_valign, - { - layout = wibox.layout.fixed.horizontal, - spacing = ret.prompt_icon_text_spacing, - { - widget = wibox.widget.textbox, - font = ret.prompt_icon_font, - markup = ret.prompt_icon_markup - }, - ret._private.prompt.textbox - } - } - } - } - }, - { - widget = wibox.container.margin, - margins = ret.apps_margin, - ret._private.grid - } - } - } - - -- Private variables to be used to be used by the scrolling and searching functions - ret._private.max_apps_per_page = ret.apps_per_column * ret.apps_per_row - ret._private.apps_per_page = ret._private.max_apps_per_page - ret._private.pages_count = 0 - ret._private.current_page = 1 - - generate_apps(ret) - reset(ret) - - if ret.rubato and ret.rubato.x then - ret.rubato.x:subscribe(function(pos) - ret._private.widget.x = pos - end) - end - if ret.rubato and ret.rubato.y then - ret.rubato.y:subscribe(function(pos) - ret._private.widget.y = pos - end) - end - - if ret.hide_on_left_clicked_outside then - awful.mouse.append_client_mousebinding( - awful.button({ }, 1, function (c) - ret:hide() - end) - ) - - awful.mouse.append_global_mousebinding( - awful.button({ }, 1, function (c) - ret:hide() - end) - ) - end - if ret.hide_on_right_clicked_outside then - awful.mouse.append_client_mousebinding( - awful.button({ }, 3, function (c) - ret:hide() - end) - ) - - awful.mouse.append_global_mousebinding( - awful.button({ }, 3, function (c) - ret:hide() - end) - ) - end - - local kill_old_inotify_process_script = [[ ps x | grep "inotifywait -e modify /usr/share/applications" | grep -v grep | awk '{print $1}' | xargs kill ]] - local subscribe_script = [[ bash -c "while (inotifywait -e modify /usr/share/applications -qq) do echo; done" ]] - - awful.spawn.easy_async_with_shell(kill_old_inotify_process_script, function() - awful.spawn.with_line_callback(subscribe_script, {stdout = function(_) - generate_apps(ret) - end}) - end) - - return ret -end - -function app_launcher.text(args) - args = args or {} - - args.prompt_height = args.prompt_height or dpi(50) - args.prompt_margins = args.prompt_margins or dpi(30) - args.prompt_paddings = args.prompt_paddings or dpi(15) - args.app_width = args.app_width or dpi(400) - args.app_height = args.app_height or dpi(40) - args.apps_spacing = args.apps_spacing or dpi(10) - args.apps_per_row = args.apps_per_row or 15 - args.apps_per_column = args.apps_per_column or 1 - args.app_name_halign = args.app_name_halign or "left" - args.app_show_icon = args.app_show_icon ~= nil and args.app_show_icon or false - args.app_show_generic_name = args.app_show_generic_name == nil and true or args.app_show_generic_name - args.apps_margin = args.apps_margin or { left = dpi(40), right = dpi(40), bottom = dpi(30) } - - return new(args) -end - -function app_launcher.mt:__call(...) - return new(...) -end - -return setmetatable(app_launcher, app_launcher.mt) diff --git a/cfg/awesome/bling/widget/app_launcher/prompt.lua b/cfg/awesome/bling/widget/app_launcher/prompt.lua deleted file mode 100644 index fae3b86..0000000 --- a/cfg/awesome/bling/widget/app_launcher/prompt.lua +++ /dev/null @@ -1,656 +0,0 @@ ---------------------------------------------------------------------------- ---- Modified Prompt module. --- @author Julien Danjou <julien@danjou.info> --- @copyright 2008 Julien Danjou ---------------------------------------------------------------------------- - -local akey = require("awful.key") -local keygrabber = require("awful.keygrabber") -local gobject = require("gears.object") -local gdebug = require('gears.debug') -local gtable = require("gears.table") -local gcolor = require("gears.color") -local gstring = require("gears.string") -local gfs = require("gears.filesystem") -local wibox = require("wibox") -local beautiful = require("beautiful") -local io = io -local table = table -local math = math -local ipairs = ipairs -local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility with Lua 5.1) -local capi = { selection = selection } - -local prompt = { mt = {} } - ---- Private data -local data = {} -data.history = {} - -local function itera(inc,a, i) - i = i + inc - local v = a[i] - if v then return i,v end -end - -local function history_check_load(id, max) - if id and id ~= "" and not data.history[id] then - data.history[id] = { max = 50, table = {} } - - if max then - data.history[id].max = max - end - - local f = io.open(id, "r") - if not f then return end - - -- Read history file - for line in f:lines() do - if gtable.hasitem(data.history[id].table, line) == nil then - table.insert(data.history[id].table, line) - if #data.history[id].table >= data.history[id].max then - break - end - end - end - f:close() - end -end - -local function is_word_char(c) - if string.find(c, "[{[(,.:;_-+=@/ ]") then - return false - else - return true - end -end - -local function cword_start(s, pos) - local i = pos - if i > 1 then - i = i - 1 - end - while i >= 1 and not is_word_char(s:sub(i, i)) do - i = i - 1 - end - while i >= 1 and is_word_char(s:sub(i, i)) do - i = i - 1 - end - if i <= #s then - i = i + 1 - end - return i -end - -local function cword_end(s, pos) - local i = pos - while i <= #s and not is_word_char(s:sub(i, i)) do - i = i + 1 - end - while i <= #s and is_word_char(s:sub(i, i)) do - i = i + 1 - end - return i -end - -local function history_save(id) - if data.history[id] then - gfs.make_parent_directories(id) - local f = io.open(id, "w") - if not f then - gdebug.print_warning("Failed to write the history to "..id) - return - end - for i = 1, math.min(#data.history[id].table, data.history[id].max) do - f:write(data.history[id].table[i] .. "\n") - end - f:close() - end -end - -local function history_items(id) - if data.history[id] then - return #data.history[id].table - else - return -1 - end -end - -local function history_add(id, command) - if data.history[id] and command ~= "" then - local index = gtable.hasitem(data.history[id].table, command) - if index == nil then - table.insert(data.history[id].table, command) - - -- Do not exceed our max_cmd - if #data.history[id].table > data.history[id].max then - table.remove(data.history[id].table, 1) - end - - history_save(id) - else - -- Bump this command to the end of history - table.remove(data.history[id].table, index) - table.insert(data.history[id].table, command) - history_save(id) - end - end -end - -local function have_multibyte_char_at(text, position) - return text:sub(position, position):wlen() == -1 -end - -local function prompt_text_with_cursor(args) - local char, spacer, text_start, text_end, ret - local text = args.text or "" - local _prompt = args.prompt or "" - local underline = args.cursor_ul or "none" - - if args.select_all then - if #text == 0 then char = " " else char = gstring.xml_escape(text) end - spacer = " " - text_start = "" - text_end = "" - elseif #text < args.cursor_pos then - char = " " - spacer = "" - text_start = gstring.xml_escape(text) - text_end = "" - else - local offset = 0 - if have_multibyte_char_at(text, args.cursor_pos) then - offset = 1 - end - char = gstring.xml_escape(text:sub(args.cursor_pos, args.cursor_pos + offset)) - spacer = " " - text_start = gstring.xml_escape(text:sub(1, args.cursor_pos - 1)) - text_end = gstring.xml_escape(text:sub(args.cursor_pos + 1 + offset)) - end - - local cursor_color = gcolor.ensure_pango_color(args.cursor_color) - local text_color = gcolor.ensure_pango_color(args.text_color) - - if args.highlighter then - text_start, text_end = args.highlighter(text_start, text_end) - end - - ret = _prompt .. text_start .. "" .. char .. "" .. text_end .. spacer - - return ret -end - -local function update(self) - self.textbox:set_font(self.font) - self.textbox:set_markup(prompt_text_with_cursor{ - text = self.command, text_color = self.fg_cursor, cursor_color = self.bg_cursor, - cursor_pos = self._private_cur_pos, cursor_ul = self.ul_cursor, select_all = self.select_all, - prompt = self.prompt, highlighter = self.highlighter }) -end - -local function exec(self, cb, command_to_history) - self.textbox:set_markup("") - history_add(self.history_path, command_to_history) - keygrabber.stop(self._private.grabber) - if cb then cb(self.command) end - if self.done_callback then - self.done_callback() - end -end - -function prompt:start() - -- The cursor position - if self.reset_on_stop == true or self._private_cur_pos == nil then - self._private_cur_pos = (self.select_all and 1) or self.text:wlen() + 1 - end - if self.reset_on_stop == true then self.text = "" self.command = "" end - - self.textbox:set_font(self.font) - self.textbox:set_markup(prompt_text_with_cursor{ - text = self.reset_on_stop and self.text or self.command, text_color = self.fg_cursor, cursor_color = self.bg_cursor, - cursor_pos = self._private_cur_pos, cursor_ul = self.ul_cursor, select_all = self.select_all, - prompt = self.prompt, highlighter = self.highlighter}) - - self._private.search_term = nil - - history_check_load(self.history_path, self.history_max) - local history_index = history_items(self.history_path) + 1 - - -- The completion element to use on completion request. - local ncomp = 1 - - local command_before_comp - local cur_pos_before_comp - - self._private.grabber = keygrabber.run(function(modifiers, key, event) - -- Convert index array to hash table - local mod = {} - for _, v in ipairs(modifiers) do mod[v] = true end - - if event ~= "press" then - if self.keyreleased_callback then - self.keyreleased_callback(mod, key, self.command) - end - return - end - - -- Call the user specified callback. If it returns true as - -- the first result then return from the function. Treat the - -- second and third results as a new command and new prompt - -- to be set (if provided) - if self.keypressed_callback then - local user_catched, new_command, new_prompt = - self.keypressed_callback(mod, key, self.command) - if new_command or new_prompt then - if new_command then - self.command = new_command - end - if new_prompt then - self.prompt = new_prompt - end - update(self) - end - if user_catched then - if self.changed_callback then - self.changed_callback(self.command) - end - return - end - end - - local filtered_modifiers = {} - - -- User defined cases - if self.hooks[key] then - -- Remove caps and num lock - for _, m in ipairs(modifiers) do - if not gtable.hasitem(akey.ignore_modifiers, m) then - table.insert(filtered_modifiers, m) - end - end - - for _,v in ipairs(self.hooks[key]) do - if #filtered_modifiers == #v[1] then - local match = true - for _,v2 in ipairs(v[1]) do - match = match and mod[v2] - end - if match then - local cb - local ret, quit = v[3](self.command) - local original_command = self.command - - -- Support both a "simple" and a "complex" way to - -- control if the prompt should quit. - quit = quit == nil and (ret ~= true) or (quit~=false) - - -- Allow the callback to change the command - self.command = (ret ~= true) and ret or self.command - - -- Quit by default, but allow it to be disabled - if ret and type(ret) ~= "boolean" then - cb = self.exe_callback - if not quit then - self._private_cur_pos = ret:wlen() + 1 - update(self) - end - elseif quit then - -- No callback. - cb = function() end - end - - -- Execute the callback - if cb then - exec(self, cb, original_command) - end - - return - end - end - end - end - - -- Get out cases - if (mod.Control and (key == "c" or key == "g")) - or (not mod.Control and key == "Escape") then - self:stop() - return false - elseif (mod.Control and (key == "j" or key == "m")) - -- or (not mod.Control and key == "Return") - -- or (not mod.Control and key == "KP_Enter") - then - exec(self, self.exe_callback, self.command) - -- We already unregistered ourselves so we don't want to return - -- true, otherwise we may unregister someone else. - return - end - - -- Control cases - if mod.Control then - self.select_all = nil - if key == "v" then - local selection = capi.selection() - if selection then - -- Remove \n - local n = selection:find("\n") - if n then - selection = selection:sub(1, n - 1) - end - self.command = self.command:sub(1, self._private_cur_pos - 1) .. selection .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = self._private_cur_pos + #selection - end - elseif key == "a" then - self._private_cur_pos = 1 - elseif key == "b" then - if self._private_cur_pos > 1 then - self._private_cur_pos = self._private_cur_pos - 1 - if have_multibyte_char_at(self.command, self._private_cur_pos) then - self._private_cur_pos = self._private_cur_pos - 1 - end - end - elseif key == "d" then - if self._private_cur_pos <= #self.command then - self.command = self.command:sub(1, self._private_cur_pos - 1) .. self.command:sub(self._private_cur_pos + 1) - end - elseif key == "p" then - if history_index > 1 then - history_index = history_index - 1 - - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - end - elseif key == "n" then - if history_index < history_items(self.history_path) then - history_index = history_index + 1 - - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - elseif history_index == history_items(self.history_path) then - history_index = history_index + 1 - - self.command = "" - self._private_cur_pos = 1 - end - elseif key == "e" then - self._private_cur_pos = #self.command + 1 - elseif key == "r" then - self._private.search_term = self._private.search_term or self.command:sub(1, self._private_cur_pos - 1) - for i,v in (function(a,i) return itera(-1,a,i) end), data.history[self.history_path].table, history_index do - if v:find(self._private.search_term,1,true) ~= nil then - self.command=v - history_index=i - self._private_cur_pos=#self.command+1 - break - end - end - elseif key == "s" then - self._private.search_term = self._private.search_term or self.command:sub(1, self._private_cur_pos - 1) - for i,v in (function(a,i) return itera(1,a,i) end), data.history[self.history_path].table, history_index do - if v:find(self._private.search_term,1,true) ~= nil then - self.command=v - history_index=i - self._private_cur_pos=#self.command+1 - break - end - end - elseif key == "f" then - if self._private_cur_pos <= #self.command then - if have_multibyte_char_at(self.command, self._private_cur_pos) then - self._private_cur_pos = self._private_cur_pos + 2 - else - self._private_cur_pos = self._private_cur_pos + 1 - end - end - elseif key == "h" then - if self._private_cur_pos > 1 then - local offset = 0 - if have_multibyte_char_at(self.command, self._private_cur_pos - 1) then - offset = 1 - end - self.command = self.command:sub(1, self._private_cur_pos - 2 - offset) .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = self._private_cur_pos - 1 - offset - end - elseif key == "k" then - self.command = self.command:sub(1, self._private_cur_pos - 1) - elseif key == "u" then - self.command = self.command:sub(self._private_cur_pos, #self.command) - self._private_cur_pos = 1 - elseif key == "Prior" then - self._private.search_term = self.command:sub(1, self._private_cur_pos - 1) or "" - for i,v in (function(a,i) return itera(-1,a,i) end), data.history[self.history_path].table, history_index do - if v:find(self._private.search_term,1,true) == 1 then - self.command=v - history_index=i - break - end - end - elseif key == "Next" then - self._private.search_term = self.command:sub(1, self._private_cur_pos - 1) or "" - for i,v in (function(a,i) return itera(1,a,i) end), data.history[self.history_path].table, history_index do - if v:find(self._private.search_term,1,true) == 1 then - self.command=v - history_index=i - break - end - end - elseif key == "w" or key == "BackSpace" then - local wstart = 1 - local wend = 1 - local cword_start_pos = 1 - local cword_end_pos = 1 - while wend < self._private_cur_pos do - wend = self.command:find("[{[(,.:;_-+=@/ ]", wstart) - if not wend then wend = #self.command + 1 end - if self._private_cur_pos >= wstart and self._private_cur_pos <= wend + 1 then - cword_start_pos = wstart - cword_end_pos = self._private_cur_pos - 1 - break - end - wstart = wend + 1 - end - self.command = self.command:sub(1, cword_start_pos - 1) .. self.command:sub(cword_end_pos + 1) - self._private_cur_pos = cword_start_pos - elseif key == "Delete" then - -- delete from history only if: - -- we are not dealing with a new command - -- the user has not edited an existing entry - if self.command == data.history[self.history_path].table[history_index] then - table.remove(data.history[self.history_path].table, history_index) - if history_index <= history_items(self.history_path) then - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - elseif history_index > 1 then - history_index = history_index - 1 - - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - else - self.command = "" - self._private_cur_pos = 1 - end - end - end - elseif mod.Mod1 or mod.Mod3 then - if key == "b" then - self._private_cur_pos = cword_start(self.command, self._private_cur_pos) - elseif key == "f" then - self._private_cur_pos = cword_end(self.command, self._private_cur_pos) - elseif key == "d" then - self.command = self.command:sub(1, self._private_cur_pos - 1) .. self.command:sub(cword_end(self.command, self._private_cur_pos)) - elseif key == "BackSpace" then - local wstart = cword_start(self.command, self._private_cur_pos) - self.command = self.command:sub(1, wstart - 1) .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = wstart - end - else - if self.completion_callback then - if key == "Tab" or key == "ISO_Left_Tab" then - if key == "ISO_Left_Tab" or mod.Shift then - if ncomp == 1 then return end - if ncomp == 2 then - self.command = command_before_comp - self.textbox:set_font(self.font) - self.textbox:set_markup(prompt_text_with_cursor{ - text = command_before_comp, text_color = self.fg_cursor, cursor_color = self.bg_cursor, - cursor_pos = self._private_cur_pos, cursor_ul = self.ul_cursor, select_all = self.select_all, - prompt = self.prompt }) - self._private_cur_pos = cur_pos_before_comp - ncomp = 1 - return - end - - ncomp = ncomp - 2 - elseif ncomp == 1 then - command_before_comp = self.command - cur_pos_before_comp = self._private_cur_pos - end - local matches - self.command, self._private_cur_pos, matches = self.completion_callback(command_before_comp, cur_pos_before_comp, ncomp) - ncomp = ncomp + 1 - key = "" - -- execute if only one match found and autoexec flag set - if matches and #matches == 1 and args.autoexec then - exec(self, self.exe_callback) - return - end - elseif key ~= "Shift_L" and key ~= "Shift_R" then - ncomp = 1 - end - end - - -- Typin cases - if mod.Shift and key == "Insert" then - local selection = capi.selection() - if selection then - -- Remove \n - local n = selection:find("\n") - if n then - selection = selection:sub(1, n - 1) - end - self.command = self.command:sub(1, self._private_cur_pos - 1) .. selection .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = self._private_cur_pos + #selection - end - elseif key == "Home" then - self._private_cur_pos = 1 - elseif key == "End" then - self._private_cur_pos = #self.command + 1 - elseif key == "BackSpace" then - if self._private_cur_pos > 1 then - local offset = 0 - if have_multibyte_char_at(self.command, self._private_cur_pos - 1) then - offset = 1 - end - self.command = self.command:sub(1, self._private_cur_pos - 2 - offset) .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = self._private_cur_pos - 1 - offset - end - elseif key == "Delete" then - self.command = self.command:sub(1, self._private_cur_pos - 1) .. self.command:sub(self._private_cur_pos + 1) - elseif key == "Left" then - self._private_cur_pos = self._private_cur_pos - 1 - elseif key == "Right" then - self._private_cur_pos = self._private_cur_pos + 1 - elseif key == "Prior" then - if history_index > 1 then - history_index = history_index - 1 - - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - end - elseif key == "Next" then - if history_index < history_items(self.history_path) then - history_index = history_index + 1 - - self.command = data.history[self.history_path].table[history_index] - self._private_cur_pos = #self.command + 2 - elseif history_index == history_items(self.history_path) then - history_index = history_index + 1 - - self.command = "" - self._private_cur_pos = 1 - end - else - -- wlen() is UTF-8 aware but #key is not, - -- so check that we have one UTF-8 char but advance the cursor of # position - if key:wlen() == 1 then - if self.select_all then self.command = "" end - self.command = self.command:sub(1, self._private_cur_pos - 1) .. key .. self.command:sub(self._private_cur_pos) - self._private_cur_pos = self._private_cur_pos + #key - end - end - if self._private_cur_pos < 1 then - self._private_cur_pos = 1 - elseif self._private_cur_pos > #self.command + 1 then - self._private_cur_pos = #self.command + 1 - end - self.select_all = nil - end - - update(self) - if self.changed_callback then - self.changed_callback(self.command) - end - end) -end - -function prompt:stop() - keygrabber.stop(self._private.grabber) - history_save(self.history_path) - if self.done_callback then self.done_callback() end - return false -end - -local function new(args) - args = args or {} - - args.command = args.text or "" - args.prompt = args.prompt or "" - args.text = args.text or "" - args.font = args.font or beautiful.prompt_font or beautiful.font - args.bg_cursor = args.bg_cursor or beautiful.prompt_bg_cursor or beautiful.bg_focus or "white" - args.fg_cursor = args.fg_cursor or beautiful.prompt_fg_cursor or beautiful.fg_focus or "black" - args.ul_cursor = args.ul_cursor or nil - args.reset_on_stop = args.reset_on_stop == nil and true or args.reset_on_stop - args.select_all = args.select_all or nil - args.highlighter = args.highlighter or nil - args.hooks = args.hooks or {} - args.keypressed_callback = args.keypressed_callback or nil - args.changed_callback = args.changed_callback or nil - args.done_callback = args.done_callback or nil - args.history_max = args.history_max or nil - args.history_path = args.history_path or nil - args.completion_callback = args.completion_callback or nil - args.exe_callback = args.exe_callback or nil - args.textbox = args.textbox or wibox.widget.textbox() - - -- Build the hook map - local hooks = {} - for _,v in ipairs(args.hooks) do - if #v == 3 then - local _,key,callback = unpack(v) - if type(callback) == "function" then - hooks[key] = hooks[key] or {} - hooks[key][#hooks[key]+1] = v - else - gdebug.print_warning("The hook's 3rd parameter has to be a function.") - end - else - gdebug.print_warning("The hook has to have 3 parameters.") - end - end - args.hooks = hooks - - local ret = gobject({}) - ret._private = {} - gtable.crush(ret, prompt) - gtable.crush(ret, args) - - return ret -end - -function prompt.mt:__call(...) - return new(...) -end - -return setmetatable(prompt, prompt.mt) \ No newline at end of file diff --git a/cfg/awesome/bling/widget/init.lua b/cfg/awesome/bling/widget/init.lua deleted file mode 100644 index d3c6ebd..0000000 --- a/cfg/awesome/bling/widget/init.lua +++ /dev/null @@ -1,7 +0,0 @@ -return { - tag_preview = require(... .. ".tag_preview"), - task_preview = require(... .. ".task_preview"), - window_switcher = require(... .. ".window_switcher"), - tabbed_misc = require(... .. ".tabbed_misc"), - app_launcher = require(... .. ".app_launcher"), -} diff --git a/cfg/awesome/bling/widget/tabbar/boxes.lua b/cfg/awesome/bling/widget/tabbar/boxes.lua deleted file mode 100644 index 720f420..0000000 --- a/cfg/awesome/bling/widget/tabbar/boxes.lua +++ /dev/null @@ -1,57 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local wibox = require("wibox") - -local beautiful = require("beautiful") - -local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff" -local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" -local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" -local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" -local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus -local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus -local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal -local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal -local font = beautiful.tabbar_font or beautiful.font or "Hack 15" -local size = beautiful.tabbar_size or 40 -local position = beautiful.tabbar_position or "bottom" - -local function create(c, focused_bool, buttons, inactive_bool) - local bg_temp = inactive_bool and bg_normal_inactive or bg_normal - local fg_temp = inactive_bool and fg_normal_inactive or fg_normal - if focused_bool then - bg_temp = inactive_bool and bg_focus_inactive or bg_focus - fg_temp = inactive_bool and fg_focus_inactive or fg_focus - end - local wid_temp = wibox.widget({ - { - { - awful.widget.clienticon(c), - left = 10, - right = 10, - bottom = 10, - top = 10, - widget = wibox.container.margin(), - }, - widget = wibox.container.place(), - }, - buttons = buttons, - bg = bg_temp, - widget = wibox.container.background(), - }) - return wid_temp -end - -local layout = wibox.layout.fixed.horizontal -if position == "left" or position == "right" then - layout = wibox.layout.fixed.vertical -end - -return { - layout = layout, - create = create, - position = position, - size = size, - bg_normal = bg_normal, - bg_focus = bg_normal, -} diff --git a/cfg/awesome/bling/widget/tabbar/default.lua b/cfg/awesome/bling/widget/tabbar/default.lua deleted file mode 100644 index ad6b0b1..0000000 --- a/cfg/awesome/bling/widget/tabbar/default.lua +++ /dev/null @@ -1,60 +0,0 @@ -local gears = require("gears") -local wibox = require("wibox") - -local beautiful = require("beautiful") - -local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff" -local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" -local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" -local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" -local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus -local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus -local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal -local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal -local font = beautiful.tabbar_font or beautiful.font or "Hack 15" -local size = beautiful.tabbar_size or 20 -local position = beautiful.tabbar_position or "top" - -local function create(c, focused_bool, buttons, inactive_bool) - local flexlist = wibox.layout.flex.horizontal() - local title_temp = c.name or c.class or "-" - local bg_temp = inactive_bool and bg_normal_inactive or bg_normal - local fg_temp = inactive_bool and fg_normal_inactive or fg_normal - if focused_bool then - bg_temp = inactive_bool and bg_focus_inactive or bg_focus - fg_temp = inactive_bool and fg_focus_inactive or fg_focus - end - local text_temp = wibox.widget.textbox() - text_temp.align = "center" - text_temp.valign = "center" - text_temp.font = font - text_temp.markup = "" - .. title_temp - .. "" - c:connect_signal("property::name", function(_) - local title_temp = c.name or c.class or "-" - text_temp.markup = "" - .. title_temp - .. "" - end) - local wid_temp = wibox.widget({ - text_temp, - buttons = buttons, - bg = bg_temp, - widget = wibox.container.background(), - }) - return wid_temp -end - -return { - layout = wibox.layout.flex.horizontal, - create = create, - position = position, - size = size, - bg_normal = bg_normal, - bg_focus = bg_focus, -} diff --git a/cfg/awesome/bling/widget/tabbar/modern.lua b/cfg/awesome/bling/widget/tabbar/modern.lua deleted file mode 100644 index 5f48066..0000000 --- a/cfg/awesome/bling/widget/tabbar/modern.lua +++ /dev/null @@ -1,271 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local wibox = require("wibox") -local beautiful = require("beautiful") -local xresources = require("beautiful.xresources") -local dpi = xresources.apply_dpi -local helpers = require(tostring(...):match(".*bling") .. ".helpers") - -local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff" -local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" -local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" -local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" -local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus -local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus -local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal -local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal -local font = beautiful.tabbar_font or beautiful.font or "Hack 15" -local size = beautiful.tabbar_size or dpi(40) -local border_radius = beautiful.mstab_border_radius - or beautiful.border_radius - or 6 -local position = beautiful.tabbar_position or "top" -local close_color = beautiful.tabbar_color_close - or beautiful.xcolor1 - or "#f9929b" -local min_color = beautiful.tabbar_color_min or beautiful.xcolor3 or "#fbdf90" -local float_color = beautiful.tabbar_color_float - or beautiful.xcolor5 - or "#ccaced" - --- Helper to create buttons -local function create_title_button(c, color_focus, color_unfocus) - local tb_color = wibox.widget({ - wibox.widget.textbox(), - forced_width = dpi(8), - forced_height = dpi(8), - bg = color_focus, - shape = gears.shape.circle, - widget = wibox.container.background, - }) - - local tb = wibox.widget({ - tb_color, - width = dpi(25), - height = dpi(25), - strategy = "min", - layout = wibox.layout.constraint, - }) - - local function update() - if client.focus == c then - tb_color.bg = color_focus - else - tb_color.bg = color_unfocus - end - end - update() - c:connect_signal("focus", update) - c:connect_signal("unfocus", update) - - tb:connect_signal("mouse::enter", function() - tb_color.bg = color_focus .. "70" - end) - - tb:connect_signal("mouse::leave", function() - tb_color.bg = color_focus - end) - - tb.visible = true - return tb -end - -local function create(c, focused_bool, buttons, inactive_bool) - -- local flexlist = wibox.layout.flex.horizontal() - local title_temp = c.name or c.class or "-" - local bg_temp = inactive_bool and bg_normal_inactive or bg_normal - local fg_temp = inactive_bool and fg_normal_inactive or fg_normal - if focused_bool then - bg_temp = inactive_bool and bg_focus_inactive or bg_focus - fg_temp = inactive_bool and fg_focus_inactive or fg_focus - end - local text_temp = wibox.widget.textbox() - text_temp.align = "center" - text_temp.valign = "center" - text_temp.font = font - text_temp.markup = "" - .. title_temp - .. "" - c:connect_signal("property::name", function(_) - local title_temp = c.name or c.class or "-" - text_temp.markup = "" - .. title_temp - .. "" - end) - - local tab_content = wibox.widget({ - { - awful.widget.clienticon(c), - top = dpi(6), - left = dpi(15), - bottom = dpi(6), - widget = wibox.container.margin, - }, - text_temp, - nill, - expand = "none", - layout = wibox.layout.align.horizontal, - }) - - local close = create_title_button(c, close_color, bg_normal) - close:connect_signal("button::press", function() - c:kill() - end) - - local floating = create_title_button(c, float_color, bg_normal) - floating:connect_signal("button::press", function() - c.floating = not c.floating - end) - - local min = create_title_button(c, min_color, bg_normal) - min:connect_signal("button::press", function() - c.minimized = true - end) - - if focused_bool then - tab_content = wibox.widget({ - { - awful.widget.clienticon(c), - top = dpi(10), - left = dpi(15), - bottom = dpi(10), - widget = wibox.container.margin, - }, - text_temp, - { - { min, floating, close, layout = wibox.layout.fixed.horizontal }, - top = dpi(10), - right = dpi(10), - bottom = dpi(10), - widget = wibox.container.margin, - }, - expand = "none", - layout = wibox.layout.align.horizontal, - }) - end - - local main_content = nil - local left_shape = nil - local right_shape = nil - - if position == "top" then - main_content = wibox.widget({ - { - tab_content, - bg = bg_temp, - shape = helpers.shape.prrect( - border_radius, - true, - true, - false, - false - ), - widget = wibox.container.background, - }, - top = dpi(8), - widget = wibox.container.margin, - }) - - left_shape = helpers.shape.prrect( - border_radius, - false, - false, - true, - false - ) - right_shape = helpers.shape.prrect( - border_radius, - false, - false, - false, - true - ) - else - main_content = wibox.widget({ - { - tab_content, - bg = bg_temp, - shape = helpers.shape.prrect( - border_radius, - false, - false, - true, - true - ), - widget = wibox.container.background, - }, - bottom = dpi(8), - widget = wibox.container.margin, - }) - - left_shape = helpers.shape.prrect( - border_radius, - false, - true, - false, - false - ) - right_shape = helpers.shape.prrect( - border_radius, - true, - false, - false, - false - ) - end - - local wid_temp = wibox.widget({ - buttons = buttons, - { - { - { - wibox.widget.textbox(), - bg = bg_normal, - shape = left_shape, - widget = wibox.container.background, - }, - bg = bg_temp, - shape = gears.rectangle, - widget = wibox.container.background, - }, - width = border_radius + (border_radius / 2), - height = size, - strategy = "exact", - layout = wibox.layout.constraint, - }, - main_content, - { - { - { - wibox.widget.textbox(), - bg = bg_normal, - shape = right_shape, - widget = wibox.container.background, - }, - bg = bg_temp, - shape = gears.rectangle, - widget = wibox.container.background, - }, - width = border_radius + (border_radius / 2), - height = size, - strategy = "exact", - layout = wibox.layout.constraint, - }, - - layout = wibox.layout.align.horizontal, - }) - return wid_temp -end - -return { - layout = wibox.layout.flex.horizontal, - create = create, - position = position, - size = size, - bg_normal = bg_normal, - bg_focus = bg_focus, -} diff --git a/cfg/awesome/bling/widget/tabbar/pure.lua b/cfg/awesome/bling/widget/tabbar/pure.lua deleted file mode 100644 index 5be82e5..0000000 --- a/cfg/awesome/bling/widget/tabbar/pure.lua +++ /dev/null @@ -1,81 +0,0 @@ -local awful = require("awful") -local gears = require("gears") -local wibox = require("wibox") -local gcolor = require("gears.color") -local beautiful = require("beautiful") - -local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff" -local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" -local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" -local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" -local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus -local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus -local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal -local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal -local font = beautiful.tabbar_font or beautiful.font or "Hack 15" -local size = beautiful.tabbar_size or 20 -local position = beautiful.tabbar_position or "top" - -local function create(c, focused_bool, buttons, inactive_bool) - local bg_temp = inactive_bool and bg_normal_inactive or bg_normal - local fg_temp = inactive_bool and fg_normal_inactive or fg_normal - if focused_bool then - bg_temp = inactive_bool and bg_focus_inactive or bg_focus - fg_temp = inactive_bool and fg_focus_inactive or fg_focus - end - - local wid_temp = wibox.widget({ - { - { -- Left - wibox.widget.base.make_widget( - awful.titlebar.widget.iconwidget(c) - ), - buttons = buttons, - layout = wibox.layout.fixed.horizontal, - }, - { -- Title - wibox.widget.base.make_widget( - awful.titlebar.widget.titlewidget(c) - ), - buttons = buttons, - widget = wibox.container.place, - }, - { -- Right - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.floatingbutton(c) - ) or nil, - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.stickybutton(c) - ) or nil, - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.ontopbutton(c) - ) or nil, - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.maximizedbutton(c) - ) or nil, - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.minimizebutton(c) - ) or nil, - focused_bool and wibox.widget.base.make_widget( - awful.titlebar.widget.closebutton(c) - ) or nil, - layout = wibox.layout.fixed.horizontal, - }, - layout = wibox.layout.align.horizontal, - }, - bg = bg_temp, - fg = fg_temp, - widget = wibox.container.background, - }) - - return wid_temp -end - -return { - layout = wibox.layout.flex.horizontal, - create = create, - position = position, - size = size, - bg_normal = bg_normal, - bg_focus = bg_focus, -} diff --git a/cfg/awesome/bling/widget/tabbed_misc/custom_tasklist.lua b/cfg/awesome/bling/widget/tabbed_misc/custom_tasklist.lua deleted file mode 100644 index ac22377..0000000 --- a/cfg/awesome/bling/widget/tabbed_misc/custom_tasklist.lua +++ /dev/null @@ -1,51 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local gears = require("gears") -local beautiful = require("beautiful") -local dpi = require("beautiful.xresources").apply_dpi - -local function tabobj_support(self, c, index, clients) - -- Self is the background widget in this context - if not c.bling_tabbed and #c.bling_tabbed.clients > 1 then - return - end - - local group = c.bling_tabbed - - -- TODO: Allow customization here - local layout_v = wibox.widget { - vertical_spacing = dpi(2), - horizontal_spacing = dpi(2), - layout = wibox.layout.grid.horizontal, - forced_num_rows = 2, - forced_num_cols = 2, - homogeneous = true - } - - local wrapper = wibox.widget({ - layout_v, - id = "click_role", - widget = wibox.container.margin, - margins = dpi(5), - }) - - -- To get the ball rolling. - for idx, c in ipairs(group.clients) do - if not (c and c.icon) then goto skip end - - -- Add to the last layout - layout_v:add(wibox.widget { - { - widget = awful.widget.clienticon, - client = c - }, - widget = wibox.container.constraint, - width = dpi(24), - height = dpi(24) - }) - ::skip:: - end - self.widget = wrapper -end - -return tabobj_support diff --git a/cfg/awesome/bling/widget/tabbed_misc/init.lua b/cfg/awesome/bling/widget/tabbed_misc/init.lua deleted file mode 100644 index 1de3fbb..0000000 --- a/cfg/awesome/bling/widget/tabbed_misc/init.lua +++ /dev/null @@ -1,9 +0,0 @@ -return { - titlebar_indicator = require( - tostring(...):match(".*bling") - .. ".widget.tabbed_misc.titlebar_indicator" - ), - custom_tasklist = require( - tostring(...):match(".*bling") .. ".widget.tabbed_misc.custom_tasklist" - ), -} diff --git a/cfg/awesome/bling/widget/tabbed_misc/titlebar_indicator.lua b/cfg/awesome/bling/widget/tabbed_misc/titlebar_indicator.lua deleted file mode 100644 index 46959cd..0000000 --- a/cfg/awesome/bling/widget/tabbed_misc/titlebar_indicator.lua +++ /dev/null @@ -1,133 +0,0 @@ -local wibox = require("wibox") -local awful = require("awful") -local gears = require("gears") -local beautiful = require("beautiful") -local dpi = require("beautiful.xresources").apply_dpi -local tabbed_module = require( - tostring(...):match(".*bling") .. ".module.tabbed" -) - --- Just check if a table contains a value. -local function tbl_contains(tbl, item) - for _, v in ipairs(tbl) do - if v == item then - return true - end - end - return false -end - --- Needs to be run, every time a new titlbear is created -return function(c, opts) - -- Args & Fallback -- Widget templates are in their original loactions - opts = gears.table.crush({ - layout_spacing = dpi(4), - icon_size = dpi(20), - icon_margin = dpi(4), - bg_color_focus = "#ff0000", - bg_color = "#00000000", - fg_color = "#fafafa", - fg_color_focus = "#e0e0e0", - icon_shape = function(cr, w, h) - gears.shape.rounded_rect(cr, w, h, 0) - end, - layout = wibox.layout.fixed.horizontal, - }, gears.table.join( - opts, - beautiful.bling_tabbed_misc_titlebar_indicator - )) - - -- Container to store icons - local tabbed_icons = wibox.widget({ - layout = opts.layout, - spacing = opts.layout_spacing, - }) - - awesome.connect_signal("bling::tabbed::client_removed", function(_, removed_c) - -- Remove from list - for idx, icon in ipairs(tabbed_icons.children) do - if icon._client == removed_c then - tabbed_icons:remove(idx) - end - end - - -- Empty list - if removed_c == c then - tabbed_icons:reset() - end - end) - - local function recreate(group) - if tbl_contains(group.clients, c) then - tabbed_icons:reset() - local focused = group.clients[group.focused_idx] - - -- Autohide? - if #group.clients == 1 then - return - end - - for idx, client in ipairs(group.clients) do - local widget = wibox.widget( - opts.widget_template or { - { - { - { - id = "icon_role", - forced_width = opts.icon_size, - forced_height = opts.icon_size, - widget = awful.widget.clienticon, - }, - margins = opts.icon_margin, - widget = wibox.container.margin, - }, - shape = opts.icon_shape, - id = "bg_role", - widget = wibox.container.background, - }, - halign = "center", - valign = "center", - widget = wibox.container.place, - }) - - widget._client = client - - -- No creation call back since this would be called on creation & every time the widget updated. - if opts.widget_template and opts.widget_template.update_callback then - opts.widget_template.update_callback(widget, client, group) - end - - -- Add icons & etc - for _, w in ipairs(widget:get_children_by_id("icon_role")) do - -- TODO: Allow fallback icon? - w.image = client.icon - w.client = client - end - - for _, w in ipairs(widget:get_children_by_id("bg_role")) do - w:add_button(awful.button({}, 1, function() - tabbed_module.switch_to(group, idx) - end)) - if client == focused then - w.bg = opts.bg_color_focus - w.fg = opts.fg_color_focus - else - w.bg = opts.bg_color - w.fg = opts.fg_color - end - end - - for _, w in ipairs(widget:get_children_by_id("text_role")) do - w.text = client.name - end - - tabbed_icons:add(widget) - end - end - end - - awesome.connect_signal("bling::tabbed::client_added", recreate) - awesome.connect_signal("bling::tabbed::changed_focus", recreate) - - return tabbed_icons -end diff --git a/cfg/awesome/bling/widget/tag_preview.lua b/cfg/awesome/bling/widget/tag_preview.lua deleted file mode 100644 index aeedb25..0000000 --- a/cfg/awesome/bling/widget/tag_preview.lua +++ /dev/null @@ -1,248 +0,0 @@ --- --- Provides: --- bling::tag_preview::update -- first line is the signal --- t (tag) -- indented lines are function parameters --- bling::tag_preview::visibility --- s (screen) --- v (boolean) --- -local awful = require("awful") -local wibox = require("wibox") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local gears = require("gears") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local cairo = require("lgi").cairo - -local function draw_widget( - t, - tag_preview_image, - scale, - screen_radius, - client_radius, - client_opacity, - client_bg, - client_border_color, - client_border_width, - widget_bg, - widget_border_color, - widget_border_width, - geo, - margin, - background_image -) - local client_list = wibox.layout.manual() - client_list.forced_height = geo.height - client_list.forced_width = geo.width - local tag_screen = t.screen - for i, c in ipairs(t:clients()) do - if not c.hidden and not c.minimized then - - - local img_box = wibox.widget ({ - resize = true, - forced_height = 100 * scale, - forced_width = 100 * scale, - widget = wibox.widget.imagebox, - }) - - -- If fails to set image, fallback to a awesome icon - if not pcall(function() img_box.image = gears.surface.load(c.icon) end) then - img_box.image = beautiful.theme_assets.awesome_icon (24, "#222222", "#fafafa") - end - - if tag_preview_image then - if c.prev_content or t.selected then - local content - if t.selected then - content = gears.surface(c.content) - else - content = gears.surface(c.prev_content) - end - local cr = cairo.Context(content) - local x, y, w, h = cr:clip_extents() - local img = cairo.ImageSurface.create( - cairo.Format.ARGB32, - w - x, - h - y - ) - cr = cairo.Context(img) - cr:set_source_surface(content, 0, 0) - cr.operator = cairo.Operator.SOURCE - cr:paint() - - img_box = wibox.widget({ - image = gears.surface.load(img), - resize = true, - opacity = client_opacity, - forced_height = math.floor(c.height * scale), - forced_width = math.floor(c.width * scale), - widget = wibox.widget.imagebox, - }) - end - end - - local client_box = wibox.widget({ - { - nil, - { - nil, - img_box, - nil, - expand = "outside", - layout = wibox.layout.align.horizontal, - }, - nil, - expand = "outside", - widget = wibox.layout.align.vertical, - }, - forced_height = math.floor(c.height * scale), - forced_width = math.floor(c.width * scale), - bg = client_bg, - shape_border_color = client_border_color, - shape_border_width = client_border_width, - shape = helpers.shape.rrect(client_radius), - widget = wibox.container.background, - }) - - client_box.point = { - x = math.floor((c.x - geo.x) * scale), - y = math.floor((c.y - geo.y) * scale), - } - - client_list:add(client_box) - end - end - - return wibox.widget { - { - background_image, - { - { - { - { - client_list, - forced_height = geo.height, - forced_width = geo.width, - widget = wibox.container.place, - }, - layout = wibox.layout.align.horizontal, - }, - layout = wibox.layout.align.vertical, - }, - margins = margin, - widget = wibox.container.margin, - }, - layout = wibox.layout.stack - }, - bg = widget_bg, - shape_border_width = widget_border_width, - shape_border_color = widget_border_color, - shape = helpers.shape.rrect(screen_radius), - widget = wibox.container.background, - } -end - -local enable = function(opts) - local opts = opts or {} - - local tag_preview_image = opts.show_client_content or false - local widget_x = opts.x or dpi(20) - local widget_y = opts.y or dpi(20) - local scale = opts.scale or 0.2 - local work_area = opts.honor_workarea or false - local padding = opts.honor_padding or false - local placement_fn = opts.placement_fn or nil - local background_image = opts.background_widget or nil - - local margin = beautiful.tag_preview_widget_margin or dpi(0) - local screen_radius = beautiful.tag_preview_widget_border_radius or dpi(0) - local client_radius = beautiful.tag_preview_client_border_radius or dpi(0) - local client_opacity = beautiful.tag_preview_client_opacity or 0.5 - local client_bg = beautiful.tag_preview_client_bg or "#000000" - local client_border_color = beautiful.tag_preview_client_border_color - or "#ffffff" - local client_border_width = beautiful.tag_preview_client_border_width - or dpi(3) - local widget_bg = beautiful.tag_preview_widget_bg or "#000000" - local widget_border_color = beautiful.tag_preview_widget_border_color - or "#ffffff" - local widget_border_width = beautiful.tag_preview_widget_border_width - or dpi(3) - - local tag_preview_box = awful.popup({ - screen = awful.screen.focused(), - type = "dropdown_menu", - visible = false, - ontop = true, - placement = placement_fn, - widget = wibox.container.background, - input_passthrough = true, - bg = "#00000000", - }) - - tag.connect_signal("property::selected", function(t) - -- Awesome switches up tags on startup really fast it seems, probably depends on what rules you have set - -- which can cause the c.content to not show the correct image - gears.timer - { - timeout = 0.1, - call_now = false, - autostart = true, - single_shot = true, - callback = function() - if t.selected == true then - for _, c in ipairs(t:clients()) do - c.prev_content = gears.surface.duplicate_surface(c.content) - end - end - end - } - end) - - awesome.connect_signal("bling::tag_preview::update", function(t) - local geo = t.screen:get_bounding_geometry({ - honor_padding = padding, - honor_workarea = work_area, - }) - - tag_preview_box.maximum_width = scale * geo.width + margin * 2 - tag_preview_box.maximum_height = scale * geo.height + margin * 2 - - tag_preview_box.widget = draw_widget( - t, - tag_preview_image, - scale, - screen_radius, - client_radius, - client_opacity, - client_bg, - client_border_color, - client_border_width, - widget_bg, - widget_border_color, - widget_border_width, - geo, - margin, - background_image - ) - end) - - awesome.connect_signal("bling::tag_preview::visibility", function(s, v) - if not placement_fn then - tag_preview_box.x = s.geometry.x + widget_x - tag_preview_box.y = s.geometry.y + widget_y - end - - if v == false then - tag_preview_box.widget = nil - collectgarbage("collect") - else - tag_preview_box.screen = awful.screen.focused() - end - - tag_preview_box.visible = v - end) -end - -return {enable = enable, draw_widget = draw_widget} diff --git a/cfg/awesome/bling/widget/task_preview.lua b/cfg/awesome/bling/widget/task_preview.lua deleted file mode 100644 index 037a423..0000000 --- a/cfg/awesome/bling/widget/task_preview.lua +++ /dev/null @@ -1,201 +0,0 @@ --- --- Provides: --- bling::task_preview::visibility --- s (screen) --- v (boolean) --- c (client) --- -local awful = require("awful") -local wibox = require("wibox") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local gears = require("gears") -local beautiful = require("beautiful") -local dpi = beautiful.xresources.apply_dpi -local cairo = require("lgi").cairo - --- TODO: rename structure to something better? -local function draw_widget( - c, - widget_template, - screen_radius, - widget_bg, - widget_border_color, - widget_border_width, - margin, - widget_width, - widget_height -) - if not pcall(function() - return type(c.content) - end) then - return - end - - local content = nil - if c.active then - content = gears.surface(c.content) - elseif c.prev_content then - content = gears.surface(c.prev_content) - end - - local img = nil - if content ~= nil then - local cr = cairo.Context(content) - local x, y, w, h = cr:clip_extents() - img = cairo.ImageSurface.create(cairo.Format.ARGB32, w - x, h - y) - cr = cairo.Context(img) - cr:set_source_surface(content, 0, 0) - cr.operator = cairo.Operator.SOURCE - cr:paint() - end - - local widget = wibox.widget({ - (widget_template or { - { - { - { - { - id = "icon_role", - resize = true, - forced_height = dpi(20), - forced_width = dpi(20), - widget = wibox.widget.imagebox, - }, - { - { - id = "name_role", - align = "center", - widget = wibox.widget.textbox, - }, - left = dpi(4), - right = dpi(4), - widget = wibox.container.margin, - }, - layout = wibox.layout.align.horizontal, - }, - { - { - { - id = "image_role", - resize = true, - clip_shape = helpers.shape.rrect(screen_radius), - widget = wibox.widget.imagebox, - }, - valign = "center", - halign = "center", - widget = wibox.container.place, - }, - top = margin * 0.25, - widget = wibox.container.margin, - }, - fill_space = true, - layout = wibox.layout.fixed.vertical, - }, - margins = margin, - widget = wibox.container.margin, - }, - bg = widget_bg, - shape_border_width = widget_border_width, - shape_border_color = widget_border_color, - shape = helpers.shape.rrect(screen_radius), - widget = wibox.container.background, - }), - width = widget_width, - height = widget_height, - widget = wibox.container.constraint, - }) - - -- TODO: have something like a create callback here? - - for _, w in ipairs(widget:get_children_by_id("image_role")) do - w.image = img -- TODO: copy it with gears.surface.xxx or something - end - - for _, w in ipairs(widget:get_children_by_id("name_role")) do - w.text = c.name - end - - for _, w in ipairs(widget:get_children_by_id("icon_role")) do - w.image = c.icon -- TODO: detect clienticon - end - - return widget -end - -local enable = function(opts) - local opts = opts or {} - - local widget_x = opts.x or dpi(20) - local widget_y = opts.y or dpi(20) - local widget_height = opts.height or dpi(200) - local widget_width = opts.width or dpi(200) - local placement_fn = opts.placement_fn or nil - - local margin = beautiful.task_preview_widget_margin or dpi(0) - local screen_radius = beautiful.task_preview_widget_border_radius or dpi(0) - local widget_bg = beautiful.task_preview_widget_bg or "#000000" - local widget_border_color = beautiful.task_preview_widget_border_color - or "#ffffff" - local widget_border_width = beautiful.task_preview_widget_border_width - or dpi(3) - - local task_preview_box = awful.popup({ - screen = awful.screen.focused(), - type = "dropdown_menu", - visible = false, - ontop = true, - placement = placement_fn, - widget = wibox.container.background, -- A dummy widget to make awful.popup not scream - input_passthrough = true, - bg = "#00000000", - }) - - tag.connect_signal("property::selected", function(t) - -- Awesome switches up tags on startup really fast it seems, probably depends on what rules you have set - -- which can cause the c.content to not show the correct image - gears.timer - { - timeout = 0.1, - call_now = false, - autostart = true, - single_shot = true, - callback = function() - if t.selected == true then - for _, c in ipairs(t:clients()) do - c.prev_content = gears.surface.duplicate_surface(c.content) - end - end - end - } - end) - - awesome.connect_signal("bling::task_preview::visibility", function(s, v, c) - if v then - task_preview_box.screen = awful.screen.focused() - -- Update task preview contents - task_preview_box.widget = draw_widget( - c, - opts.structure, - screen_radius, - widget_bg, - widget_border_color, - widget_border_width, - margin, - widget_width, - widget_height - ) - else - task_preview_box.widget = nil - collectgarbage("collect") - end - - if not placement_fn then - task_preview_box.x = s.geometry.x + widget_x - task_preview_box.y = s.geometry.y + widget_y - end - - task_preview_box.visible = v - end) -end - -return { enable = enable, draw_widget = draw_widget } diff --git a/cfg/awesome/bling/widget/window_switcher.lua b/cfg/awesome/bling/widget/window_switcher.lua deleted file mode 100644 index 97dbeb1..0000000 --- a/cfg/awesome/bling/widget/window_switcher.lua +++ /dev/null @@ -1,461 +0,0 @@ -local cairo = require("lgi").cairo -local awful = require("awful") -local gears = require("gears") -local wibox = require("wibox") -local beautiful = require("beautiful") -local helpers = require(tostring(...):match(".*bling") .. ".helpers") -local dpi = beautiful.xresources.apply_dpi - -local window_switcher_first_client -- The client that was focused when the window_switcher was activated -local window_switcher_minimized_clients = {} -- The clients that were minimized when the window switcher was activated -local window_switcher_grabber - -local get_num_clients = function() - local minimized_clients_in_tag = 0 - local matcher = function(c) - return awful.rules.match( - c, - { - minimized = true, - skip_taskbar = false, - hidden = false, - first_tag = awful.screen.focused().selected_tag, - } - ) - end - for c in awful.client.iterate(matcher) do - minimized_clients_in_tag = minimized_clients_in_tag + 1 - end - return minimized_clients_in_tag + #awful.screen.focused().clients -end - -local window_switcher_hide = function(window_switcher_box) - -- Add currently focused client to history - if client.focus then - local window_switcher_last_client = client.focus - awful.client.focus.history.add(window_switcher_last_client) - -- Raise client that was focused originally - -- Then raise last focused client - if - window_switcher_first_client and window_switcher_first_client.valid - then - window_switcher_first_client:raise() - window_switcher_last_client:raise() - end - end - - -- Minimize originally minimized clients - local s = awful.screen.focused() - for _, c in pairs(window_switcher_minimized_clients) do - if c and c.valid and not (client.focus and client.focus == c) then - c.minimized = true - end - end - -- Reset helper table - window_switcher_minimized_clients = {} - - -- Resume recording focus history - awful.client.focus.history.enable_tracking() - -- Stop and hide window_switcher - awful.keygrabber.stop(window_switcher_grabber) - window_switcher_box.visible = false - window_switcher_box.widget = nil - collectgarbage("collect") -end - -local function draw_widget( - type, - background, - border_width, - border_radius, - border_color, - clients_spacing, - client_icon_horizontal_spacing, - client_width, - client_height, - client_margins, - thumbnail_margins, - thumbnail_scale, - name_margins, - name_valign, - name_forced_width, - name_font, - name_normal_color, - name_focus_color, - icon_valign, - icon_width, - mouse_keys, - filterClients -) - filterClients = filterClients or awful.widget.tasklist.filter.currenttags - local tasklist_widget = type == "thumbnail" - and awful.widget.tasklist({ - screen = awful.screen.focused(), - filter = filterClients, - buttons = mouse_keys, - style = { - font = name_font, - fg_normal = name_normal_color, - fg_focus = name_focus_color, - }, - layout = { - layout = wibox.layout.flex.horizontal, - spacing = clients_spacing, - }, - widget_template = { - widget = wibox.container.background, - id = "bg_role", - forced_width = client_width, - forced_height = client_height, - create_callback = function(self, c, _, __) - local content = gears.surface(c.content) - local cr = cairo.Context(content) - local x, y, w, h = cr:clip_extents() - local img = cairo.ImageSurface.create( - cairo.Format.ARGB32, - w - x, - h - y - ) - cr = cairo.Context(img) - cr:set_source_surface(content, 0, 0) - cr.operator = cairo.Operator.SOURCE - cr:paint() - self:get_children_by_id("thumbnail")[1].image = - gears.surface.load( - img - ) - end, - { - { - { - horizontal_fit_policy = thumbnail_scale == true - and "fit" - or "auto", - vertical_fit_policy = thumbnail_scale == true - and "fit" - or "auto", - id = "thumbnail", - widget = wibox.widget.imagebox, - }, - margins = thumbnail_margins, - widget = wibox.container.margin, - }, - { - { - { - id = "icon_role", - widget = wibox.widget.imagebox, - }, - forced_width = icon_width, - valign = icon_valign, - widget = wibox.container.place, - }, - { - { - forced_width = name_forced_width, - valign = name_valign, - id = "text_role", - widget = wibox.widget.textbox, - }, - margins = name_margins, - widget = wibox.container.margin, - }, - spacing = client_icon_horizontal_spacing, - layout = wibox.layout.fixed.horizontal, - }, - layout = wibox.layout.flex.vertical, - }, - }, - }) - or awful.widget.tasklist({ - screen = awful.screen.focused(), - filter = filterClients, - buttons = mouse_keys, - style = { - font = name_font, - fg_normal = name_normal_color, - fg_focus = name_focus_color, - }, - layout = { - layout = wibox.layout.fixed.vertical, - spacing = clients_spacing, - }, - widget_template = { - widget = wibox.container.background, - id = "bg_role", - forced_width = client_width, - forced_height = client_height, - { - { - { - id = "icon_role", - widget = wibox.widget.imagebox, - }, - forced_width = icon_width, - valign = icon_valign, - widget = wibox.container.place, - }, - { - { - forced_width = name_forced_width, - valign = name_valign, - id = "text_role", - widget = wibox.widget.textbox, - }, - margins = name_margins, - widget = wibox.container.margin, - }, - spacing = client_icon_horizontal_spacing, - layout = wibox.layout.fixed.horizontal, - }, - }, - }) - - return wibox.widget({ - { - tasklist_widget, - margins = client_margins, - widget = wibox.container.margin, - }, - shape_border_width = border_width, - shape_border_color = border_color, - bg = background, - shape = helpers.shape.rrect(border_radius), - widget = wibox.container.background, - }) -end - -local enable = function(opts) - local opts = opts or {} - - local type = opts.type or "thumbnail" - local background = beautiful.window_switcher_widget_bg or "#000000" - local border_width = beautiful.window_switcher_widget_border_width or dpi(3) - local border_radius = beautiful.window_switcher_widget_border_radius - or dpi(0) - local border_color = beautiful.window_switcher_widget_border_color - or "#ffffff" - local clients_spacing = beautiful.window_switcher_clients_spacing or dpi(20) - local client_icon_horizontal_spacing = beautiful.window_switcher_client_icon_horizontal_spacing - or dpi(5) - local client_width = beautiful.window_switcher_client_width - or dpi(type == "thumbnail" and 150 or 500) - local client_height = beautiful.window_switcher_client_height - or dpi(type == "thumbnail" and 250 or 50) - local client_margins = beautiful.window_switcher_client_margins or dpi(10) - local thumbnail_margins = beautiful.window_switcher_thumbnail_margins - or dpi(5) - local thumbnail_scale = beautiful.thumbnail_scale or false - local name_margins = beautiful.window_switcher_name_margins or dpi(10) - local name_valign = beautiful.window_switcher_name_valign or "center" - local name_forced_width = beautiful.window_switcher_name_forced_width - or dpi(type == "thumbnail" and 200 or 550) - local name_font = beautiful.window_switcher_name_font or beautiful.font - local name_normal_color = beautiful.window_switcher_name_normal_color - or "#FFFFFF" - local name_focus_color = beautiful.window_switcher_name_focus_color - or "#FF0000" - local icon_valign = beautiful.window_switcher_icon_valign or "center" - local icon_width = beautiful.window_switcher_icon_width or dpi(40) - - local hide_window_switcher_key = opts.hide_window_switcher_key or "Escape" - - local select_client_key = opts.select_client_key or 1 - local minimize_key = opts.minimize_key or "n" - local unminimize_key = opts.unminimize_key or "N" - local kill_client_key = opts.kill_client_key or "q" - - local cycle_key = opts.cycle_key or "Tab" - - local previous_key = opts.previous_key or "Left" - local next_key = opts.next_key or "Right" - - local vim_previous_key = opts.vim_previous_key or "h" - local vim_next_key = opts.vim_next_key or "l" - - local scroll_previous_key = opts.scroll_previous_key or 4 - local scroll_next_key = opts.scroll_next_key or 5 - - local cycleClientsByIdx = opts.cycleClientsByIdx or awful.client.focus.byidx - local filterClients = opts.filterClients or awful.widget.tasklist.filter.currenttags - - local window_switcher_box = awful.popup({ - bg = "#00000000", - visible = false, - ontop = true, - placement = awful.placement.centered, - screen = awful.screen.focused(), - widget = wibox.container.background, -- A dummy widget to make awful.popup not scream - widget = { - { - draw_widget(), - margins = client_margins, - widget = wibox.container.margin, - }, - shape_border_width = border_width, - shape_border_color = border_color, - bg = background, - shape = helpers.shape.rrect(border_radius), - widget = wibox.container.background, - }, - }) - - local mouse_keys = gears.table.join( - awful.button({ - modifiers = { "Any" }, - button = select_client_key, - on_press = function(c) - client.focus = c - end, - }), - - awful.button({ - modifiers = { "Any" }, - button = scroll_previous_key, - on_press = function() - cycleClientsByIdx(-1) - end, - }), - - awful.button({ - modifiers = { "Any" }, - button = scroll_next_key, - on_press = function() - cycleClientsByIdx(1) - end, - }) - ) - - local keyboard_keys = { - [hide_window_switcher_key] = function() - window_switcher_hide(window_switcher_box) - end, - - [minimize_key] = function() - if client.focus then - client.focus.minimized = true - end - end, - [unminimize_key] = function() - if awful.client.restore() then - client.focus = awful.client.restore() - end - end, - [kill_client_key] = function() - if client.focus then - client.focus:kill() - end - end, - - [cycle_key] = function() - cycleClientsByIdx(1) - end, - - [previous_key] = function() - cycleClientsByIdx(1) - end, - [next_key] = function() - cycleClientsByIdx(-1) - end, - - [vim_previous_key] = function() - cycleClientsByIdx(1) - end, - [vim_next_key] = function() - cycleClientsByIdx(-1) - end, - } - - window_switcher_box:connect_signal("property::width", function() - if window_switcher_box.visible and get_num_clients() == 0 then - window_switcher_hide(window_switcher_box) - end - end) - - window_switcher_box:connect_signal("property::height", function() - if window_switcher_box.visible and get_num_clients() == 0 then - window_switcher_hide(window_switcher_box) - end - end) - - awesome.connect_signal("bling::window_switcher::turn_on", function() - local number_of_clients = get_num_clients() - if number_of_clients == 0 then - return - end - - -- Store client that is focused in a variable - window_switcher_first_client = client.focus - - -- Stop recording focus history - awful.client.focus.history.disable_tracking() - - -- Go to previously focused client (in the tag) - awful.client.focus.history.previous() - - -- Track minimized clients - -- Unminimize them - -- Lower them so that they are always below other - -- originally unminimized windows - local clients = awful.screen.focused().selected_tag:clients() - for _, c in pairs(clients) do - if c.minimized then - table.insert(window_switcher_minimized_clients, c) - c.minimized = false - c:lower() - end - end - - -- Start the keygrabber - window_switcher_grabber = awful.keygrabber.run(function(_, key, event) - if event == "release" then - -- Hide if the modifier was released - -- We try to match Super or Alt or Control since we do not know which keybind is - -- used to activate the window switcher (the keybind is set by the user in keys.lua) - if - key:match("Super") - or key:match("Alt") - or key:match("Control") - then - window_switcher_hide(window_switcher_box) - end - -- Do nothing - return - end - - -- Run function attached to key, if it exists - if keyboard_keys[key] then - keyboard_keys[key]() - end - end) - - window_switcher_box.widget = draw_widget( - type, - background, - border_width, - border_radius, - border_color, - clients_spacing, - client_icon_horizontal_spacing, - client_width, - client_height, - client_margins, - thumbnail_margins, - thumbnail_scale, - name_margins, - name_valign, - name_forced_width, - name_font, - name_normal_color, - name_focus_color, - icon_valign, - icon_width, - mouse_keys, - filterClients - ) - window_switcher_box.screen = awful.screen.focused() - window_switcher_box.visible = true - end) -end - -return { enable = enable } diff --git a/cfg/awesome/configuration/autofocus.lua b/cfg/awesome/configuration/autofocus.lua deleted file mode 100644 index 78d93ee..0000000 --- a/cfg/awesome/configuration/autofocus.lua +++ /dev/null @@ -1,3 +0,0 @@ -client.connect_signal("mouse::enter", function(c) - c:activate { context = "mouse_enter", raise = false } -end) diff --git a/cfg/awesome/configuration/init.lua b/cfg/awesome/configuration/init.lua deleted file mode 100644 index b7e48a1..0000000 --- a/cfg/awesome/configuration/init.lua +++ /dev/null @@ -1,7 +0,0 @@ -require "configuration.notifications" -require "configuration.theme" -require "configuration.layouts" -require "configuration.mousebindings" -require "configuration.keybindings" -require "configuration.rules" -require "configuration.autofocus" \ No newline at end of file diff --git a/cfg/awesome/configuration/keybindings.lua b/cfg/awesome/configuration/keybindings.lua deleted file mode 100644 index 6f6c98e..0000000 --- a/cfg/awesome/configuration/keybindings.lua +++ /dev/null @@ -1,212 +0,0 @@ -local awful = require "awful" -local hotkeys_popup = require "awful.hotkeys_popup" - -local function set_keybindings () - awful.keyboard.append_global_keybindings({ - awful.key({ modkey, }, "s", hotkeys_popup.show_help, - {description="show help", group="awesome"}), - awful.key({ modkey, "Control" }, "r", awesome.restart, - {description = "reload awesome", group = "awesome"}), - awful.key({ modkey, "Shift" }, "q", awesome.quit, - {description = "quit awesome", group = "awesome"}), - awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, - {description = "open a terminal", group = "launcher"}), - awful.key({ modkey }, "p", function() menubar.show() end, - {description = "show the menubar", group = "launcher"}), - awful.key({ modkey, "Shift" }, "Return", function () awful.spawn("rofi -show drun") end, - {description = "Open rofi", group = "launcher"}), - }) - - -- Tags related keybindings - awful.keyboard.append_global_keybindings({ - awful.key({ modkey, }, "Left", awful.tag.viewprev, - {description = "view previous", group = "tag"}), - awful.key({ modkey, }, "Right", awful.tag.viewnext, - {description = "view next", group = "tag"}), - awful.key({ modkey, }, "Escape", awful.tag.history.restore, - {description = "go back", group = "tag"}), - }) - - -- Focus related keybindings - awful.keyboard.append_global_keybindings({ - awful.key({ modkey, }, "j", - function () - awful.client.focus.byidx( 1) - end, - {description = "focus next by index", group = "client"} - ), - awful.key({ modkey, }, "k", - function () - awful.client.focus.byidx(-1) - end, - {description = "focus previous by index", group = "client"} - ), - awful.key({ modkey, }, "Tab", - function () - awful.client.focus.history.previous() - if client.focus then - client.focus:raise() - end - end, - {description = "go back", group = "client"}), - awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, - {description = "focus the next screen", group = "screen"}), - awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, - {description = "focus the previous screen", group = "screen"}), - awful.key({ modkey, "Control" }, "n", - function () - local c = awful.client.restore() - -- Focus restored client - if c then - c:activate { raise = true, context = "key.unminimize" } - end - end, - {description = "restore minimized", group = "client"}), - }) - - -- Layout related keybindings - awful.keyboard.append_global_keybindings({ - awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, - {description = "swap with next client by index", group = "client"}), - awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, - {description = "swap with previous client by index", group = "client"}), - awful.key({ modkey, }, "u", awful.client.urgent.jumpto, - {description = "jump to urgent client", group = "client"}), - awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, - {description = "increase master width factor", group = "layout"}), - awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, - {description = "decrease master width factor", group = "layout"}), - awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, - {description = "increase the number of master clients", group = "layout"}), - awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, - {description = "decrease the number of master clients", group = "layout"}), - awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, - {description = "increase the number of columns", group = "layout"}), - awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, - {description = "decrease the number of columns", group = "layout"}), - awful.key({ modkey, }, "Tab", function () awful.layout.inc( 1) end, - {description = "select next", group = "layout"}), - awful.key({ modkey, "Shift" }, "Tab", function () awful.layout.inc(-1) end, - {description = "select previous", group = "layout"}), - }) - - -- @DOC_NUMBER_KEYBINDINGS@ - - awful.keyboard.append_global_keybindings({ - awful.key { - modifiers = { modkey }, - keygroup = "numrow", - description = "only view tag", - group = "tag", - on_press = function (index) - local screen = awful.screen.focused() - local tag = screen.tags[index] - if tag then - tag:view_only() - end - end, - }, - awful.key { - modifiers = { modkey, "Control" }, - keygroup = "numrow", - description = "toggle tag", - group = "tag", - on_press = function (index) - local screen = awful.screen.focused() - local tag = screen.tags[index] - if tag then - awful.tag.viewtoggle(tag) - end - end, - }, - awful.key { - modifiers = { modkey, "Shift" }, - keygroup = "numrow", - description = "move focused client to tag", - group = "tag", - on_press = function (index) - if client.focus then - local tag = client.focus.screen.tags[index] - if tag then - client.focus:move_to_tag(tag) - end - end - end, - }, - awful.key { - modifiers = { modkey, "Control", "Shift" }, - keygroup = "numrow", - description = "toggle focused client on tag", - group = "tag", - on_press = function (index) - if client.focus then - local tag = client.focus.screen.tags[index] - if tag then - client.focus:toggle_tag(tag) - end - end - end, - }, - awful.key { - modifiers = { modkey }, - keygroup = "numpad", - description = "select layout directly", - group = "layout", - on_press = function (index) - local t = awful.screen.focused().selected_tag - if t then - t.layout = t.layouts[index] or t.layout - end - end, - } - }) - - -- @DOC_CLIENT_KEYBINDINGS@ - client.connect_signal("request::default_keybindings", function() - awful.keyboard.append_client_keybindings({ - awful.key({ modkey, }, "f", - function (c) - c.fullscreen = not c.fullscreen - c:raise() - end, - {description = "toggle fullscreen", group = "client"}), - awful.key({ modkey }, "w", function (c) c:kill() end, - {description = "close", group = "client"}), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , - {description = "toggle floating", group = "client"}), - awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, - {description = "move to master", group = "client"}), - awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, - {description = "move to screen", group = "client"}), - awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, - {description = "toggle keep on top", group = "client"}), - awful.key({ modkey, }, "n", - function (c) - -- The client currently has the input focus, so it cannot be - -- minimized, since minimized clients can't have the focus. - c.minimized = true - end , - {description = "minimize", group = "client"}), - awful.key({ modkey, }, "m", - function (c) - c.maximized = not c.maximized - c:raise() - end , - {description = "(un)maximize", group = "client"}), - awful.key({ modkey, "Control" }, "m", - function (c) - c.maximized_vertical = not c.maximized_vertical - c:raise() - end , - {description = "(un)maximize vertically", group = "client"}), - awful.key({ modkey, "Shift" }, "m", - function (c) - c.maximized_horizontal = not c.maximized_horizontal - c:raise() - end , - {description = "(un)maximize horizontally", group = "client"}), - }) - end) -end - -set_keybindings() diff --git a/cfg/awesome/configuration/layouts.lua b/cfg/awesome/configuration/layouts.lua deleted file mode 100644 index 03bf28b..0000000 --- a/cfg/awesome/configuration/layouts.lua +++ /dev/null @@ -1,13 +0,0 @@ -local awful = require "awful" - -local function set_layouts() - tag.connect_signal("request::default_layouts", function () - awful.layout.append_default_layouts { - awful.layout.suit.floating, - awful.layout.suit.tile, - awful.layout.suit.max, - } - end) -end - -set_layouts() diff --git a/cfg/awesome/configuration/mousebindings.lua b/cfg/awesome/configuration/mousebindings.lua deleted file mode 100644 index a6d1bf5..0000000 --- a/cfg/awesome/configuration/mousebindings.lua +++ /dev/null @@ -1,26 +0,0 @@ -local awful = require "awful" -local menu = require "ui.menu" - -local function set_mousebindings () - awful.mouse.append_global_mousebindings { - awful.button({ }, 3, function () menu.mainmenu:toggle() end), - awful.button({ }, 4, awful.tag.viewprev), - awful.button({ }, 5, awful.tag.viewnext), - } - - client.connect_signal("request::default_mousebindings", function () - awful.mouse.append_client_mousebindings { - awful.button({ }, 1, function (c) - c:activate { context = "mouse_click" } - end), - awful.button({ modkey }, 1, function (c) - c:activate { context = "mouse_click", action = "mouse_move" } - end), - awful.button({ modkey }, 3, function (c) - c:activate { context = "mouse_click", action = "mouse_resize" } - end) - } - end) -end - -set_mousebindings() diff --git a/cfg/awesome/configuration/notifications.lua b/cfg/awesome/configuration/notifications.lua deleted file mode 100644 index d570b8f..0000000 --- a/cfg/awesome/configuration/notifications.lua +++ /dev/null @@ -1,24 +0,0 @@ -local naughty = require "naughty" -local beautiful = require 'beautiful' -local gears = require 'gears' -local awful = require 'awful' - --- display errors -naughty.connect_signal('request::display_error', function (message, startup) - naughty.notification { - urgency = 'critical', - title = 'An error happened' .. (startup and ' during startup' or ''), - message = message, - } -end) - --- display notification -naughty.connect_signal('request::display', function (n) - naughty.layout.box { - notification = n, - position = 'bottom_right', - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, beautiful.border_radius) - end - } -end) diff --git a/cfg/awesome/configuration/rules.lua b/cfg/awesome/configuration/rules.lua deleted file mode 100644 index 3f1d7b1..0000000 --- a/cfg/awesome/configuration/rules.lua +++ /dev/null @@ -1,53 +0,0 @@ -local ruled = require "ruled" -local awful = require "awful" - -local function setup_rules () - ruled.client.connect_signal("request::rules", function() - ruled.client.append_rule { - id = "global", - rule = { }, - properties = { - focus = awful.client.focus.filter, - raise = true, - screen = awful.screen.preferred, - placement = awful.placement.no_overlap+awful.placement.no_offscreen - } - } - ruled.client.append_rule { - id = "floating", - rule_any = { - instance = { "copyq", "pinentry" }, - class = { - "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv", - "Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer" - }, - name = { - "Event Tester", -- xev. - }, - role = { - "AlarmWindow", -- Thunderbird's calendar. - "ConfigManager", -- Thunderbird's about:config. - "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. - } - }, - properties = { floating = true } - } - ruled.client.append_rule { - id = "titlebars", - rule_any = { type = { "normal", "dialog" } }, - properties = { titlebars_enabled = true } - } - end) - - ruled.notification.connect_signal("request::rules", function () - ruled.notification.append_rule { - rule = { }, - properties = { - screen = awful.screen.preferred, - implicit_timeout = 5, - } - } - end) -end - -setup_rules() diff --git a/cfg/awesome/configuration/theme.lua b/cfg/awesome/configuration/theme.lua deleted file mode 100644 index 681b8f4..0000000 --- a/cfg/awesome/configuration/theme.lua +++ /dev/null @@ -1,8 +0,0 @@ -local beautiful = require "beautiful" -local gears = require "gears" - -local function load_theme () - beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua") -end - -load_theme() diff --git a/cfg/awesome/helpers.lua b/cfg/awesome/helpers.lua deleted file mode 100644 index 5042368..0000000 --- a/cfg/awesome/helpers.lua +++ /dev/null @@ -1,39 +0,0 @@ -local awful = require 'awful' - -local helpers = {} - --- function that adds feedback to a `wibox.container.background` changing its --- background color to the supplied ones -function helpers.add_feedback(w, bg, hbg) - w:connect_signal("mouse::enter", function (self) - self.bg = hbg - end) - w:connect_signal("mouse::leave", function (self) - self.bg = bg - end) -end - - --- Given a `match` condition, returns an array with clients that match it, or --- just the first found client if `first_only` is true. --- @credits: elenapan -function helpers.find_clients(match, first_only) - local matcher = function (c) - return awful.rules.match(c, match) - end - - if first_only then - for c in awful.client.iterate(matcher) do - return c - end - else - local clients = {} - for c in awful.client.iterate(matcher) do - table.insert(clients, c) - end - return clients - end - return nil -end - -return helpers diff --git a/cfg/awesome/rc.lua b/cfg/awesome/rc.lua deleted file mode 100644 index ae79ff1..0000000 --- a/cfg/awesome/rc.lua +++ /dev/null @@ -1,8 +0,0 @@ -pcall(require, "luarocks.loader") - -require "awful.autofocus" - -require "user_likes" -require "autostart" -require "configuration" -require "ui" diff --git a/cfg/awesome/scripts/set-volume.sh b/cfg/awesome/scripts/set-volume.sh deleted file mode 100755 index f801937..0000000 --- a/cfg/awesome/scripts/set-volume.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash -SINK=$(pactl list short sinks | sed -e 's,^\([0-9][0-9]*\)[^0-9].*,\1,' | head -n 1) -pactl set-sink-volume $SINK $1% diff --git a/cfg/awesome/signal/brightness.lua b/cfg/awesome/signal/brightness.lua deleted file mode 100644 index 83e4586..0000000 --- a/cfg/awesome/signal/brightness.lua +++ /dev/null @@ -1,21 +0,0 @@ -local gears = require 'gears' -local awful = require 'awful' - -local script = 'light -G | sed -s "s/\\./ /g" | awk "{print \\$1}"' - -gears.timer { - timeout = 5, - call_now = true, - autostart = true, - callback = function () - awful.spawn.easy_async_with_shell(script, function (out) - awesome.emit_signal('brightness::value', tonumber(out)) - end) - end -} - -local function set(val) - awful.spawn('light -S ' .. tonumber(val)) -end - -return { set = set } diff --git a/cfg/awesome/signal/playerctl.lua b/cfg/awesome/signal/playerctl.lua deleted file mode 100644 index b7bdc28..0000000 --- a/cfg/awesome/signal/playerctl.lua +++ /dev/null @@ -1,17 +0,0 @@ -local bling = require 'bling' - -local instance = nil - -local function new () - return bling.signal.playerctl.lib { - update_on_activity = true, - player = { "spotify", "mpd", "%any" }, - debounce_delay = 1, - } -end - -if not instance then - instance = new() -end - -return instance diff --git a/cfg/awesome/signal/volume.lua b/cfg/awesome/signal/volume.lua deleted file mode 100644 index ffa1316..0000000 --- a/cfg/awesome/signal/volume.lua +++ /dev/null @@ -1,24 +0,0 @@ -local gears = require 'gears' -local awful = require 'awful' -local gfs = require 'gears.filesystem' - -local script = "SINK=$(pactl list short sinks | sed -e 's,^\\([0-9][0-9]*\\)[^0-9].*,\\1,' | head -n 1); pactl list sinks | grep '^[[:space:]]Volume:' | head -n $(( $SINK + 1 )) | tail -n 1 | sed -e 's,.* \\([0-9][0-9]*\\)%.*,\\1,'" - -gears.timer { - timeout = 5, - call_now = true, - autostart = true, - callback = function () - awful.spawn.easy_async_with_shell(script, function(out) - awesome.emit_signal('volume::value', tonumber(out)) - end) - end -} - -local function set(vol) - awful.spawn(gfs.get_configuration_dir () .. 'scripts/set-volume.sh ' .. tonumber(vol)) -end - -return { - set = set, -} diff --git a/cfg/awesome/theme.lua b/cfg/awesome/theme.lua deleted file mode 100644 index 295aa49..0000000 --- a/cfg/awesome/theme.lua +++ /dev/null @@ -1,178 +0,0 @@ -local xresources = require("beautiful.xresources") -local gears = require "gears" -local gfs = require("gears.filesystem") - -local dpi = xresources.apply_dpi - --- paths -local themes_path = gfs.get_themes_dir() -local assets_path = gfs.get_configuration_dir() .. "assets/" - --- assets -local icons_path = assets_path .. "icons/" -local shapes_path = assets_path .. "shapes/" -local titlebar_assets_path = assets_path .. "titlebar/" -local actions_assets_path = assets_path .. "actions/" -local dock_assets = assets_path .. "dock-pinned/" - -local theme = {} - --- fonts -theme.font_name = 'Product Sans' -theme.nerd_font = 'Iosevka Nerd Font' -theme.font_size = '10' -theme.font = theme.font_name .. ' ' .. theme.font_size - --- base colors -theme.black = '#1c1e27' -theme.light_black = '#262831' -theme.red = '#dd6777' -theme.yellow = '#ecd3a0' -theme.magenta = '#c296eb' -theme.green = '#90ceaa' -theme.blue = '#86aaec' -theme.cyan = '#93cee9' - --- backgrounds -theme.bg_normal = "#0d0f18" -theme.bg_contrast = "#0f111a" -theme.bg_lighter = "#11131c" - --- elements bg -theme.bg_focus = theme.bg_normal -theme.bg_urgent = theme.red -theme.bg_minimize = theme.bg_normal -theme.bg_systray = theme.bg_lighter - --- foregrounds -theme.fg_normal = "#a5b6cf" -theme.fg_focus = theme.fg_nromal -theme.fg_urgent = theme.fg_normal -theme.fg_minimize = theme.fg_normal - --- some actions bg colors -theme.actions = { - bg = theme.bg_normal, - contrast = theme.bg_contrast, - lighter = theme.bg_lighter, - fg = theme.fg_normal, -} - --- bar -theme.bar_width = dpi(45) -theme.bar_height = dpi(40) - --- gaps and borders -theme.useless_gap = dpi(6) -theme.border_width = dpi(0) -theme.border_color_normal = theme.bg_normal -theme.border_color_active = theme.bg_normal -theme.border_color_marked = theme.bg_normal -theme.border_radius = dpi(10) - --- tasklist -theme.tasklist_plain_task_name = true -theme.tasklist_bg = theme.black -theme.tasklist_bg_focus = theme.blue - --- taglist -theme.taglist_bg = theme.bg_lighter -theme.taglist_bg_focus = theme.blue -theme.taglist_bg_occupied = theme.cyan -theme.taglist_bg_empty = theme.black - --- systray -theme.systray_icon_spacing = dpi(3) - --- menu -theme.menu_font = theme.font -theme.menu_submenu_icon = gears.color.recolor_image(shapes_path .. "triangle.png", theme.fg_normal) -theme.menu_height = dpi(35) -theme.menu_width = dpi(180) -theme.menu_bg_focus = theme.bg_lighter - --- titlebar -theme.titlebar_bg = theme.bg_contrast -theme.titlebar_bg_focus = theme.bg_normal -theme.titlebar_fg = theme.fg_normal - -theme.titlebar_close_button_normal = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.red) -theme.titlebar_close_button_focus = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.red) - -theme.titlebar_maximized_button_normal_inactive = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.yellow) -theme.titlebar_maximized_button_focus_inactive = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.yellow) -theme.titlebar_maximized_button_normal_active = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.yellow) -theme.titlebar_maximized_button_focus_active = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.yellow) - -theme.titlebar_minimize_button_normal = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.green) -theme.titlebar_minimize_button_focus = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.green) - -theme.titlebar_floating_button_normal_inactive = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.cyan) -theme.titlebar_floating_button_focus_inactive = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.cyan) -theme.titlebar_floating_button_normal_active = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.cyan) -theme.titlebar_floating_button_focus_active = gears.color.recolor_image(titlebar_assets_path .. "circle.png", theme.cyan) - --- wallpaper -theme.wallpaper = assets_path .. "wallpaper.png" - --- layouts -theme.layout_fairh = gears.color.recolor_image(themes_path.."default/layouts/fairhw.png", theme.fg_normal) -theme.layout_fairv = gears.color.recolor_image(themes_path.."default/layouts/fairvw.png", theme.fg_normal) -theme.layout_floating = gears.color.recolor_image(themes_path.."default/layouts/floatingw.png", theme.fg_normal) -theme.layout_magnifier = gears.color.recolor_image(themes_path.."default/layouts/magnifierw.png", theme.fg_normal) -theme.layout_max = gears.color.recolor_image(themes_path.."default/layouts/maxw.png", theme.fg_normal) -theme.layout_fullscreen = gears.color.recolor_image(themes_path.."default/layouts/fullscreenw.png", theme.fg_normal) -theme.layout_tilebottom = gears.color.recolor_image(themes_path.."default/layouts/tilebottomw.png", theme.fg_normal) -theme.layout_tileleft = gears.color.recolor_image(themes_path.."default/layouts/tileleftw.png", theme.fg_normal) -theme.layout_tile = gears.color.recolor_image(themes_path.."default/layouts/tilew.png", theme.fg_normal) -theme.layout_tiletop = gears.color.recolor_image(themes_path.."default/layouts/tiletopw.png", theme.fg_normal) -theme.layout_spiral = gears.color.recolor_image(themes_path.."default/layouts/spiralw.png", theme.fg_normal) -theme.layout_dwindle = gears.color.recolor_image(themes_path.."default/layouts/dwindlew.png", theme.fg_normal) -theme.layout_cornernw = gears.color.recolor_image(themes_path.."default/layouts/cornernww.png", theme.fg_normal) -theme.layout_cornerne = gears.color.recolor_image(themes_path.."default/layouts/cornernew.png", theme.fg_normal) -theme.layout_cornersw = gears.color.recolor_image(themes_path.."default/layouts/cornersww.png", theme.fg_normal) -theme.layout_cornerse = gears.color.recolor_image(themes_path.."default/layouts/cornersew.png", theme.fg_normal) - --- icons -theme.rofi_spawner_icon = gears.color.recolor_image(icons_path .. "rocket.svg", theme.fg_normal) -theme.settings_icon = gears.color.recolor_image(icons_path .. "gear-solid.svg", theme.fg_normal) - --- actions icons -theme.fallback_music_image = actions_assets_path .. "music/fallback.png" -theme.previous_music = gears.color.recolor_image(actions_assets_path .. "music/previous.svg", theme.fg_normal) -theme.pause_music = gears.color.recolor_image(actions_assets_path .. "music/pause.svg", theme.fg_normal) -theme.play_music = gears.color.recolor_image(actions_assets_path .. "music/play.svg", theme.fg_normal) -theme.next_music = gears.color.recolor_image(actions_assets_path .. "music/next.svg", theme.fg_normal) -theme.shutdown = gears.color.recolor_image(actions_assets_path .. "powerbuttons/shutdown.svg", theme.red) -theme.reboot = gears.color.recolor_image(actions_assets_path .. "powerbuttons/reboot.svg", theme.yellow) -theme.pfp = actions_assets_path .. "user/pfp.png" - --- disable icon theme -theme.icon_theme = nil - --- task preview -theme.task_preview_widget_border_radius = dpi(7) -theme.task_preview_widget_bg = theme.bg_normal -theme.task_preview_widget_border_color = theme.bg_normal -theme.task_preview_widget_border_width = 0 -theme.task_preview_widget_margin = dpi(10) - --- tag preview -theme.tag_preview_widget_border_radius = dpi(7) -theme.tag_preview_client_border_radius = dpi(7) -theme.tag_preview_client_opacity = 0.5 -theme.tag_preview_client_bg = theme.bg_lighter -theme.tag_preview_client_border_color = theme.blue -theme.tag_preview_client_border_width = 1 -theme.tag_preview_widget_bg = theme.bg_normal -theme.tag_preview_widget_border_color = theme.bg_normal -theme.tag_preview_widget_border_width = 0 -theme.tag_preview_widget_margin = dpi(7) - --- taskbar pinneds -theme.thunar = dock_assets .. "thunar.svg" -theme.firefox = dock_assets .. "firefox.svg" -theme.kitty = dock_assets .. 'kitty.svg' -theme.vscode = dock_assets .. 'code.svg' - -return theme diff --git a/cfg/awesome/ui/actions/blocks/controls.lua b/cfg/awesome/ui/actions/blocks/controls.lua deleted file mode 100644 index 88341e4..0000000 --- a/cfg/awesome/ui/actions/blocks/controls.lua +++ /dev/null @@ -1,86 +0,0 @@ -local wibox = require 'wibox' -local gears = require 'gears' -local beautiful = require 'beautiful' -local xresources = require 'beautiful.xresources' - -local volume_signal = require 'signal.volume' -local br_signal = require 'signal.brightness' - -local dpi = xresources.apply_dpi - -local height = 90 - -local volume = wibox.widget { - forced_width = dpi(160), - forced_height = dpi(16), - bar_shape = gears.shape.rounded_bar, - bar_height = dpi(6), - bar_color = beautiful.bg_lighter, - bar_active_color = beautiful.green, - handle_shape = gears.shape.circle, - handle_color = beautiful.green, - handle_width = dpi(16), - value = 0, - widget = wibox.widget.slider, -} - --- update volume widget value -awesome.connect_signal('volume::value', function (vol) - volume:set_value(vol) -end) - --- update volume on change slider -volume:connect_signal('property::value', function (_, value) - volume_signal.set(value) -end) - -local brightness = wibox.widget { - forced_width = dpi(160), - forced_height = dpi(16), - bar_shape = gears.shape.rounded_bar, - bar_height = dpi(6), - bar_color = beautiful.bg_lighter, - bar_active_color = beautiful.yellow, - handle_shape = gears.shape.circle, - handle_color = beautiful.yellow, - handle_width = dpi(16), - value = 0, - widget = wibox.widget.slider, -} - --- update brightness value -awesome.connect_signal('brightness::value', function (br) - brightness:set_value(br) -end) - --- update brightness on slider change -brightness:connect_signal('property::value', function (_, value) - br_signal.set(value) -end) - -local controls_widget = wibox.widget { - { - nil, - nil, - nil, - layout = wibox.layout.align.horizontal, - }, - { - { - volume, - brightness, - spacing = dpi(15), - layout = wibox.layout.fixed.vertical, - }, - align = 'center', - valign = 'center', - widget = wibox.container.margin, - layout = wibox.container.place, - }, - layout = wibox.layout.stack, -} - -return { - height = height, - widget = controls_widget, -} diff --git a/cfg/awesome/ui/actions/blocks/date.lua b/cfg/awesome/ui/actions/blocks/date.lua deleted file mode 100644 index f827288..0000000 --- a/cfg/awesome/ui/actions/blocks/date.lua +++ /dev/null @@ -1,121 +0,0 @@ -local wibox = require 'wibox' -local beautiful = require 'beautiful' -local gears = require 'gears' -local awful = require 'awful' -local helpers = require 'ui.actions.helpers' -local xresources = require 'beautiful.xresources' - -local dpi = xresources.apply_dpi - -local height = 200 - -local hour = wibox.widget { - markup = '', - align = 'center', - valign = 'center', - font = beautiful.font_name .. ' 40', - widget = wibox.widget.textbox, -} - -local minutes = wibox.widget { - markup = '', - align = 'center', - valign = 'center', - font = beautiful.font_name .. ' 40', - widget = wibox.widget.textbox, -} - -local date = wibox.widget { - markup = '', - align = 'center', - valign = 'center', - widget = wibox.widget.textbox, -} - -local function trim(s) - local result = s:gsub("%s+", "") - - return string.gsub(result, "%s+", "") -end - -gears.timer { - timeout = 1, - call_now = true, - autostart = true, - callback = function () - awful.spawn.easy_async_with_shell('date +%H', function (h) - hour:set_markup_silently(trim(h)) - end) - awful.spawn.easy_async_with_shell('date +%M', function (m) - minutes:set_markup_silently(trim(m)) - end) - awful.spawn.easy_async_with_shell('date "+%A, %B %d"', function (d) - date:set_markup_silently(d) - end) - end -} - -local gen_block = function (background) - if not background then - background = beautiful.blue - end - - return wibox.widget { - bg = background, - shape = gears.shape.rectangle, - forced_width = dpi(1), - forced_height = dpi(16), - valign = 'center', - halign = 'center', - align = 'center', - widget = wibox.container.background, - } -end - -local divider = wibox.widget { - gen_block(beautiful.magenta), - gen_block(beautiful.blue), - gen_block(beautiful.red), - layout = wibox.layout.align.vertical, -} - -local date_widget = wibox.widget { - { - { - { - { - hour, - left = dpi(28), - widget = wibox.container.margin, - }, - nil, - { - minutes, - right = dpi(35), - widget = wibox.container.margin, - }, - layout = wibox.layout.align.horizontal, - }, - { - divider, - halign = 'center', - valign = 'center', - widget = wibox.container.margin, - layout = wibox.container.place, - }, - layout = wibox.layout.stack, - }, - top = helpers.percent(height, 18), - bottom = dpi(12), - widget = wibox.container.margin, - }, - date, - layout = wibox.layout.fixed.vertical, -} - -return { - height = height, - contrast = true, - notop = true, - widget = date_widget, -} diff --git a/cfg/awesome/ui/actions/blocks/header.lua b/cfg/awesome/ui/actions/blocks/header.lua deleted file mode 100644 index aed9008..0000000 --- a/cfg/awesome/ui/actions/blocks/header.lua +++ /dev/null @@ -1,37 +0,0 @@ -local wibox = require 'wibox' -local beautiful = require 'beautiful' -local gears = require 'gears' -local awful = require 'awful' -local dpi = beautiful.xresources.apply_dpi - -local gaps = dpi(20) - -local close_button = wibox.widget { - { - margins = 2, - widget = wibox.container.margin, - }, - bg = beautiful.red, - shape = gears.shape.circle, - forced_width = dpi(14), - forced_height = dpi(14), - widget = wibox.container.background, - buttons = awful.button({}, 1, function () - require 'ui.actions'.toggle_popup() - end) -} - -local header_widget = wibox.widget { - { - close_button, - top = gaps / 2, - bottom = gaps / 2, - right = gaps / 2, - widget = wibox.container.margin, - }, - valign = 'center', - halign = 'right', - layout = wibox.container.place, -} - -return header_widget diff --git a/cfg/awesome/ui/actions/blocks/music.lua b/cfg/awesome/ui/actions/blocks/music.lua deleted file mode 100644 index 46e7a1f..0000000 --- a/cfg/awesome/ui/actions/blocks/music.lua +++ /dev/null @@ -1,174 +0,0 @@ --- BRUH, idk what i'm doing in this widget, but it should works xd, so if it works it works lol - -local wibox = require 'wibox' -local beautiful = require 'beautiful' -local xresources = require 'beautiful.xresources' -local gears = require 'gears' -local playerctl = require 'signal.playerctl' -local awful = require 'awful' -local bling = require 'bling' - -local dpi = xresources.apply_dpi - -local height = 120 - --- base widgets -local image = wibox.widget { - image = beautiful.fallback_music_image, - align = 'center', - valign = 'center', - forced_width = dpi(64), - forced_height = dpi(64), - widget = wibox.widget.imagebox, - clip_shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, dpi(7)) - end -} - -local title = wibox.widget { - markup = 'Not Playing', - align = 'center', - valign = 'center', - widget = wibox.widget.textbox, -} - -local position = wibox.widget { - max_value = 100, - value = 0, - forced_height = dpi(1), - forced_width = dpi(3), - border_width = 0, - bar_border_width = 0, - color = beautiful.blue, - background_color = beautiful.bg_lighter, - widget = wibox.widget.progressbar, -} - --- buttons -local playerctl_cli = bling.signal.playerctl.cli() - -local previous_button = wibox.widget { - image = beautiful.previous_music, - forced_width = dpi(16), - forced_height = dpi(16), - widget = wibox.widget.imagebox, - buttons = { - awful.button({}, 1, function () - playerctl_cli:previous('spotify') - end) - } -} - -local pause_button = wibox.widget { - image = beautiful.play_music, - forced_width = dpi(16), - forced_height = dpi(16), - widget = wibox.widget.imagebox, - buttons = { - awful.button({}, 1, function () - playerctl_cli:play_pause('spotify') - end) - } -} - -local next_button = wibox.widget { - image = beautiful.next_music, - forced_width = dpi(16), - forced_height = dpi(16), - widget = wibox.widget.imagebox, - buttons = { - awful.button({}, 1, function () - playerctl_cli:next('spotify') - end) - } -} - --- connection to playerctl -local function limit_by(txt, len) - if #txt >= len then - txt = txt:sub(1, len - 3) .. "..." - end - - return txt -end - -playerctl:connect_signal('metadata', function (_, music_title, artist, album_path, album, new, player_name) - image:set_image(gears.surface.load_uncached(album_path)) - title:set_markup_silently(limit_by(music_title, 22)) -end) - -playerctl:connect_signal('no_players', function () - title:set_markup_silently('No playing') - image:set_image(gears.surface.load_uncached(beautiful.fallback_music_image)) - position:set_max_value(100) - position:set_value(0) - pause_button:set_image(gears.surface.load_uncached(beautiful.play_music)) -end) - -playerctl:connect_signal('position', function (_, interval_sec, length_sec) - position:set_max_value(length_sec) - position:set_value(interval_sec) -end) - -playerctl:connect_signal('playback_status', function (_, playing) - pause_button:set_image(gears.surface.load_uncached( - playing - and beautiful.pause_music - or beautiful.play_music - )) -end) - --- making the widget -local music_widget = wibox.widget { - { - image, - left = dpi(12), - widget = wibox.container.margin, - }, - { - { - title, - top = dpi(15), - widget = wibox.container.margin, - }, - { - position, - left = dpi(25), - right = dpi(25), - top = dpi(10), - widget = wibox.container.margin - }, - { - { - { - previous_button, - { - left = dpi(30), - widget = wibox.container.margin, - }, - next_button, - layout = wibox.layout.align.horizontal, - }, - { - pause_button, - valign = 'center', - align = 'center', - widget = wibox.container.margin, - layout = wibox.container.place, - }, - layout = wibox.layout.stack, - }, - top = dpi(12), - left = dpi(50), - right = dpi(50), - widget = wibox.container.margin, - }, - layout = wibox.layout.fixed.vertical, - }, - layout = wibox.layout.align.horizontal, -} - -return { - widget = music_widget, - height = height -} diff --git a/cfg/awesome/ui/actions/blocks/powerbuttons.lua b/cfg/awesome/ui/actions/blocks/powerbuttons.lua deleted file mode 100644 index cee5eca..0000000 --- a/cfg/awesome/ui/actions/blocks/powerbuttons.lua +++ /dev/null @@ -1,131 +0,0 @@ -local wibox = require 'wibox' -local gears = require 'gears' -local beautiful = require 'beautiful' -local xresources = require 'beautiful.xresources' -local props = require 'ui.actions.props' -local awful = require 'awful' - -local dpi = xresources.apply_dpi - -local shutdown_button = wibox.widget { - { - { - image = beautiful.shutdown, - forced_height = dpi(16), - forced_width = dpi(16), - halign = 'center', - valign = 'center', - widget = wibox.widget.imagebox, - }, - margins = dpi(6), - widget = wibox.container.margin, - }, - bg = beautiful.bg_contrast, - widget = wibox.container.background, - buttons = { - awful.button({}, 1, function () - awful.spawn('doas poweroff') - end) - }, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, dpi(7)) - end -} - --- hover -shutdown_button:connect_signal('mouse::enter', function (self) - self.bg = beautiful.bg_lighter -end) - -shutdown_button:connect_signal('mouse::leave', function (self) - self.bg = beautiful.bg_contrast -end) - --- tooltip -local shutdown_tooltip = awful.tooltip { - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, beautiful.border_radius) - end -} - -shutdown_tooltip:add_to_object(shutdown_button) - -shutdown_button:connect_signal('mouse::enter', function () - shutdown_tooltip:set_text("Press to shutdown") -end) - -local reboot_button = wibox.widget { - { - { - image = beautiful.reboot, - forced_height = dpi(13), - forced_width = dpi(13), - align = 'center', - valign = 'center', - widget = wibox.widget.imagebox, - }, - top = dpi(6), - left = dpi(6), - right = dpi(6), - bottom = dpi(4), - widget = wibox.container.margin, - }, - bg = beautiful.bg_contrast, - widget = wibox.container.background, - buttons = { - awful.button({}, 1, function () - awful.spawn('doas reboot') - end) - }, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, dpi(7)) - end -} - --- hover -reboot_button:connect_signal('mouse::enter', function (self) - self.bg = beautiful.bg_lighter -end) - -reboot_button:connect_signal('mouse::leave', function (self) - self.bg = beautiful.bg_contrast -end) - --- tooltip -local reboot_tooltip = awful.tooltip { - fg = beautiful.fg_normal, - bg = beautiful.bg_normal, -} - -reboot_tooltip:add_to_object(reboot_button) - -reboot_button:connect_signal('mouse::enter', function () - reboot_tooltip:set_text("Press to reboot") -end) - -local buttons = wibox.widget { - shutdown_button, - reboot_button, - spacing = dpi(20), - layout = wibox.layout.fixed.horizontal, -} - -local powerbuttons_widget = wibox.widget { - { - nil, - { - buttons, - halign = 'center', - valign = 'center', - widget = wibox.container.margin, - layout = wibox.container.place, - }, - layout = wibox.layout.stack, - }, - margins = props.gaps, - widget = wibox.container.margin, -} - -return powerbuttons_widget diff --git a/cfg/awesome/ui/actions/blocks/stats.lua b/cfg/awesome/ui/actions/blocks/stats.lua deleted file mode 100644 index 380d5d5..0000000 --- a/cfg/awesome/ui/actions/blocks/stats.lua +++ /dev/null @@ -1,94 +0,0 @@ -local wibox = require 'wibox' -local xresources = require 'beautiful.xresources' -local beautiful = require 'beautiful' -local gears = require 'gears' -local awful = require 'awful' - -local dpi = xresources.apply_dpi -local height = 105 - -local stats_widget = wibox.widget { - { - { - { - markup = 'īĄš', - font = beautiful.nerd_font .. ' 15', - valign = 'center', - align = 'center', - widget = wibox.widget.textbox, - }, - paddings = { - right = dpi(6), - }, - id = 'ram', - forced_width = dpi(65), - value = 0, - color = beautiful.red, - border_color = beautiful.actions.lighter, - border_width = dpi(5), - max_value = 1, - min_value = 0, - widget = wibox.container.radialprogressbar, - }, - left = dpi(35), - top = dpi(5), - bottom = dpi(5), - widget = wibox.container.margin, - }, - nil, - { - { - { - markup = 'î‰Ļ', - font = beautiful.nerd_font .. ' 11', - valign = 'center', - align = 'center', - widget = wibox.widget.textbox, - }, - paddings = { - right = dpi(7), - }, - id = 'cpu', - forced_width = dpi(65), - color = beautiful.yellow, - border_color = beautiful.actions.lighter, - border_width = dpi(5), - value = 0, - max_value = 1, - min_value = 0, - widget = wibox.container.radialprogressbar, - }, - right = dpi(45), - top = dpi(5), - bottom = dpi(5), - widget = wibox.container.margin, - }, - layout = wibox.layout.align.horizontal, - - -- val is the free ram, inverting, i want the used ram - set_ram = function (self, val) - self:get_children_by_id('ram')[1].value = 1 - (val / 100) - end, - set_cpu = function (self, val) - self:get_children_by_id('cpu')[1].value = val / 100 - end -} - -gears.timer { - timeout = 10, - call_now = true, - autostart = true, - callback = function () - awful.spawn.easy_async_with_shell("free | grep Mem | awk '{print $4/$2 * 100.0}' | sed 's/\\./ /g' | awk '{print $1}'", function (out) - stats_widget.ram = out - end) - awful.spawn.easy_async_with_shell("grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage}' | sed 's/\\./ /g' | awk '{print $1}'", function (out) - stats_widget.cpu = out - end) - end -} - -return { - height = height, - widget = stats_widget, -} diff --git a/cfg/awesome/ui/actions/blocks/user.lua b/cfg/awesome/ui/actions/blocks/user.lua deleted file mode 100644 index 170a94f..0000000 --- a/cfg/awesome/ui/actions/blocks/user.lua +++ /dev/null @@ -1,52 +0,0 @@ -local wibox = require 'wibox' -local gears = require 'gears' -local beautiful = require 'beautiful' -local xresources = require 'beautiful.xresources' -local awful = require 'awful' - -local dpi = xresources.apply_dpi -local height = 75 - -local pfp = wibox.widget { - image = beautiful.pfp, - forced_width = dpi(64), - forced_height = dpi(64), - clip_shape = gears.shape.circle, - widget = wibox.widget.imagebox, -} - -local username = wibox.widget { - markup = '', - align = 'center', - valign = 'center', - font = beautiful.font_name .. ' 12', - widget = wibox.widget.textbox, -} - -awful.spawn.easy_async_with_shell('whoami', function (user) - username:set_markup_silently('Welcome ' .. user .. '') -end) - -local user_widget = wibox.widget { - { - pfp, - left = dpi(12), - widget = wibox.container.margin, - }, - { - nil, - { - username, - top = dpi(2), - widget = wibox.container.margin, - }, - layout = wibox.layout.align.vertical, - }, - layout = wibox.layout.align.horizontal, -} - -return { - height = height, - contrast = true, - widget = user_widget, -} diff --git a/cfg/awesome/ui/actions/helpers.lua b/cfg/awesome/ui/actions/helpers.lua deleted file mode 100644 index 957e5c4..0000000 --- a/cfg/awesome/ui/actions/helpers.lua +++ /dev/null @@ -1,42 +0,0 @@ -local xresources = require 'beautiful.xresources' -local beautiful = require 'beautiful' -local wibox = require 'wibox' -local gears = require 'gears' -local props = require 'ui.actions.props' - -local dpi = xresources.apply_dpi - -local helpers = {} - -function helpers.percent(n, p) - return p * n / 100 -end - -function helpers.mkblock(opts) - local height = opts.height or helpers.percent(props.height, 15) - local widget = opts.widget or {} - local notop = opts.notop or false - local contrast = opts.contrast or false - - return { - { - { - widget, - margins = props.gaps, - widget = wibox.container.margin, - }, - bg = contrast and beautiful.actions.contrast or beautiful.actions.bg, - forced_height = dpi(height), - widget = wibox.container.background, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, props.radius) - end - }, - top = notop and 0 or props.gaps, - left = props.gaps, - right = props.gaps, - widget = wibox.container.margin, - } -end - -return helpers diff --git a/cfg/awesome/ui/actions/init.lua b/cfg/awesome/ui/actions/init.lua deleted file mode 100644 index 8cc3e9b..0000000 --- a/cfg/awesome/ui/actions/init.lua +++ /dev/null @@ -1,50 +0,0 @@ -local awful = require 'awful' -local gears = require 'gears' -local xresources = require 'beautiful.xresources' -local beautiful = require 'beautiful' -local wibox = require 'wibox' -local helpers = require 'ui.actions.helpers' -local props = require 'ui.actions.props' - -local dpi = xresources.apply_dpi - -local actions = {} - -actions.popup = awful.popup { - widget = {}, - screen = awful.screen.focused(), - minimum_width = dpi(10), - minimum_height = props.height, - type = 'dock', - placement = awful.placement.bottom_left, - ontop = true, - visible = false, - bg = beautiful.actions.bg, - fg = beautiful.actions.fg, - shape = function (cr, w, h) - return gears.shape.partially_rounded_rect(cr, w, h, false, true, false, false, beautiful.border_radius) - end -} - -function actions.toggle_popup() - if not actions.popup.visible then - actions.popup.widget = wibox.widget{ - require 'ui.actions.blocks.header', - helpers.mkblock(require 'ui.actions.blocks.date'), - helpers.mkblock(require 'ui.actions.blocks.music'), - helpers.mkblock(require 'ui.actions.blocks.user'), - helpers.mkblock(require 'ui.actions.blocks.stats'), - helpers.mkblock(require 'ui.actions.blocks.controls'), - require 'ui.actions.blocks.powerbuttons', - layout = wibox.layout.fixed.vertical, - } - actions.popup.screen = awful.screen.focused() - actions.popup.visible = true - else - actions.popup.widget = nil - actions.popup.visible = false - collectgarbage('collect') - end -end - -return actions diff --git a/cfg/awesome/ui/actions/props.lua b/cfg/awesome/ui/actions/props.lua deleted file mode 100644 index 19f1354..0000000 --- a/cfg/awesome/ui/actions/props.lua +++ /dev/null @@ -1,11 +0,0 @@ -local beautiful = require 'beautiful' -local awful = require 'awful' - -local dpi = beautiful.xresources.apply_dpi -local screen = awful.screen.focused() - -return { - height = screen.geometry.height - beautiful.useless_gap * 1.5, - gaps = dpi(16), - radius = dpi(12), -} diff --git a/cfg/awesome/ui/bar.lua b/cfg/awesome/ui/bar.lua deleted file mode 100644 index f883216..0000000 --- a/cfg/awesome/ui/bar.lua +++ /dev/null @@ -1,347 +0,0 @@ ----@diagnostic disable:undefined-global - -local awful = require 'awful' -local beautiful = require 'beautiful' -local gears = require 'gears' -local wibox = require 'wibox' -local xresources = require 'beautiful.xresources' - -local dpi = xresources.apply_dpi - -screen.connect_signal('request::desktop_decoration', function (s) - awful.tag( - { '1', '2', '3', '4', '5', '6' }, - s, awful.layout.layouts[1] - ) - - s.mylauncher = wibox.widget { - { - { - widget = wibox.widget.imagebox, - image = beautiful.rofi_spawner_icon, - forced_height = dpi(16), - forced_width = dpi(16), - halign = 'center', - valign = 'center', - }, - left = dpi(7), - right = dpi(7), - top = dpi(5), - bottom = dpi(5), - widget = wibox.container.margin, - }, - bg = beautiful.bg_lighter, - widget = wibox.container.background, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, dpi(5)) - end, - buttons = { - awful.button({}, 1, function () - awful.spawn('rofi -show drun') - end) - } - } - - s.mylauncher:connect_signal('mouse::enter', function () - s.mylauncher.bg = beautiful.black - end) - - s.mylauncher:connect_signal('mouse::leave', function () - s.mylauncher.bg = beautiful.bg_lighter - end) - - s.mydateraw = wibox.widget { - format = '%I:%M %p', - widget = wibox.widget.textclock, - } - - local calendar = require 'ui.calendar' - - s.mydate = wibox.widget { - s.mydateraw, - layout = wibox.layout.fixed.horizontal, - buttons = awful.button({}, 1, function () - s.mydateraw.toggled = s.mydateraw.toggled and s.mydateraw.toggled or false - s.mydateraw.format = s.mydateraw.toggled and '%I:%M %p' or '%A %B %d' - s.mydateraw.toggled = not s.mydateraw.toggled - end) - } - - -- WIP limitations - - --[[ - s.mydate:connect_signal('mouse::enter', function () - calendar.toggle() - end) - - s.mydate:connect_signal('mouse::leave', function () - calendar.toggle() - end)]]-- - - s.mytaglist = awful.widget.taglist { - screen = s, - filter = awful.widget.taglist.filter.all, - style = { - shape = gears.shape.circle, - }, - layout = { - layout = wibox.layout.fixed.horizontal, - }, - buttons = { - -- clicks - awful.button({}, 1, function (t) - t:view_only() - end), - - -- scroll - awful.button({}, 4, function (t) - awful.tag.viewprev(t.screen) - end), - awful.button({}, 5, function (t) - awful.tag.viewnext(t.screen) - end) - }, - widget_template = { - { - { - id = 'background_role', - forced_height = dpi(12), - forced_width = dpi(12), - widget = wibox.container.background, - }, - id = 'tag_margin', - left = dpi(6), - right = dpi(6), - top = dpi(6), - bottom = dpi(6), - widget = wibox.container.margin, - }, - bg = beautiful.taglist_bg, - widget = wibox.container.background, - create_callback = function (self, c3, index, tagsList) - -- bling taglist preview - self:connect_signal('mouse::enter', function () - if #c3:clients() > 0 then - awesome.emit_signal('bling::tag_preview::update', c3) - awesome.emit_signal('bling::tag_preview::visibility', s, true) - end - end) - - self:connect_signal('mouse::leave', function () - awesome.emit_signal('bling::tag_preview::visibility', s, false) - end) - - if index == 1 then - self.shape = function (cr, w, h) - return gears.shape.partially_rounded_rect(cr, w, h, true, false, false, true, dpi(20)) - end - - self:get_children_by_id('tag_margin')[1].left = dpi(10) - end - - if index == #tagsList then - self.shape = function (cr, w, h) - return gears.shape.partially_rounded_rect(cr, w, h, false, true, true, false, dpi(20)) - end - - self:get_children_by_id('tag_margin')[1].right = dpi(10) - end - end - } - } - - s.mytasklist = awful.widget.tasklist { - screen = s, - filter = awful.widget.tasklist.filter.allscreen, - widget_template = { - { - { - forced_width = dpi(26), - forced_height = dpi(26), - widget = awful.widget.clienticon, - }, - top = dpi(3), - bottom = dpi(3), - left = dpi(7), - right = dpi(7), - widget = wibox.container.margin, - }, - nil, - { - wibox.widget.base.make_widget(), - id = 'background_role', - forced_height = dpi(2), - widget = wibox.container.background, - }, - layout = wibox.layout.align.vertical, - create_callback = function (self, c, index, objects) - self:connect_signal('mouse::enter', function () - awesome.emit_signal('bling::task_preview::visibility', s, true, c) - end) - self:connect_signal('mouse::leave', function () - awesome.emit_signal('bling::task_preview::visibility', s, false, c) - end) - - -- handle click - self:add_button(awful.button({ - modifiers = {}, - button = 1, - on_press = function () - if not c.active then - c:activate { - context = 'through_dock', - switch_to_tag = true, - } - else - c.minimized = true - end - end - })) - end - } - } - - s.mysystray = wibox.widget { - horizontal = true, - widget = wibox.widget.systray, - } - - s.myverticalsep = wibox.widget { - { - widget = wibox.container.background, - forced_width = dpi(1), - bg = beautiful.black, - }, - top = dpi(5), - bottom = dpi(5), - left = dpi(5), - widget = wibox.container.margin, - } - - s.myactiontoggler = wibox.widget { - { - { - widget = wibox.widget.imagebox, - image = beautiful.settings_icon, - forced_height = dpi(16), - forced_width = dpi(16), - halign = 'center', - valign = 'center', - }, - left = dpi(7), - right = dpi(7), - top = dpi(5), - bottom = dpi(5), - widget = wibox.container.margin, - }, - bg = beautiful.bg_lighter, - widget = wibox.container.background, - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, dpi(5)) - end, - buttons = { - awful.button({}, 1, function () - require 'ui.actions'.toggle_popup() - end) - } - } - - s.myactiontoggler:connect_signal('mouse::enter', function () - s.myactiontoggler.bg = beautiful.black - end) - - s.myactiontoggler:connect_signal('mouse::leave', function () - s.myactiontoggler.bg = beautiful.bg_lighter - end) - - s.mylayoutbox = awful.widget.layoutbox { - screen = s, - buttons = { - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc(-1) end), - awful.button({ }, 5, function () awful.layout.inc( 1) end), - } - } - - s.mywibox = awful.wibar { - position = 'bottom', - screen = s, - height = beautiful.bar_height, - width = s.geometry.width - beautiful.useless_gap * 4, - shape = function (cr, w, h) - return gears.shape.partially_rounded_rect(cr, w, h, true, true, false, false, beautiful.border_radius) - end - } - - s.mywibox:setup { - { - layout = wibox.layout.align.horizontal, - { - { - { - s.mylauncher, - s.mytaglist, - s.myactiontoggler, - layout = wibox.layout.fixed.horizontal, - spacing = dpi(10), - }, - top = dpi(7), - bottom = dpi(7), - widget = wibox.container.margin, - }, - left = dpi(12), - widget = wibox.container.margin, - }, - nil, - { - { - { - { - { - { - s.mysystray, - s.myverticalsep, - { - s.mydate, - left = dpi(5), - right = dpi(5), - widget = wibox.container.margin, - }, - layout = wibox.layout.fixed.horizontal, - spacing = dpi(5), - }, - widget = wibox.container.margin, - left = dpi(10), - right = dpi(10), - }, - bg = beautiful.bg_lighter, - widget = wibox.container.background, - shape = gears.shape.rounded_bar, - }, - top = dpi(7), - bottom = dpi(7), - widget = wibox.container.margin, - }, - { - s.mylayoutbox, - top = dpi(10), - bottom = dpi(10), - widget = wibox.container.margin, - }, - spacing = dpi(10), - layout = wibox.layout.fixed.horizontal, - }, - right = dpi(12), - widget = wibox.container.margin, - } - }, - { - s.mytasklist, - halign = 'center', - widget = wibox.widget.margin, - layout = wibox.container.place, - }, - layout = wibox.layout.stack, - } -end) diff --git a/cfg/awesome/ui/calendar/init.lua b/cfg/awesome/ui/calendar/init.lua deleted file mode 100644 index 23a1cb2..0000000 --- a/cfg/awesome/ui/calendar/init.lua +++ /dev/null @@ -1,46 +0,0 @@ -local awful = require 'awful' -local beautiful = require 'beautiful' -local dpi = beautiful.xresources.apply_dpi -local gears = require 'gears' -local wibox = require 'wibox' - -local calendar = {} - -calendar.popup = awful.popup { - widget = wibox.widget { - widget = wibox.widget.textbox, - text = 'hello', - halign = 'center', - valign = 'center', - layout = wibox.container.place, - }, - type = 'dock', - ontop = true, - visible = false, - minimum_width = dpi(200), - minimum_height = dpi(150), - shape = function (cr, w, h) - return gears.shape.rounded_rect(cr, w, h, beautiful.border_radius) - end, - placement = function (d) - return awful.placement.bottom_right(d, { - margins = { - right = beautiful.useless_gap * 2, - bottom = beautiful.bar_height + beautiful.useless_gap * 2, - } - }) - end, - screen = awful.screen.focused(), - bg = beautiful.bg_normal, - fg = beautiful.fg_normal, -} - -calendar.toggle = function () - if not calendar.popup.visible then - calendar.popup.screen = awful.screen.focused() - end - - calendar.popup.visible = not calendar.popup.visible -end - -return calendar diff --git a/cfg/awesome/ui/init.lua b/cfg/awesome/ui/init.lua deleted file mode 100644 index b08ee75..0000000 --- a/cfg/awesome/ui/init.lua +++ /dev/null @@ -1,5 +0,0 @@ -require "ui.wallpaper" -require "ui.bar" -require "ui.titlebar" -require 'ui.tag_preview' -require 'ui.task_preview' \ No newline at end of file diff --git a/cfg/awesome/ui/menu.lua b/cfg/awesome/ui/menu.lua deleted file mode 100644 index 5ec267d..0000000 --- a/cfg/awesome/ui/menu.lua +++ /dev/null @@ -1,41 +0,0 @@ -local awful = require 'awful' -local beautiful = require 'beautiful' -local gears = require 'gears' - -local menu = {} - -menu.awesome = { - { "Edit Config", editor_cmd .. " " .. awesome.conffile }, - { "Edit Config (GUI)", visual_editor .. " " .. awesome.conffile }, - { "Restart", awesome.restart }, - { "Close Session", function () awesome.quit() end } -} - -menu.mainmenu = awful.menu { - items = { - { "Terminal", terminal }, - { "Browser", browser }, - { "Editor", editor_cmd }, - { "GUI Editor", visual_editor }, - { "AwesomeWM", menu.awesome }, - } -} - --- apply rounded corners to menus, thanks to u/signalsourcesexy -local rounded_borders = function (cr, width, height) - return gears.shape.rounded_rect(cr, width, height, beautiful.border_radius) -end - -menu.mainmenu.wibox.shape = rounded_borders - --- apply rounded corners to submenus, thanks to u/signalsourcesexy -awful.menu.original_new = awful.menu.new - -function awful.menu.new(...) - local ret = awful.menu.original_new(...) - ret.wibox.shape = rounded_borders - - return ret -end - -return menu diff --git a/cfg/awesome/ui/tag_preview.lua b/cfg/awesome/ui/tag_preview.lua deleted file mode 100644 index 1feb204..0000000 --- a/cfg/awesome/ui/tag_preview.lua +++ /dev/null @@ -1,25 +0,0 @@ -local bling = require 'bling' -local awful = require 'awful' -local wibox = require 'wibox' -local beautiful = require 'beautiful' - -bling.widget.tag_preview.enable { - show_client_content = false, - scale = 0.25, - honor_padding = false, - honor_workarea = false, - placement_fn = function (c) - awful.placement.bottom_left(c, { - margins = { - bottom = beautiful.bar_height + beautiful.useless_gap * 2, - left = beautiful.useless_gap * 2, - }, - }) - end, - background_widget = wibox.widget { - image = beautiful.wallpaper, - horizontal_fit_policy = 'fit', - vertical_fit_policy = 'fit', - widget = wibox.widget.imagebox, - } -} diff --git a/cfg/awesome/ui/task_preview.lua b/cfg/awesome/ui/task_preview.lua deleted file mode 100644 index fb4bd53..0000000 --- a/cfg/awesome/ui/task_preview.lua +++ /dev/null @@ -1,43 +0,0 @@ -local bling = require 'bling' -local awful = require 'awful' -local beautiful = require 'beautiful' -local xresources = require 'beautiful.xresources' -local wibox = require 'wibox' -local dpi = xresources.apply_dpi - -bling.widget.task_preview.enable { - height = dpi(300), - width = dpi(300), - placement_fn = function (c) - awful.placement.bottom(c, { - margins = { - bottom = beautiful.bar_height + beautiful.useless_gap * 2, - } - }) - end, - widget_structure = { - { - { - { - id = 'icon_role', - widget = awful.widget.clienticon, -- The client icon - }, - { - id = 'name_role', -- The client name / title - widget = wibox.widget.textbox, - }, - layout = wibox.layout.flex.horizontal - }, - widget = wibox.container.margin, - margins = 5 - }, - { - id = 'image_role', -- The client preview - resize = true, - valign = 'center', - halign = 'center', - widget = wibox.widget.imagebox, - }, - layout = wibox.layout.fixed.vertical - } -} diff --git a/cfg/awesome/ui/titlebar.lua b/cfg/awesome/ui/titlebar.lua deleted file mode 100644 index f77bf49..0000000 --- a/cfg/awesome/ui/titlebar.lua +++ /dev/null @@ -1,55 +0,0 @@ ----@diagnostic disable: undefined-global -local awful = require "awful" -local wibox = require "wibox" - -client.connect_signal("request::titlebars", function (c) - local titlebar = awful.titlebar(c, { - position = 'left', - size = 30 - }) - - local function separate_button(b, opts) - opts = opts or {} - return wibox.widget { - b, - top = opts.top or 4, - bottom = opts.bottom or 4, - left = opts.left or 8, - right = opts.right or 8, - widget = wibox.container.margin, - } - end - - titlebar:setup { - { -- Top - separate_button(awful.titlebar.widget.closebutton(c), { top = 9 }), - separate_button(awful.titlebar.widget.maximizedbutton(c)), - separate_button(awful.titlebar.widget.minimizebutton(c)), - layout = wibox.layout.fixed.vertical - }, - { -- middle, just loads the titlebar buttons - layout = wibox.layout.fixed.vertical, - buttons = { - awful.button({}, 1, function () - c:activate { context = "titlebar", action = "mouse_move" } - end), - awful.button({}, 3, function () - c:activate { context = "titlebar", action = "mouse_resize" } - end) - }, - }, - { -- Bottom - { - { - awful.titlebar.widget.floatingbutton(c), - margins = 5, - widget = wibox.container.margin, - }, - layout = wibox.layout.fixed.vertical, - }, - margins = 3, - widget = wibox.container.margin, - }, - layout = wibox.layout.align.vertical - } -end) diff --git a/cfg/awesome/ui/wallpaper.lua b/cfg/awesome/ui/wallpaper.lua deleted file mode 100644 index fb51219..0000000 --- a/cfg/awesome/ui/wallpaper.lua +++ /dev/null @@ -1,8 +0,0 @@ -local beautiful = require 'beautiful' -local gears = require 'gears' - -screen.connect_signal('request::wallpaper', function (s) - if beautiful.wallpaper then - gears.wallpaper.maximized(beautiful.wallpaper, s, false, nil) - end -end) \ No newline at end of file diff --git a/cfg/awesome/user_likes.lua b/cfg/awesome/user_likes.lua deleted file mode 100644 index 3748c3c..0000000 --- a/cfg/awesome/user_likes.lua +++ /dev/null @@ -1,12 +0,0 @@ -local menubar = require "menubar" - -terminal = "kitty" -browser = "firefox" -launcher = "rofi -show drun" -editor = os.getenv("EDITOR") or "vim" -visual_editor = "code" -- vscode -editor_cmd = terminal .. " -e " .. editor -modkey = "Mod4" -- super, the windows key - --- Set the terminal for applications that require it -menubar.utils.terminal = terminal diff --git a/cfg/cava/config b/cfg/cava/config deleted file mode 100644 index 12b768f..0000000 --- a/cfg/cava/config +++ /dev/null @@ -1,206 +0,0 @@ -## Configuration file for CAVA. Default values are commented out. Use either ';' or '#' for commenting. - - -[general] - -# Smoothing mode. Can be 'normal', 'scientific' or 'waves'. DEPRECATED as of 0.6.0 -; mode = normal - -# Accepts only non-negative values. -; framerate = 60 - -# 'autosens' will attempt to decrease sensitivity if the bars peak. 1 = on, 0 = off -# new as of 0.6.0 autosens of low values (dynamic range) -# 'overshoot' allows bars to overshoot (in % of terminal height) without initiating autosens. DEPRECATED as of 0.6.0 -; autosens = 1 -; overshoot = 20 - -# Manual sensitivity in %. If autosens is enabled, this will only be the initial value. -# 200 means double height. Accepts only non-negative values. -; sensitivity = 100 - -# The number of bars (0-200). 0 sets it to auto (fill up console). -# Bars' width and space between bars in number of characters. -; bars = 0 -; bar_width = 2 -; bar_spacing = 1 -# bar_height is only used for output in "noritake" format -; bar_height = 32 - -# For SDL width and space between bars is in pixels, defaults are: -; bar_width = 20 -; bar_spacing = 5 - - -# Lower and higher cutoff frequencies for lowest and highest bars -# the bandwidth of the visualizer. -# Note: there is a minimum total bandwidth of 43Mhz x number of bars. -# Cava will automatically increase the higher cutoff if a too low band is specified. -; lower_cutoff_freq = 50 -; higher_cutoff_freq = 10000 - - -# Seconds with no input before cava goes to sleep mode. Cava will not perform FFT or drawing and -# only check for input once per second. Cava will wake up once input is detected. 0 = disable. -; sleep_timer = 0 - - -[input] - -# Audio capturing method. Possible methods are: 'pulse', 'alsa', 'fifo', 'sndio' or 'shmem' -# Defaults to 'pulse', 'alsa' or 'fifo', in that order, dependent on what support cava was built with. -# -# All input methods uses the same config variable 'source' -# to define where it should get the audio. -# -# For pulseaudio 'source' will be the source. Default: 'auto', which uses the monitor source of the default sink -# (all pulseaudio sinks(outputs) have 'monitor' sources(inputs) associated with them). -# -# For alsa 'source' will be the capture device. -# For fifo 'source' will be the path to fifo-file. -# For shmem 'source' will be /squeezelite-AA:BB:CC:DD:EE:FF where 'AA:BB:CC:DD:EE:FF' will be squeezelite's MAC address -; method = pulse -; source = auto - -; method = alsa -; source = hw:Loopback,1 - -; method = fifo -; source = /tmp/mpd.fifo -; sample_rate = 44100 -; sample_bits = 16 - -; method = shmem -; source = /squeezelite-AA:BB:CC:DD:EE:FF - -; method = portaudio -; source = auto - - -[output] - -# Output method. Can be 'ncurses', 'noncurses', 'raw', 'noritake' or 'sdl'. -# 'noncurses' uses a custom framebuffer technique and prints only changes -# from frame to frame in the terminal. 'ncurses' is default if supported. -# -# 'raw' is an 8 or 16 bit (configurable via the 'bit_format' option) data -# stream of the bar heights that can be used to send to other applications. -# 'raw' defaults to 200 bars, which can be adjusted in the 'bars' option above. -# -# 'noritake' outputs a bitmap in the format expected by a Noritake VFD display -# in graphic mode. It only support the 3000 series graphical VFDs for now. -# -# 'sdl' uses the Simple DirectMedia Layer to render in a graphical context. -; method = ncurses - -# Visual channels. Can be 'stereo' or 'mono'. -# 'stereo' mirrors both channels with low frequencies in center. -# 'mono' outputs left to right lowest to highest frequencies. -# 'mono_option' set mono to either take input from 'left', 'right' or 'average'. -# set 'reverse' to 1 to display frequencies the other way around. -; channels = stereo -; mono_option = average -; reverse = 0 - -# Raw output target. A fifo will be created if target does not exist. -; raw_target = /dev/stdout - -# Raw data format. Can be 'binary' or 'ascii'. -; data_format = binary - -# Binary bit format, can be '8bit' (0-255) or '16bit' (0-65530). -; bit_format = 16bit - -# Ascii max value. In 'ascii' mode range will run from 0 to value specified here -; ascii_max_range = 1000 - -# Ascii delimiters. In ascii format each bar and frame is separated by a delimiters. -# Use decimal value in ascii table (i.e. 59 = ';' and 10 = '\n' (line feed)). -; bar_delimiter = 59 -; frame_delimiter = 10 - -# sdl window size and position. -1,-1 is centered. -; sdl_width = 1000 -; sdl_height = 500 -; sdl_x = -1 -; sdl_y= -1 - -# set label on bars on the x-axis. Can be 'frequency' or 'none'. Default: 'none' -# 'frequency' displays the lower cut off frequency of the bar above. -# Only supported on ncurses and noncurses output. -; xaxis = none - -# enable alacritty synchronized updates. 1 = on, 0 = off -# removes flickering in alacritty terminal emeulator. -# defaults to off since the behaviour in other terminal emulators is unknown -; alacritty_sync = 0 - -[color] - -# Colors can be one of seven predefined: black, blue, cyan, green, magenta, red, white, yellow. -# Or defined by hex code '#xxxxxx' (hex code must be within ''). User defined colors requires -# ncurses output method and a terminal that can change color definitions such as Gnome-terminal or rxvt. -# if supported, ncurses mode will be forced on if user defined colors are used. -# default is to keep current terminal color -; background = default -; foreground = default - -# SDL only support hex code colors, these are the default: -; background = '#111111' -; foreground = '#33cccc' - - -# Gradient mode, only hex defined colors (and thereby ncurses mode) are supported, -# background must also be defined in hex or remain commented out. 1 = on, 0 = off. -# You can define as many as 8 different colors. They range from bottom to top of screen -gradient = 1 -gradient_color_1 = '#70a5eb' -gradient_color_2 = '#8c9ae7' -gradient_color_3 = '#a68edd' -gradient_color_4 = '#be81cd' -gradient_color_5 = '#d075b8' -gradient_color_6 = '#dc699e' -gradient_color_7 = '#e26282' -gradient_color_8 = '#e05f65' - - - -[smoothing] - -# Percentage value for integral smoothing. Takes values from 0 - 100. -# Higher values means smoother, but less precise. 0 to disable. -# DEPRECATED as of 0.8.0, use noise_reduction instead -; integral = 77 - -# Disables or enables the so-called "Monstercat smoothing" with or without "waves". Set to 0 to disable. -; monstercat = 0 -; waves = 0 - -# Set gravity percentage for "drop off". Higher values means bars will drop faster. -# Accepts only non-negative values. 50 means half gravity, 200 means double. Set to 0 to disable "drop off". -# DEPRECATED as of 0.8.0, use noise_reduction instead -; gravity = 100 - - -# In bar height, bars that would have been lower that this will not be drawn. -# DEPRECATED as of 0.8.0 -; ignore = 0 - -# Noise reduction, float 0 - 1. default 0.77 -# the raw visualization is very noisy, this factor adjusts the integral and gravity filters to keep the signal smooth -# 1 will be very slow and smooth, 0 will be fast but noisy. -; noise_reduction = 0.77 - - -[eq] - -# This one is tricky. You can have as much keys as you want. -# Remember to uncomment more then one key! More keys = more precision. -# Look at readme.md on github for further explanations and examples. -# DEPRECATED as of 0.8.0 can be brought back by popular request, open issue at: -# https://github.com/karlstav/cava -; 1 = 1 # bass -; 2 = 1 -; 3 = 1 # midtone -; 4 = 1 -; 5 = 1 # treble diff --git a/cfg/hilbish/.assets/howlooks.png b/cfg/hilbish/.assets/howlooks.png deleted file mode 100644 index 9de0468..0000000 Binary files a/cfg/hilbish/.assets/howlooks.png and /dev/null differ diff --git a/cfg/hilbish/.gitignore b/cfg/hilbish/.gitignore deleted file mode 100644 index 662a2e6..0000000 --- a/cfg/hilbish/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -custom.lua -rc.lua diff --git a/cfg/hilbish/README.md b/cfg/hilbish/README.md deleted file mode 100644 index d78e073..0000000 --- a/cfg/hilbish/README.md +++ /dev/null @@ -1,124 +0,0 @@ -# Hilbish Config (SHELL) - -This config aims to be a complete shell configuration with some features that you can love, i'm trying to improve -this more as I can (cuz this is my favourite shell of course). - -## How it looks right now!! - -![demonstration](./.assets/howlooks.png) - -## Custom.lua - -You can create a new file called custom.lua (or you can leave it like how it's and it should works anyway). -In that file you can define custom aliases or modify your path, in fact, do the things that you want! - -An example of a custom.lua that defines custom aliases and modify the path is this: - -```lua -local path = require "path" -local aliases = require "aliases" - -local custom = {} - -function M.setup () - path.load_table({ - "~/.nvm/versions/node/v16.15.1/bin", - "~/.cargo/bin", - "~/.yarn/bin" - }) - - aliases.load_table({ - duf = "duf -theme ansi", - icat = "kitty +kitten icat" - }) -end - -return custom -``` - -## TBSM - -You can enable the tbsm support too! open your `custom.lua` and type the next: - -```lua -local tbsm = require 'tbsm' - -local custom = {} - -custom.setup = function () - tbsm.setup() -end - -return custom -``` - -Just call the `tbsm.setup` method inside the `custom.setup` method (you can have another stuff inside `custom.setup` of course). - -## Prompt - -For now exists two styles for the prompt: `ghost` and `blocks` (blocks is the default). -To change the prompt style you can create a file called `rc.lua` and put the next as example: - -```lua -local ansikit = require 'ansikit' - -return { - prompt = { - do_end_line = false, -- append an enter after command execution - style = 'ghost', -- blocks or ghost - vim_mode = { - cursors_case = { - insert = ansikit.lineCursor, - others = ansikit.blockCursor, - }, - } - } -} -``` - -That should remove the space between commands and change the prompt style to 'ghost' (that's more minimalist than blocks, but don't have support to git yet). - -## Default Aliases - -The default aliases are: - -| **command** | **replacement** | -|--------------|-------------| -|cat|bat or batcat| -|ls|exa --icons| -|la|exa --icons -la| -|tree| exa --icons --tree| -|grep|grep --color=always| - -## Custom commands - -This config includes some custom commands that can save you a bit of time searching why just one command don't work -in hilbish: `alias`, the alias command doesn't works when you're using the shell mode -of hilbish, e.g, if you type `alias john 'echo doe'` it don't work, but with this config, it works. - -I just made a 'command' that adds support to this using `hilbish.alias`, so now, it works! BUT - -### Differences between bash alias and my custom hilbish custom alias - -In bash you can do things like this: - -```sh -alias john='echo doe' -``` - -but in with hilbish you should type: - -```sh -alias john 'echo doe' -``` - -just replace the `=` to and space. - -## Automatic bat support - -In some distros, bat (the enhanced cat), isn't called bat, it's called `batcat`, so i made -an automatic and dynamic alias to solve that, see: [bat.lua](./bat.lua) - -## Enjoy! - -Hope you like this :D diff --git a/cfg/hilbish/aliases.lua b/cfg/hilbish/aliases.lua deleted file mode 100644 index ed0306e..0000000 --- a/cfg/hilbish/aliases.lua +++ /dev/null @@ -1,32 +0,0 @@ -local hilbish = require "hilbish" -local bat = require "bat" - -local M = {} - -M.aliases = { - ls = "exa --icons", - la = "ls -la", - tree = "ls --tree", - grep = 'grep --color=always', -} - -function M.setup_bat () - local bat_flags = ' --paging=never --style=plain --theme=base16' - local bat_exec = bat.get_exec() - if bat_exec ~= nil then - M.aliases.cat = bat_exec .. bat_flags - end -end - -function M.load_table (table) - for cmd, new_cmd in pairs(table) do - hilbish.alias(cmd, new_cmd) - end -end - -function M.load_aliases () - M.setup_bat() - M.load_table(M.aliases) -end - -return M diff --git a/cfg/hilbish/bat.lua b/cfg/hilbish/bat.lua deleted file mode 100644 index e7d9697..0000000 --- a/cfg/hilbish/bat.lua +++ /dev/null @@ -1,18 +0,0 @@ -local M = {} - -local function is_valid_cmd (cmd) - return hilbish.which(cmd) ~= '' and hilbish.which(cmd) ~= nil -end - -function M.get_exec () - local choices = {'bat', 'batcat'} - for _, choice in ipairs(choices) do - if is_valid_cmd(choice) then - return choice - end - end - - return nil -end - -return M diff --git a/cfg/hilbish/commands.lua b/cfg/hilbish/commands.lua deleted file mode 100644 index 4dd448a..0000000 --- a/cfg/hilbish/commands.lua +++ /dev/null @@ -1,23 +0,0 @@ -local commander = require "commander" - -local M = {} - -function M.which (input) - print(hilbish.which(input[1])) -end - -function M.alias (argv) - local name = argv[1] - local cmd = argv[2] - - hilbish.alias(name, cmd) -end - -function M.setup () - if hilbish.which("which") == nil then - commander.register('which', M.which) - end - commander.register('alias', M.alias) -end - -return M diff --git a/cfg/hilbish/init.lua b/cfg/hilbish/init.lua deleted file mode 100644 index 6b9a058..0000000 --- a/cfg/hilbish/init.lua +++ /dev/null @@ -1,18 +0,0 @@ -if not hilbish.interactive then - return -end - -local prompt = require("prompt") -local path = require "path" -local aliases = require("aliases") -local commands = require('commands') -local present, custom = pcall(require, 'custom') - -aliases.load_aliases() -path.setup() -prompt.setup() -commands.setup() - -if present then - custom.setup() -end diff --git a/cfg/hilbish/path.lua b/cfg/hilbish/path.lua deleted file mode 100644 index 76f5ce9..0000000 --- a/cfg/hilbish/path.lua +++ /dev/null @@ -1,18 +0,0 @@ -local hilbish = require "hilbish" -local M = {} - -M.paths = { - "~/.local/bin" -} - -function M.load_table(table) - for _, path in ipairs(table) do - hilbish.appendPath(path) - end -end - -function M.setup () - M.load_table(M.paths) -end - -return M diff --git a/cfg/hilbish/prompt.lua b/cfg/hilbish/prompt.lua deleted file mode 100644 index b4a9e1a..0000000 --- a/cfg/hilbish/prompt.lua +++ /dev/null @@ -1,121 +0,0 @@ -local hilbish = require("hilbish") -local bait = require("bait") -local lunacolors = require("lunacolors") -local ansikit = require("ansikit") - -local rc = require 'utils.rc'.get_rc() - -local M = {} - --- configuration -M.do_conf = function () - hilbish.inputMode('vim') -end - --- events -M.do_end_line = function (cmd_str) - if cmd_str ~= 'clear' and rc.prompt.do_end_line then - print() - end -end - -M.do_vim_mode_setup = function (mode) - if mode == 'insert' then - ansikit.cursorStyle(rc.prompt.vim_mode.cursors_case.insert) - else - ansikit.cursorStyle(rc.prompt.vim_mode.cursors_case.others) - end -end - -M.do_events = function () - bait.catch('command.exit', function (code, cmd_str) - M.do_end_line(cmd_str) - M.do_prompt(code) - end) - - bait.catch('hilbish.vimMode', function (mode) - M.do_vim_mode_setup(mode) - end) -end - --- prompt styling -M.get_icon_by_failure = function (fail, colors, icons) - if not icons then - icons = { - failure = 'ī™˜', - success = 'īžŸ' - } - end - return fail and colors.failure .. icons.failure or colors.success .. icons.success -end - --- trim strings -local function trim(s) - local result = s:gsub("%s+", "") - - return string.gsub(result, "%s+", "") -end - --- git integration -local function dirty() -- thanks to TorchedSammy - local _, dirt = hilbish.run('git status --porcelain | wc -l', false) - local ret = trim(dirt) - - if ret == '' then - return '' - end - - return tonumber(ret) > 0 and ' ī‘„' or '' -end - -local function get_branch_name() -- thanks to TorchedSammy - local _, branch = hilbish.run('git rev-parse --abbrev-ref HEAD', false) - local ret = trim(branch) - - if ret == '' then - return nil - end - - return ret -end - --- return the prompt format -M.ghost_prompt = function (fail, _) - return M.get_icon_by_failure(fail, { - success = '{blue}', - failure = '{red}', - }, { - success = 'īžŸ {blue}❯{cyan}❯', - failure = 'ī™˜ {red}❯{magenta}❯' - }) .. ' ' -end - -M.blocks_prompt = function (fail, _) - local branch = get_branch_name() - local show_branch = branch ~= nil - - return M.get_icon_by_failure(fail, { - success = "{blue}î‚ļ{blueBg}", - failure = '{red}î‚ļ{redBg}', - }, { - success = '{black}īžŸ {reset}{blue}' .. (show_branch and '{cyanBg}' or '{blackBg}') .. 'î‚ŧ', - failure = '{black}ī™˜ {reset}{red}' .. (show_branch and '{cyanBg}' or '{blackBg}') .. 'î‚ŧ', - }) .. '{reset}' .. (show_branch and '{cyanBg}{black}  ' .. branch .. dirty() .. ' {reset}{cyan}{blackBg}î‚ŧ' or '') .. '{blackBg}{cyan} î—ŋ %d {reset}{black}î‚ŧ {yellow}{reset}{yellow}īƒ§ {reset}' -end - --- change the style changing the name of the functin that `hilbish.prompt` calls -M.do_prompt = function (code) - hilbish.prompt(lunacolors.format(M[rc.prompt.style .. '_prompt']( - code ~= 0 and code ~= nil, -- checks if the command was executed successfully - hilbish.user == 'root' -- checks if the user is root - ))) -end - --- main function -M.setup = function () - M.do_conf() - M.do_prompt() - M.do_events() -end - -return M diff --git a/cfg/hilbish/tbsm.lua b/cfg/hilbish/tbsm.lua deleted file mode 100644 index 5b1d893..0000000 --- a/cfg/hilbish/tbsm.lua +++ /dev/null @@ -1,15 +0,0 @@ -local hilbish = require "hilbish" - -local M = {} - -function M.start_tbsm () - hilbish.run("tbsm") -end - -function M.setup () - if hilbish.login then - M.start_tbsm() - end -end - -return M diff --git a/cfg/hilbish/utils/rc.lua b/cfg/hilbish/utils/rc.lua deleted file mode 100644 index b49e274..0000000 --- a/cfg/hilbish/utils/rc.lua +++ /dev/null @@ -1,27 +0,0 @@ -local rc = {} -local ansikit = require 'ansikit' - --- in construction rc -rc.default_conf = { - prompt = { - do_end_line = true, -- append an enter after command execution - style = 'blocks', -- blocks or ghost - vim_mode = { - cursors_case = { - insert = ansikit.lineCursor, - others = ansikit.blockCursor, - }, - } - } -} - -rc.get_rc = function () - local ok, mod = pcall(require, 'rc') - if not ok then - return rc.default_conf - else - return mod - end -end - -return rc diff --git a/cfg/kitty/decayce.ini b/cfg/kitty/decayce.ini deleted file mode 100644 index 0e6808f..0000000 --- a/cfg/kitty/decayce.ini +++ /dev/null @@ -1,46 +0,0 @@ -# Eye Friendly Colors -# Created by https://github.com/decaycs - -# Special -background #0d0f18 -foreground #a5b6cf - -# Black -color0 #151720 -color8 #1c1e27 - -# Red -color1 #dd6777 -color9 #e26c7c - -# Green -color2 #90ceaa -color10 #95d3af - -# Yellow -color3 #ecd3a0 -color11 #f1d8a5 - -# Blue -color4 #86aaec -color12 #8baff1 - -# Magenta -color5 #c296eb -color13 #c79bf0 - -# Cyan -color6 #93cee9 -color14 #98d3ee - -# White -color7 #cbced3 -color15 #d0d3d8 - -# Cursor -cursor #cbced3 -cursor_text_color #a5b6cf - -# Selection highlight -selection_foreground #a5b6cf -selection_background #1c1e27 diff --git a/cfg/kitty/kitty.conf b/cfg/kitty/kitty.conf deleted file mode 100644 index 701c839..0000000 --- a/cfg/kitty/kitty.conf +++ /dev/null @@ -1,11 +0,0 @@ -include decayce.ini - -font_family CaskaydiaCove Nerd Font -font_size 9 - -confirm_os_window_close -0 -close_on_child_death yes -cursor_shape beam -adjust_line_height 3 - -window_padding_width 18 diff --git a/cfg/sfetch/config.cfg b/cfg/sfetch/config.cfg deleted file mode 100644 index b04856d..0000000 --- a/cfg/sfetch/config.cfg +++ /dev/null @@ -1,43 +0,0 @@ -; Simple Fetch Configuration File! - -; general sfetch settings -[settings] -hide_cursor = yes ; hide the cursor when sfetch is running -enable_colors = yes ; enable color in output -enable_headers = yes ; enable headers: `@` -enable_colorbars = yes ; enable colorbars -colorbar_padding = no ; defines if colorbars should put an extra space between color blocks and data -colorbar_use_bg = no ; defines if colorbars should use bg or fg to render blocks -modules_order = "os kr sh us" ; the order on how modules should be rendered - -; modules disabling section: disable the modules that you don't use -; to have a better performance. You can disable it by removing the module -; in `settings.modules_order` but if you don't disable it here, the module will be loaded anyway -[modules] -os = yes ; operative system -kr = yes ; kernel -sh = yes ; shell -us = yes ; user - -; prefixes settings: Defines the prefixes template of the modules -[prefixes] -os = "ī„‰" -kr = "īŒš" -sh = "" -us = "ī€‡" - -; formats: string formats, like the format on how the module -; should be rendered and the prefix of it -[formats] -prefix_format = "{}" -sep_format = " " -colorbar_char_format = "īžŸ " - -; colors of the modules to render and the header color, available colors are: -; black, red, green, yellow, blue, magenta, cyan and white -[colors] -header = white -os = green -us = red -kr = magenta -sh = blue