Added audio device selector, new notification theme and much more. Rewritten some files and made a new README
382
README.md
@@ -1,62 +1,380 @@
|
|||||||
# Crylia Theme
|
<div align="center">
|
||||||
|
<h1>Crylia Theme</h1>
|
||||||
This theme is inspired by simple bar and many other things that I think look good and fit my theme. AwesomeWM lets you configure your desktop as you want, no compromises, the sky is the limit!
|
</div>
|
||||||
This is the reason I choose AwesomeWM.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## FAQ - Wiki
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
If you feel lost, got a problem or just have a question, please check out the wiki first before opening an issue.
|

|
||||||
|
|
||||||
## Quick Install
|

|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### [Installation](https://github.com/Crylia/crylia-theme/wiki/Guide)
|
<div align="center">
|
||||||
|
<h1>Welcome to my dotfiles</h1>
|
||||||
|
</div>
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
Installing this theme is rather easy, just copy the repo and put the awesome folder to ~/.config/
|
An AwesomeWM theme inspired by everything I could find online and thought "Hey, that looks good!".
|
||||||
But in order for it to work as seen you need some dependencies installed along the way. Here are the main components, but in order for everything to work go [here](https://github.com/Crylia/crylia-theme/wiki/Guide).
|
|
||||||
|
|
||||||
||Arch|Ubuntu|Why?|
|
This repository holds mainly my AwesomeWM theme but also some other rice's I've done over the years.
|
||||||
|:-:|:-:|:-:|:-:|
|
|
||||||
|AwesomeWM|awesome|[Guide here](https://github.com/awesomeWM/awesome)|Its your Window Manager lol|
|
Everything you see is done purely because I hate myself and like to give myself a hard time.
|
||||||
|Rofi|rofi|[Guide here](https://github.com/davatorium/rofi)|For the application launcher|
|
</div>
|
||||||
|Picom|picom-ibhagwan-git<sup>aur</sup>|[Guide here](https://github.com/jonaburg/picom/security)|Compositor, needed for transparency/blur/effects/animations etc|
|
|
||||||
|||||
|
|
||||||
|
## Information
|
||||||
|
|
||||||
|
---
|
||||||
|
<image align="right" width="450px" src="assets/neofetch.png"/>
|
||||||
|
|
||||||
|
**My system setup**:
|
||||||
|
|
||||||
|
- **OS**: [Pop!_OS](https://pop.system76.com/)
|
||||||
|
- **WM**: [AwesomeWM](https://github.com/awesomeWM/awesome)
|
||||||
|
- **Terminal**: [Alacritty](https://github.com/alacritty/alacritty)
|
||||||
|
- **Shell**: [ZSH](https://github.com/ohmyzsh/ohmyzsh)
|
||||||
|
- **Compositor**: [Picom](https://github.com/jonaburg/picom)
|
||||||
|
- **Application Launcher**: [Rofi](https://github.com/davatorium/rofi)
|
||||||
|
- **File Manager**: [Thunar](https://github.com/xfce-mirror/thunar)
|
||||||
|
- **Icons**: [Papirus-Dark](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme)
|
||||||
|
- **Cursor**: [Vimix-Cursors](https://github.com/vinceliuice/Vimix-cursors)
|
||||||
|
- **Font**: [JetBrainsMonoNerdFont](https://www.nerdfonts.com/font-downloads)
|
||||||
|
- **Editor**: [VS Code](https://code.visualstudio.com/)
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### Here are three levels of what you need
|
||||||
|
|
||||||
|
1. Dependencies you need to have in order for the rice to work
|
||||||
|
2. Important dependencies but can be replaced, the theme might behave weird without these or without proper reconfiguration!
|
||||||
|
3. Nice to have and are the default. Can be easily changed without any worries!
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>1. Dependencies</b></summary>
|
||||||
|
|
||||||
|
#### **AwesomeWM**
|
||||||
|
|
||||||
|
>**Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yay -S awesome-git
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt build-dep awesome
|
||||||
|
git clone https://github.com/awesomeWM/awesome.git
|
||||||
|
make package
|
||||||
|
sudo dpkg -i awesome*.deb
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **Rofi**
|
||||||
|
|
||||||
|
>**Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yay -S rofi-git
|
||||||
|
```
|
||||||
|
|
||||||
|
>**Ubuntu**
|
||||||
|
|
||||||
|
Check [HERE](https://github.com/davatorium/rofi/blob/next/INSTALL.md) for how to build from source. Note **DO NOT INSTAL ROFI FROM APT IT WONT WORK**
|
||||||
|
|
||||||
|
#### **Picom**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yay -S picom-jonaburg-git
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/jonaburg/picom
|
||||||
|
cd picom
|
||||||
|
meson --buildtype=release . build
|
||||||
|
sudo ninja -C build install
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
<details>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<summary><b>2. Important Dependencies</b></summary>
|
||||||
|
|
||||||
|
#### **Papirus** - Icon Theme
|
||||||
|
|
||||||
|
***Make sure the theme is located at `/usr/share/icons/`***
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S papirus-icon-theme
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install papirus-icon-theme
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **pactl - PulseAudio Controler**
|
||||||
|
|
||||||
|
***All audio scripts depends on this***
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S pulseaudio-alsa
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install pulseaudio-utils
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **upower - Battery Info**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S upower
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install upower
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **bluez/bluetoothctl - Bluetooth**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S bluez bluez-utils
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install bluez bluez-utils
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **setxkbmap - Change Keyboard Layout**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S xorg-setxkbmap
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install xorg
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **xfce4-power-manager - Backlight**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S xfce4-power-manager
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install xfce4-power-manager
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **playerctl - Media control**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S playerctl
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install playerctl
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **LightDM - Login/Logout/ScreenLock**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S lightdm light-locker
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install lightdm light-locker
|
||||||
|
```
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>3. Optional Dependencies</b></summary>
|
||||||
|
|
||||||
|
#### **Alacritty** - Default terminal
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S alacritty
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install alacritty
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **Thunar** - Default file manager
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S thunar
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install thunar
|
||||||
|
```
|
||||||
|
|
||||||
|
#### **Flameshot - Screenshots**
|
||||||
|
|
||||||
|
> **Arch**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo pacman -S flameshot
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Ubuntu**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install flameshot
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### Setup
|
||||||
|
|
||||||
|
Make sure to backup any data before you copy my theme over!
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/Crylia/crylia-theme
|
||||||
|
cd crylia-theme
|
||||||
|
cp -r awesome ~/.config/.
|
||||||
|
cp -r picom.conf ~/.config/.
|
||||||
|
cp -r rofi ~/.config/.
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp -r alacritty ~/.config/.
|
||||||
|
```
|
||||||
|
|
||||||
|
## [Documentation | Wiki | FAQ](https://github.com/Crylia/crylia-theme/wiki/Documentation)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Some would say there are more features than a WM needs, I say you can never have enough features (as long as they make some sense).
|
#### Some notable features
|
||||||
|
|
||||||
- [x] Multi screen support
|
- [x] Multi screen support
|
||||||
- [x] Interactive taskbar (left, right click and hover over)
|
- [x] Interactive task/taglist and dock (left, right click and hover over)
|
||||||
- [x] Session option to reboot, shutdown etc
|
- [x] Session option to reboot, shutdown etc
|
||||||
- [x] Multi keyboard layout support + switch widget
|
- [x] Multi keyboard layout support + switch widget
|
||||||
- [x] Calendar widget (not interactive)
|
|
||||||
- [x] Rofi application launcher and window switcher
|
- [x] Rofi application launcher and window switcher
|
||||||
- [x] Volume / Brightness switcher
|
- [x] Volume / Brightness control widget
|
||||||
- [X] Dock
|
- [X] Configurable Dock
|
||||||
- [x] Systray
|
- [x] Systray
|
||||||
|
- [x] GPU/CPU/RAM Temperature, Usage and Clock widget
|
||||||
|
- [x] Full audio device selector
|
||||||
|
- [x] Easy to configure dots
|
||||||
|
- [x] Interactive notifications
|
||||||
|
|
||||||
Some stuff planned for the future
|
#### Some stuff planned for the future
|
||||||
|
|
||||||
- [ ] Calendar OSD
|
- [ ] Calendar OSD
|
||||||
- [ ] GPU/CPU/RAM etc Temparature and Usage widget
|
|
||||||
- [ ] Extended volume and microphone control
|
|
||||||
- [ ] More bugs
|
- [ ] More bugs
|
||||||
- [ ] I3 like layout / manual tiling
|
- [ ] I3 like layout / manual tiling
|
||||||
|
|
||||||
I've added various widgets you can choose or remove how you like it.
|
<br>
|
||||||
|
|
||||||
__Including__:<br>
|
There are many widgets to choose from
|
||||||
Battery, Network (Wifi, Ethernet), Bluetooth, Volume, Keyboardlayout, Date (with Calendar), Time, Session options, Taglist, Tasklist, Layoutswitcher.
|
|
||||||
|
**Widget List**:
|
||||||
|
|
||||||
|
- Battery
|
||||||
|
- Network (Wifi, Ethernet)
|
||||||
|
- Bluetooth
|
||||||
|
- Volume
|
||||||
|
- Keyboardlayout
|
||||||
|
- Date
|
||||||
|
- Time
|
||||||
|
- Session options
|
||||||
|
- Taglist
|
||||||
|
- Tasklist
|
||||||
|
- Layoutswitcher
|
||||||
|
- GPU/CPU/RAM Temperature/Usage and Clock speed.
|
||||||
|
|
||||||
|
## Gallery
|
||||||
|
|
||||||
|
---
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Entire Desktop with two terminal open
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Lockscreen
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Volume OSD (Backlight looks similar)
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Switch In/Output devices easily
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Spotify example notification with working media control
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Top Left bar closeup
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Top Center bar closeup
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Top Right bar closeup
|
||||||
|
|
||||||
|
>
|
||||||
|
>
|
||||||
|
>Dock closeup
|
||||||
|
|
||||||
## Known bugs
|
## Known bugs
|
||||||
|
|
||||||
|
|||||||
BIN
assets/DeviceChooser.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
assets/EntireScreen_VolumeOSD.png
Normal file
|
After Width: | Height: | Size: 3.6 MiB |
BIN
assets/Notification1.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
assets/TopCenter.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
BIN
assets/TopLeftBar.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
assets/TopRight.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
BIN
assets/dock.png
Normal file
|
After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
BIN
assets/neofetch.png
Normal file
|
After Width: | Height: | Size: 241 KiB |
@@ -38,7 +38,7 @@ return function(s, widgets)
|
|||||||
{
|
{
|
||||||
widget,
|
widget,
|
||||||
left = dpi(6),
|
left = dpi(6),
|
||||||
right = dpi(3),
|
right = dpi(6),
|
||||||
top = dpi(6),
|
top = dpi(6),
|
||||||
bottom = dpi(6),
|
bottom = dpi(6),
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.margin
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ local wibox = require("wibox")
|
|||||||
|
|
||||||
return function(screen, programs)
|
return function(screen, programs)
|
||||||
|
|
||||||
local function create_dock_element(class, program, name, is_steam, size)
|
local function create_dock_element(class, program, name, user_icon, is_steam, size)
|
||||||
if program == nil or class == nil then
|
if program == nil or class == nil then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
is_steam = is_steam or false
|
is_steam = is_steam or false
|
||||||
|
user_icon = user_icon or nil
|
||||||
local dock_element = wibox.widget {
|
local dock_element = wibox.widget {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -23,9 +23,9 @@ return function(screen, programs)
|
|||||||
resize = true,
|
resize = true,
|
||||||
forced_width = size,
|
forced_width = size,
|
||||||
forced_height = size,
|
forced_height = size,
|
||||||
image = Get_icon(user_vars.icon_theme, nil, program, class, is_steam),
|
image = user_icon or Get_icon(user_vars.icon_theme, nil, program, class, is_steam),
|
||||||
widget = wibox.widget.imagebox,
|
widget = wibox.widget.imagebox,
|
||||||
id = "icon"
|
id = "icon",
|
||||||
},
|
},
|
||||||
margins = dpi(5),
|
margins = dpi(5),
|
||||||
widget = wibox.container.margin,
|
widget = wibox.container.margin,
|
||||||
@@ -104,7 +104,7 @@ return function(screen, programs)
|
|||||||
local dock_elements = { layout = wibox.layout.fixed.horizontal }
|
local dock_elements = { layout = wibox.layout.fixed.horizontal }
|
||||||
|
|
||||||
for i, p in ipairs(pr) do
|
for i, p in ipairs(pr) do
|
||||||
dock_elements[i] = create_dock_element(p[1], p[2], p[3], p[4], user_vars.dock_icon_size)
|
dock_elements[i] = create_dock_element(p[1], p[2], p[3], p[4], p[5], user_vars.dock_icon_size)
|
||||||
end
|
end
|
||||||
|
|
||||||
return dock_elements
|
return dock_elements
|
||||||
@@ -181,22 +181,14 @@ return function(screen, programs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
local function check_for_dock_hide(s)
|
local function check_for_dock_hide(s)
|
||||||
local naughty = require("naughty")
|
|
||||||
if #s.selected_tag:clients() < 1 then
|
if #s.selected_tag:clients() < 1 then
|
||||||
dock.visible = true
|
dock.visible = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if s == mouse.screen then
|
if s == mouse.screen then
|
||||||
--[[ if mouse.current_widget then
|
|
||||||
if tostring(mouse.current_widget):match("fake") then
|
|
||||||
dock.visible = true
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end ]]
|
|
||||||
local visible = false
|
local visible = false
|
||||||
for j, c in ipairs(s.selected_tag:clients()) do
|
for j, c in ipairs(s.selected_tag:clients()) do
|
||||||
|
|
||||||
--naughty.notify({ title = tostring(c.class) })
|
|
||||||
if c.maximized or c.fullscreen then
|
if c.maximized or c.fullscreen then
|
||||||
dock.visible = false
|
dock.visible = false
|
||||||
return
|
return
|
||||||
@@ -209,10 +201,6 @@ return function(screen, programs)
|
|||||||
else
|
else
|
||||||
dock.visible = true
|
dock.visible = true
|
||||||
end
|
end
|
||||||
--[[ if visible then
|
|
||||||
dock.visible = visible
|
|
||||||
return
|
|
||||||
end ]]
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
dock.visible = false
|
dock.visible = false
|
||||||
|
|||||||
@@ -23,29 +23,30 @@ awful.screen.connect_for_each_screen(
|
|||||||
require("src.modules.volume_osd")(s)
|
require("src.modules.volume_osd")(s)
|
||||||
require("src.modules.brightness_osd")(s)
|
require("src.modules.brightness_osd")(s)
|
||||||
require("src.modules.titlebar")
|
require("src.modules.titlebar")
|
||||||
|
require("src.modules.volume_controller")(s)
|
||||||
|
|
||||||
-- Widgets
|
-- Widgets
|
||||||
s.battery = require("src.widgets.battery")()
|
--s.battery = require("src.widgets.battery")()
|
||||||
s.network = require("src.widgets.network")()
|
s.audio = require("src.widgets.audio")(s)
|
||||||
s.audio = require("src.widgets.audio")()
|
|
||||||
s.date = require("src.widgets.date")()
|
s.date = require("src.widgets.date")()
|
||||||
s.clock = require("src.widgets.clock")()
|
s.clock = require("src.widgets.clock")()
|
||||||
s.bluetooth = require("src.widgets.bluetooth")()
|
--s.bluetooth = require("src.widgets.bluetooth")()
|
||||||
s.layoutlist = require("src.widgets.layout_list")()
|
s.layoutlist = require("src.widgets.layout_list")()
|
||||||
s.powerbutton = require("src.widgets.power")()
|
s.powerbutton = require("src.widgets.power")()
|
||||||
s.kblayout = require("src.widgets.kblayout")(s)
|
s.kblayout = require("src.widgets.kblayout")(s)
|
||||||
s.taglist = require("src.widgets.taglist")(s)
|
s.taglist = require("src.widgets.taglist")(s)
|
||||||
s.tasklist = require("src.widgets.tasklist")(s)
|
s.tasklist = require("src.widgets.tasklist")(s)
|
||||||
s.systray = require("src.widgets.systray")(s)
|
--s.cpu_freq = require("src.widgets.cpu_info")("freq", "average")
|
||||||
s.cpu_usage = require("src.widgets.cpu_info")("usage")
|
|
||||||
s.cpu_temp = require("src.widgets.cpu_info")("temp")
|
|
||||||
s.cpu_freq = require("src.widgets.cpu_info")("freq", "average")
|
|
||||||
s.ram_info = require("src.widgets.ram_info")()
|
|
||||||
s.gpu_usage = require("src.widgets.gpu_info")("usage")
|
|
||||||
s.gpu_temp = require("src.widgets.gpu_info")("temp")
|
|
||||||
-- Add more of these if statements if you want to change
|
-- Add more of these if statements if you want to change
|
||||||
-- the modules/widgets per screen.
|
-- the modules/widgets per screen.
|
||||||
if s.index == 1 then
|
if s.index == 1 then
|
||||||
|
s.systray = require("src.widgets.systray")(s)
|
||||||
|
s.cpu_usage = require("src.widgets.cpu_info")("usage")
|
||||||
|
s.cpu_temp = require("src.widgets.cpu_info")("temp")
|
||||||
|
s.gpu_usage = require("src.widgets.gpu_info")("usage")
|
||||||
|
s.gpu_temp = require("src.widgets.gpu_info")("temp")
|
||||||
|
|
||||||
require("crylia_bar.left_bar")(s, { s.layoutlist, s.systray, s.taglist })
|
require("crylia_bar.left_bar")(s, { s.layoutlist, s.systray, s.taglist })
|
||||||
require("crylia_bar.center_bar")(s, { s.tasklist })
|
require("crylia_bar.center_bar")(s, { s.tasklist })
|
||||||
require("crylia_bar.right_bar")(s, { s.gpu_usage, s.gpu_temp, s.cpu_usage, s.cpu_temp, s.audio, s.kblayout, s.date, s.clock, s.powerbutton })
|
require("crylia_bar.right_bar")(s, { s.gpu_usage, s.gpu_temp, s.cpu_usage, s.cpu_temp, s.audio, s.kblayout, s.date, s.clock, s.powerbutton })
|
||||||
@@ -53,6 +54,9 @@ awful.screen.connect_for_each_screen(
|
|||||||
end
|
end
|
||||||
|
|
||||||
if s.index == 2 then
|
if s.index == 2 then
|
||||||
|
s.network = require("src.widgets.network")()
|
||||||
|
s.ram_info = require("src.widgets.ram_info")()
|
||||||
|
|
||||||
require("crylia_bar.left_bar")(s, { s.layoutlist, s.taglist })
|
require("crylia_bar.left_bar")(s, { s.layoutlist, s.taglist })
|
||||||
require("crylia_bar.center_bar")(s, { s.tasklist })
|
require("crylia_bar.center_bar")(s, { s.tasklist })
|
||||||
require("crylia_bar.right_bar")(s, { s.ram_info, s.audio, s.kblayout, s.network, s.date, s.clock, s.powerbutton })
|
require("crylia_bar.right_bar")(s, { s.ram_info, s.audio, s.kblayout, s.network, s.date, s.clock, s.powerbutton })
|
||||||
|
|||||||
@@ -5,63 +5,63 @@ local globalkeys = require("../mappings/global_keys")
|
|||||||
local modkey = user_vars.modkey
|
local modkey = user_vars.modkey
|
||||||
|
|
||||||
for i = 1, 9 do
|
for i = 1, 9 do
|
||||||
globalkeys = gears.table.join(globalkeys,
|
globalkeys = gears.table.join(globalkeys,
|
||||||
|
|
||||||
-- View tag only
|
-- View tag only
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#" .. i + 9,
|
"#" .. i + 9,
|
||||||
function()
|
function()
|
||||||
local screen = awful.screen.focused()
|
local screen = awful.screen.focused()
|
||||||
local tag = screen.tags[i]
|
local tag = screen.tags[i]
|
||||||
if tag then
|
if tag then
|
||||||
tag:view_only()
|
tag:view_only()
|
||||||
end
|
end
|
||||||
client.emit_signal("tag::switched")
|
client.emit_signal("tag::switched")
|
||||||
end,
|
end,
|
||||||
{ description = "View Tag " .. i, group = "Tag" }
|
{ description = "View Tag " .. i, group = "Tag" }
|
||||||
),
|
),
|
||||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#" .. i + 9,
|
"#" .. i + 9,
|
||||||
function()
|
function()
|
||||||
local screen = awful.screen.focused()
|
local screen = awful.screen.focused()
|
||||||
local tag = screen.tags[i]
|
local tag = screen.tags[i]
|
||||||
if tag then
|
if tag then
|
||||||
awful.tag.viewtoggle(tag)
|
awful.tag.viewtoggle(tag)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{ description = "Toggle Tag " .. i, group = "Tag" }
|
{ description = "Toggle Tag " .. i, group = "Tag" }
|
||||||
),
|
),
|
||||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#" .. i + 9,
|
"#" .. i + 9,
|
||||||
function()
|
function()
|
||||||
local screen = awful.screen.focused()
|
local screen = awful.screen.focused()
|
||||||
if client.focus then
|
if client.focus then
|
||||||
local tag = screen.tags[i]
|
local tag = screen.tags[i]
|
||||||
if tag then
|
if tag then
|
||||||
client.focus:move_to_tag(tag)
|
client.focus:move_to_tag(tag)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
||||||
),
|
),
|
||||||
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
-- Brings the window over without chaning the tag, reverts automatically on tag change
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control", "Shift" },
|
{ modkey, "Control", "Shift" },
|
||||||
"#" .. i + 9,
|
"#" .. i + 9,
|
||||||
function()
|
function()
|
||||||
local screen = awful.screen.focused()
|
local screen = awful.screen.focused()
|
||||||
local tag = screen.tags[i]
|
local tag = screen.tags[i]
|
||||||
if tag then
|
if tag then
|
||||||
awful.tag.viewtoggle(tag)
|
awful.tag.viewtoggle(tag)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
{ description = "Move focused client on tag " .. i, group = "Tag" }
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
end
|
end
|
||||||
root.keys(globalkeys)
|
root.keys(globalkeys)
|
||||||
|
|||||||
@@ -5,15 +5,15 @@ local gears = require("gears")
|
|||||||
local modkey = user_vars.modkey
|
local modkey = user_vars.modkey
|
||||||
|
|
||||||
return gears.table.join(
|
return gears.table.join(
|
||||||
awful.button({}, 1, function(c)
|
awful.button({}, 1, function(c)
|
||||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||||
end),
|
end),
|
||||||
awful.button({ modkey }, 1, function(c)
|
awful.button({ modkey }, 1, function(c)
|
||||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||||
awful.mouse.client.move(c)
|
awful.mouse.client.move(c)
|
||||||
end),
|
end),
|
||||||
awful.button({ modkey }, 3, function(c)
|
awful.button({ modkey }, 3, function(c)
|
||||||
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
c:emit_signal("request::activate", "mouse_click", { raise = true })
|
||||||
awful.mouse.client.resize(c)
|
awful.mouse.client.resize(c)
|
||||||
end)
|
end)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,53 +5,53 @@ local gears = require("gears")
|
|||||||
local modkey = user_vars.modkey
|
local modkey = user_vars.modkey
|
||||||
|
|
||||||
return gears.table.join(
|
return gears.table.join(
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#41",
|
"#41",
|
||||||
function(c)
|
function(c)
|
||||||
c.fullscreen = not c.fullscreen
|
c.fullscreen = not c.fullscreen
|
||||||
c:raise()
|
c:raise()
|
||||||
end,
|
end,
|
||||||
{ description = "Toggle fullscreen", group = "Client" }
|
{ description = "Toggle fullscreen", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#24",
|
"#24",
|
||||||
function(c)
|
function(c)
|
||||||
c:kill()
|
c:kill()
|
||||||
end,
|
end,
|
||||||
{ description = "Close focused client", group = "Client" }
|
{ description = "Close focused client", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#42",
|
"#42",
|
||||||
awful.client.floating.toggle,
|
awful.client.floating.toggle,
|
||||||
{ description = "Toggle floating window", group = "Client" }
|
{ description = "Toggle floating window", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#58",
|
"#58",
|
||||||
function(c)
|
function(c)
|
||||||
c.maximized = not c.maximized
|
c.maximized = not c.maximized
|
||||||
c:raise()
|
c:raise()
|
||||||
end,
|
end,
|
||||||
{ description = "(un)maximize", group = "Client" }
|
{ description = "(un)maximize", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#57",
|
"#57",
|
||||||
function(c)
|
function(c)
|
||||||
if c == client.focus then
|
if c == client.focus then
|
||||||
c.minimized = true
|
c.minimized = true
|
||||||
else
|
else
|
||||||
c.minimized = false
|
c.minimized = false
|
||||||
if not c:isvisible() and c.first_tag then
|
if not c:isvisible() and c.first_tag then
|
||||||
c.first_tag:view_only()
|
c.first_tag:view_only()
|
||||||
end
|
end
|
||||||
c:emit_signal('request::activate')
|
c:emit_signal('request::activate')
|
||||||
c:raise()
|
c:raise()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
{ description = "(un)hide", group = "Client" }
|
{ description = "(un)hide", group = "Client" }
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ local gears = require("gears")
|
|||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
|
|
||||||
root.buttons = gears.table.join(
|
root.buttons = gears.table.join(
|
||||||
awful.button({}, 4, awful.tag.viewnext),
|
awful.button({}, 4, awful.tag.viewnext),
|
||||||
awful.button({}, 5, awful.tag.viewprev)
|
awful.button({}, 5, awful.tag.viewprev)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -7,378 +7,375 @@ local ruled = require("ruled")
|
|||||||
local modkey = user_vars.modkey
|
local modkey = user_vars.modkey
|
||||||
|
|
||||||
return gears.table.join(
|
return gears.table.join(
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#39",
|
"#39",
|
||||||
hotkeys_popup.show_help,
|
hotkeys_popup.show_help,
|
||||||
{ description = "Cheat sheet", group = "Awesome" }
|
{ description = "Cheat sheet", group = "Awesome" }
|
||||||
),
|
),
|
||||||
-- Tag browsing
|
-- Tag browsing
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#113",
|
"#113",
|
||||||
awful.tag.viewprev,
|
awful.tag.viewprev,
|
||||||
{ description = "View previous tag", group = "Tag" }
|
{ description = "View previous tag", group = "Tag" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#114",
|
"#114",
|
||||||
awful.tag.viewnext,
|
awful.tag.viewnext,
|
||||||
{ description = "View next tag", group = "Tag" }
|
{ description = "View next tag", group = "Tag" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#66",
|
"#66",
|
||||||
awful.tag.history.restore,
|
awful.tag.history.restore,
|
||||||
{ description = "Go back to last tag", group = "Tag" }
|
{ description = "Go back to last tag", group = "Tag" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#44",
|
"#44",
|
||||||
function()
|
function()
|
||||||
awful.client.focus.byidx(1)
|
awful.client.focus.byidx(1)
|
||||||
end,
|
end,
|
||||||
{ description = "Focus next client by index", group = "Client" }
|
{ description = "Focus next client by index", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#45",
|
"#45",
|
||||||
function()
|
function()
|
||||||
awful.client.focus.byidx(-1)
|
awful.client.focus.byidx(-1)
|
||||||
end,
|
end,
|
||||||
{ description = "Focus previous client by index", group = "Client" }
|
{ description = "Focus previous client by index", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#25",
|
"#25",
|
||||||
function()
|
function()
|
||||||
user_vars.main_menu:show()
|
user_vars.main_menu:show()
|
||||||
end,
|
end,
|
||||||
{ description = "Show context menu", group = "Awesome" }
|
{ description = "Show context menu", group = "Awesome" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#44",
|
"#44",
|
||||||
function()
|
function()
|
||||||
awful.client.swap.byidx(1)
|
awful.client.swap.byidx(1)
|
||||||
end,
|
end,
|
||||||
{ description = "Swap with next client by index", group = "Client" }
|
{ description = "Swap with next client by index", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#45",
|
"#45",
|
||||||
function()
|
function()
|
||||||
awful.client.swap.byidx(-1)
|
awful.client.swap.byidx(-1)
|
||||||
end,
|
end,
|
||||||
{ description = "Swap with previous client by index", group = "Client" }
|
{ description = "Swap with previous client by index", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#44",
|
"#44",
|
||||||
function()
|
function()
|
||||||
awful.screen.focus_relative(1)
|
awful.screen.focus_relative(1)
|
||||||
end,
|
end,
|
||||||
{ description = "Focus the next screen", group = "Screen" }
|
{ description = "Focus the next screen", group = "Screen" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#45",
|
"#45",
|
||||||
function()
|
function()
|
||||||
awful.screen.focus_relative(-1)
|
awful.screen.focus_relative(-1)
|
||||||
end,
|
end,
|
||||||
{ description = "Focus the previous screen", group = "Screen" }
|
{ description = "Focus the previous screen", group = "Screen" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#30",
|
"#30",
|
||||||
awful.client.urgent.jumpto,
|
awful.client.urgent.jumpto,
|
||||||
{ description = "Jump to urgent client", group = "Client" }
|
{ description = "Jump to urgent client", group = "Client" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#36",
|
"#36",
|
||||||
function()
|
function()
|
||||||
awful.spawn(user_vars.terminal)
|
awful.spawn(user_vars.terminal)
|
||||||
end,
|
end,
|
||||||
{ description = "Open terminal", group = "Applications" }
|
{ description = "Open terminal", group = "Applications" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#27",
|
"#27",
|
||||||
awesome.restart,
|
awesome.restart,
|
||||||
{ description = "Reload awesome", group = "Awesome" }
|
{ description = "Reload awesome", group = "Awesome" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#46",
|
"#46",
|
||||||
function()
|
function()
|
||||||
awful.tag.incmwfact(0.05)
|
awful.tag.incmwfact(0.05)
|
||||||
end,
|
end,
|
||||||
{ description = "Increase client width", group = "Layout" }
|
{ description = "Increase client width", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#43",
|
"#43",
|
||||||
function()
|
function()
|
||||||
awful.tag.incmwfact(-0.05)
|
awful.tag.incmwfact(-0.05)
|
||||||
end,
|
end,
|
||||||
{ description = "Decrease client width", group = "Layout" }
|
{ description = "Decrease client width", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#43",
|
"#43",
|
||||||
function()
|
function()
|
||||||
awful.tag.incncol(1, nil, true)
|
awful.tag.incncol(1, nil, true)
|
||||||
end,
|
end,
|
||||||
{ description = "Increase the number of columns", group = "Layout" }
|
{ description = "Increase the number of columns", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Control" },
|
{ modkey, "Control" },
|
||||||
"#46",
|
"#46",
|
||||||
function()
|
function()
|
||||||
awful.tag.incncol(-1, nil, true)
|
awful.tag.incncol(-1, nil, true)
|
||||||
end,
|
end,
|
||||||
{ description = "Decrease the number of columns", group = "Layout" }
|
{ description = "Decrease the number of columns", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#65",
|
"#65",
|
||||||
function()
|
function()
|
||||||
awful.layout.inc(-1)
|
awful.layout.inc(-1)
|
||||||
end,
|
end,
|
||||||
{ description = "Select previous layout", group = "Layout" }
|
{ description = "Select previous layout", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#36",
|
"#36",
|
||||||
function()
|
function()
|
||||||
awful.layout.inc(1)
|
awful.layout.inc(1)
|
||||||
end,
|
end,
|
||||||
{ description = "Select next layout", group = "Layout" }
|
{ description = "Select next layout", group = "Layout" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#40",
|
"#40",
|
||||||
function()
|
function()
|
||||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||||
end,
|
end,
|
||||||
{ descripton = "Application launcher", group = "Application" }
|
{ descripton = "Application launcher", group = "Application" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#23",
|
"#23",
|
||||||
function()
|
function()
|
||||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||||
end,
|
end,
|
||||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ "Mod1" },
|
{ "Mod1" },
|
||||||
"#23",
|
"#23",
|
||||||
function()
|
function()
|
||||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||||
end,
|
end,
|
||||||
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
{ descripton = "Client switcher (alt+tab)", group = "Application" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#26",
|
"#26",
|
||||||
function()
|
function()
|
||||||
awful.spawn(user_vars.file_manager)
|
awful.spawn(user_vars.file_manager)
|
||||||
end,
|
end,
|
||||||
{ descripton = "Open file manager", group = "System" }
|
{ descripton = "Open file manager", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey, "Shift" },
|
{ modkey, "Shift" },
|
||||||
"#26",
|
"#26",
|
||||||
function()
|
function()
|
||||||
awesome.emit_signal("module::powermenu:show")
|
awesome.emit_signal("module::powermenu:show")
|
||||||
end,
|
end,
|
||||||
{ descripton = "Session options", group = "System" }
|
{ descripton = "Session options", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"#107",
|
"#107",
|
||||||
function()
|
function()
|
||||||
awful.spawn(user_vars.screenshot_program)
|
awful.spawn(user_vars.screenshot_program)
|
||||||
end,
|
end,
|
||||||
{ description = "Screenshot", group = "Applications" }
|
{ description = "Screenshot", group = "Applications" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"XF86AudioLowerVolume",
|
"XF86AudioLowerVolume",
|
||||||
function(c)
|
function(c)
|
||||||
awful.spawn.easy_async_with_shell("pactl set-sink-volume @DEFAULT_SINK@ -2%", function()
|
awful.spawn.easy_async_with_shell("pactl set-sink-volume @DEFAULT_SINK@ -2%", function()
|
||||||
awesome.emit_signal("widget::volume")
|
awesome.emit_signal("module::volume_osd:show", true)
|
||||||
awesome.emit_signal("module::volume_osd:show", true)
|
awesome.emit_signal("module::slider:update")
|
||||||
awesome.emit_signal("module::slider:update")
|
awesome.emit_signal("widget::volume_osd:rerun")
|
||||||
awesome.emit_signal("widget::volume_osd:rerun")
|
end)
|
||||||
end)
|
end,
|
||||||
end,
|
{ description = "Lower volume", group = "System" }
|
||||||
{ description = "Lower volume", group = "System" }
|
),
|
||||||
),
|
awful.key(
|
||||||
awful.key(
|
{},
|
||||||
{},
|
"XF86AudioRaiseVolume",
|
||||||
"XF86AudioRaiseVolume",
|
function(c)
|
||||||
function(c)
|
awful.spawn.easy_async_with_shell("pactl set-sink-volume @DEFAULT_SINK@ +2%", function()
|
||||||
awful.spawn.easy_async_with_shell("pactl set-sink-volume @DEFAULT_SINK@ +2%", function()
|
awesome.emit_signal("module::volume_osd:show", true)
|
||||||
awesome.emit_signal("widget::volume")
|
awesome.emit_signal("module::slider:update")
|
||||||
awesome.emit_signal("module::volume_osd:show", true)
|
awesome.emit_signal("widget::volume_osd:rerun")
|
||||||
awesome.emit_signal("module::slider:update")
|
end)
|
||||||
awesome.emit_signal("widget::volume_osd:rerun")
|
end,
|
||||||
end)
|
{ description = "Increase volume", group = "System" }
|
||||||
end,
|
),
|
||||||
{ description = "Increase volume", group = "System" }
|
awful.key(
|
||||||
),
|
{},
|
||||||
awful.key(
|
"XF86AudioMute",
|
||||||
{},
|
function(c)
|
||||||
"XF86AudioMute",
|
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||||
function(c)
|
awesome.emit_signal("module::volume_osd:show", true)
|
||||||
awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
awesome.emit_signal("module::slider:update")
|
||||||
awesome.emit_signal("widget::volume")
|
awesome.emit_signal("widget::volume_osd:rerun")
|
||||||
awesome.emit_signal("module::volume_osd:show", true)
|
end,
|
||||||
awesome.emit_signal("module::slider:update")
|
{ description = "Mute volume", group = "System" }
|
||||||
awesome.emit_signal("widget::volume_osd:rerun")
|
),
|
||||||
end,
|
awful.key(
|
||||||
{ description = "Mute volume", group = "System" }
|
{},
|
||||||
),
|
"XF86MonBrightnessUp",
|
||||||
awful.key(
|
function(c)
|
||||||
{},
|
--awful.spawn("xbacklight -time 100 -inc 10%+")
|
||||||
"XF86MonBrightnessUp",
|
awful.spawn.easy_async_with_shell(
|
||||||
function(c)
|
"pkexec xfpm-power-backlight-helper --get-brightness",
|
||||||
--awful.spawn("xbacklight -time 100 -inc 10%+")
|
function(stdout)
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell("pkexec xfpm-power-backlight-helper --set-brightness " .. tostring(tonumber(stdout) + BACKLIGHT_SEPS), function(stdou2)
|
||||||
"pkexec xfpm-power-backlight-helper --get-brightness",
|
|
||||||
function(stdout)
|
|
||||||
awful.spawn.easy_async_with_shell("pkexec xfpm-power-backlight-helper --set-brightness " .. tostring(tonumber(stdout) + BACKLIGHT_SEPS), function(stdou2)
|
|
||||||
|
|
||||||
end)
|
end)
|
||||||
awesome.emit_signal("module::brightness_osd:show", true)
|
awesome.emit_signal("module::brightness_osd:show", true)
|
||||||
awesome.emit_signal("module::brightness_slider:update")
|
awesome.emit_signal("module::brightness_slider:update")
|
||||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
{ description = "Raise backlight brightness", group = "System" }
|
{ description = "Raise backlight brightness", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"XF86MonBrightnessDown",
|
"XF86MonBrightnessDown",
|
||||||
function(c)
|
function(c)
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
"pkexec xfpm-power-backlight-helper --get-brightness",
|
"pkexec xfpm-power-backlight-helper --get-brightness",
|
||||||
function(stdout)
|
function(stdout)
|
||||||
awful.spawn.easy_async_with_shell("pkexec xfpm-power-backlight-helper --set-brightness " .. tostring(tonumber(stdout) - BACKLIGHT_SEPS), function(stdout2)
|
awful.spawn.easy_async_with_shell("pkexec xfpm-power-backlight-helper --set-brightness " .. tostring(tonumber(stdout) - BACKLIGHT_SEPS), function(stdout2)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
awesome.emit_signal("module::brightness_osd:show", true)
|
awesome.emit_signal("module::brightness_osd:show", true)
|
||||||
awesome.emit_signal("module::brightness_slider:update")
|
awesome.emit_signal("module::brightness_slider:update")
|
||||||
awesome.emit_signal("widget::brightness_osd:rerun")
|
awesome.emit_signal("widget::brightness_osd:rerun")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end,
|
end,
|
||||||
{ description = "Lower backlight brightness", group = "System" }
|
{ description = "Lower backlight brightness", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"XF86AudioPlay",
|
"XF86AudioPlay",
|
||||||
function(c)
|
function(c)
|
||||||
awful.spawn("playerctl play-pause")
|
awful.spawn("playerctl play-pause")
|
||||||
end,
|
end,
|
||||||
{ description = "Play / Pause audio", group = "System" }
|
{ description = "Play / Pause audio", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"XF86AudioNext",
|
"XF86AudioNext",
|
||||||
function(c)
|
function(c)
|
||||||
awful.spawn("playerctl next")
|
awful.spawn("playerctl next")
|
||||||
end,
|
end,
|
||||||
{ description = "Play / Pause audio", group = "System" }
|
{ description = "Play / Pause audio", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{},
|
{},
|
||||||
"XF86AudioPrev",
|
"XF86AudioPrev",
|
||||||
function(c)
|
function(c)
|
||||||
awful.spawn("playerctl previous")
|
awful.spawn("playerctl previous")
|
||||||
end,
|
end,
|
||||||
{ description = "Play / Pause audio", group = "System" }
|
{ description = "Play / Pause audio", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#65",
|
"#65",
|
||||||
function()
|
function()
|
||||||
awesome.emit_signal("kblayout::toggle")
|
awesome.emit_signal("kblayout::toggle")
|
||||||
end,
|
end,
|
||||||
{ description = "Toggle keyboard layout", group = "System" }
|
{ description = "Toggle keyboard layout", group = "System" }
|
||||||
),
|
),
|
||||||
awful.key(
|
awful.key(
|
||||||
{ modkey },
|
{ modkey },
|
||||||
"#22",
|
"#22",
|
||||||
function()
|
function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
[[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']],
|
[[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']],
|
||||||
function(stdout)
|
function(stdout)
|
||||||
if stdout then
|
if stdout then
|
||||||
ruled.client.append_rule {
|
ruled.client.append_rule {
|
||||||
rule = { class = stdout:gsub("\n", "") },
|
rule = { class = stdout:gsub("\n", "") },
|
||||||
properties = {
|
properties = {
|
||||||
floating = true
|
floating = true
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
"cat ~/.config/awesome/src/assets/rules.txt",
|
"cat ~/.config/awesome/src/assets/rules.txt",
|
||||||
function(stdout2)
|
function(stdout2)
|
||||||
for class in stdout2:gmatch("%a+") do
|
for class in stdout2:gmatch("%a+") do
|
||||||
if class:match(stdout:gsub("\n", "")) then
|
if class:match(stdout:gsub("\n", "")) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
awful.spawn.with_shell("echo -n '" .. stdout:gsub("\n", "") .. ";' >> ~/.config/awesome/src/assets/rules.txt")
|
awful.spawn.with_shell("echo -n '" .. stdout:gsub("\n", "") .. ";' >> ~/.config/awesome/src/assets/rules.txt")
|
||||||
local c = mouse.screen.selected_tag:clients()
|
local c = mouse.screen.selected_tag:clients()
|
||||||
for j, client in ipairs(c) do
|
for j, client in ipairs(c) do
|
||||||
if client.class:match(stdout:gsub("\n", "")) then
|
if client.class:match(stdout:gsub("\n", "")) then
|
||||||
client.floating = true
|
client.floating = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
),
|
)
|
||||||
awful.key(
|
end
|
||||||
{ modkey, "Shift" },
|
end
|
||||||
"#22",
|
)
|
||||||
function()
|
end
|
||||||
awful.spawn.easy_async_with_shell(
|
),
|
||||||
[[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']],
|
awful.key(
|
||||||
function(stdout)
|
{ modkey, "Shift" },
|
||||||
if stdout then
|
"#22",
|
||||||
ruled.client.append_rule {
|
function()
|
||||||
rule = { class = stdout:gsub("\n", "") },
|
awful.spawn.easy_async_with_shell(
|
||||||
properties = {
|
[[xprop | grep WM_CLASS | awk '{gsub(/"/, "", $4); print $4}']],
|
||||||
floating = false
|
function(stdout)
|
||||||
},
|
if stdout then
|
||||||
}
|
ruled.client.append_rule {
|
||||||
awful.spawn.easy_async_with_shell(
|
rule = { class = stdout:gsub("\n", "") },
|
||||||
[[
|
properties = {
|
||||||
|
floating = false
|
||||||
|
},
|
||||||
|
}
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[
|
||||||
REMOVE="]] .. stdout:gsub("\n", "") .. [[;"
|
REMOVE="]] .. stdout:gsub("\n", "") .. [[;"
|
||||||
STR=$(cat ~/.config/awesome/src/assets/rules.txt)
|
STR=$(cat ~/.config/awesome/src/assets/rules.txt)
|
||||||
echo -n ${STR//$REMOVE/} > ~/.config/awesome/src/assets/rules.txt
|
echo -n ${STR//$REMOVE/} > ~/.config/awesome/src/assets/rules.txt
|
||||||
]],
|
]],
|
||||||
function(stdout2)
|
function(stdout2)
|
||||||
local c = mouse.screen.selected_tag:clients()
|
local c = mouse.screen.selected_tag:clients()
|
||||||
for j, client in ipairs(c) do
|
for j, client in ipairs(c) do
|
||||||
if client.class:match(stdout:gsub("\n", "")) then
|
if client.class:match(stdout:gsub("\n", "")) then
|
||||||
client.floating = false
|
client.floating = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,9 +10,10 @@
|
|||||||
require("src.theme.user_variables")
|
require("src.theme.user_variables")
|
||||||
require("src.theme.init")
|
require("src.theme.init")
|
||||||
require("src.core.error_handling")
|
require("src.core.error_handling")
|
||||||
require("src.core.rules")
|
|
||||||
require("src.core.signals")
|
require("src.core.signals")
|
||||||
|
require("src.core.notifications")
|
||||||
|
require("src.core.rules")
|
||||||
require("mappings.global_buttons")
|
require("mappings.global_buttons")
|
||||||
require("mappings.bind_to_tags")
|
require("mappings.bind_to_tags")
|
||||||
require("crylia_bar.init")
|
require("crylia_bar.init")
|
||||||
--require("src.tools.auto_starter")(user_vars.autostart)
|
require("src.tools.auto_starter")(user_vars.autostart)
|
||||||
|
|||||||
1
awesome/src/assets/icons/notifications/play-pause.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M3,5V19L11,12M13,19H16V5H13M18,5V19H21V5" /></svg>
|
||||||
|
After Width: | Height: | Size: 335 B |
1
awesome/src/assets/icons/notifications/skip-next.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M16,18H18V6H16M6,18L14.5,12L6,6V18Z" /></svg>
|
||||||
|
After Width: | Height: | Size: 330 B |
1
awesome/src/assets/icons/notifications/skip-prev.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z" /></svg>
|
||||||
|
After Width: | Height: | Size: 332 B |
14
awesome/src/assets/layout/cornerne.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g transform="rotate(90, 130, 130)" id="svg_11">
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="20" width="60" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="100" width="60" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="180" width="60" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="140" height="140" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="60" height="60" id="svg_9" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="100" y="180" width="60" height="60" id="svg_10" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 874 B |
12
awesome/src/assets/layout/cornernw.svg
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="20" width="60" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="100" width="60" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="180" width="60" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="140" height="140" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="60" height="60" id="svg_9" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="100" y="180" width="60" height="60" id="svg_10" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 810 B |
14
awesome/src/assets/layout/cornerse.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g transform="rotate(180, 130, 130)" id="svg_11">
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="20" width="60" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="100" width="60" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="180" width="60" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="140" height="140" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="60" height="60" id="svg_9" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="100" y="180" width="60" height="60" id="svg_10" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 875 B |
14
awesome/src/assets/layout/cornersw.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g transform="rotate(-90, 130, 130)" id="svg_11">
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="20" width="60" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="100" width="60" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="180" y="180" width="60" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="140" height="140" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="60" height="60" id="svg_9" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="100" y="180" width="60" height="60" id="svg_10" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 875 B |
14
awesome/src/assets/layout/fairh.svg
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g transform="rotate(90, 130, 130)" id="svg_8">
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="20" width="100" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="100" width="100" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="180" width="100" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="100" height="60" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="100" width="100" height="60" id="svg_6" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="100" height="60" id="svg_7" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 875 B |
12
awesome/src/assets/layout/fairv.svg
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="20" width="100" height="60" id="svg_2" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="100" width="100" height="60" id="svg_3" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="139.67742" y="180" width="100" height="60" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="100" height="60" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="100" width="100" height="60" id="svg_6" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="180" width="100" height="60" id="svg_7" rx="12" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 818 B |
@@ -1,64 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<rect stroke-opacity="0" fill="#212121" stroke="#ffffff" x="60" y="200" width="180" height="40" id="svg_4" rx="12" stroke-width="0"/>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="160" height="160" id="svg_5" rx="12" stroke-width="0"/>
|
||||||
|
<rect stroke-opacity="0" fill="#212121" stroke="#ffffff" x="200" y="60" width="40" height="180" id="svg_15" rx="12" stroke-width="0"/>
|
||||||
|
<rect stroke-opacity="0" fill="#212121" stroke="#ffffff" x="200" y="60" width="20" height="160" id="svg_16" stroke-width="0"/>
|
||||||
|
<rect stroke-opacity="0" fill="#212121" stroke="#ffffff" x="60" y="200" width="160" height="20" id="svg_17" stroke-width="0"/>
|
||||||
|
<rect stroke-opacity="0" fill="#212121" stroke="#ffffff" x="160" y="160" width="20" height="20" id="svg_20" stroke-width="0"/>
|
||||||
|
</g>
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
version="1.1"
|
|
||||||
id="svg2"
|
|
||||||
width="240"
|
|
||||||
height="240"
|
|
||||||
viewBox="0 0 240 240"
|
|
||||||
sodipodi:docname="floating.svg"
|
|
||||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
|
||||||
<metadata
|
|
||||||
id="metadata8">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<defs
|
|
||||||
id="defs6" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="1321"
|
|
||||||
inkscape:window-height="740"
|
|
||||||
id="namedview4"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:zoom="3.4570311"
|
|
||||||
inkscape:cx="-20.682487"
|
|
||||||
inkscape:cy="34.133335"
|
|
||||||
inkscape:window-x="45"
|
|
||||||
inkscape:window-y="28"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:current-layer="svg2" />
|
|
||||||
<image
|
|
||||||
width="200"
|
|
||||||
height="200"
|
|
||||||
preserveAspectRatio="none"
|
|
||||||
style="image-rendering:optimizeQuality"
|
|
||||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAC63pUWHRSYXcgcHJvZmlsZSB0eXBl IGV4aWYAAHja7ZdtktwoDIb/c4ocAUkIieNgPqpygz1+XrDd0z2Z3SS1+2er2pQBC1nI7wP0TBh/ fZ/hGy4qmUNS81xyjrhSSYUrOh7Pq+yaYtr1vtI1hOcXe3gMMEyCVs5Hq5d/hV0/XrjnoOPVHvwa Yb8CXQN3QFkzMzr9OUnY+bTTlUko4+zk4vac6sFn2+6U/eOed1p2Nus5PBuSQaWumEiYh5DEXfuZ gZx3xS27ZvhFMfSTWEBDcn8SBHn5vLuN8VmgF5HvXvis/qP3SXyul10+aZkvjdD5coD0a/G3xE8T yyMjfh0wuUN9IfLsPuc4v66mDEXztaK22HSHgeMByWW/llEMt6JvuxQUjzU2IO+xxQOlUSEGlRko UadKk8ZuGzWkmHiwoWVuLNvmYly4gRKBEQpNNinSxcGy8QhAmYQfudCet+z5Gjlm7gRXJgQjvPK3 JfzT4J+UMGdbElH0h1bIi9e6RhqL3KrhBSA0L266Bb7LhT8+rZ+1VBPclsyOD6zxOEMcSh9rSzZn gZ+iPbcQBetXAEiEuRXJkIBAzCRKmaIxGxF0dACqyJwl8QECpModSXISwXlk7LzmxjtG25eVMy8z ziaAUMnYTw5CFbBSUqwfS441VFU0qWpWUw9atGbJKWvO2fI65KqJJVPLZuZWrLp4cvXs5u7Fa+Ei OAO15GLFSym1cqiYqCJWhX+F5eBDjnTokQ87/ChHbVg+LTVtuVnzVlrt3KXjmOi5W/deeh0UBk6K kYaOPGz4KKNOrLUpM02dedr0WWZ9ULuo/lT+gBpd1HiTWn72oAZrMLtD0DpOdDEDMU4E4rYIYEHz YhadUuJFbjGLhbEplJGkLjah0yIGhGkQ66QHuw9yv8UtqP8WN/4VubDQ/RfkAtD9zO0Lan39zrVN 7NyFS9Mo2H3wqewBd4yo/m37DvQO9A70DvQO9A70DvT/DyQTfzzgn9jwA1+gnbQtmhjxAAABhWlD Q1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw1AUhU9TRZGKgwVFHDJUJyuioo5ahSJUCLVCqw4mL/2DJg1J iouj4Fpw8Gex6uDirKuDqyAI/oA4OTopukiJ9yWFFjFeeLyP8+45vHcfINRKTLPaxgBNt81kPCam M6tixyuCCKAPo5iWmWXMSVICvvV1T71Ud1Ge5d/3Z3WrWYsBAZF4lhmmTbxBPLVpG5z3icOsIKvE 58QjJl2Q+JHrisdvnPMuCzwzbKaS88RhYjHfwkoLs4KpEU8SR1RNp3wh7bHKeYuzVqqwxj35C0NZ fWWZ67QGEcciliBBhIIKiijBRpR2nRQLSTqP+fgHXL9ELoVcRTByLKAMDbLrB/+D37O1chPjXlIo BrS/OM7HENCxC9SrjvN97Dj1EyD4DFzpTX+5Bsx8kl5tapEjoGcbuLhuasoecLkD9D8Zsim7UpCW kMsB72f0TRmg9xboWvPm1jjH6QOQolklboCDQ2A4T9nrPu/ubJ3bvz2N+f0AqXVyvRuPd5MAAAAG YktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfkAwEXLw3L2R+kAAAA 1UlEQVR42u3bWwqDMBBG4ZPSZdQuqF1I19T1jftIX3yLFMReEucM+KYwfJI/MNFSayVznUheAgjQ 1h2Ygdr5FcBtL0BZCcEALoO8wACunwYYbVsoZoAAAggggAACCCCAAAIIIIAAAggggAACCCCAAAII IEBSgE1niUc8GnvXf3OWmA2gud8MEECApuaB+o9vADwGQYil130JesDvBN0FMofglBlgAp5bHzr/ YQ26BAQQQAABBBBAAAEEEEAAAY4I0PM4LX4B0OtMcXWGWPx32AwQIHW9ADONWkwCJwxXAAAAAElF TkSuQmCC "
|
|
||||||
id="image10"
|
|
||||||
x="20"
|
|
||||||
y="20" />
|
|
||||||
</svg>
|
</svg>
|
||||||
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 886 B |
@@ -1,64 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<svg width="260" height="260" xmlns="http://www.w3.org/2000/svg">
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<rect fill="#212121" stroke="#424242" x="20" y="20" width="100" height="220" id="svg_1" rx="12" stroke-width="0" />
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="20" width="100" height="100" id="svg_2" rx="12" stroke-width="0" />
|
||||||
|
<rect fill="#212121" stroke="#424242" x="140" y="140" width="100" height="100" id="svg_3" rx="12" stroke-width="0" />
|
||||||
|
</g>
|
||||||
|
|
||||||
<svg
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:cc="http://creativecommons.org/ns#"
|
|
||||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
||||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
||||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
||||||
version="1.1"
|
|
||||||
id="svg2"
|
|
||||||
width="240"
|
|
||||||
height="240"
|
|
||||||
viewBox="0 0 240 240"
|
|
||||||
sodipodi:docname="tile.svg"
|
|
||||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
|
||||||
<metadata
|
|
||||||
id="metadata8">
|
|
||||||
<rdf:RDF>
|
|
||||||
<cc:Work
|
|
||||||
rdf:about="">
|
|
||||||
<dc:format>image/svg+xml</dc:format>
|
|
||||||
<dc:type
|
|
||||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
||||||
<dc:title></dc:title>
|
|
||||||
</cc:Work>
|
|
||||||
</rdf:RDF>
|
|
||||||
</metadata>
|
|
||||||
<defs
|
|
||||||
id="defs6" />
|
|
||||||
<sodipodi:namedview
|
|
||||||
pagecolor="#ffffff"
|
|
||||||
bordercolor="#666666"
|
|
||||||
borderopacity="1"
|
|
||||||
objecttolerance="10"
|
|
||||||
gridtolerance="10"
|
|
||||||
guidetolerance="10"
|
|
||||||
inkscape:pageopacity="0"
|
|
||||||
inkscape:pageshadow="2"
|
|
||||||
inkscape:window-width="1321"
|
|
||||||
inkscape:window-height="740"
|
|
||||||
id="namedview4"
|
|
||||||
showgrid="false"
|
|
||||||
inkscape:pagecheckerboard="true"
|
|
||||||
inkscape:zoom="3.4570311"
|
|
||||||
inkscape:cx="113.41698"
|
|
||||||
inkscape:cy="20.959299"
|
|
||||||
inkscape:window-x="45"
|
|
||||||
inkscape:window-y="28"
|
|
||||||
inkscape:window-maximized="0"
|
|
||||||
inkscape:current-layer="svg2" />
|
|
||||||
<image
|
|
||||||
width="200"
|
|
||||||
height="200"
|
|
||||||
preserveAspectRatio="none"
|
|
||||||
style="image-rendering:optimizeQuality"
|
|
||||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAC63pUWHRSYXcgcHJvZmlsZSB0eXBl IGV4aWYAAHja7ZdtktwoDIb/c4ocAUkIieNgPqpygz1+XrDd0z2Z3SS1+2er2pQBC1nI7wP0TBh/ fZ/hGy4qmUNS81xyjrhSSYUrOh7Pq+yaYtr1vtI1hOcXe3gMMEyCVs5Hq5d/hV0/XrjnoOPVHvwa Yb8CXQN3QFkzMzr9OUnY+bTTlUko4+zk4vac6sFn2+6U/eOed1p2Nus5PBuSQaWumEiYh5DEXfuZ gZx3xS27ZvhFMfSTSEDD25VOQV4+725jfBboReS7Fz6r/+h9Ep/rZZdPWuZLI3S+HCD9Wvwt8dPE 8siIXwdM7lBfiDy7zznOr6spQ9F8ragtNt1h4HhActmvZRTDrejbLgXFY40NyHts8UBpVIhBZQZK 1KnSpLHbRg0pJh5saJkby7a5GBduoERghEKTTYp0ccBqPAJQJuFHLrTnLXu+Ro6ZO8GVCcEIr/xt Cf80+CclzNmWRBT9oRXy4rWukcYit2p4AQjNi5tuge9y4Y9P62ct1QS3JbPjA2s8zhCH0sfaks1Z 4Kdozy1EwfoVABJhbkUyJCAQM4lSpmjMRgQdHYAqMmdJfIAAqXJHkowNgvPI2HnNjXeMti8rZ15m nE0AoZKxnxyEKmClpFg/lhxrqKpoUtWsph60aM2SU9acs+V1yFUTS6aWzcytWHXx5OrZzd2L18JF cAZqycWKl1Jq5VAxUUWsCv8Ky8GHHOnQIx92+FGO2rB8WmracrPmrbTauUvHMdFzt+699DooDJwU Iw0dedjwUUadWGtTZpo687Tps8z6oHZR/an8ATW6qPEmtfzsQQ3WYHaHoHWc6GIGYpwIxG0RwILm xSw6pcSL3GIWC2NTKCNJXWxCp0UMCNMg1kkPdh/kfotbUP8tbvwrcmGh+y/IBaD7mdsX1Pr6nWub 2LkLl6ZRsPvgU9kD7hhR/dv2Hegd6B3oHegd6B3oHej/H0gm/njAP7HhB3u4nbY7yMH4AAABhWlD Q1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw1AUhU9TtSIVBwuKOGSoLloQFXHUKhShQqgVWnUweemP0KQh SXFxFFwLDv4sVh1cnHV1cBUEwR8QJ0cnRRcp8b6k0CLGC4/3cd49h/fuA4RaiWlW2xig6baZSsTF THZFDL0iiAD6MIIOmVnGrCQl4Vtf99RLdRfjWf59f1a3mrMYEBCJZ5hh2sTrxFObtsF5nzjCirJK fE48atIFiR+5rnj8xrngssAzI2Y6NUccIRYLLay0MCuaGvEkcVTVdMoXMh6rnLc4a6UKa9yTvzCc 05eXuE5rEAksYBESRCioYAMl2IjRrpNiIUXncR//gOuXyKWQawOMHPMoQ4Ps+sH/4PdsrfzEuJcU jgPtL47zMQSEdoF61XG+jx2nfgIEn4Ervekv14DpT9KrTS16BPRsAxfXTU3ZAy53gP4nQzZlVwrS EvJ54P2MvikL9N4CXave3BrnOH0A0jSr5A1wcAgMFyh7zefdna1z+7enMb8fKAtyidNZ3ucAAAAG YktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfkAwEXKxzFBfpSAAAA pUlEQVR42u3bQQpAIQgFwIzuf+X+Cdp8KgzHZaDQQC4eFHPOVrl6K14AqgOMxfnfxRCvzesbh696 U8+zAwAAAAAAAAAAAAAAAADgUMXm3q3zxiXoyDrPEwBQvG7tgKcywSyXX/XKBO0AAAAAAAAAAAAA AAAAvAAgE2wyQTsAQNaSCSa+/KpXJmgHAAAAAAAAAAAAAAAA4ARA6gxv97zwd9gTAFC6PgsFG4ct jyRYAAAAAElFTkSuQmCC "
|
|
||||||
id="image10"
|
|
||||||
x="20"
|
|
||||||
y="20" />
|
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 477 B |
@@ -1 +1 @@
|
|||||||
Lutris;Steam;Io.elementary.appcenter;Repoman;Com.github.donadigo.eddy;Sysmontask;join?action=join&confno=9992624875&confid=dXRpZD1VVElEXzM0ODYxOTgyYzg0YzQ1Y2NiYmM0YWNiMzczODNiYjgxJnVzcz1TaU1YUnNEWG5BQWNBYnRpYklBNWE0MjRDNkpBMzMyVXRUc2pCX1YxVm5JY0hWeVRybGN5WjZZS2VBa1pvNkszOXdNWEVkVE9hTU54Z3BROFZFckhPR3Y4eGo0MlB0emNCZjNRLnNlM28yNy13YWpGYy1ReXEmdGlkPTcyNjEzNGRjYWJkZTQyYTNhNzJmZjVjYjVkNTU2YTYw&browser=join?action=join&confno=9992624875&confid=dXRpZD1VVElEXzM0ODYxOTgyYzg0YzQ1Y2NiYmM0YWNiMzczODNiYjgxJnVzcz1TaU1YUnNEWG5BQWNBYnRpYklBNWE0MjRDNkpBMzMyVXRUc2pCX1YxVm5JY0hWeVRybGN5WjZZS2VBa1pvNkszOXdNWEVkVE9hTU54Z3BROFZFckhPR3Y4eGo0MlB0emNCZjNRLnNlM28yNy13YWpGYy1ReXEmdGlkPTcyNjEzNGRjYWJkZTQyYTNhNzJmZjVjYjVkNTU2YTYw&browser=Gnome-calculator;Virt-manager;Gwe;
|
Lutris;Steam;Io.elementary.appcenter;Repoman;Com.github.donadigo.eddy;Sysmontask;join?action=join&confno=9992624875&confid=dXRpZD1VVElEXzM0ODYxOTgyYzg0YzQ1Y2NiYmM0YWNiMzczODNiYjgxJnVzcz1TaU1YUnNEWG5BQWNBYnRpYklBNWE0MjRDNkpBMzMyVXRUc2pCX1YxVm5JY0hWeVRybGN5WjZZS2VBa1pvNkszOXdNWEVkVE9hTU54Z3BROFZFckhPR3Y4eGo0MlB0emNCZjNRLnNlM28yNy13YWpGYy1ReXEmdGlkPTcyNjEzNGRjYWJkZTQyYTNhNzJmZjVjYjVkNTU2YTYw&browser=join?action=join&confno=9992624875&confid=dXRpZD1VVElEXzM0ODYxOTgyYzg0YzQ1Y2NiYmM0YWNiMzczODNiYjgxJnVzcz1TaU1YUnNEWG5BQWNBYnRpYklBNWE0MjRDNkpBMzMyVXRUc2pCX1YxVm5JY0hWeVRybGN5WjZZS2VBa1pvNkszOXdNWEVkVE9hTU54Z3BROFZFckhPR3Y4eGo0MlB0emNCZjNRLnNlM28yNy13YWpGYy1ReXEmdGlkPTcyNjEzNGRjYWJkZTQyYTNhNzJmZjVjYjVkNTU2YTYw&browser=Gnome-calculator;Virt-manager;Gwe;whatsdesk;Totem;
|
||||||
@@ -4,30 +4,22 @@
|
|||||||
-- Awesome Libs
|
-- Awesome Libs
|
||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
|
|
||||||
if awesome.startup_errors then
|
|
||||||
naughty.notify({
|
|
||||||
preset = naughty.config.presets.critical,
|
|
||||||
title = "! Not so Awesome ERROR !",
|
|
||||||
text = awesome.startup_errors
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
do
|
do
|
||||||
local in_error = false
|
local in_error = false
|
||||||
awesome.connect_signal(
|
awesome.connect_signal(
|
||||||
"debug::error",
|
"debug::error",
|
||||||
function(err)
|
function(err)
|
||||||
if in_error then
|
if in_error then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
in_error = true
|
in_error = true
|
||||||
|
|
||||||
naughty.notify({
|
naughty.notify({
|
||||||
preset = naughty.config.presets.critical,
|
preset = naughty.config.presets.critical,
|
||||||
title = "ERROR",
|
title = "ERROR",
|
||||||
text = tostring(err)
|
text = tostring(err)
|
||||||
})
|
})
|
||||||
in_error = false
|
in_error = false
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
396
awesome/src/core/notifications.lua
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
-------------------------------
|
||||||
|
-- The Notification defaults --
|
||||||
|
-------------------------------
|
||||||
|
|
||||||
|
-- Awesome Libs
|
||||||
|
local awful = require("awful")
|
||||||
|
local color = require("src.theme.colors")
|
||||||
|
local dpi = require("beautiful").xresources.apply_dpi
|
||||||
|
local gears = require("gears")
|
||||||
|
local menubar = require('menubar')
|
||||||
|
local naughty = require("naughty")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
|
||||||
|
local icondir = awful.util.getdir("config") .. "src/assets/icons/notifications/"
|
||||||
|
|
||||||
|
-- TODO: Figure out how to use hover effects without messing up the actions
|
||||||
|
|
||||||
|
naughty.config.defaults.ontop = true
|
||||||
|
naughty.config.defaults.icon_size = dpi(80)
|
||||||
|
naughty.config.defaults.timeout = 3
|
||||||
|
naughty.config.defaults.title = "System Notification"
|
||||||
|
naughty.config.defaults.margin = dpi(10)
|
||||||
|
naughty.config.defaults.position = "bottom_right"
|
||||||
|
naughty.config.defaults.shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, dpi(10))
|
||||||
|
end
|
||||||
|
naughty.config.defaults.border_width = dpi(4)
|
||||||
|
naughty.config.defaults.border_color = color["Grey800"]
|
||||||
|
naughty.config.defaults.spacing = dpi(10)
|
||||||
|
|
||||||
|
naughty.connect_signal(
|
||||||
|
'request::icon',
|
||||||
|
function(n, context, hints)
|
||||||
|
if context ~= 'app_icon' then return end
|
||||||
|
local path = menubar.utils.lookup_icon(hints.app_icon) or
|
||||||
|
menubar.utils.lookup_icon(hints.app_icon:lower())
|
||||||
|
if path then
|
||||||
|
n.icon = path
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
naughty.connect_signal(
|
||||||
|
"request::display",
|
||||||
|
function(n)
|
||||||
|
|
||||||
|
if n.urgency == "critical" then
|
||||||
|
n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>", color["RedA200"], n.title) or ""
|
||||||
|
n.message = string.format("<span foreground='%s'>%s</span>", color["Red200"], n.message) or ""
|
||||||
|
n.app_name = string.format("<span foreground='%s'>%s</span>", color["RedA400"], n.app_name) or ""
|
||||||
|
n.bg = color["Grey900"]
|
||||||
|
else
|
||||||
|
n.title = string.format("<span foreground='%s' font='JetBrainsMono Nerd Font, ExtraBold 16'>%s</span>", color["Pink200"], n.title) or ""
|
||||||
|
n.message = string.format("<span foreground='%s'>%s</span>", "#ffffffaa", n.message) or ""
|
||||||
|
n.bg = color["Grey900"]
|
||||||
|
n.timeout = n.timeout or 3
|
||||||
|
end
|
||||||
|
|
||||||
|
local use_image = false
|
||||||
|
|
||||||
|
if n.app_name == "Spotify" then
|
||||||
|
n.actions = {
|
||||||
|
naughty.action {
|
||||||
|
program = "Spotify",
|
||||||
|
id = "skip-prev",
|
||||||
|
icon = gears.color.recolor_image(icondir .. "skip-prev.svg", color["Cyan200"]),
|
||||||
|
},
|
||||||
|
naughty.action {
|
||||||
|
program = "Spotify",
|
||||||
|
id = "play-pause",
|
||||||
|
icon = gears.color.recolor_image(icondir .. "play-pause.svg", color["Cyan200"]),
|
||||||
|
},
|
||||||
|
naughty.action {
|
||||||
|
program = "Spotify",
|
||||||
|
id = "skip-next",
|
||||||
|
icon = gears.color.recolor_image(icondir .. "skip-next.svg", color["Cyan200"]),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
use_image = true
|
||||||
|
end
|
||||||
|
|
||||||
|
local action_template_widget = {}
|
||||||
|
|
||||||
|
if use_image then
|
||||||
|
action_template_widget = {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
id = "icon_role",
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
id = "centered",
|
||||||
|
valign = "center",
|
||||||
|
halign = "center",
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
forced_height = dpi(35),
|
||||||
|
forced_width = dpi(35),
|
||||||
|
fg = color["Cyan200"],
|
||||||
|
bg = color["Grey800"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, dpi(6))
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background,
|
||||||
|
id = "bgrnd"
|
||||||
|
},
|
||||||
|
id = "mrgn",
|
||||||
|
top = dpi(10),
|
||||||
|
bottom = dpi(10),
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
}
|
||||||
|
else
|
||||||
|
action_template_widget = {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
id = "text_role",
|
||||||
|
font = "JetBrainsMono Nerd Font, Regular 12",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "centered",
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
fg = color["Green200"],
|
||||||
|
bg = color["Grey800"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, dpi(6))
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background,
|
||||||
|
id = "bgrnd"
|
||||||
|
},
|
||||||
|
id = "mrgn",
|
||||||
|
top = dpi(10),
|
||||||
|
bottom = dpi(10),
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local actions_template = wibox.widget {
|
||||||
|
notification = n,
|
||||||
|
base_layout = wibox.widget {
|
||||||
|
spacing = dpi(40),
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
widget_template = action_template_widget,
|
||||||
|
style = {
|
||||||
|
underline_normal = false,
|
||||||
|
underline_selected = true,
|
||||||
|
bg_normal = color["Grey100"],
|
||||||
|
bg_selected = color["Grey200"]
|
||||||
|
},
|
||||||
|
widget = naughty.list.actions
|
||||||
|
}
|
||||||
|
|
||||||
|
local w_template = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
markup = n.app_name or 'System Notification',
|
||||||
|
align = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
fg = color["Teal200"],
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
margins = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
font = user_vars.font.specify .. ", 10",
|
||||||
|
text = "✕",
|
||||||
|
align = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
start_angle = 4.71239,
|
||||||
|
thickness = dpi(2),
|
||||||
|
min_value = 0,
|
||||||
|
max_value = 360,
|
||||||
|
value = 360,
|
||||||
|
widget = wibox.container.arcchart,
|
||||||
|
id = "arc_chart"
|
||||||
|
},
|
||||||
|
id = "background",
|
||||||
|
fg = color["Teal200"],
|
||||||
|
bg = color["Grey900"],
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
strategy = "exact",
|
||||||
|
width = dpi(20),
|
||||||
|
height = dpi(20),
|
||||||
|
widget = wibox.container.constraint,
|
||||||
|
id = "const"
|
||||||
|
},
|
||||||
|
margins = dpi(10),
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
id = "arc_margin"
|
||||||
|
},
|
||||||
|
id = "arc_app_layout",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
id = "arc_app_bg",
|
||||||
|
border_color = color["Grey800"],
|
||||||
|
border_width = dpi(2),
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
image = n.icon,
|
||||||
|
resize = true,
|
||||||
|
widget = wibox.widget.imagebox,
|
||||||
|
clip_shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 10)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
width = naughty.config.defaults.icon_size,
|
||||||
|
height = naughty.config.defaults.icon_size,
|
||||||
|
strategy = "exact",
|
||||||
|
widget = wibox.container.constraint
|
||||||
|
},
|
||||||
|
halign = "center",
|
||||||
|
valign = "top",
|
||||||
|
widget = wibox.container.place,
|
||||||
|
},
|
||||||
|
left = dpi(20),
|
||||||
|
bottom = dpi(15),
|
||||||
|
top = dpi(15),
|
||||||
|
right = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
widget = naughty.widget.title,
|
||||||
|
align = "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
widget = naughty.widget.message,
|
||||||
|
align = "left"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
actions_template,
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
layout = wibox.layout.fixed.vertical
|
||||||
|
},
|
||||||
|
left = dpi(10),
|
||||||
|
bottom = dpi(10),
|
||||||
|
top = dpi(10),
|
||||||
|
right = dpi(20),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "widget_layout",
|
||||||
|
layout = wibox.layout.fixed.vertical
|
||||||
|
},
|
||||||
|
id = "min_size",
|
||||||
|
strategy = "min",
|
||||||
|
width = dpi(100),
|
||||||
|
widget = wibox.container.constraint
|
||||||
|
},
|
||||||
|
id = "max_size",
|
||||||
|
strategy = "max",
|
||||||
|
width = Theme.notification_max_width or dpi(500),
|
||||||
|
widget = wibox.container.constraint,
|
||||||
|
},
|
||||||
|
id = "background",
|
||||||
|
bg = color["Grey900"],
|
||||||
|
border_color = color["Grey800"],
|
||||||
|
border_width = dpi(4),
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
|
local close = w_template.max_size.min_size.widget_layout.arc_app_bg.arc_app_layout.arc_margin.const.background
|
||||||
|
local arc = close.arc_chart
|
||||||
|
|
||||||
|
local timeout = n.timeout
|
||||||
|
local remove_time = timeout
|
||||||
|
|
||||||
|
if timeout ~= 0 then
|
||||||
|
arc.value = 360
|
||||||
|
gears.timer {
|
||||||
|
timeout = 0.1,
|
||||||
|
call_now = true,
|
||||||
|
autostart = true,
|
||||||
|
callback = function()
|
||||||
|
arc.value = (remove_time - 0) / (timeout - 0) * 360
|
||||||
|
remove_time = remove_time - 0.1
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
Hover_signal(close, color["Grey900"], color["Teal200"])
|
||||||
|
|
||||||
|
close:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
n:destroy()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
w_template:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function(c, d, e, key)
|
||||||
|
if key == 3 then
|
||||||
|
n:destroy()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local box = naughty.layout.box {
|
||||||
|
notification = n,
|
||||||
|
timeout = 3,
|
||||||
|
type = "notification",
|
||||||
|
screen = awful.screen.focused(),
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 10)
|
||||||
|
end,
|
||||||
|
widget_template = w_template
|
||||||
|
}
|
||||||
|
|
||||||
|
box.buttons = {}
|
||||||
|
n.buttons = {}
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
naughty.connect_signal(
|
||||||
|
"destroyed",
|
||||||
|
function()
|
||||||
|
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Test notification
|
||||||
|
--[[ naughty.notification {
|
||||||
|
app_name = "System Notification",
|
||||||
|
title = "A notification 2",
|
||||||
|
message = "This is very informative and overflowing",
|
||||||
|
icon = "/home/crylia/.config/awesome/src/assets/userpfp/crylia.png",
|
||||||
|
urgency = "normal",
|
||||||
|
timeout = 0,
|
||||||
|
actions = {
|
||||||
|
naughty.action {
|
||||||
|
name = "Accept",
|
||||||
|
},
|
||||||
|
naughty.action {
|
||||||
|
name = "Refuse",
|
||||||
|
},
|
||||||
|
naughty.action {
|
||||||
|
name = "Ignore",
|
||||||
|
},
|
||||||
|
}
|
||||||
|
} ]]
|
||||||
|
|
||||||
|
naughty.connect_signal(
|
||||||
|
"invoked",
|
||||||
|
function(_, action)
|
||||||
|
if action.program == "Spotify" then
|
||||||
|
if action.id == "skip-prev" then
|
||||||
|
awful.spawn("playerctl previous")
|
||||||
|
end
|
||||||
|
if action.id == "play-pause" then
|
||||||
|
awful.spawn("playerctl play-pause")
|
||||||
|
end
|
||||||
|
if action.id == "skip-next" then
|
||||||
|
awful.spawn("playerctl next")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
@@ -8,58 +8,58 @@ local beautiful = require("beautiful")
|
|||||||
local ruled = require("ruled")
|
local ruled = require("ruled")
|
||||||
|
|
||||||
awful.rules.rules = {
|
awful.rules.rules = {
|
||||||
{
|
{
|
||||||
rule = {},
|
rule = {},
|
||||||
properties = {
|
properties = {
|
||||||
border_width = beautiful.border_width,
|
border_width = beautiful.border_width,
|
||||||
border_color = beautiful.border_normal,
|
border_color = beautiful.border_normal,
|
||||||
focus = awful.client.focus.filter,
|
focus = awful.client.focus.filter,
|
||||||
raise = true,
|
raise = true,
|
||||||
keys = require("../../mappings/client_keys"),
|
keys = require("../../mappings/client_keys"),
|
||||||
buttons = require("../../mappings/client_buttons"),
|
buttons = require("../../mappings/client_buttons"),
|
||||||
screen = awful.screen.preferred,
|
screen = awful.screen.preferred,
|
||||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
placement = awful.placement.no_overlap + awful.placement.no_offscreen
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rule_any = {
|
|
||||||
instance = {},
|
|
||||||
class = {
|
|
||||||
"Arandr",
|
|
||||||
"Lxappearance",
|
|
||||||
"kdeconnect.app",
|
|
||||||
"zoom",
|
|
||||||
"file-roller",
|
|
||||||
"File-roller"
|
|
||||||
},
|
|
||||||
name = {},
|
|
||||||
role = {
|
|
||||||
"AlarmWindow",
|
|
||||||
"ConfigManager",
|
|
||||||
"pop-up"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
properties = { floating = true, titlebars_enabled = true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id = "titlebar",
|
|
||||||
rule_any = {
|
|
||||||
type = { "normal", "dialog", "modal", "utility" }
|
|
||||||
},
|
|
||||||
properties = { titlebars_enabled = true }
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
rule_any = {
|
||||||
|
instance = {},
|
||||||
|
class = {
|
||||||
|
"Arandr",
|
||||||
|
"Lxappearance",
|
||||||
|
"kdeconnect.app",
|
||||||
|
"zoom",
|
||||||
|
"file-roller",
|
||||||
|
"File-roller"
|
||||||
|
},
|
||||||
|
name = {},
|
||||||
|
role = {
|
||||||
|
"AlarmWindow",
|
||||||
|
"ConfigManager",
|
||||||
|
"pop-up"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
properties = { floating = true, titlebars_enabled = true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "titlebar",
|
||||||
|
rule_any = {
|
||||||
|
type = { "normal", "dialog", "modal", "utility" }
|
||||||
|
},
|
||||||
|
properties = { titlebars_enabled = true }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
"cat ~/.config/awesome/src/assets/rules.txt",
|
"cat ~/.config/awesome/src/assets/rules.txt",
|
||||||
function(stdout)
|
function(stdout)
|
||||||
for class in stdout:gmatch("%a+") do
|
for class in stdout:gmatch("%a+") do
|
||||||
ruled.client.append_rule {
|
ruled.client.append_rule {
|
||||||
rule = { class = class },
|
rule = { class = class },
|
||||||
properties = {
|
properties = {
|
||||||
floating = true
|
floating = true
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -4,155 +4,155 @@ local beautiful = require("beautiful")
|
|||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
|
|
||||||
screen.connect_signal(
|
screen.connect_signal(
|
||||||
"added",
|
"added",
|
||||||
function()
|
function()
|
||||||
awesome.restart()
|
awesome.restart()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
screen.connect_signal(
|
screen.connect_signal(
|
||||||
"removed",
|
"removed",
|
||||||
function()
|
function()
|
||||||
awesome.restart()
|
awesome.restart()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
"manage",
|
"manage",
|
||||||
function(c)
|
function(c)
|
||||||
if awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
|
if awesome.startup and not c.size_hints.user_porition and not c.size_hints.program_position then
|
||||||
awful.placement.no_offscreen(c)
|
awful.placement.no_offscreen(c)
|
||||||
end
|
end
|
||||||
c.shape = function(cr, width, height)
|
c.shape = function(cr, width, height)
|
||||||
if c.fullscreen or c.maximized then
|
if c.fullscreen or c.maximized then
|
||||||
gears.shape.rectangle(cr, width, height)
|
gears.shape.rectangle(cr, width, height)
|
||||||
else
|
else
|
||||||
gears.shape.rounded_rect(cr, width, height, 10)
|
gears.shape.rounded_rect(cr, width, height, 10)
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
'unmanage',
|
'unmanage',
|
||||||
function(c)
|
function(c)
|
||||||
if #awful.screen.focused().clients > 0 then
|
if #awful.screen.focused().clients > 0 then
|
||||||
awful.screen.focused().clients[1]:emit_signal(
|
awful.screen.focused().clients[1]:emit_signal(
|
||||||
'request::activate',
|
'request::activate',
|
||||||
'mouse_enter',
|
'mouse_enter',
|
||||||
{
|
{
|
||||||
raise = true
|
raise = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
'tag::switched',
|
'tag::switched',
|
||||||
function(c)
|
function(c)
|
||||||
if #awful.screen.focused().clients > 0 then
|
if #awful.screen.focused().clients > 0 then
|
||||||
awful.screen.focused().clients[1]:emit_signal(
|
awful.screen.focused().clients[1]:emit_signal(
|
||||||
'request::activate',
|
'request::activate',
|
||||||
'mouse_enter',
|
'mouse_enter',
|
||||||
{
|
{
|
||||||
raise = true
|
raise = true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
-- Sloppy focus
|
-- Sloppy focus
|
||||||
client.connect_signal("mouse::enter", function(c)
|
client.connect_signal("mouse::enter", function(c)
|
||||||
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
c:emit_signal("request::activate", "mouse_enter", { raise = false })
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Workaround for focused border color, why in the love of god doesnt it work with
|
-- Workaround for focused border color, why in the love of god doesnt it work with
|
||||||
-- beautiful.border_focus
|
-- beautiful.border_focus
|
||||||
client.connect_signal("focus", function(c)
|
client.connect_signal("focus", function(c)
|
||||||
c.border_color = "#616161"
|
c.border_color = "#616161"
|
||||||
end)
|
end)
|
||||||
|
|
||||||
client.connect_signal("unfocus", function(c)
|
client.connect_signal("unfocus", function(c)
|
||||||
c.border_color = beautiful.border_normal
|
c.border_color = beautiful.border_normal
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function Hover_signal(widget, bg, fg)
|
function Hover_signal(widget, bg, fg)
|
||||||
local old_wibox, old_cursor, old_bg, old_fg
|
local old_wibox, old_cursor, old_bg, old_fg
|
||||||
widget:connect_signal(
|
widget:connect_signal(
|
||||||
"mouse::enter",
|
"mouse::enter",
|
||||||
function()
|
function()
|
||||||
if bg then
|
if bg then
|
||||||
old_bg = widget.bg
|
old_bg = widget.bg
|
||||||
if string.len(bg) == 7 then
|
if string.len(bg) == 7 then
|
||||||
widget.bg = bg .. 'dd'
|
widget.bg = bg .. 'dd'
|
||||||
else
|
else
|
||||||
widget.bg = bg
|
widget.bg = bg
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if fg then
|
if fg then
|
||||||
old_fg = widget.fg
|
old_fg = widget.fg
|
||||||
widget.fg = fg
|
widget.fg = fg
|
||||||
end
|
end
|
||||||
local w = mouse.current_wibox
|
local w = mouse.current_wibox
|
||||||
if w then
|
if w then
|
||||||
old_cursor, old_wibox = w.cursor, w
|
old_cursor, old_wibox = w.cursor, w
|
||||||
w.cursor = "hand1"
|
w.cursor = "hand1"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
widget:connect_signal(
|
widget:connect_signal(
|
||||||
"button::press",
|
"button::press",
|
||||||
function()
|
function()
|
||||||
if bg then
|
if bg then
|
||||||
if bg then
|
if bg then
|
||||||
if string.len(bg) == 7 then
|
if string.len(bg) == 7 then
|
||||||
widget.bg = bg .. 'bb'
|
widget.bg = bg .. 'bb'
|
||||||
else
|
else
|
||||||
widget.bg = bg
|
widget.bg = bg
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if fg then
|
|
||||||
widget.fg = fg
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
)
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
widget.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
widget:connect_signal(
|
widget:connect_signal(
|
||||||
"button::release",
|
"button::release",
|
||||||
function()
|
function()
|
||||||
if bg then
|
if bg then
|
||||||
if bg then
|
if bg then
|
||||||
if string.len(bg) == 7 then
|
if string.len(bg) == 7 then
|
||||||
widget.bg = bg .. 'dd'
|
widget.bg = bg .. 'dd'
|
||||||
else
|
else
|
||||||
widget.bg = bg
|
widget.bg = bg
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if fg then
|
|
||||||
widget.fg = fg
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
)
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
widget.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
widget:connect_signal(
|
widget:connect_signal(
|
||||||
"mouse::leave",
|
"mouse::leave",
|
||||||
function()
|
function()
|
||||||
if bg then
|
if bg then
|
||||||
widget.bg = old_bg
|
widget.bg = old_bg
|
||||||
end
|
end
|
||||||
if fg then
|
if fg then
|
||||||
widget.fg = old_fg
|
widget.fg = old_fg
|
||||||
end
|
end
|
||||||
if old_wibox then
|
if old_wibox then
|
||||||
old_wibox.cursor = old_cursor
|
old_wibox.cursor = old_cursor
|
||||||
old_wibox = nil
|
old_wibox = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,222 +15,220 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/brightness/"
|
|||||||
BACKLIGHT_MAX_BRIGHTNESS = 0
|
BACKLIGHT_MAX_BRIGHTNESS = 0
|
||||||
BACKLIGHT_SEPS = 0
|
BACKLIGHT_SEPS = 0
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
"pkexec xfpm-power-backlight-helper --get-max-brightness",
|
"pkexec xfpm-power-backlight-helper --get-max-brightness",
|
||||||
function(stdout)
|
function(stdout)
|
||||||
BACKLIGHT_MAX_BRIGHTNESS = tonumber(stdout)
|
BACKLIGHT_MAX_BRIGHTNESS = tonumber(stdout)
|
||||||
BACKLIGHT_SEPS = BACKLIGHT_MAX_BRIGHTNESS / 100
|
BACKLIGHT_SEPS = BACKLIGHT_MAX_BRIGHTNESS / 100
|
||||||
BACKLIGHT_SEPS = math.floor(BACKLIGHT_SEPS)
|
BACKLIGHT_SEPS = math.floor(BACKLIGHT_SEPS)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
return function(s)
|
return function(s)
|
||||||
|
|
||||||
local brightness_osd_widget = wibox.widget {
|
local brightness_osd_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
nil,
|
||||||
{
|
{
|
||||||
{
|
nil,
|
||||||
{
|
{
|
||||||
nil,
|
id = "icon",
|
||||||
{
|
forced_height = dpi(220),
|
||||||
nil,
|
image = icondir .. "brightness-high.svg",
|
||||||
{
|
widget = wibox.widget.imagebox
|
||||||
id = "icon",
|
},
|
||||||
forced_height = dpi(220),
|
nil,
|
||||||
image = icondir .. "brightness-high.svg",
|
expand = "none",
|
||||||
widget = wibox.widget.imagebox
|
id = "icon_margin2",
|
||||||
},
|
layout = wibox.layout.align.vertical
|
||||||
nil,
|
|
||||||
expand = "none",
|
|
||||||
id = "icon_margin2",
|
|
||||||
layout = wibox.layout.align.vertical
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
id = "icon_margin1",
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "label",
|
|
||||||
text = "Brightness",
|
|
||||||
align = "left",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
{
|
|
||||||
id = "value",
|
|
||||||
text = "0%",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "label_value_layout",
|
|
||||||
forced_height = dpi(48),
|
|
||||||
layout = wibox.layout.align.horizontal,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
id = "brightness_slider",
|
|
||||||
bar_shape = gears.shape.rounded_rect,
|
|
||||||
bar_height = dpi(10),
|
|
||||||
bar_color = color["Grey800"] .. "88",
|
|
||||||
bar_active_color = "#ffffff",
|
|
||||||
handle_color = "#ffffff",
|
|
||||||
handle_shape = gears.shape.circle,
|
|
||||||
handle_width = dpi(10),
|
|
||||||
handle_border_color = color["White"],
|
|
||||||
maximum = 100,
|
|
||||||
widget = wibox.widget.slider
|
|
||||||
},
|
|
||||||
id = "slider_layout",
|
|
||||||
forced_height = dpi(24),
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_slider_layout",
|
|
||||||
spacing = dpi(0),
|
|
||||||
layout = wibox.layout.align.vertical
|
|
||||||
},
|
|
||||||
id = "osd_layout",
|
|
||||||
layout = wibox.layout.align.vertical
|
|
||||||
},
|
},
|
||||||
id = "container",
|
nil,
|
||||||
left = dpi(24),
|
id = "icon_margin1",
|
||||||
right = dpi(24),
|
expand = "none",
|
||||||
widget = wibox.container.margin
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
id = "label",
|
||||||
|
text = "Brightness",
|
||||||
|
align = "left",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
id = "value",
|
||||||
|
text = "0%",
|
||||||
|
align = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "label_value_layout",
|
||||||
|
forced_height = dpi(48),
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
id = "brightness_slider",
|
||||||
|
bar_shape = gears.shape.rounded_rect,
|
||||||
|
bar_height = dpi(10),
|
||||||
|
bar_color = color["Grey800"] .. "88",
|
||||||
|
bar_active_color = "#ffffff",
|
||||||
|
handle_color = "#ffffff",
|
||||||
|
handle_shape = gears.shape.circle,
|
||||||
|
handle_width = dpi(10),
|
||||||
|
handle_border_color = color["White"],
|
||||||
|
maximum = 100,
|
||||||
|
widget = wibox.widget.slider
|
||||||
|
},
|
||||||
|
id = "slider_layout",
|
||||||
|
forced_height = dpi(24),
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
id = "icon_slider_layout",
|
||||||
|
spacing = dpi(0),
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
},
|
},
|
||||||
bg = color["Grey900"] .. "88",
|
id = "osd_layout",
|
||||||
widget = wibox.container.background,
|
layout = wibox.layout.align.vertical
|
||||||
ontop = true,
|
},
|
||||||
visible = true,
|
id = "container",
|
||||||
type = "notification",
|
left = dpi(24),
|
||||||
forced_height = dpi(300),
|
right = dpi(24),
|
||||||
forced_width = dpi(300),
|
widget = wibox.container.margin
|
||||||
offset = dpi(5),
|
},
|
||||||
}
|
bg = color["Grey900"] .. "88",
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
visible = true,
|
||||||
|
type = "notification",
|
||||||
|
forced_height = dpi(300),
|
||||||
|
forced_width = dpi(300),
|
||||||
|
offset = dpi(5),
|
||||||
|
}
|
||||||
|
|
||||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:connect_signal(
|
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:connect_signal(
|
||||||
"property::value",
|
"property::value",
|
||||||
function()
|
function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
"pkexec xfpm-power-backlight-helper --get-brightness",
|
"pkexec xfpm-power-backlight-helper --get-brightness",
|
||||||
function(stdout)
|
function(stdout)
|
||||||
local brightness_value = math.floor((tonumber(stdout) - 1) / (BACKLIGHT_MAX_BRIGHTNESS - 1) * 100)
|
local brightness_value = math.floor((tonumber(stdout) - 1) / (BACKLIGHT_MAX_BRIGHTNESS - 1) * 100)
|
||||||
-- Performance is horrible, or it overrides and executes at the same time as the keymappings
|
brightness_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(tostring(brightness_value) .. "%")
|
||||||
--awful.spawn("xbacklight -set " .. brightness_value, false)
|
|
||||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.label_value_layout.value:set_text(tostring(brightness_value) .. "%")
|
|
||||||
|
|
||||||
awesome.emit_signal(
|
awesome.emit_signal(
|
||||||
"widget::brightness:update",
|
|
||||||
brightness_value
|
|
||||||
)
|
|
||||||
|
|
||||||
if awful.screen.focused().show_brightness_osd then
|
|
||||||
awesome.emit_signal(
|
|
||||||
"module::brightness_osd:show",
|
|
||||||
true
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
local icon = icondir .. "brightness"
|
|
||||||
if brightness_value >= 0 and brightness_value < 34 then
|
|
||||||
icon = icon .. "-low"
|
|
||||||
elseif brightness_value >= 34 and brightness_value < 67 then
|
|
||||||
icon = icon .. "-medium"
|
|
||||||
elseif brightness_value >= 67 then
|
|
||||||
icon = icon .. "-high"
|
|
||||||
end
|
|
||||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icon .. ".svg")
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
local update_slider = function()
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[ pkexec xfpm-power-backlight-helper --get-brightness ]],
|
|
||||||
function(stdout)
|
|
||||||
stdout = math.floor((tonumber(stdout) - 1) / (BACKLIGHT_MAX_BRIGHTNESS - 1) * 100)
|
|
||||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(stdout)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"module::brightness_slider:update",
|
|
||||||
function()
|
|
||||||
update_slider()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"widget::brightness:update",
|
"widget::brightness:update",
|
||||||
function(value)
|
brightness_value
|
||||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(tonumber(value))
|
)
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
|
if awful.screen.focused().show_brightness_osd then
|
||||||
|
awesome.emit_signal(
|
||||||
|
"module::brightness_osd:show",
|
||||||
|
true
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local icon = icondir .. "brightness"
|
||||||
|
if brightness_value >= 0 and brightness_value < 34 then
|
||||||
|
icon = icon .. "-low"
|
||||||
|
elseif brightness_value >= 34 and brightness_value < 67 then
|
||||||
|
icon = icon .. "-medium"
|
||||||
|
elseif brightness_value >= 67 then
|
||||||
|
icon = icon .. "-high"
|
||||||
|
end
|
||||||
|
brightness_osd_widget.container.osd_layout.icon_slider_layout.icon_margin1.icon_margin2.icon:set_image(icon .. ".svg")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local update_slider = function()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ pkexec xfpm-power-backlight-helper --get-brightness ]],
|
||||||
|
function(stdout)
|
||||||
|
stdout = math.floor((tonumber(stdout) - 1) / (BACKLIGHT_MAX_BRIGHTNESS - 1) * 100)
|
||||||
|
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(stdout)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"module::brightness_slider:update",
|
||||||
|
function()
|
||||||
update_slider()
|
update_slider()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
local brightness_container = awful.popup {
|
awesome.connect_signal(
|
||||||
widget = wibox.container.background,
|
"widget::brightness:update",
|
||||||
ontop = true,
|
function(value)
|
||||||
bg = color["Grey900"] .. "00",
|
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(tonumber(value))
|
||||||
stretch = false,
|
end
|
||||||
visible = false,
|
)
|
||||||
screen = s,
|
|
||||||
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 15)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
local hide_brightness_osd = gears.timer {
|
update_slider()
|
||||||
timeout = 2,
|
|
||||||
autostart = true,
|
|
||||||
callback = function()
|
|
||||||
brightness_container.visible = false
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
brightness_container:setup {
|
local brightness_container = awful.popup {
|
||||||
brightness_osd_widget,
|
widget = wibox.container.background,
|
||||||
layout = wibox.layout.fixed.horizontal
|
ontop = true,
|
||||||
}
|
bg = color["Grey900"] .. "00",
|
||||||
|
stretch = false,
|
||||||
|
visible = false,
|
||||||
|
screen = s,
|
||||||
|
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 15)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
awesome.connect_signal(
|
local hide_brightness_osd = gears.timer {
|
||||||
"widget::brightness_osd:rerun",
|
timeout = 2,
|
||||||
function()
|
autostart = true,
|
||||||
if hide_brightness_osd.started then
|
callback = function()
|
||||||
hide_brightness_osd:again()
|
brightness_container.visible = false
|
||||||
else
|
end
|
||||||
hide_brightness_osd:start()
|
}
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
brightness_container:setup {
|
||||||
"module::brightness_osd:show",
|
brightness_osd_widget,
|
||||||
function()
|
layout = wibox.layout.fixed.horizontal
|
||||||
if s == mouse.screen then
|
}
|
||||||
brightness_container.visible = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
brightness_container:connect_signal(
|
awesome.connect_signal(
|
||||||
"mouse::enter",
|
"widget::brightness_osd:rerun",
|
||||||
function()
|
function()
|
||||||
brightness_container.visible = true
|
if hide_brightness_osd.started then
|
||||||
hide_brightness_osd:stop()
|
hide_brightness_osd:again()
|
||||||
end
|
else
|
||||||
)
|
hide_brightness_osd:start()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
brightness_container:connect_signal(
|
awesome.connect_signal(
|
||||||
"mouse::leave",
|
"module::brightness_osd:show",
|
||||||
function()
|
function()
|
||||||
brightness_container.visible = true
|
if s == mouse.screen then
|
||||||
hide_brightness_osd:again()
|
brightness_container.visible = true
|
||||||
end
|
end
|
||||||
)
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
brightness_container:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
function()
|
||||||
|
brightness_container.visible = true
|
||||||
|
hide_brightness_osd:stop()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
brightness_container:connect_signal(
|
||||||
|
"mouse::leave",
|
||||||
|
function()
|
||||||
|
brightness_container.visible = true
|
||||||
|
hide_brightness_osd:again()
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,183 +0,0 @@
|
|||||||
---------------------------------------
|
|
||||||
-- This is the calendar_osd module --
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
-- Awesome Libs
|
|
||||||
|
|
||||||
local awful = require("awful")
|
|
||||||
local wibox = require("wibox")
|
|
||||||
local gears = require("gears")
|
|
||||||
local dpi = require("beautiful").xresources.apply_dpi
|
|
||||||
local color = require("src.theme.colors")
|
|
||||||
|
|
||||||
return function(s)
|
|
||||||
local styles = {}
|
|
||||||
|
|
||||||
styles.month = {
|
|
||||||
padding = 15,
|
|
||||||
bg_color = color["Grey900"],
|
|
||||||
border_width = 1,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
styles.normal = {
|
|
||||||
fg_color = color["Grey900"],
|
|
||||||
font = user_vars.font.extrabold,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
styles.focus = {
|
|
||||||
fg_color = color["Grey900"],
|
|
||||||
bg_color = color["Purple200"],
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
styles.header = {
|
|
||||||
fg_color = color["Grey900"],
|
|
||||||
bg_color = color["Teal200"],
|
|
||||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
styles.weekday = {
|
|
||||||
padding = 8,
|
|
||||||
fg_color = color["Grey900"],
|
|
||||||
bg_color = color["Teal200"],
|
|
||||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
local function decorate_cell(widget, flag, date)
|
|
||||||
if flag == 'monthheader' and not styles.monthheader then
|
|
||||||
flag = 'header'
|
|
||||||
end
|
|
||||||
local props = styles[flag] or {}
|
|
||||||
if props.markup and widget.get_text and widget.set_markup then
|
|
||||||
widget:set_markup(props.markup(widget:get_text()))
|
|
||||||
end
|
|
||||||
-- Change bg color for weekends
|
|
||||||
local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) }
|
|
||||||
local weekday = tonumber(os.date('%w', os.time(d)))
|
|
||||||
local default_bg = (weekday == 0 or weekday == 6) and color["Red200"] or color["White"]
|
|
||||||
local ret = wibox.widget {
|
|
||||||
{
|
|
||||||
widget,
|
|
||||||
left = dpi(8),
|
|
||||||
right = dpi(8),
|
|
||||||
top = dpi(4),
|
|
||||||
bottom = dpi(4),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end,
|
|
||||||
fg = props.fg_color or '#999999',
|
|
||||||
bg = props.bg_color or default_bg,
|
|
||||||
widget = wibox.container.background
|
|
||||||
}
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
local calendar = wibox.widget {
|
|
||||||
date = os.date('*t'),
|
|
||||||
fn_embed = decorate_cell,
|
|
||||||
widget = wibox.widget.calendar.month,
|
|
||||||
font = user_vars.font.extrabold,
|
|
||||||
spacing = dpi(10)
|
|
||||||
}
|
|
||||||
|
|
||||||
local calendar_osd_widget = wibox.widget {
|
|
||||||
{
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
fg = "#ffffff",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
font = "DS-Digital, Bold Italic 50",
|
|
||||||
id = "digital_clock"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
widget = calendar
|
|
||||||
},
|
|
||||||
visible = true,
|
|
||||||
layout = wibox.layout.fixed.vertical
|
|
||||||
}
|
|
||||||
|
|
||||||
local set_clock = function()
|
|
||||||
calendar_osd_widget.digital_clock:set_text(os.date("%H:%M"))
|
|
||||||
end
|
|
||||||
|
|
||||||
local calendar_clock_update = gears.timer {
|
|
||||||
timeout = 5,
|
|
||||||
autostart = true,
|
|
||||||
call_now = true,
|
|
||||||
callback = function()
|
|
||||||
set_clock()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
local calendar_osd_container = awful.popup {
|
|
||||||
screen = s,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
ontop = true,
|
|
||||||
bg = color["Grey900"],
|
|
||||||
stretch = false,
|
|
||||||
visible = false,
|
|
||||||
placement = function(c) awful.placement.top_right(c, { margins = { right = dpi(100), top = dpi(60) } }) end,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
local hide_osd = gears.timer {
|
|
||||||
timeout = 0.25,
|
|
||||||
autostart = true,
|
|
||||||
callback = function()
|
|
||||||
calendar_osd_container.visible = false
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar_osd_container:setup {
|
|
||||||
calendar_osd_widget,
|
|
||||||
layout = wibox.layout.align.horizontal
|
|
||||||
}
|
|
||||||
|
|
||||||
calendar_osd_container:connect_signal(
|
|
||||||
"mouse::enter",
|
|
||||||
function()
|
|
||||||
calendar_osd_container.visible = true
|
|
||||||
hide_osd:stop()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
calendar_osd_container:connect_signal(
|
|
||||||
"mouse::leave",
|
|
||||||
function()
|
|
||||||
calendar_osd_container.visible = false
|
|
||||||
hide_osd:stop()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"widget::calendar_osd:stop",
|
|
||||||
function()
|
|
||||||
calendar_osd_container.visible = true
|
|
||||||
hide_osd:stop()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"widget::calendar_osd:rerun",
|
|
||||||
function()
|
|
||||||
if hide_osd.started then
|
|
||||||
hide_osd:again()
|
|
||||||
else
|
|
||||||
hide_osd:start()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
@@ -15,32 +15,32 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/powermenu/"
|
|||||||
|
|
||||||
return function(s)
|
return function(s)
|
||||||
|
|
||||||
-- Profile picture imagebox
|
-- Profile picture imagebox
|
||||||
local profile_picture = wibox.widget {
|
local profile_picture = wibox.widget {
|
||||||
image = icondir .. "defaultpfp.svg",
|
image = icondir .. "defaultpfp.svg",
|
||||||
resize = true,
|
resize = true,
|
||||||
forced_height = dpi(200),
|
forced_height = dpi(200),
|
||||||
clip_shape = function(cr, width, height)
|
clip_shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 30)
|
gears.shape.rounded_rect(cr, width, height, 30)
|
||||||
end,
|
end,
|
||||||
widget = wibox.widget.imagebox
|
widget = wibox.widget.imagebox
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Username textbox
|
-- Username textbox
|
||||||
local profile_name = wibox.widget {
|
local profile_name = wibox.widget {
|
||||||
align = 'center',
|
align = 'center',
|
||||||
valign = 'center',
|
valign = 'center',
|
||||||
text = " ",
|
text = " ",
|
||||||
font = "JetBrains Mono Bold 30",
|
font = "JetBrains Mono Bold 30",
|
||||||
widget = wibox.widget.textbox
|
widget = wibox.widget.textbox
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Get the profile script from /var/lib/AccountsService/icons/${USER}
|
-- Get the profile script from /var/lib/AccountsService/icons/${USER}
|
||||||
-- and copy it to the assets folder
|
-- and copy it to the assets folder
|
||||||
-- TODO: If the user doesnt have AccountsService look into $HOME/.faces
|
-- TODO: If the user doesnt have AccountsService look into $HOME/.faces
|
||||||
local update_profile_picture = function()
|
local update_profile_picture = function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
[=[
|
[=[
|
||||||
iconPath="/var/lib/AccountsService/icons/${USER}"
|
iconPath="/var/lib/AccountsService/icons/${USER}"
|
||||||
userIconPath="${HOME}/.config/awesome/src/assets/userpfp/"
|
userIconPath="${HOME}/.config/awesome/src/assets/userpfp/"
|
||||||
if [[ -f "${userIconPath}" ]];
|
if [[ -f "${userIconPath}" ]];
|
||||||
@@ -65,23 +65,23 @@ return function(s)
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
]=],
|
]=],
|
||||||
function(stdout)
|
function(stdout)
|
||||||
if stdout then
|
if stdout then
|
||||||
profile_picture:set_image(stdout:gsub("\n", ""))
|
profile_picture:set_image(stdout:gsub("\n", ""))
|
||||||
else
|
else
|
||||||
profile_picture:set_image(icondir .. "defaultpfp.svg")
|
profile_picture:set_image(icondir .. "defaultpfp.svg")
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
update_profile_picture()
|
)
|
||||||
|
end
|
||||||
|
update_profile_picture()
|
||||||
|
|
||||||
-- Will determin the display style
|
-- Will determin the display style
|
||||||
local namestyle = user_vars.namestyle
|
local namestyle = user_vars.namestyle
|
||||||
-- Get the full username(if set) and the username + hostname
|
-- Get the full username(if set) and the username + hostname
|
||||||
local update_user_name = function()
|
local update_user_name = function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
[=[
|
[=[
|
||||||
fullname="$(getent passwd `whoami` | cut -d ':' -f 5)"
|
fullname="$(getent passwd `whoami` | cut -d ':' -f 5)"
|
||||||
user="$(whoami)"
|
user="$(whoami)"
|
||||||
host="$(hostname)"
|
host="$(hostname)"
|
||||||
@@ -95,227 +95,227 @@ return function(s)
|
|||||||
printf "Rick Astley"
|
printf "Rick Astley"
|
||||||
fi
|
fi
|
||||||
]=],
|
]=],
|
||||||
function(stdout)
|
function(stdout)
|
||||||
if stdout:gsub("\n", "") == "Rick Astley" then
|
if stdout:gsub("\n", "") == "Rick Astley" then
|
||||||
profile_picture:set_image(awful.util.getdir("config") .. "src/assets/userpfp/" .. "rickastley.jpg")
|
profile_picture:set_image(awful.util.getdir("config") .. "src/assets/userpfp/" .. "rickastley.jpg")
|
||||||
end
|
end
|
||||||
profile_name:set_text(stdout)
|
profile_name:set_text(stdout)
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
update_user_name()
|
)
|
||||||
|
end
|
||||||
|
update_user_name()
|
||||||
|
|
||||||
-- Universal Button widget
|
-- Universal Button widget
|
||||||
local button = function(name, icon, bg_color, callback)
|
local button = function(name, icon, bg_color, callback)
|
||||||
local item = wibox.widget {
|
local item = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
{
|
-- TODO: using gears.color to recolor a SVG will make it look super low res
|
||||||
{
|
-- currently I recolor it in the .svg file directly, but later implement
|
||||||
{
|
-- a better way to recolor a SVG
|
||||||
-- TODO: using gears.color to recolor a SVG will make it look super low res
|
-- image = gears.color.recolor_image(icon, color["Grey900"]),
|
||||||
-- currently I recolor it in the .svg file directly, but later implement
|
image = icon,
|
||||||
-- a better way to recolor a SVG
|
resize = true,
|
||||||
-- image = gears.color.recolor_image(icon, color["Grey900"]),
|
forced_height = dpi(30),
|
||||||
image = icon,
|
widget = wibox.widget.imagebox
|
||||||
resize = true,
|
},
|
||||||
forced_height = dpi(30),
|
margins = dpi(0),
|
||||||
widget = wibox.widget.imagebox
|
widget = wibox.container.margin
|
||||||
},
|
|
||||||
margins = dpi(0),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{
|
|
||||||
text = name,
|
|
||||||
font = "JetBrains Mono Bold 30",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
margins = dpi(0),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
widget = wibox.layout.fixed.horizontal
|
|
||||||
},
|
|
||||||
margins = dpi(10),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
fg = color["Grey900"],
|
|
||||||
bg = bg_color,
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 10)
|
|
||||||
end,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
id = 'background'
|
|
||||||
},
|
},
|
||||||
spacing = dpi(0),
|
{
|
||||||
layout = wibox.layout.align.vertical
|
{
|
||||||
}
|
text = name,
|
||||||
|
font = "JetBrains Mono Bold 30",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
margins = dpi(0),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
widget = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
margins = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
fg = color["Grey900"],
|
||||||
|
bg = bg_color,
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 10)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background,
|
||||||
|
id = 'background'
|
||||||
|
},
|
||||||
|
spacing = dpi(0),
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
}
|
||||||
|
|
||||||
item:connect_signal(
|
item:connect_signal(
|
||||||
"button::release",
|
"button::release",
|
||||||
function()
|
function()
|
||||||
callback()
|
callback()
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
return item
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
|
||||||
-- Create the power menu actions
|
return item
|
||||||
local suspend_command = function()
|
end
|
||||||
awful.spawn("dm-tool lock & systemctl suspend")
|
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
|
||||||
end
|
|
||||||
|
|
||||||
local logout_command = function()
|
-- Create the power menu actions
|
||||||
awesome.quit()
|
local suspend_command = function()
|
||||||
end
|
awful.spawn("dm-tool lock & systemctl suspend")
|
||||||
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
|
end
|
||||||
|
|
||||||
local lock_command = function()
|
local logout_command = function()
|
||||||
awful.spawn("dm-tool lock")
|
awesome.quit()
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
end
|
||||||
end
|
|
||||||
|
|
||||||
local shutdown_command = function()
|
local lock_command = function()
|
||||||
awful.spawn("shutdown now")
|
awful.spawn("dm-tool lock")
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
end
|
end
|
||||||
|
|
||||||
local reboot_command = function()
|
local shutdown_command = function()
|
||||||
awful.spawn("reboot")
|
awful.spawn("shutdown now")
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Create the buttons with their command and name etc
|
local reboot_command = function()
|
||||||
local shutdown_button = button("Shutdown", icondir .. "shutdown.svg", color["Blue200"], shutdown_command)
|
awful.spawn("reboot")
|
||||||
local reboot_button = button("Reboot", icondir .. "reboot.svg", color["Red200"], reboot_command)
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
local suspend_button = button("Suspend", icondir .. "suspend.svg", color["Yellow200"], suspend_command)
|
end
|
||||||
local logout_button = button("Logout", icondir .. "logout.svg", color["Green200"], logout_command)
|
|
||||||
local lock_button = button("Lock", icondir .. "lock.svg", color["Orange200"], lock_command)
|
|
||||||
|
|
||||||
-- Signals to change color on hover
|
-- Create the buttons with their command and name etc
|
||||||
Hover_signal(shutdown_button.background, color["Blue200"])
|
local shutdown_button = button("Shutdown", icondir .. "shutdown.svg", color["Blue200"], shutdown_command)
|
||||||
Hover_signal(reboot_button.background, color["Red200"])
|
local reboot_button = button("Reboot", icondir .. "reboot.svg", color["Red200"], reboot_command)
|
||||||
Hover_signal(suspend_button.background, color["Yellow200"])
|
local suspend_button = button("Suspend", icondir .. "suspend.svg", color["Yellow200"], suspend_command)
|
||||||
Hover_signal(logout_button.background, color["Green200"])
|
local logout_button = button("Logout", icondir .. "logout.svg", color["Green200"], logout_command)
|
||||||
Hover_signal(lock_button.background, color["Orange200"])
|
local lock_button = button("Lock", icondir .. "lock.svg", color["Orange200"], lock_command)
|
||||||
|
|
||||||
-- The powermenu widget
|
-- Signals to change color on hover
|
||||||
local powermenu = wibox.widget {
|
Hover_signal(shutdown_button.background, color["Blue200"])
|
||||||
layout = wibox.layout.align.vertical,
|
Hover_signal(reboot_button.background, color["Red200"])
|
||||||
expand = "none",
|
Hover_signal(suspend_button.background, color["Yellow200"])
|
||||||
|
Hover_signal(logout_button.background, color["Green200"])
|
||||||
|
Hover_signal(lock_button.background, color["Orange200"])
|
||||||
|
|
||||||
|
-- The powermenu widget
|
||||||
|
local powermenu = wibox.widget {
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
expand = "none",
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
{
|
||||||
nil,
|
nil,
|
||||||
{
|
{
|
||||||
|
{
|
||||||
|
nil,
|
||||||
{
|
{
|
||||||
nil,
|
nil,
|
||||||
{
|
{
|
||||||
{
|
profile_picture,
|
||||||
nil,
|
margins = dpi(0),
|
||||||
{
|
widget = wibox.container.margin
|
||||||
nil,
|
},
|
||||||
{
|
nil,
|
||||||
profile_picture,
|
expand = "none",
|
||||||
margins = dpi(0),
|
layout = wibox.layout.align.horizontal
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
layout = wibox.layout.align.vertical,
|
|
||||||
expand = "none"
|
|
||||||
},
|
|
||||||
spacing = dpi(50),
|
|
||||||
{
|
|
||||||
profile_name,
|
|
||||||
margins = dpi(0),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
layout = wibox.layout.fixed.vertical
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal
|
|
||||||
},
|
},
|
||||||
{
|
nil,
|
||||||
nil,
|
layout = wibox.layout.align.vertical,
|
||||||
{
|
expand = "none"
|
||||||
{
|
},
|
||||||
shutdown_button,
|
spacing = dpi(50),
|
||||||
reboot_button,
|
{
|
||||||
logout_button,
|
profile_name,
|
||||||
lock_button,
|
margins = dpi(0),
|
||||||
suspend_button,
|
widget = wibox.container.margin
|
||||||
spacing = dpi(30),
|
},
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.vertical
|
||||||
},
|
|
||||||
margins = dpi(0),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
expand = "none",
|
|
||||||
layout = wibox.layout.align.horizontal
|
|
||||||
},
|
|
||||||
layout = wibox.layout.align.vertical
|
|
||||||
},
|
},
|
||||||
nil
|
nil,
|
||||||
}
|
expand = "none",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
{
|
||||||
|
shutdown_button,
|
||||||
|
reboot_button,
|
||||||
|
logout_button,
|
||||||
|
lock_button,
|
||||||
|
suspend_button,
|
||||||
|
spacing = dpi(30),
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
margins = dpi(0),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
expand = "none",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
},
|
||||||
|
nil
|
||||||
|
}
|
||||||
|
|
||||||
-- Container for the widget, covers the entire screen
|
-- Container for the widget, covers the entire screen
|
||||||
local powermenu_container = wibox {
|
local powermenu_container = wibox {
|
||||||
widget = powermenu,
|
widget = powermenu,
|
||||||
screen = s,
|
screen = s,
|
||||||
type = "splash",
|
type = "splash",
|
||||||
visible = false,
|
visible = false,
|
||||||
ontop = true,
|
ontop = true,
|
||||||
bg = "#21212188",
|
bg = "#21212188",
|
||||||
height = s.geometry.height,
|
height = s.geometry.height,
|
||||||
width = s.geometry.width,
|
width = s.geometry.width,
|
||||||
x = s.geometry.x,
|
x = s.geometry.x,
|
||||||
y = s.geometry.y
|
y = s.geometry.y
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Close on rightclick
|
-- Close on rightclick
|
||||||
powermenu_container:buttons(
|
powermenu_container:buttons(
|
||||||
gears.table.join(
|
gears.table.join(
|
||||||
awful.button(
|
awful.button(
|
||||||
{},
|
{},
|
||||||
3,
|
3,
|
||||||
function()
|
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
|
||||||
end
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Close on Escape
|
|
||||||
local powermenu_keygrabber = awful.keygrabber {
|
|
||||||
autostart = false,
|
|
||||||
stop_event = 'release',
|
|
||||||
keypressed_callback = function(self, mod, key, command)
|
|
||||||
if key == 'Escape' then
|
|
||||||
awesome.emit_signal("module::powermenu:hide")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Signals
|
|
||||||
awesome.connect_signal(
|
|
||||||
"module::powermenu:show",
|
|
||||||
function()
|
function()
|
||||||
if s == mouse.screen then
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
powermenu_container.visible = true
|
end
|
||||||
powermenu_keygrabber:start()
|
)
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
|
|
||||||
awesome.connect_signal(
|
-- Close on Escape
|
||||||
"module::powermenu:hide",
|
local powermenu_keygrabber = awful.keygrabber {
|
||||||
function()
|
autostart = false,
|
||||||
powermenu_keygrabber:stop()
|
stop_event = 'release',
|
||||||
powermenu_container.visible = false
|
keypressed_callback = function(self, mod, key, command)
|
||||||
end
|
if key == 'Escape' then
|
||||||
)
|
awesome.emit_signal("module::powermenu:hide")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Signals
|
||||||
|
awesome.connect_signal(
|
||||||
|
"module::powermenu:show",
|
||||||
|
function()
|
||||||
|
if s == mouse.screen then
|
||||||
|
powermenu_container.visible = true
|
||||||
|
powermenu_keygrabber:start()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"module::powermenu:hide",
|
||||||
|
function()
|
||||||
|
powermenu_keygrabber:stop()
|
||||||
|
powermenu_container.visible = false
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -17,235 +17,236 @@ awful.titlebar.enable_tooltip = true
|
|||||||
awful.titlebar.fallback_name = 'Client'
|
awful.titlebar.fallback_name = 'Client'
|
||||||
|
|
||||||
local double_click_event_handler = function(double_click_event)
|
local double_click_event_handler = function(double_click_event)
|
||||||
if double_click_timer then
|
if double_click_timer then
|
||||||
double_click_timer:stop()
|
double_click_timer:stop()
|
||||||
double_click_timer = nil
|
double_click_timer = nil
|
||||||
double_click_event()
|
double_click_event()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
double_click_timer = gears.timer.start_new(
|
double_click_timer = gears.timer.start_new(
|
||||||
0.20,
|
0.20,
|
||||||
function()
|
function()
|
||||||
double_click_timer = nil
|
double_click_timer = nil
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local create_click_events = function(c)
|
local create_click_events = function(c)
|
||||||
local buttons = gears.table.join(
|
local buttons = gears.table.join(
|
||||||
awful.button(
|
awful.button(
|
||||||
{},
|
{},
|
||||||
1,
|
1,
|
||||||
function()
|
function()
|
||||||
double_click_event_handler(function()
|
double_click_event_handler(function()
|
||||||
if c.floating then
|
if c.floating then
|
||||||
c.float = false
|
c.float = false
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
c.maximized = not c.maximized
|
c.maximized = not c.maximized
|
||||||
c:raise()
|
c:raise()
|
||||||
end)
|
end)
|
||||||
c:activate { context = 'titlebar', action = 'mouse_move' }
|
c:activate { context = 'titlebar', action = 'mouse_move' }
|
||||||
end
|
end
|
||||||
),
|
),
|
||||||
awful.button(
|
awful.button(
|
||||||
{},
|
{},
|
||||||
3,
|
3,
|
||||||
function()
|
function()
|
||||||
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
||||||
end
|
end
|
||||||
)
|
|
||||||
)
|
)
|
||||||
return buttons
|
)
|
||||||
|
return buttons
|
||||||
end
|
end
|
||||||
|
|
||||||
local create_titlebar = function(c, bg, size)
|
local create_titlebar = function(c, bg, size)
|
||||||
local titlebar = awful.titlebar(c, {
|
local titlebar = awful.titlebar(c, {
|
||||||
position = "left",
|
position = "left",
|
||||||
bg = bg,
|
bg = bg,
|
||||||
size = size
|
size = size
|
||||||
})
|
})
|
||||||
|
|
||||||
titlebar:setup {
|
titlebar:setup {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
awful.titlebar.widget.closebutton(c),
|
||||||
{
|
widget = wibox.container.background,
|
||||||
awful.titlebar.widget.closebutton(c),
|
bg = color["Red200"],
|
||||||
widget = wibox.container.background,
|
shape = function(cr, height, width)
|
||||||
bg = color["Red200"],
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
shape = function(cr, height, width)
|
end,
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
id = "closebutton"
|
||||||
end,
|
|
||||||
id = "closebutton"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
awful.titlebar.widget.maximizedbutton(c),
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = color["Yellow200"],
|
|
||||||
shape = function(cr, height, width)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
|
||||||
end,
|
|
||||||
id = "maximizebutton"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
awful.titlebar.widget.minimizebutton(c),
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = color["Green200"],
|
|
||||||
shape = function(cr, height, width)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
|
||||||
end,
|
|
||||||
id = "minimizebutton"
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
id = "spacing"
|
|
||||||
},
|
|
||||||
margins = dpi(8),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
id = "margin"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
buttons = create_click_events(c),
|
awful.titlebar.widget.maximizedbutton(c),
|
||||||
layout = wibox.layout.flex.vertical
|
widget = wibox.container.background,
|
||||||
|
bg = color["Yellow200"],
|
||||||
|
shape = function(cr, height, width)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
id = "maximizebutton"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
{
|
awful.titlebar.widget.minimizebutton(c),
|
||||||
widget = awful.widget.clienticon(c)
|
widget = wibox.container.background,
|
||||||
},
|
bg = color["Green200"],
|
||||||
margins = dpi(5),
|
shape = function(cr, height, width)
|
||||||
widget = wibox.container.margin
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
id = "minimizebutton"
|
||||||
},
|
},
|
||||||
layout = wibox.layout.align.vertical,
|
spacing = dpi(10),
|
||||||
id = "main"
|
layout = wibox.layout.fixed.vertical,
|
||||||
}
|
id = "spacing"
|
||||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color["Red200"])
|
},
|
||||||
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color["Yellow200"])
|
margins = dpi(8),
|
||||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
widget = wibox.container.margin,
|
||||||
|
id = "margin"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
buttons = create_click_events(c),
|
||||||
|
layout = wibox.layout.flex.vertical
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
widget = awful.widget.clienticon(c)
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
id = "main"
|
||||||
|
}
|
||||||
|
Hover_signal(titlebar.main.margin.spacing.closebutton, color["Red200"])
|
||||||
|
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color["Yellow200"])
|
||||||
|
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
||||||
end
|
end
|
||||||
|
|
||||||
local create_titlebar_dialog = function(c, bg, size)
|
local create_titlebar_dialog = function(c, bg, size)
|
||||||
local titlebar = awful.titlebar(c, {
|
local titlebar = awful.titlebar(c, {
|
||||||
position = "left",
|
position = "left",
|
||||||
bg = bg,
|
bg = bg,
|
||||||
size = size
|
size = size
|
||||||
})
|
})
|
||||||
|
|
||||||
titlebar:setup {
|
titlebar:setup {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
awful.titlebar.widget.closebutton(c),
|
||||||
{
|
widget = wibox.container.background,
|
||||||
awful.titlebar.widget.closebutton(c),
|
bg = color["Red200"],
|
||||||
widget = wibox.container.background,
|
shape = function(cr, height, width)
|
||||||
bg = color["Red200"],
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
shape = function(cr, height, width)
|
end,
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
id = "closebutton"
|
||||||
end,
|
|
||||||
id = "closebutton"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
awful.titlebar.widget.minimizebutton(c),
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = color["Green200"],
|
|
||||||
shape = function(cr, height, width)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 4)
|
|
||||||
end,
|
|
||||||
id = "minimizebutton"
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
layout = wibox.layout.fixed.vertical,
|
|
||||||
id = "spacing"
|
|
||||||
},
|
|
||||||
margins = dpi(8),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
id = "margin"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
buttons = create_click_events(c),
|
awful.titlebar.widget.minimizebutton(c),
|
||||||
layout = wibox.layout.flex.vertical
|
widget = wibox.container.background,
|
||||||
|
bg = color["Green200"],
|
||||||
|
shape = function(cr, height, width)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
id = "minimizebutton"
|
||||||
},
|
},
|
||||||
{
|
spacing = dpi(10),
|
||||||
{
|
layout = wibox.layout.fixed.vertical,
|
||||||
widget = awful.widget.clienticon(c)
|
id = "spacing"
|
||||||
},
|
},
|
||||||
margins = dpi(5),
|
margins = dpi(8),
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.margin,
|
||||||
},
|
id = "margin"
|
||||||
layout = wibox.layout.align.vertical,
|
},
|
||||||
id = "main"
|
{
|
||||||
}
|
buttons = create_click_events(c),
|
||||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color["Red200"])
|
layout = wibox.layout.flex.vertical
|
||||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
widget = awful.widget.clienticon(c)
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
id = "main"
|
||||||
|
}
|
||||||
|
Hover_signal(titlebar.main.margin.spacing.closebutton, color["Red200"])
|
||||||
|
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color["Green200"])
|
||||||
end
|
end
|
||||||
|
|
||||||
local draw_titlebar = function(c)
|
local draw_titlebar = function(c)
|
||||||
if c.type == 'normal' and not c.requests_no_titlebar then
|
if c.type == 'normal' and not c.requests_no_titlebar then
|
||||||
if c.class == 'Firefox' then
|
if c.class == 'Firefox' then
|
||||||
create_titlebar(c, '#121212AA', 35)
|
create_titlebar(c, '#121212AA', 35)
|
||||||
elseif c.name == "Steam" then
|
elseif c.name == "Steam" then
|
||||||
create_titlebar(c, '#121212AA', 0)
|
create_titlebar(c, '#121212AA', 0)
|
||||||
elseif c.name == "Settings" then
|
elseif c.name == "Settings" then
|
||||||
create_titlebar(c, '#121212AA', 0)
|
create_titlebar(c, '#121212AA', 0)
|
||||||
elseif c.class == "gcr-prompter" or c.class == "Gcr-prompter" then
|
elseif c.class == "gcr-prompter" or c.class == "Gcr-prompter" then
|
||||||
create_titlebar(c, '#121212AA', 0)
|
create_titlebar(c, '#121212AA', 0)
|
||||||
else
|
else
|
||||||
create_titlebar(c, '#121212AA', 35)
|
create_titlebar(c, '#121212AA', 35)
|
||||||
end
|
|
||||||
elseif c.type == 'dialog' then
|
|
||||||
create_titlebar_dialog(c, '#121212AA', 35)
|
|
||||||
end
|
end
|
||||||
|
elseif c.type == 'dialog' then
|
||||||
|
create_titlebar_dialog(c, '#121212AA', 35)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
"property::maximized",
|
"property::maximized",
|
||||||
function(c)
|
function(c)
|
||||||
if c.maximized then
|
if c.maximized then
|
||||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||||
Theme.titlebar_maximized_button_inactive = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_inactive = icondir .. "unmaximize.svg"
|
||||||
elseif not c.minimized then
|
elseif not c.minimized then
|
||||||
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
||||||
Theme.titlebar_maximized_button_active = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_active = icondir .. "maximize.svg"
|
||||||
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
"request::titlebars",
|
"request::titlebars",
|
||||||
function(c)
|
function(c)
|
||||||
if c.maximized then
|
if c.maximized then
|
||||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||||
Theme.titlebar_maximized_button_inactive = icondir .. "unmaximize.svg"
|
Theme.titlebar_maximized_button_inactive = icondir .. "unmaximize.svg"
|
||||||
elseif not c.minimized then
|
draw_titlebar(c)
|
||||||
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
elseif not c.minimized then
|
||||||
Theme.titlebar_maximized_button_active = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
||||||
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_active = icondir .. "maximize.svg"
|
||||||
end
|
Theme.titlebar_maximized_button_inactive = icondir .. "maximize.svg"
|
||||||
draw_titlebar(c)
|
draw_titlebar(c)
|
||||||
if not c.floating or c.maximized then
|
end
|
||||||
awful.titlebar.hide(c, 'left')
|
if not c.floating or c.maximized then
|
||||||
awful.titlebar.hide(c, 'right')
|
awful.titlebar.hide(c, 'left')
|
||||||
awful.titlebar.hide(c, 'top')
|
awful.titlebar.hide(c, 'right')
|
||||||
awful.titlebar.hide(c, 'bottom')
|
awful.titlebar.hide(c, 'top')
|
||||||
end
|
awful.titlebar.hide(c, 'bottom')
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
client.connect_signal(
|
client.connect_signal(
|
||||||
'property::floating',
|
'property::floating',
|
||||||
function(c)
|
function(c)
|
||||||
if c.floating or (c.floating and c.maximized) then
|
if c.floating or (c.floating and c.maximized) then
|
||||||
awful.titlebar.show(c, 'left')
|
awful.titlebar.show(c, 'left')
|
||||||
awful.titlebar.hide(c, 'right')
|
awful.titlebar.hide(c, 'right')
|
||||||
awful.titlebar.hide(c, 'top')
|
awful.titlebar.hide(c, 'top')
|
||||||
awful.titlebar.hide(c, 'bottom')
|
awful.titlebar.hide(c, 'bottom')
|
||||||
else
|
else
|
||||||
awful.titlebar.hide(c, 'left')
|
awful.titlebar.hide(c, 'left')
|
||||||
awful.titlebar.hide(c, 'right')
|
awful.titlebar.hide(c, 'right')
|
||||||
awful.titlebar.hide(c, 'top')
|
awful.titlebar.hide(c, 'top')
|
||||||
awful.titlebar.hide(c, 'bottom')
|
awful.titlebar.hide(c, 'bottom')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|||||||
792
awesome/src/modules/volume_controller.lua
Normal file
@@ -0,0 +1,792 @@
|
|||||||
|
-----------------------------------
|
||||||
|
-- This is the volume controller --
|
||||||
|
-----------------------------------
|
||||||
|
|
||||||
|
-- Awesome Libs
|
||||||
|
local awful = require("awful")
|
||||||
|
local color = require("src.theme.colors")
|
||||||
|
local dpi = require("beautiful").xresources.apply_dpi
|
||||||
|
local gears = require("gears")
|
||||||
|
local wibox = require("wibox")
|
||||||
|
require("src.core.signals")
|
||||||
|
|
||||||
|
-- Icon directory path
|
||||||
|
local icondir = awful.util.getdir("config") .. "src/assets/icons/audio/"
|
||||||
|
|
||||||
|
-- Returns the volume controller
|
||||||
|
return function(s)
|
||||||
|
|
||||||
|
local function create_device(name, node, sink)
|
||||||
|
local device = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
image = "",
|
||||||
|
id = "icon",
|
||||||
|
resize = false,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text = name,
|
||||||
|
id = "node",
|
||||||
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "device_layout",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
id = "device_margin",
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "background",
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
}
|
||||||
|
|
||||||
|
if sink == true then
|
||||||
|
device:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
awful.spawn.spawn("./.config/awesome/src/scripts/vol.sh set_sink " .. node)
|
||||||
|
|
||||||
|
awesome.emit_signal("update::background:vol", node)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
--#region Signal Functions
|
||||||
|
local old_wibox, old_cursor, old_bg, old_fg
|
||||||
|
local bg = ""
|
||||||
|
local fg = ""
|
||||||
|
local mouse_enter = function()
|
||||||
|
if bg then
|
||||||
|
old_bg = device.background.bg
|
||||||
|
device.background.bg = bg .. 'dd'
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
old_fg = device.background.fg
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
local w = mouse.current_wibox
|
||||||
|
if w then
|
||||||
|
old_cursor, old_wibox = w.cursor, w
|
||||||
|
w.cursor = "hand1"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local button_press = function()
|
||||||
|
if bg then
|
||||||
|
if bg then
|
||||||
|
if string.len(bg) == 7 then
|
||||||
|
device.background.bg = bg .. 'bb'
|
||||||
|
else
|
||||||
|
device.background.bg = bg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local button_release = function()
|
||||||
|
if bg then
|
||||||
|
if bg then
|
||||||
|
if string.len(bg) == 7 then
|
||||||
|
device.background.bg = bg .. 'dd'
|
||||||
|
else
|
||||||
|
device.background.bg = bg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local mouse_leave = function()
|
||||||
|
if bg then
|
||||||
|
device.background.bg = old_bg
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = old_fg
|
||||||
|
end
|
||||||
|
if old_wibox then
|
||||||
|
old_wibox.cursor = old_cursor
|
||||||
|
old_wibox = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
mouse_enter
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
button_press
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"button::release",
|
||||||
|
button_release
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"mouse::leave",
|
||||||
|
mouse_leave
|
||||||
|
)
|
||||||
|
--#endregion
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"update::background:vol",
|
||||||
|
function(new_node)
|
||||||
|
if node == new_node then
|
||||||
|
old_bg = color["Purple200"]
|
||||||
|
old_fg = color["Grey900"]
|
||||||
|
bg = color["Purple200"]
|
||||||
|
fg = color["Grey900"]
|
||||||
|
device.background:set_bg(color["Purple200"])
|
||||||
|
device.background:set_fg(color["Grey900"])
|
||||||
|
else
|
||||||
|
fg = color["Purple200"]
|
||||||
|
bg = color["Grey700"]
|
||||||
|
device.background:set_fg(color["Purple200"])
|
||||||
|
device.background:set_bg(color["Grey700"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ pactl get-default-sink ]],
|
||||||
|
function(stdout)
|
||||||
|
local node_active = stdout:gsub("\n", "")
|
||||||
|
if node == node_active then
|
||||||
|
bg = color["Purple200"]
|
||||||
|
fg = color["Grey900"]
|
||||||
|
device.background:set_bg(color["Purple200"])
|
||||||
|
device.background:set_fg(color["Grey900"])
|
||||||
|
else
|
||||||
|
fg = color["Purple200"]
|
||||||
|
bg = color["Grey700"]
|
||||||
|
device.background:set_fg(color["Purple200"])
|
||||||
|
device.background:set_bg(color["Grey700"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
else
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
awful.spawn.spawn("./.config/awesome/src/scripts/mic.sh set_source " .. node)
|
||||||
|
|
||||||
|
awesome.emit_signal("update::background:mic", node)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
--#region Signal Functions
|
||||||
|
local old_wibox, old_cursor, old_bg, old_fg
|
||||||
|
local bg = ""
|
||||||
|
local fg = ""
|
||||||
|
local mouse_enter = function()
|
||||||
|
if bg then
|
||||||
|
old_bg = device.background.bg
|
||||||
|
device.background.bg = bg .. 'dd'
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
old_fg = device.background.fg
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
local w = mouse.current_wibox
|
||||||
|
if w then
|
||||||
|
old_cursor, old_wibox = w.cursor, w
|
||||||
|
w.cursor = "hand1"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local button_press = function()
|
||||||
|
if bg then
|
||||||
|
if bg then
|
||||||
|
if string.len(bg) == 7 then
|
||||||
|
device.background.bg = bg .. 'bb'
|
||||||
|
else
|
||||||
|
device.background.bg = bg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local button_release = function()
|
||||||
|
if bg then
|
||||||
|
if bg then
|
||||||
|
if string.len(bg) == 7 then
|
||||||
|
device.background.bg = bg .. 'dd'
|
||||||
|
else
|
||||||
|
device.background.bg = bg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = fg
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local mouse_leave = function()
|
||||||
|
if bg then
|
||||||
|
device.background.bg = old_bg
|
||||||
|
end
|
||||||
|
if fg then
|
||||||
|
device.background.fg = old_fg
|
||||||
|
end
|
||||||
|
if old_wibox then
|
||||||
|
old_wibox.cursor = old_cursor
|
||||||
|
old_wibox = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
mouse_enter
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
button_press
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"button::release",
|
||||||
|
button_release
|
||||||
|
)
|
||||||
|
|
||||||
|
device:connect_signal(
|
||||||
|
"mouse::leave",
|
||||||
|
mouse_leave
|
||||||
|
)
|
||||||
|
--#endregion
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"update::background:mic",
|
||||||
|
function(new_node)
|
||||||
|
if node == new_node then
|
||||||
|
old_bg = color["Blue200"]
|
||||||
|
old_fg = color["Grey900"]
|
||||||
|
bg = color["Blue200"]
|
||||||
|
fg = color["Grey900"]
|
||||||
|
device.background:set_bg(color["Blue200"])
|
||||||
|
device.background:set_fg(color["Grey900"])
|
||||||
|
else
|
||||||
|
fg = color["Blue200"]
|
||||||
|
bg = color["Grey700"]
|
||||||
|
device.background:set_fg(color["Blue200"])
|
||||||
|
device.background:set_bg(color["Grey700"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ pactl get-default-source ]],
|
||||||
|
function(stdout)
|
||||||
|
local node_active = stdout:gsub("\n", "")
|
||||||
|
if node == node_active then
|
||||||
|
bg = color["Blue200"]
|
||||||
|
fg = color["Grey900"]
|
||||||
|
device.background:set_bg(color["Blue200"])
|
||||||
|
device.background:set_fg(color["Grey900"])
|
||||||
|
else
|
||||||
|
fg = color["Blue200"]
|
||||||
|
bg = color["Grey700"]
|
||||||
|
device.background:set_fg(color["Blue200"])
|
||||||
|
device.background:set_bg(color["Grey700"])
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
return device
|
||||||
|
end
|
||||||
|
|
||||||
|
local dropdown_list_volume = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
id = "volume_device_list"
|
||||||
|
},
|
||||||
|
id = "volume_device_background",
|
||||||
|
bg = color["Grey800"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
}
|
||||||
|
|
||||||
|
local dropdown_list_microphone = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
id = "volume_device_list"
|
||||||
|
},
|
||||||
|
id = "volume_device_background",
|
||||||
|
bg = color["Grey800"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.partially_rounded_rect(cr, width, height, false, false, true, true, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
}
|
||||||
|
|
||||||
|
local volume_controller = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
-- Audio Device selector
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
resize = false,
|
||||||
|
image = gears.color.recolor_image(icondir .. "menu-down.svg", color["Purple200"]),
|
||||||
|
widget = wibox.widget.imagebox,
|
||||||
|
id = "icon"
|
||||||
|
},
|
||||||
|
id = "center",
|
||||||
|
halign = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.container.place,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
text = "Output Device",
|
||||||
|
widget = wibox.widget.textbox,
|
||||||
|
id = "device_name"
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "audio_volume",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "audio_bg",
|
||||||
|
bg = color["Grey800"],
|
||||||
|
fg = color["Purple200"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
id = "audio_selector_margin",
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
top = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "volume_list",
|
||||||
|
widget = dropdown_list_volume,
|
||||||
|
visible = false
|
||||||
|
},
|
||||||
|
-- Microphone selector
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
resize = false,
|
||||||
|
image = gears.color.recolor_image(icondir .. "menu-down.svg", color["LightBlueA200"]),
|
||||||
|
widget = wibox.widget.imagebox,
|
||||||
|
id = "icon",
|
||||||
|
},
|
||||||
|
id = "center",
|
||||||
|
halign = "center",
|
||||||
|
valign = "center",
|
||||||
|
widget = wibox.container.place,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
text = "Input Device",
|
||||||
|
widget = wibox.widget.textbox,
|
||||||
|
id = "device_name"
|
||||||
|
},
|
||||||
|
margins = dpi(5),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "mic_volume",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "mic_bg",
|
||||||
|
bg = color["Grey800"],
|
||||||
|
fg = color["LightBlueA200"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
},
|
||||||
|
id = "mic_selector_margin",
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
top = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id = "mic_list",
|
||||||
|
widget = dropdown_list_microphone,
|
||||||
|
visible = false
|
||||||
|
},
|
||||||
|
-- Audio volume slider
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
resize = false,
|
||||||
|
widget = wibox.widget.imagebox,
|
||||||
|
image = gears.color.recolor_image(icondir .. "volume-high.svg", color["Purple200"]),
|
||||||
|
id = "icon",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
bar_shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
bar_height = dpi(5),
|
||||||
|
bar_color = color["Grey800"],
|
||||||
|
bar_active_color = color["Purple200"],
|
||||||
|
handle_color = color["Purple200"],
|
||||||
|
handle_shape = gears.shape.circle,
|
||||||
|
handle_border_color = color["Purple200"],
|
||||||
|
handle_width = dpi(15),
|
||||||
|
maximum = 100,
|
||||||
|
forced_height = dpi(26),
|
||||||
|
widget = wibox.widget.slider,
|
||||||
|
id = "slider"
|
||||||
|
},
|
||||||
|
bottom = dpi(12),
|
||||||
|
left = dpi(5),
|
||||||
|
id = "slider_margin",
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "audio_volume",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
id = "audio_volume_margin",
|
||||||
|
top = dpi(10),
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
-- Microphone volume slider
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
resize = false,
|
||||||
|
widget = wibox.widget.imagebox,
|
||||||
|
image = gears.color.recolor_image(icondir .. "microphone.svg", color["Blue200"]),
|
||||||
|
id = "icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{
|
||||||
|
bar_shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
bar_height = dpi(5),
|
||||||
|
bar_color = color["Grey800"],
|
||||||
|
bar_active_color = color["Blue200"],
|
||||||
|
handle_color = color["Blue200"],
|
||||||
|
handle_shape = gears.shape.circle,
|
||||||
|
handle_border_color = color["Blue200"],
|
||||||
|
handle_width = dpi(15),
|
||||||
|
maximum = 100,
|
||||||
|
forced_height = dpi(26),
|
||||||
|
widget = wibox.widget.slider,
|
||||||
|
id = "slider"
|
||||||
|
},
|
||||||
|
left = dpi(5),
|
||||||
|
id = "slider_margin",
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "mic_volume",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
id = "mic_volume_margin",
|
||||||
|
left = dpi(10),
|
||||||
|
right = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
id = "controller_layout",
|
||||||
|
layout = wibox.layout.fixed.vertical
|
||||||
|
},
|
||||||
|
id = "controller_margin",
|
||||||
|
margins = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Grey900"],
|
||||||
|
border_color = color["Grey800"],
|
||||||
|
border_width = dpi(4),
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 12)
|
||||||
|
end,
|
||||||
|
forced_width = dpi(400),
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Variables for easier access and better readability
|
||||||
|
local audio_selector_margin = volume_controller:get_children_by_id("audio_selector_margin")[1]
|
||||||
|
local volume_list = volume_controller:get_children_by_id("volume_list")[1]
|
||||||
|
local audio_bg = volume_controller:get_children_by_id("audio_bg")[1]
|
||||||
|
local audio_volume = volume_controller:get_children_by_id("audio_volume")[1].center
|
||||||
|
|
||||||
|
-- Click event for the audio dropdown
|
||||||
|
audio_selector_margin:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
volume_list.visible = not volume_list.visible
|
||||||
|
if volume_list.visible then
|
||||||
|
audio_bg.shape = function(cr, width, height)
|
||||||
|
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, 4)
|
||||||
|
end
|
||||||
|
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg", color["Teal200"]))
|
||||||
|
else
|
||||||
|
audio_bg.shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end
|
||||||
|
audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg", color["Teal200"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Variables for easier access and better readability
|
||||||
|
local mic_selector_margin = volume_controller:get_children_by_id("mic_selector_margin")[1]
|
||||||
|
local mic_list = volume_controller:get_children_by_id("mic_list")[1]
|
||||||
|
local mic_bg = volume_controller:get_children_by_id("mic_bg")[1]
|
||||||
|
local mic_volume = volume_controller:get_children_by_id("mic_volume")[1].center
|
||||||
|
|
||||||
|
-- Click event for the microphone dropdown
|
||||||
|
mic_selector_margin:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
mic_list.visible = not mic_list.visible
|
||||||
|
if mic_list.visible then
|
||||||
|
mic_selector_margin.mic_bg.shape = function(cr, width, height)
|
||||||
|
gears.shape.partially_rounded_rect(cr, width, height, true, true, false, false, 4)
|
||||||
|
end
|
||||||
|
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-up.svg", color["Teal200"]))
|
||||||
|
else
|
||||||
|
mic_bg.shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 4)
|
||||||
|
end
|
||||||
|
mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "menu-down.svg", color["Teal200"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local audio_slider_margin = volume_controller:get_children_by_id("audio_volume_margin")[1].audio_volume.slider_margin.slider
|
||||||
|
|
||||||
|
-- Volume slider change event
|
||||||
|
audio_slider_margin:connect_signal(
|
||||||
|
"property::value",
|
||||||
|
function()
|
||||||
|
local volume = audio_slider_margin.value
|
||||||
|
awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ " .. tonumber(volume) .. "%")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
local mic_slider_margin = volume_controller:get_children_by_id("mic_volume_margin")[1].mic_volume.slider_margin.slider
|
||||||
|
|
||||||
|
-- Microphone slider change event
|
||||||
|
mic_slider_margin:connect_signal(
|
||||||
|
"property::value",
|
||||||
|
function()
|
||||||
|
local volume = mic_slider_margin.value
|
||||||
|
awful.spawn("pactl set-source-volume @DEFAULT_SOURCE@ " .. tonumber(volume) .. "%")
|
||||||
|
awesome.emit_signal("get::mic_volume", volume)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Main container
|
||||||
|
local volume_controller_container = awful.popup {
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
bg = color["Grey900"],
|
||||||
|
stretch = false,
|
||||||
|
visible = false,
|
||||||
|
screen = s,
|
||||||
|
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(305), top = dpi(60) } }) end,
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 12)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Get all audio devices from all sinks
|
||||||
|
local function get_devices()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ pactl list sinks | grep -E 'node.name|alsa.card_name' | awk '{gsub(/"/, ""); for(i = 3;i < NF;i++) printf $i " "; print $NF}' ]],
|
||||||
|
|
||||||
|
function(stdout)
|
||||||
|
local i, j = 1, 1
|
||||||
|
local device_list = { layout = wibox.layout.fixed.vertical }
|
||||||
|
|
||||||
|
local node_names, alsa_names = {}, {}
|
||||||
|
for node_name in stdout:gmatch("[^\n]+") do
|
||||||
|
if (i % 2) == 0 then
|
||||||
|
table.insert(node_names, node_name)
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for alsa_name in stdout:gmatch("[^\n]+") do
|
||||||
|
if (j % 2) == 1 then
|
||||||
|
table.insert(alsa_names, alsa_name)
|
||||||
|
end
|
||||||
|
j = j + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for k = 1, #alsa_names, 1 do
|
||||||
|
device_list[#device_list + 1] = create_device(alsa_names[k], node_names[k], true)
|
||||||
|
end
|
||||||
|
dropdown_list_volume.volume_device_background.volume_device_list.children = device_list
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
get_devices()
|
||||||
|
|
||||||
|
-- Get all input devices from all sources
|
||||||
|
local function get_input_devices()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ pactl list sources | grep -E "node.name|alsa.card_name" | awk '{gsub(/"/, ""); for(i = 3;i < NF;i++) printf $i " "; print $NF}' ]],
|
||||||
|
|
||||||
|
function(stdout)
|
||||||
|
local i, j = 1, 1
|
||||||
|
local device_list = { layout = wibox.layout.fixed.vertical }
|
||||||
|
|
||||||
|
local node_names, alsa_names = {}, {}
|
||||||
|
for node_name in stdout:gmatch("[^\n]+") do
|
||||||
|
if (i % 2) == 0 then
|
||||||
|
table.insert(node_names, node_name)
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for alsa_name in stdout:gmatch("[^\n]+") do
|
||||||
|
if (j % 2) == 1 then
|
||||||
|
table.insert(alsa_names, alsa_name)
|
||||||
|
end
|
||||||
|
j = j + 1
|
||||||
|
end
|
||||||
|
|
||||||
|
for k = 1, #alsa_names, 1 do
|
||||||
|
device_list[#device_list + 1] = create_device(alsa_names[k], node_names[k], false)
|
||||||
|
end
|
||||||
|
dropdown_list_microphone.volume_device_background.volume_device_list.children = device_list
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
get_input_devices()
|
||||||
|
|
||||||
|
-- Get microphone volume
|
||||||
|
local function get_mic_volume()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"./.config/awesome/src/scripts/mic.sh volume",
|
||||||
|
function(stdout)
|
||||||
|
local volume = stdout:gsub("%%", ""):gsub("\n", "")
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].mic_volume.slider_margin.slider:set_value(tonumber(volume))
|
||||||
|
if volume > 0 then
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].icon:set_image(gears.color.recolor_image(icondir .. "microphone.svg", color["LightBlue200"]))
|
||||||
|
else
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].icon:set_image(gears.color.recolor_image(icondir .. "microphone-off.svg", color["LightBlue200"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
get_mic_volume()
|
||||||
|
|
||||||
|
-- Check if microphone is muted
|
||||||
|
local function get_mic_mute()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"./.config/awesome/src/scripts/mic.sh mute",
|
||||||
|
function(stdout)
|
||||||
|
if stdout:match("yes") then
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].mic_volume.slider_margin.slider:set_value(tonumber(0))
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].icon:set_image(gears.color.recolor_image(icondir .. "microphone-off.svg", color["LightBlue200"]))
|
||||||
|
else
|
||||||
|
get_mic_volume()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
get_mic_mute()
|
||||||
|
|
||||||
|
volume_controller_container:setup {
|
||||||
|
volume_controller,
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Global signal called from src.widgets.audio.lua
|
||||||
|
awesome.connect_signal(
|
||||||
|
"get::volume",
|
||||||
|
function(volume)
|
||||||
|
volume = tonumber(volume)
|
||||||
|
local icon = icondir .. "volume"
|
||||||
|
if volume < 1 then
|
||||||
|
icon = icon .. "-mute"
|
||||||
|
|
||||||
|
elseif volume >= 1 and volume < 34 then
|
||||||
|
icon = icon .. "-low"
|
||||||
|
elseif volume >= 34 and volume < 67 then
|
||||||
|
icon = icon .. "-medium"
|
||||||
|
elseif volume >= 67 then
|
||||||
|
icon = icon .. "-high"
|
||||||
|
end
|
||||||
|
|
||||||
|
volume_controller.controller_margin.controller_layout.audio_volume_margin.audio_volume.slider_margin.slider:set_value(volume)
|
||||||
|
volume_controller.controller_margin.controller_layout.audio_volume_margin.audio_volume.icon:set_image(gears.color.recolor_image(icon .. ".svg", color["Purple200"]))
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Global signal called from src.widgets.audio.lua
|
||||||
|
awesome.connect_signal(
|
||||||
|
"get::volume_mute",
|
||||||
|
function(mute)
|
||||||
|
if mute then
|
||||||
|
volume_controller.controller_margin.controller_layout.audio_volume_margin.audio_volume.icon:set_image(gears.color.recolor_image(icondir .. "volume-mute.svg", color["Purple200"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"get::mic_volume",
|
||||||
|
function(volume)
|
||||||
|
if volume > 0 then
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "microphone.svg", color["LightBlue200"]))
|
||||||
|
else
|
||||||
|
volume_controller:get_children_by_id("mic_volume_margin")[1].mic_volume.icon:set_image(gears.color.recolor_image(icondir .. "microphone-off.svg", color["LightBlue200"]))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Toggle container visibility
|
||||||
|
awesome.connect_signal(
|
||||||
|
"volume_controller::toggle",
|
||||||
|
function(scr)
|
||||||
|
if scr == s then
|
||||||
|
volume_controller_container.visible = not volume_controller_container.visible
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
end
|
||||||
27
awesome/src/scripts/mic.sh
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
SINK=$(LC_ALL=C pactl get-default-source)
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
|
||||||
|
"volume")
|
||||||
|
echo $(LC_ALL=C pactl get-source-volume $SINK | awk '{print $5}')
|
||||||
|
;;
|
||||||
|
|
||||||
|
"mute")
|
||||||
|
echo $(LC_ALL=C pactl get-source-mute $SINK)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"toggle_mute")
|
||||||
|
$(LC_ALL=C pactl set-source-mute $SINK toggle)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"set_volume")
|
||||||
|
$(LC_ALL=C pactl set-source-volume $SINK $2)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"set_source")
|
||||||
|
$(LC_ALL=C pactl set-default-source $2)
|
||||||
|
;;
|
||||||
|
|
||||||
|
esac
|
||||||
@@ -2,10 +2,17 @@
|
|||||||
|
|
||||||
SINK=$(LC_ALL=C pactl get-default-sink)
|
SINK=$(LC_ALL=C pactl get-default-sink)
|
||||||
|
|
||||||
if [[ $1 == "volume" ]]
|
case $1 in
|
||||||
then
|
|
||||||
echo $(LC_ALL=C pactl get-sink-volume $SINK | awk '{print $5}')
|
"volume")
|
||||||
elif [[ $1 == "mute" ]]
|
echo $(LC_ALL=C pactl get-sink-volume $SINK | awk '{print $5}')
|
||||||
then
|
;;
|
||||||
echo $(LC_ALL=C pactl get-sink-mute $SINK)
|
|
||||||
fi
|
"mute")
|
||||||
|
echo $(LC_ALL=C pactl get-sink-mute $SINK)
|
||||||
|
;;
|
||||||
|
|
||||||
|
"set_sink")
|
||||||
|
$(LC_ALL=C pactl set-default-sink $2)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|||||||
@@ -3,193 +3,209 @@
|
|||||||
-----------------------------------------------------
|
-----------------------------------------------------
|
||||||
|
|
||||||
return {
|
return {
|
||||||
['White'] = '#ffffffdd',
|
['White'] = '#ffffffdd',
|
||||||
['Black'] = '#000000',
|
['Black'] = '#000000',
|
||||||
|
|
||||||
['Grey50'] = '#fafafa',
|
['Grey50'] = '#fafafa',
|
||||||
['Grey100'] = '#f5f5f5',
|
['Grey100'] = '#f5f5f5',
|
||||||
['Grey200'] = '#eeeeee',
|
['Grey200'] = '#eeeeee',
|
||||||
['Grey300'] = '#e0e0e0',
|
['Grey300'] = '#e0e0e0',
|
||||||
['Grey400'] = '#bdbdbd',
|
['Grey400'] = '#bdbdbd',
|
||||||
['Grey500'] = '#9e9e9e',
|
['Grey500'] = '#9e9e9e',
|
||||||
['Grey600'] = '#757575',
|
['Grey600'] = '#757575',
|
||||||
['Grey700'] = '#616161',
|
['Grey700'] = '#616161',
|
||||||
['Grey800'] = '#424242',
|
['Grey800'] = '#424242',
|
||||||
['Grey900'] = '#212121',
|
['Grey900'] = '#212121',
|
||||||
|
|
||||||
['Red50'] = '#ffebee',
|
['Red50'] = '#ffebee',
|
||||||
['Red100'] = '#ffcdd2',
|
['Red100'] = '#ffcdd2',
|
||||||
['Red200'] = '#ef9a9a',
|
['Red200'] = '#ef9a9a',
|
||||||
['Red300'] = '#e57373',
|
['Red300'] = '#e57373',
|
||||||
['Red400'] = '#ef5350',
|
['Red400'] = '#ef5350',
|
||||||
['Red500'] = '#f44336',
|
['Red500'] = '#f44336',
|
||||||
['Red600'] = '#e53935',
|
['Red600'] = '#e53935',
|
||||||
['Red700'] = '#d32f2f',
|
['Red700'] = '#d32f2f',
|
||||||
['Red800'] = '#c62828',
|
['Red800'] = '#c62828',
|
||||||
['Red900'] = '#b71c1c',
|
['Red900'] = '#b71c1c',
|
||||||
['RedA100'] = '#ff8a80',
|
['RedA100'] = '#ff8a80',
|
||||||
['RedA200'] = '#ff5252',
|
['RedA200'] = '#ff5252',
|
||||||
['RedA400'] = '#ff1744',
|
['RedA400'] = '#ff1744',
|
||||||
['RedA700'] = '#d50000',
|
['RedA700'] = '#d50000',
|
||||||
|
|
||||||
['Pink50'] = '#fce4ec',
|
['Pink50'] = '#fce4ec',
|
||||||
['Pink100'] = '#f8bbd0',
|
['Pink100'] = '#f8bbd0',
|
||||||
['Pink200'] = '#f48fb1',
|
['Pink200'] = '#f48fb1',
|
||||||
['Pink300'] = '#f06292',
|
['Pink300'] = '#f06292',
|
||||||
['Pink400'] = '#ec407a',
|
['Pink400'] = '#ec407a',
|
||||||
['Pink500'] = '#e91e63',
|
['Pink500'] = '#e91e63',
|
||||||
['Pink600'] = '#d81b60',
|
['Pink600'] = '#d81b60',
|
||||||
['Pink700'] = '#c2185b',
|
['Pink700'] = '#c2185b',
|
||||||
['Pink800'] = '#ad1457',
|
['Pink800'] = '#ad1457',
|
||||||
['Pink900'] = '#880e4f',
|
['Pink900'] = '#880e4f',
|
||||||
['PinkA100'] = '#ff80ab',
|
['PinkA100'] = '#ff80ab',
|
||||||
['PinkA200'] = '#ff4081',
|
['PinkA200'] = '#ff4081',
|
||||||
['PinkA400'] = '#f50057',
|
['PinkA400'] = '#f50057',
|
||||||
['PinkA700'] = '#c51162',
|
['PinkA700'] = '#c51162',
|
||||||
|
|
||||||
['Blue50'] = '#e3f2fd',
|
['Blue50'] = '#e3f2fd',
|
||||||
['Blue100'] = '#bbdefb',
|
['Blue100'] = '#bbdefb',
|
||||||
['Blue200'] = '#90caf9',
|
['Blue200'] = '#90caf9',
|
||||||
['Blue300'] = '#64b5f6',
|
['Blue300'] = '#64b5f6',
|
||||||
['Blue400'] = '#42a5f5',
|
['Blue400'] = '#42a5f5',
|
||||||
['Blue500'] = '#2196f3',
|
['Blue500'] = '#2196f3',
|
||||||
['Blue600'] = '#1e88e5',
|
['Blue600'] = '#1e88e5',
|
||||||
['Blue700'] = '#1976d2',
|
['Blue700'] = '#1976d2',
|
||||||
['Blue800'] = '#1565c0',
|
['Blue800'] = '#1565c0',
|
||||||
['Blue900'] = '#0d47a1',
|
['Blue900'] = '#0d47a1',
|
||||||
['BlueA100'] = '#82b1ff',
|
['BlueA100'] = '#82b1ff',
|
||||||
['BlueA200'] = '#448aff',
|
['BlueA200'] = '#448aff',
|
||||||
['BlueA400'] = '#2979ff',
|
['BlueA400'] = '#2979ff',
|
||||||
['BlueA700'] = '#2962ff',
|
['BlueA700'] = '#2962ff',
|
||||||
|
|
||||||
['Yellow50'] = '#fffde7',
|
['Yellow50'] = '#fffde7',
|
||||||
['Yellow100'] = '#fff9c4',
|
['Yellow100'] = '#fff9c4',
|
||||||
['Yellow200'] = '#fff59d',
|
['Yellow200'] = '#fff59d',
|
||||||
['Yellow300'] = '#fff176',
|
['Yellow300'] = '#fff176',
|
||||||
['Yellow400'] = '#ffee58',
|
['Yellow400'] = '#ffee58',
|
||||||
['Yellow500'] = '#ffeb3b',
|
['Yellow500'] = '#ffeb3b',
|
||||||
['Yellow600'] = '#fdd835',
|
['Yellow600'] = '#fdd835',
|
||||||
['Yellow700'] = '#fbc02d',
|
['Yellow700'] = '#fbc02d',
|
||||||
['Yellow800'] = '#f9a825',
|
['Yellow800'] = '#f9a825',
|
||||||
['Yellow900'] = '#f57f17',
|
['Yellow900'] = '#f57f17',
|
||||||
['YellowA100'] = '#ffff8d',
|
['YellowA100'] = '#ffff8d',
|
||||||
['YellowA200'] = '#ffff00',
|
['YellowA200'] = '#ffff00',
|
||||||
['YellowA400'] = '#ffea00',
|
['YellowA400'] = '#ffea00',
|
||||||
['YellowA700'] = '#ffd600',
|
['YellowA700'] = '#ffd600',
|
||||||
|
|
||||||
['Teal50'] = '#e0f2f1',
|
['Teal50'] = '#e0f2f1',
|
||||||
['Teal100'] = '#b2dfdb',
|
['Teal100'] = '#b2dfdb',
|
||||||
['Teal200'] = '#80cbc4',
|
['Teal200'] = '#80cbc4',
|
||||||
['Teal300'] = '#4db6ac',
|
['Teal300'] = '#4db6ac',
|
||||||
['Teal400'] = '#26a69a',
|
['Teal400'] = '#26a69a',
|
||||||
['Teal500'] = '#009688',
|
['Teal500'] = '#009688',
|
||||||
['Teal600'] = '#00897b',
|
['Teal600'] = '#00897b',
|
||||||
['Teal700'] = '#00796b',
|
['Teal700'] = '#00796b',
|
||||||
['Teal800'] = '#00695c',
|
['Teal800'] = '#00695c',
|
||||||
['Teal900'] = '#004d40',
|
['Teal900'] = '#004d40',
|
||||||
['TealA100'] = '#a7ffeb',
|
['TealA100'] = '#a7ffeb',
|
||||||
['TealA200'] = '#64ffda',
|
['TealA200'] = '#64ffda',
|
||||||
['TealA400'] = '#1de9b6',
|
['TealA400'] = '#1de9b6',
|
||||||
['TealA700'] = '#00bfa5',
|
['TealA700'] = '#00bfa5',
|
||||||
|
|
||||||
['Green50'] = '#e8f5e9',
|
['Green50'] = '#e8f5e9',
|
||||||
['Green100'] = '#c8e6c9',
|
['Green100'] = '#c8e6c9',
|
||||||
['Green200'] = '#a5d6a7',
|
['Green200'] = '#a5d6a7',
|
||||||
['Green300'] = '#81c784',
|
['Green300'] = '#81c784',
|
||||||
['Green400'] = '#66bb6a',
|
['Green400'] = '#66bb6a',
|
||||||
['Green500'] = '#4caf50',
|
['Green500'] = '#4caf50',
|
||||||
['Green600'] = '#43a047',
|
['Green600'] = '#43a047',
|
||||||
['Green700'] = '#388e3c',
|
['Green700'] = '#388e3c',
|
||||||
['Green800'] = '#2e7d32',
|
['Green800'] = '#2e7d32',
|
||||||
['Green900'] = '#1b5e20',
|
['Green900'] = '#1b5e20',
|
||||||
['GreenA100'] = '#b9f6ca',
|
['GreenA100'] = '#b9f6ca',
|
||||||
['GreenA200'] = '#69f0ae',
|
['GreenA200'] = '#69f0ae',
|
||||||
['GreenA400'] = '#00e676',
|
['GreenA400'] = '#00e676',
|
||||||
['GreenA700'] = '#00c853',
|
['GreenA700'] = '#00c853',
|
||||||
|
|
||||||
['Orange50'] = '#fff3e0',
|
['Orange50'] = '#fff3e0',
|
||||||
['Orange100'] = '#ffe0b2',
|
['Orange100'] = '#ffe0b2',
|
||||||
['Orange200'] = '#ffcc80',
|
['Orange200'] = '#ffcc80',
|
||||||
['Orange300'] = '#ffb74d',
|
['Orange300'] = '#ffb74d',
|
||||||
['Orange400'] = '#ffa726',
|
['Orange400'] = '#ffa726',
|
||||||
['Orange500'] = '#ff9800',
|
['Orange500'] = '#ff9800',
|
||||||
['Orange600'] = '#fb8c00',
|
['Orange600'] = '#fb8c00',
|
||||||
['Orange700'] = '#f57c00',
|
['Orange700'] = '#f57c00',
|
||||||
['Orange800'] = '#ef6c00',
|
['Orange800'] = '#ef6c00',
|
||||||
['Orange900'] = '#e65100',
|
['Orange900'] = '#e65100',
|
||||||
['OrangeA100'] = '#ffd180',
|
['OrangeA100'] = '#ffd180',
|
||||||
['OrangeA200'] = '#ffab40',
|
['OrangeA200'] = '#ffab40',
|
||||||
['OrangeA400'] = '#ff9100',
|
['OrangeA400'] = '#ff9100',
|
||||||
['OrangeA700'] = '#ff6d00',
|
['OrangeA700'] = '#ff6d00',
|
||||||
|
|
||||||
['DeepOrange50'] = '#fbe9e7',
|
['DeepOrange50'] = '#fbe9e7',
|
||||||
['DeepOrange100'] = '#ffccbc',
|
['DeepOrange100'] = '#ffccbc',
|
||||||
['DeepOrange200'] = '#ffab91',
|
['DeepOrange200'] = '#ffab91',
|
||||||
['DeepOrange300'] = '#ff8a65',
|
['DeepOrange300'] = '#ff8a65',
|
||||||
['DeepOrange400'] = '#ff7043',
|
['DeepOrange400'] = '#ff7043',
|
||||||
['DeepOrange500'] = '#ff5722',
|
['DeepOrange500'] = '#ff5722',
|
||||||
['DeepOrange600'] = '#f4511e',
|
['DeepOrange600'] = '#f4511e',
|
||||||
['DeepOrange700'] = '#e64a19',
|
['DeepOrange700'] = '#e64a19',
|
||||||
['DeepOrange800'] = '#d84315',
|
['DeepOrange800'] = '#d84315',
|
||||||
['DeepOrange900'] = '#bf360c',
|
['DeepOrange900'] = '#bf360c',
|
||||||
['DeepOrangeA100'] = '#ff9e80',
|
['DeepOrangeA100'] = '#ff9e80',
|
||||||
['DeepOrangeA200'] = '#ff6e40',
|
['DeepOrangeA200'] = '#ff6e40',
|
||||||
['DeepOrangeA400'] = '#ff3d00',
|
['DeepOrangeA400'] = '#ff3d00',
|
||||||
['DeepOrangeA700'] = '#dd2c00',
|
['DeepOrangeA700'] = '#dd2c00',
|
||||||
|
|
||||||
['Purple50'] = '#F3E5F5',
|
['Purple50'] = '#F3E5F5',
|
||||||
['Purple100'] = '#E1BEE7',
|
['Purple100'] = '#E1BEE7',
|
||||||
['Purple200'] = '#CE93D8',
|
['Purple200'] = '#CE93D8',
|
||||||
['Purple300'] = '#BA68C8',
|
['Purple300'] = '#BA68C8',
|
||||||
['Purple400'] = '#AB47BC',
|
['Purple400'] = '#AB47BC',
|
||||||
['Purple500'] = '#9C27B0',
|
['Purple500'] = '#9C27B0',
|
||||||
['Purple600'] = '#8E24AA',
|
['Purple600'] = '#8E24AA',
|
||||||
['Purple700'] = '#7B1FA2',
|
['Purple700'] = '#7B1FA2',
|
||||||
['Purple800'] = '#6A1B9A',
|
['Purple800'] = '#6A1B9A',
|
||||||
['Purple900'] = '#4A148C',
|
['Purple900'] = '#4A148C',
|
||||||
['PurpleA100'] = '#EA80FC',
|
['PurpleA100'] = '#EA80FC',
|
||||||
['PurpleA200'] = '#E040FB',
|
['PurpleA200'] = '#E040FB',
|
||||||
['PurpleA500'] = '#D500F9',
|
['PurpleA500'] = '#D500F9',
|
||||||
['PurpleA700'] = '#AA00FF',
|
['PurpleA700'] = '#AA00FF',
|
||||||
|
|
||||||
['DeepPurple50'] = '#EDE7F6',
|
['DeepPurple50'] = '#EDE7F6',
|
||||||
['DeepPurple100'] = '#D1C4E9',
|
['DeepPurple100'] = '#D1C4E9',
|
||||||
['DeepPurple200'] = '#B39DDB',
|
['DeepPurple200'] = '#B39DDB',
|
||||||
['DeepPurple300'] = '#9575CD',
|
['DeepPurple300'] = '#9575CD',
|
||||||
['DeepPurple400'] = '#7E57C2',
|
['DeepPurple400'] = '#7E57C2',
|
||||||
['DeepPurple500'] = '#673AB7',
|
['DeepPurple500'] = '#673AB7',
|
||||||
['DeepPurple600'] = '#5E35B1',
|
['DeepPurple600'] = '#5E35B1',
|
||||||
['DeepPurple700'] = '#512DA8',
|
['DeepPurple700'] = '#512DA8',
|
||||||
['DeepPurple800'] = '#4527A0',
|
['DeepPurple800'] = '#4527A0',
|
||||||
['DeepPurple900'] = '#311B92',
|
['DeepPurple900'] = '#311B92',
|
||||||
['DeepPurpleA100'] = '#B388FF',
|
['DeepPurpleA100'] = '#B388FF',
|
||||||
['DeepPurpleA200'] = '#7C4DFF',
|
['DeepPurpleA200'] = '#7C4DFF',
|
||||||
['DeepPurpleA400'] = '#651FFF',
|
['DeepPurpleA400'] = '#651FFF',
|
||||||
['DeepPurpleA700'] = '#6200EA',
|
['DeepPurpleA700'] = '#6200EA',
|
||||||
|
|
||||||
['LightBlue50'] = '#E1F5FE',
|
['LightBlue50'] = '#E1F5FE',
|
||||||
['LightBlue100'] = '#B3E5FC',
|
['LightBlue100'] = '#B3E5FC',
|
||||||
['LightBlue200'] = '#81D4FA',
|
['LightBlue200'] = '#81D4FA',
|
||||||
['LightBlue300'] = '#4FC3F7',
|
['LightBlue300'] = '#4FC3F7',
|
||||||
['LightBlue400'] = '#29B6F6',
|
['LightBlue400'] = '#29B6F6',
|
||||||
['LightBlue500'] = '#03A9F4',
|
['LightBlue500'] = '#03A9F4',
|
||||||
['LightBlue600'] = '#039BE5',
|
['LightBlue600'] = '#039BE5',
|
||||||
['LightBlue700'] = '#0288D1',
|
['LightBlue700'] = '#0288D1',
|
||||||
['LightBlue800'] = '#0277BD',
|
['LightBlue800'] = '#0277BD',
|
||||||
['LightBlue900'] = '#01579B',
|
['LightBlue900'] = '#01579B',
|
||||||
['LightBlueA100'] = '#80D8FF',
|
['LightBlueA100'] = '#80D8FF',
|
||||||
['LightBlueA200'] = '#40C4FF',
|
['LightBlueA200'] = '#40C4FF',
|
||||||
['LightBlueA400'] = '#00B0FF',
|
['LightBlueA400'] = '#00B0FF',
|
||||||
['LightBlueA700'] = '#0091EA',
|
['LightBlueA700'] = '#0091EA',
|
||||||
|
|
||||||
['BlueGrey50'] = '#ECEFF1',
|
['Cyan50'] = '#E0F7FA',
|
||||||
['BlueGrey100'] = '#CFD8DC',
|
['Cyan100'] = '#B2EBF2',
|
||||||
['BlueGrey200'] = '#B0BEC5',
|
['Cyan200'] = '#80DEEA',
|
||||||
['BlueGrey300'] = '#90A4AE',
|
['Cyan300'] = '#4DD0E1',
|
||||||
['BlueGrey400'] = '#78909C',
|
['Cyan400'] = '#26C6DA',
|
||||||
['BlueGrey500'] = '#607D8B',
|
['Cyan500'] = '#00BCD4',
|
||||||
['BlueGrey600'] = '#546E7A',
|
['Cyan600'] = '#00ACC1',
|
||||||
['BlueGrey700'] = '#455A64',
|
['Cyan700'] = '#0097A7',
|
||||||
['BlueGrey800'] = '#37474F',
|
['Cyan800'] = '#00838F',
|
||||||
['BlueGrey900'] = '#263238'
|
['Cyan900'] = '#006064',
|
||||||
|
['CyanA100'] = '#84FFFF',
|
||||||
|
['CyanA200'] = '#18FFFF',
|
||||||
|
['CyanA400'] = '#00E5FF',
|
||||||
|
['CyanA700'] = '#00B8D4',
|
||||||
|
|
||||||
|
|
||||||
|
['BlueGrey50'] = '#ECEFF1',
|
||||||
|
['BlueGrey100'] = '#CFD8DC',
|
||||||
|
['BlueGrey200'] = '#B0BEC5',
|
||||||
|
['BlueGrey300'] = '#90A4AE',
|
||||||
|
['BlueGrey400'] = '#78909C',
|
||||||
|
['BlueGrey500'] = '#607D8B',
|
||||||
|
['BlueGrey600'] = '#546E7A',
|
||||||
|
['BlueGrey700'] = '#455A64',
|
||||||
|
['BlueGrey800'] = '#37474F',
|
||||||
|
['BlueGrey900'] = '#263238'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,15 +23,14 @@ beautiful.wallpaper = user_vars.wallpaper
|
|||||||
screen.connect_signal(
|
screen.connect_signal(
|
||||||
'request::wallpaper',
|
'request::wallpaper',
|
||||||
function(s)
|
function(s)
|
||||||
-- If wallpaper is a function, call it with the screen
|
if beautiful.wallpaper then
|
||||||
if beautiful.wallpaper then
|
if type(beautiful.wallpaper) == 'string' then
|
||||||
if type(beautiful.wallpaper) == 'string' then
|
gears.wallpaper.maximized(beautiful.wallpaper, s)
|
||||||
gears.wallpaper.maximized(beautiful.wallpaper, s)
|
else
|
||||||
else
|
beautiful.wallpaper(s)
|
||||||
beautiful.wallpaper(s)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
beautiful.init(Theme)
|
beautiful.init(Theme)
|
||||||
|
|||||||
@@ -40,31 +40,22 @@ Theme.menu_fg_focus = color["White"]
|
|||||||
Theme.menu_border_color = color["Grey800"]
|
Theme.menu_border_color = color["Grey800"]
|
||||||
Theme.menu_border_width = dpi(0)
|
Theme.menu_border_width = dpi(0)
|
||||||
Theme.menu_shape = function(cr, width, heigth)
|
Theme.menu_shape = function(cr, width, heigth)
|
||||||
gears.shape.rounded_rect(cr, width, heigth, 5)
|
gears.shape.rounded_rect(cr, width, heigth, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
Theme.taglist_fg_focus = color["Grey900"]
|
Theme.taglist_fg_focus = color["Grey900"]
|
||||||
Theme.taglist_bg_focus = color["White"]
|
Theme.taglist_bg_focus = color["White"]
|
||||||
|
|
||||||
Theme.tooltip_border_color = color["Grey900"]
|
Theme.tooltip_border_color = color["Grey800"]
|
||||||
Theme.tooltip_bg = color["Grey800"]
|
Theme.tooltip_bg = color["Grey900"]
|
||||||
Theme.tooltip_fg = color["White"]
|
Theme.tooltip_fg = color["YellowA200"]
|
||||||
Theme.tooltip_border_width = dpi(0)
|
Theme.tooltip_border_width = dpi(4)
|
||||||
|
Theme.tooltip_gaps = dpi(15)
|
||||||
Theme.tooltip_shape = function(cr, width, heigth)
|
Theme.tooltip_shape = function(cr, width, heigth)
|
||||||
gears.shape.rounded_rect(cr, width, heigth, 5)
|
gears.shape.rounded_rect(cr, width, heigth, 5)
|
||||||
end
|
end
|
||||||
|
|
||||||
Theme.notification_bg = color["Grey900"]
|
Theme.notification_spacing = dpi(20)
|
||||||
Theme.notification_fg = color["White"]
|
|
||||||
Theme.notification_border_width = dpi(0)
|
|
||||||
Theme.notification_border_color = color["Grey900"]
|
|
||||||
Theme.notification_shape = function(cr, width, heigth)
|
|
||||||
gears.shape.rounded_rect(cr, width, heigth, 10)
|
|
||||||
end
|
|
||||||
Theme.notification_margin = dpi(10)
|
|
||||||
Theme.notification_max_width = dpi(400)
|
|
||||||
Theme.notification_max_height = dpi(1000)
|
|
||||||
Theme.notification_icon_size = dpi(40)
|
|
||||||
|
|
||||||
Theme.titlebar_close_button_normal = icondir .. "close.svg"
|
Theme.titlebar_close_button_normal = icondir .. "close.svg"
|
||||||
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
Theme.titlebar_maximized_button_normal = icondir .. "maximize.svg"
|
||||||
@@ -79,7 +70,7 @@ Theme.hotkeys_bg = color["Grey900"]
|
|||||||
Theme.hotkeys_fg = color["White"]
|
Theme.hotkeys_fg = color["White"]
|
||||||
Theme.hotkeys_border_width = 0
|
Theme.hotkeys_border_width = 0
|
||||||
Theme.hotkeys_shape = function(cr, width, height)
|
Theme.hotkeys_shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 10)
|
gears.shape.rounded_rect(cr, width, height, 10)
|
||||||
end
|
end
|
||||||
Theme.hotkeys_description_font = user_vars.font.bold
|
Theme.hotkeys_description_font = user_vars.font.bold
|
||||||
|
|
||||||
@@ -87,9 +78,14 @@ Theme.hotkeys_description_font = user_vars.font.bold
|
|||||||
local layout_path = Theme_path .. "../assets/layout/"
|
local layout_path = Theme_path .. "../assets/layout/"
|
||||||
|
|
||||||
-- Here are the icons for the layouts defined, if you want to add more layouts go to main/layouts.lua
|
-- Here are the icons for the layouts defined, if you want to add more layouts go to main/layouts.lua
|
||||||
Theme.layout_floating = gears.color.recolor_image(layout_path .. "floating.svg", color["Grey900"])
|
Theme.layout_floating = layout_path .. "floating.svg"
|
||||||
Theme.layout_tile = gears.color.recolor_image(layout_path .. "tile.svg", color["Grey900"])
|
Theme.layout_tile = layout_path .. "tile.svg"
|
||||||
--Theme.layout_dwindle = gears.color.recolor_image(layout_path .. "dwindle.svg", color["Grey900"])
|
Theme.layout_dwindle = layout_path .. "dwindle.svg"
|
||||||
--Theme.layout_fairh = gears.color.recolor_image(layout_path .. "fairh.svg", color["Grey900"])
|
Theme.layout_fairh = layout_path .. "fairh.svg"
|
||||||
--Theme.layout_fullscreen = gears.color.recolor_image(layout_path .. "fullscreen.svg", color["Grey900"])
|
Theme.layout_fairv = layout_path .. "fairv.svg"
|
||||||
--Theme.layout_max = gears.color.recolor_image(layout_path .. "max.svg", color["Grey900"])
|
Theme.layout_fullscreen = layout_path .. "fullscreen.svg"
|
||||||
|
Theme.layout_max = layout_path .. "max.svg"
|
||||||
|
Theme.layout_cornerne = layout_path .. "cornerne.svg"
|
||||||
|
Theme.layout_cornernw = layout_path .. "cornernw.svg"
|
||||||
|
Theme.layout_cornerse = layout_path .. "cornerse.svg"
|
||||||
|
Theme.layout_cornersw = layout_path .. "cornersw.svg"
|
||||||
|
|||||||
@@ -8,84 +8,98 @@ local home = os.getenv("HOME")
|
|||||||
-- If you want different default programs, wallpaper path or modkey; edit this file.
|
-- If you want different default programs, wallpaper path or modkey; edit this file.
|
||||||
user_vars = {
|
user_vars = {
|
||||||
|
|
||||||
-- Autotiling layouts
|
-- Autotiling layouts
|
||||||
layouts = {
|
layouts = {
|
||||||
awful.layout.suit.tile,
|
awful.layout.suit.tile,
|
||||||
awful.layout.suit.floating,
|
awful.layout.suit.tile.left,
|
||||||
awful.layout.suit.fair,
|
awful.layout.suit.tile.bottom,
|
||||||
},
|
awful.layout.suit.tile.top,
|
||||||
|
awful.layout.suit.floating,
|
||||||
|
awful.layout.suit.fair,
|
||||||
|
awful.layout.suit.fair.horizontal,
|
||||||
|
awful.layout.suit.corner.nw,
|
||||||
|
awful.layout.suit.corner.ne,
|
||||||
|
awful.layout.suit.corner.sw,
|
||||||
|
awful.layout.suit.corner.se,
|
||||||
|
awful.layout.suit.magnifier,
|
||||||
|
awful.layout.suit.max,
|
||||||
|
awful.layout.suit.max.fullscreen,
|
||||||
|
awful.layout.suit.spiral.dwindle,
|
||||||
|
},
|
||||||
|
|
||||||
-- Icon theme from /usr/share/icons
|
-- Icon theme from /usr/share/icons
|
||||||
icon_theme = "Papirus-Dark",
|
icon_theme = "Papirus-Dark",
|
||||||
|
|
||||||
-- Write the terminal command to start anything here
|
-- Write the terminal command to start anything here
|
||||||
autostart = {
|
autostart = {
|
||||||
"picom --experimental-backends",
|
"picom --experimental-backends",
|
||||||
"xfce4-power-manager",
|
"xfce4-power-manager",
|
||||||
"light-locker --lock-on-suspend --lock-on-lid &",
|
"light-locker --lock-on-suspend --lock-on-lid &",
|
||||||
"flatpak run com.spotify.Client",
|
"flatpak run com.spotify.Client",
|
||||||
"discord",
|
"discord",
|
||||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1",
|
||||||
},
|
"setxkbmap -option caps:swapescape"
|
||||||
|
},
|
||||||
|
|
||||||
-- Type 'ip a' and check your wlan and ethernet name
|
-- Type 'ip a' and check your wlan and ethernet name
|
||||||
network = {
|
network = {
|
||||||
wlan = "wlo1",
|
wlan = "wlo1",
|
||||||
ethernet = "eno1"
|
ethernet = "eno1"
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Set your font with this format:
|
-- Set your font with this format:
|
||||||
font = {
|
font = {
|
||||||
regular = "JetBrainsMono Nerd Font, 14",
|
regular = "JetBrainsMono Nerd Font, 14",
|
||||||
bold = "JetBrainsMono Nerd Font, bold 14",
|
bold = "JetBrainsMono Nerd Font, bold 14",
|
||||||
extrabold = "JetBrainsMono Nerd Font, ExtraBold 14"
|
extrabold = "JetBrainsMono Nerd Font, ExtraBold 14",
|
||||||
},
|
specify = "JetBrainsMono Nerd Font"
|
||||||
|
},
|
||||||
|
|
||||||
-- This is your default Terminal
|
-- This is your default Terminal
|
||||||
terminal = "alacritty",
|
terminal = "alacritty",
|
||||||
|
|
||||||
-- This is the modkey 'mod4' = Super/Mod/WindowsKey, 'mod3' = alt...
|
-- This is the modkey 'mod4' = Super/Mod/WindowsKey, 'mod3' = alt...
|
||||||
modkey = "Mod4",
|
modkey = "Mod4",
|
||||||
|
|
||||||
-- place your wallpaper at this path with this name, you could also try to change the path
|
-- place your wallpaper at this path with this name, you could also try to change the path
|
||||||
wallpaper = home .. "/.config/awesome/src/assets/fuji.jpg",
|
wallpaper = home .. "/.config/awesome/src/assets/fuji.jpg",
|
||||||
|
|
||||||
-- Naming scheme for the powermenu, userhost = "user@hostname", fullname = "Firstname Surname", something else ...
|
-- Naming scheme for the powermenu, userhost = "user@hostname", fullname = "Firstname Surname", something else ...
|
||||||
namestyle = "userhost",
|
namestyle = "userhost",
|
||||||
|
|
||||||
-- List every Keyboard layout you use here comma seperated. (run localectl list-keymaps to list all averiable keymaps)
|
-- List every Keyboard layout you use here comma seperated. (run localectl list-keymaps to list all averiable keymaps)
|
||||||
kblayout = { "de", "ru" },
|
kblayout = { "de", "ru" },
|
||||||
|
|
||||||
-- Your filemanager that opens with super+e
|
-- Your filemanager that opens with super+e
|
||||||
file_manager = "nemo",
|
file_manager = "thunar",
|
||||||
|
|
||||||
-- Screenshot program to make a screenshot when print is hit
|
-- Screenshot program to make a screenshot when print is hit
|
||||||
screenshot_program = "flameshot gui",
|
screenshot_program = "flameshot gui",
|
||||||
|
|
||||||
-- If you use the dock here is how you control its size
|
-- If you use the dock here is how you control its size
|
||||||
dock_icon_size = dpi(50),
|
dock_icon_size = dpi(50),
|
||||||
|
|
||||||
-- Add your programs exactly like in this example.
|
-- Add your programs exactly like in this example.
|
||||||
-- First entry has to be how you would start the program in the terminal (just try it if you dont know yahoo it)
|
-- First entry has to be how you would start the program in the terminal (just try it if you dont know yahoo it)
|
||||||
-- Second can be what ever the fuck you want it to be (will be the displayed name if you hover over it)
|
-- Second can be what ever the fuck you want it to be (will be the displayed name if you hover over it)
|
||||||
-- For steam games please use this format (look in .local/share/applications for the .desktop file, that will contain the number you need)
|
-- For steam games please use this format (look in .local/share/applications for the .desktop file, that will contain the number you need)
|
||||||
-- {"394360", "Name", true} true will tell the func that it's a steam game
|
-- {"394360", "Name", true} true will tell the func that it's a steam game
|
||||||
-- Use xprop | grep WM_CLASS and use the *SECOND* string
|
-- Use xprop | grep WM_CLASS and use the *SECOND* string
|
||||||
-- { WM_CLASS, program, name, isSteam }
|
-- { WM_CLASS, program, name, user_icon, isSteam }
|
||||||
dock_programs = {
|
dock_programs = {
|
||||||
{ "Alacritty", "alacritty", "Alacritty" },
|
{ "Alacritty", "alacritty", "Alacritty" },
|
||||||
{ "firefox", "firefox", "Firefox" },
|
{ "firefox", "firefox", "Firefox" },
|
||||||
{ "discord", "discord", "Discord" },
|
{ "discord", "discord", "Discord" },
|
||||||
{ "Spotify", "flatpak run com.spotify.Client", "Spotify" },
|
{ "Spotify", "flatpak run com.spotify.Client", "Spotify" },
|
||||||
{ "Code", "code", "Visual Studio Code" },
|
{ "Code", "code", "Visual Studio Code" },
|
||||||
{ "processing-app-Base", "arduino", "Arduino IDE" },
|
{ "processing-app-Base", "arduino", "Arduino IDE" },
|
||||||
{ "zoom", "zoom", "Zoom" },
|
{ "Zoom", "flatpak run us.zoom.Zoom", "Zoom" },
|
||||||
{ "Thunderbird", "thunderbird", "Thunderbird" },
|
{ "Thunderbird", "thunderbird", "Thunderbird" },
|
||||||
{ "Mattermost", "mattermost-desktop", "Mattermost" },
|
{ "Mattermost", "mattermost-desktop", "Mattermost" },
|
||||||
{ "Blender", "blender", "Blender" },
|
{ "Blender", "blender", "Blender" },
|
||||||
{ "Steam", "steam", "Steam" },
|
{ "Steam", "steam", "Steam" },
|
||||||
{ "FreeCAD", "freecad", "FreeCAD" },
|
{ "FreeCAD", "freecad", "FreeCAD" },
|
||||||
{ "Nemo", "nemo", "Dateien" },
|
{ "Thunar", "thunar", "Dateien" },
|
||||||
{ "Paradox Launcher", "394360", "Hearts of Iron 4", true }
|
{ "Windows", "virsh start Windows_11", "Windows 11", "/home/crylia/Bilder/windows.png", false, 50 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
|
|
||||||
return function(table)
|
return function(table)
|
||||||
for i, t in ipairs(table) do
|
for _, t in ipairs(table) do
|
||||||
awful.spawn.with_shell(t);
|
awful.spawn(t);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,74 +8,74 @@ local icon_cache = {}
|
|||||||
-- TODO: try with more icon themes
|
-- TODO: try with more icon themes
|
||||||
function Get_icon(theme, client, program_string, class_string, is_steam)
|
function Get_icon(theme, client, program_string, class_string, is_steam)
|
||||||
|
|
||||||
client = client or nil
|
client = client or nil
|
||||||
program_string = program_string or nil
|
program_string = program_string or nil
|
||||||
class_string = class_string or nil
|
class_string = class_string or nil
|
||||||
is_steam = is_steam or nil
|
is_steam = is_steam or nil
|
||||||
|
|
||||||
if theme and (client or program_string or class_string) then
|
if theme and (client or program_string or class_string) then
|
||||||
local clientName
|
local clientName
|
||||||
if is_steam then
|
if is_steam then
|
||||||
clientName = "steam_icon_" .. tostring(client) .. ".svg"
|
clientName = "steam_icon_" .. tostring(client) .. ".svg"
|
||||||
elseif client then
|
elseif client then
|
||||||
if client.class then
|
if client.class then
|
||||||
clientName = string.lower(client.class:gsub(" ", "")) .. ".svg"
|
clientName = string.lower(client.class:gsub(" ", "")) .. ".svg"
|
||||||
elseif client.name then
|
elseif client.name then
|
||||||
clientName = string.lower(client.name:gsub(" ", "")) .. ".svg"
|
clientName = string.lower(client.name:gsub(" ", "")) .. ".svg"
|
||||||
else
|
else
|
||||||
if client.icon then
|
if client.icon then
|
||||||
return client.icon
|
return client.icon
|
||||||
else
|
|
||||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if program_string then
|
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
||||||
clientName = program_string .. ".svg"
|
|
||||||
else
|
|
||||||
clientName = class_string .. ".svg"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for index, icon in ipairs(icon_cache) do
|
|
||||||
if icon:match(clientName) then
|
|
||||||
return icon
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local resolutions = { "128x128", "96x96", "64x64", "48x48", "42x42", "32x32", "24x24", "16x16" }
|
|
||||||
for i, res in ipairs(resolutions) do
|
|
||||||
local iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
|
||||||
local ioStream = io.open(iconDir .. clientName, "r")
|
|
||||||
if ioStream ~= nil then
|
|
||||||
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
|
||||||
return iconDir .. clientName
|
|
||||||
else
|
|
||||||
clientName = clientName:gsub("^%l", string.upper)
|
|
||||||
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
|
||||||
ioStream = io.open(iconDir .. clientName, "r")
|
|
||||||
if ioStream ~= nil then
|
|
||||||
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
|
||||||
return iconDir .. clientName
|
|
||||||
elseif not class_string then
|
|
||||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
|
||||||
else
|
|
||||||
clientName = class_string .. ".svg"
|
|
||||||
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
|
||||||
ioStream = io.open(iconDir .. clientName, "r")
|
|
||||||
if ioStream ~= nil then
|
|
||||||
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
|
||||||
return iconDir .. clientName
|
|
||||||
else
|
|
||||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if client then
|
|
||||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if program_string then
|
||||||
|
clientName = program_string .. ".svg"
|
||||||
|
else
|
||||||
|
clientName = class_string .. ".svg"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for index, icon in ipairs(icon_cache) do
|
||||||
|
if icon:match(clientName) then
|
||||||
|
return icon
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local resolutions = { "128x128", "96x96", "64x64", "48x48", "42x42", "32x32", "24x24", "16x16" }
|
||||||
|
for i, res in ipairs(resolutions) do
|
||||||
|
local iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
||||||
|
local ioStream = io.open(iconDir .. clientName, "r")
|
||||||
|
if ioStream ~= nil then
|
||||||
|
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
||||||
|
return iconDir .. clientName
|
||||||
|
else
|
||||||
|
clientName = clientName:gsub("^%l", string.upper)
|
||||||
|
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
||||||
|
ioStream = io.open(iconDir .. clientName, "r")
|
||||||
|
if ioStream ~= nil then
|
||||||
|
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
||||||
|
return iconDir .. clientName
|
||||||
|
elseif not class_string then
|
||||||
|
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
||||||
|
else
|
||||||
|
clientName = class_string .. ".svg"
|
||||||
|
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
||||||
|
ioStream = io.open(iconDir .. clientName, "r")
|
||||||
|
if ioStream ~= nil then
|
||||||
|
icon_cache[#icon_cache + 1] = iconDir .. clientName
|
||||||
|
return iconDir .. clientName
|
||||||
|
else
|
||||||
|
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if client then
|
||||||
|
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--———————————No swiches?———————————
|
--———————————No swiches?———————————
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ require("src.core.signals")
|
|||||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/audio/"
|
local icondir = awful.util.getdir("config") .. "src/assets/icons/audio/"
|
||||||
|
|
||||||
-- Returns the audio widget
|
-- Returns the audio widget
|
||||||
return function()
|
return function(s)
|
||||||
|
|
||||||
local audio_widget = wibox.widget {
|
local audio_widget = wibox.widget {
|
||||||
{
|
{
|
||||||
@@ -78,6 +78,7 @@ return function()
|
|||||||
end
|
end
|
||||||
audio_widget.container.audio_layout.label:set_text(volume .. "%")
|
audio_widget.container.audio_layout.label:set_text(volume .. "%")
|
||||||
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color["Grey900"]))
|
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color["Grey900"]))
|
||||||
|
awesome.emit_signal("get::volume", volume)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
@@ -90,8 +91,10 @@ return function()
|
|||||||
audio_widget.container.audio_layout.label.visible = false
|
audio_widget.container.audio_layout.label.visible = false
|
||||||
audio_widget.container:set_right(0)
|
audio_widget.container:set_right(0)
|
||||||
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", color["Grey900"]))
|
audio_widget.container.audio_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. "volume-mute" .. ".svg", color["Grey900"]))
|
||||||
|
awesome.emit_signal("get::volume_mute", true)
|
||||||
else
|
else
|
||||||
audio_widget.container:set_right(10)
|
audio_widget.container:set_right(10)
|
||||||
|
awesome.emit_signal("get::volume_mute", false)
|
||||||
get_volume()
|
get_volume()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -104,20 +107,18 @@ return function()
|
|||||||
audio_widget:connect_signal(
|
audio_widget:connect_signal(
|
||||||
"button::press",
|
"button::press",
|
||||||
function()
|
function()
|
||||||
awesome.emit_signal("widget::volume")
|
|
||||||
--awesome.emit_signal("module::volume_osd:show", true)
|
|
||||||
awesome.emit_signal("module::slider:update")
|
awesome.emit_signal("module::slider:update")
|
||||||
awesome.emit_signal("widget::volume_osd:rerun")
|
awesome.emit_signal("widget::volume_osd:rerun")
|
||||||
awesome.emit_signal("volume_controller::toggle")
|
awesome.emit_signal("volume_controller::toggle", s)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
awesome.connect_signal(
|
gears.timer {
|
||||||
"widget::volume",
|
timeout = 0.5,
|
||||||
function(c)
|
call_now = true,
|
||||||
check_muted()
|
autostart = true,
|
||||||
end
|
callback = check_muted
|
||||||
)
|
}
|
||||||
|
|
||||||
check_muted()
|
check_muted()
|
||||||
return audio_widget
|
return audio_widget
|
||||||
|
|||||||
@@ -17,185 +17,185 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/battery/"
|
|||||||
|
|
||||||
-- Returns the battery widget
|
-- Returns the battery widget
|
||||||
return function()
|
return function()
|
||||||
local battery_widget = wibox.widget {
|
local battery_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "battery-unknown.svg", "#212121"),
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
id = "icon",
|
resize = false
|
||||||
image = gears.color.recolor_image(icondir .. "battery-unknown.svg", "#212121"),
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
visible = false,
|
|
||||||
align = 'center',
|
|
||||||
valign = 'center',
|
|
||||||
id = "label",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "battery_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
id = "icon_margin",
|
||||||
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["Purple200"],
|
spacing = dpi(10),
|
||||||
fg = color["Grey900"],
|
{
|
||||||
shape = function(cr, width, height)
|
visible = false,
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
align = 'center',
|
||||||
end,
|
valign = 'center',
|
||||||
widget = wibox.container.background
|
id = "label",
|
||||||
}
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "battery_layout",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = dpi(8),
|
||||||
|
right = dpi(8),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Purple200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
local battery_tooltip = awful.tooltip {
|
local battery_tooltip = awful.tooltip {
|
||||||
objects = { battery_widget },
|
objects = { battery_widget },
|
||||||
text = "",
|
text = "",
|
||||||
mode = "inside",
|
mode = "inside",
|
||||||
preferred_alignments = "middle",
|
preferred_alignments = "middle",
|
||||||
margins = dpi(10)
|
margins = dpi(10)
|
||||||
}
|
}
|
||||||
|
|
||||||
local get_battery_info = function()
|
local get_battery_info = function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
[[ upower -i $(upower -e | grep BAT) | grep "time to " ]],
|
[[ upower -i $(upower -e | grep BAT) | grep "time to " ]],
|
||||||
function(stdout)
|
function(stdout)
|
||||||
if stdout == nil or stdout == '' then
|
if stdout == nil or stdout == '' then
|
||||||
battery_tooltip:set_text('No Battery Found')
|
battery_tooltip:set_text('No Battery Found')
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local rem_time = ""
|
local rem_time = ""
|
||||||
if stdout:match("hour") then
|
if stdout:match("hour") then
|
||||||
rem_time = "Hours"
|
rem_time = "Hours"
|
||||||
else
|
else
|
||||||
rem_time = "Minutes"
|
rem_time = "Minutes"
|
||||||
end
|
end
|
||||||
local bat_time = stdout:match("%d+,%d") or stdout:match("%d+.%d") or ""
|
local bat_time = stdout:match("%d+,%d") or stdout:match("%d+.%d") or ""
|
||||||
if stdout:match("empty") then
|
if stdout:match("empty") then
|
||||||
battery_tooltip:set_text("Remaining battery time: " .. bat_time .. " " .. rem_time)
|
battery_tooltip:set_text("Remaining battery time: " .. bat_time .. " " .. rem_time)
|
||||||
elseif stdout:match("time to full") then
|
elseif stdout:match("time to full") then
|
||||||
battery_tooltip:set_text("Battery fully charged in: " .. bat_time .. " " .. rem_time)
|
battery_tooltip:set_text("Battery fully charged in: " .. bat_time .. " " .. rem_time)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
get_battery_info()
|
||||||
|
|
||||||
|
local last_battery_check = os.time()
|
||||||
|
local notify_critical_battery = true
|
||||||
|
|
||||||
|
local battery_warning = function()
|
||||||
|
naughty.notification {
|
||||||
|
icon = gears.color.recolor_image(icondir .. "battery-alert.svg", color["White"]),
|
||||||
|
app_name = "System notification",
|
||||||
|
title = "Battery is low",
|
||||||
|
message = "Battery is almost empty",
|
||||||
|
urgency = "critical"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_battery = function(status)
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[sh -c "upower -i $(upower -e | grep BAT) | grep percentage | awk '{print \$2}' |tr -d '\n%'"]],
|
||||||
|
function(stdout)
|
||||||
|
local battery_percentage = tonumber(stdout)
|
||||||
|
|
||||||
|
if not battery_percentage then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
battery_widget.container.battery_layout.spacing = dpi(5)
|
||||||
|
battery_widget.container.battery_layout.label.visible = true
|
||||||
|
battery_widget.container.battery_layout.label:set_text(battery_percentage .. '%')
|
||||||
|
|
||||||
|
local icon = 'battery'
|
||||||
|
|
||||||
|
if status == 'fully-charged' or status == 'charging' and battery_percentage == 100 then
|
||||||
|
icon = icon .. '-' .. 'charging'
|
||||||
|
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if battery_percentage > 0 and battery_percentage < 10 and status == 'discharging' then
|
||||||
|
icon = icon .. '-' .. 'alert'
|
||||||
|
if (os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
|
||||||
|
last_battery_check = os.time()
|
||||||
|
notify_critical_battery = false
|
||||||
|
battery_warning()
|
||||||
|
end
|
||||||
|
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if battery_percentage > 0 and battery_percentage < 10 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. 'outline'
|
||||||
|
elseif battery_percentage >= 10 and battery_percentage < 20 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '10'
|
||||||
|
elseif battery_percentage >= 20 and battery_percentage < 30 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '20'
|
||||||
|
elseif battery_percentage >= 30 and battery_percentage < 40 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '30'
|
||||||
|
elseif battery_percentage >= 40 and battery_percentage < 50 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '40'
|
||||||
|
elseif battery_percentage >= 50 and battery_percentage < 60 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '50'
|
||||||
|
elseif battery_percentage >= 60 and battery_percentage < 70 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '60'
|
||||||
|
elseif battery_percentage >= 70 and battery_percentage < 80 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '70'
|
||||||
|
elseif battery_percentage >= 80 and battery_percentage < 90 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '80'
|
||||||
|
elseif battery_percentage >= 90 and battery_percentage < 100 then
|
||||||
|
icon = icon .. '-' .. status .. '-' .. '90'
|
||||||
|
end
|
||||||
|
|
||||||
|
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
||||||
|
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
Hover_signal(battery_widget, color["Purple200"])
|
||||||
|
|
||||||
|
battery_widget:connect_signal(
|
||||||
|
'button::press',
|
||||||
|
function()
|
||||||
|
awful.spawn("xfce4-power-manager-settings")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
battery_widget:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
function()
|
||||||
get_battery_info()
|
get_battery_info()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
local last_battery_check = os.time()
|
watch(
|
||||||
local notify_critical_battery = true
|
[[sh -c "upower -i $(upower -e | grep BAT) | grep state | awk '{print \$2}' | tr -d '\n'"]],
|
||||||
|
5,
|
||||||
local battery_warning = function()
|
function(widget, stdout)
|
||||||
naughty.notify({
|
local status = stdout:gsub('%\n', '')
|
||||||
icon = gears.color.recolor_image(icondir .. "battery-alert.svg", color["White"]),
|
if status == nil or status == '' then
|
||||||
app_name = "System notification",
|
battery_widget.container.battery_layout.spacing = dpi(0)
|
||||||
title = "Battery is low",
|
battery_widget.container.battery_layout.label.visible = false
|
||||||
message = "Battery is almost battery_labelempty",
|
battery_tooltip:set_text('No battery found')
|
||||||
urgency = "critical"
|
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. 'battery-off' .. '.svg', "#212121")))
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
update_battery(status)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
local update_battery = function(status)
|
return battery_widget
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[sh -c "upower -i $(upower -e | grep BAT) | grep percentage | awk '{print \$2}' |tr -d '\n%'"]],
|
|
||||||
function(stdout)
|
|
||||||
local battery_percentage = tonumber(stdout)
|
|
||||||
|
|
||||||
if not battery_percentage then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
battery_widget.container.battery_layout.spacing = dpi(5)
|
|
||||||
battery_widget.container.battery_layout.label.visible = true
|
|
||||||
battery_widget.container.battery_layout.label:set_text(battery_percentage .. '%')
|
|
||||||
|
|
||||||
local icon = 'battery'
|
|
||||||
|
|
||||||
if status == 'fully-charged' or status == 'charging' and battery_percentage == 100 then
|
|
||||||
icon = icon .. '-' .. 'charging'
|
|
||||||
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if battery_percentage > 0 and battery_percentage < 10 and status == 'discharging' then
|
|
||||||
icon = icon .. '-' .. 'alert'
|
|
||||||
if (os.difftime(os.time(), last_battery_check) > 300 or notify_critical_battery) then
|
|
||||||
last_battery_check = os.time()
|
|
||||||
notify_critical_battery = false
|
|
||||||
battery_warning()
|
|
||||||
end
|
|
||||||
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if battery_percentage > 0 and battery_percentage < 10 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. 'outline'
|
|
||||||
elseif battery_percentage >= 10 and battery_percentage < 20 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '10'
|
|
||||||
elseif battery_percentage >= 20 and battery_percentage < 30 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '20'
|
|
||||||
elseif battery_percentage >= 30 and battery_percentage < 40 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '30'
|
|
||||||
elseif battery_percentage >= 40 and battery_percentage < 50 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '40'
|
|
||||||
elseif battery_percentage >= 50 and battery_percentage < 60 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '50'
|
|
||||||
elseif battery_percentage >= 60 and battery_percentage < 70 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '60'
|
|
||||||
elseif battery_percentage >= 70 and battery_percentage < 80 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '70'
|
|
||||||
elseif battery_percentage >= 80 and battery_percentage < 90 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '80'
|
|
||||||
elseif battery_percentage >= 90 and battery_percentage < 100 then
|
|
||||||
icon = icon .. '-' .. status .. '-' .. '90'
|
|
||||||
end
|
|
||||||
|
|
||||||
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. icon .. '.svg', "#212121")))
|
|
||||||
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
Hover_signal(battery_widget, color["Purple200"])
|
|
||||||
|
|
||||||
battery_widget:connect_signal(
|
|
||||||
'button::press',
|
|
||||||
function()
|
|
||||||
awful.spawn("xfce4-power-manager-settings")
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
battery_widget:connect_signal(
|
|
||||||
"mouse::enter",
|
|
||||||
function()
|
|
||||||
get_battery_info()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
[[sh -c "upower -i $(upower -e | grep BAT) | grep state | awk '{print \$2}' | tr -d '\n'"]],
|
|
||||||
5,
|
|
||||||
function(widget, stdout)
|
|
||||||
local status = stdout:gsub('%\n', '')
|
|
||||||
if status == nil or status == '' then
|
|
||||||
battery_widget.container.battery_layout.spacing = dpi(0)
|
|
||||||
battery_widget.container.battery_layout.label.visible = false
|
|
||||||
battery_tooltip:set_text('No battery found')
|
|
||||||
battery_widget.container.battery_layout.icon_margin.icon_layout.icon:set_image(gears.surface.load_uncached(gears.color.recolor_image(icondir .. 'battery-off' .. '.svg', "#212121")))
|
|
||||||
end
|
|
||||||
update_battery(status)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
return battery_widget
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,116 +16,116 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/bluetooth/"
|
|||||||
|
|
||||||
-- Returns the bluetooth widget
|
-- Returns the bluetooth widget
|
||||||
return function()
|
return function()
|
||||||
local bluetooth_widget = wibox.widget {
|
local bluetooth_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "bluetooth-off.svg"),
|
||||||
id = "icon",
|
widget = wibox.widget.imagebox,
|
||||||
image = gears.color.recolor_image(icondir .. "bluetooth-off.svg"),
|
resize = false
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
left = dpi(8),
|
|
||||||
right = dpi(8),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
},
|
||||||
bg = color["Blue200"],
|
id = "icon_layout",
|
||||||
fg = color["Grey900"],
|
widget = wibox.container.place
|
||||||
shape = function(cr, width, height)
|
},
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
id = "icon_margin",
|
||||||
end,
|
left = dpi(8),
|
||||||
widget = wibox.container.background
|
right = dpi(8),
|
||||||
}
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Blue200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
local bluetooth_tooltip = awful.tooltip {
|
local bluetooth_tooltip = awful.tooltip {
|
||||||
objects = { bluetooth_widget },
|
objects = { bluetooth_widget },
|
||||||
text = "",
|
text = "",
|
||||||
mode = "inside",
|
mode = "inside",
|
||||||
preferred_alignments = "middle",
|
preferred_alignments = "middle",
|
||||||
margins = dpi(10)
|
margins = dpi(10)
|
||||||
}
|
}
|
||||||
|
|
||||||
local bluetooth_state = "off"
|
local bluetooth_state = "off"
|
||||||
local connected_device = "nothing"
|
local connected_device = "nothing"
|
||||||
|
|
||||||
awful.widget.watch(
|
awful.widget.watch(
|
||||||
"rfkill list bluetooth",
|
"rfkill list bluetooth",
|
||||||
5,
|
5,
|
||||||
function(_, stdout)
|
function(_, stdout)
|
||||||
local icon = icondir .. "bluetooth"
|
local icon = icondir .. "bluetooth"
|
||||||
if stdout:match('Soft blocked: yes') or stdout:gsub("\n", "") == '' then
|
if stdout:match('Soft blocked: yes') or stdout:gsub("\n", "") == '' then
|
||||||
icon = icon .. "-off"
|
icon = icon .. "-off"
|
||||||
bluetooth_state = "off"
|
bluetooth_state = "off"
|
||||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
||||||
else
|
else
|
||||||
icon = icon .. "-on"
|
icon = icon .. "-on"
|
||||||
bluetooth_state = "on"
|
bluetooth_state = "on"
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
'./.config/awesome/src/scripts/bt.sh',
|
'./.config/awesome/src/scripts/bt.sh',
|
||||||
function(stdout2)
|
function(stdout2)
|
||||||
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
||||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
||||||
else
|
else
|
||||||
connected_device = stdout2:gsub("%(", ""):gsub("%)", "")
|
connected_device = stdout2:gsub("%(", ""):gsub("%)", "")
|
||||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:\n" .. connected_device)
|
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:\n" .. connected_device)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color["Grey900"]))
|
|
||||||
end,
|
|
||||||
bluetooth_widget
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Signals
|
|
||||||
Hover_signal(bluetooth_widget, color["Blue200"])
|
|
||||||
|
|
||||||
bluetooth_widget:connect_signal(
|
|
||||||
"button::press",
|
|
||||||
function()
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
"rfkill list bluetooth",
|
|
||||||
function(stdout)
|
|
||||||
if stdout:gsub("\n", "") ~= '' then
|
|
||||||
if bluetooth_state == "off" then
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[
|
|
||||||
rfkill unblock bluetooth
|
|
||||||
sleep 1
|
|
||||||
bluetoothctl power on
|
|
||||||
]],
|
|
||||||
function()
|
|
||||||
naughty.notify({
|
|
||||||
title = "System Notification",
|
|
||||||
app_name = "Bluetooth",
|
|
||||||
message = "Bluetooth activated"
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
else
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[
|
|
||||||
bluetoothctl power off
|
|
||||||
rfkill block bluetooth
|
|
||||||
]],
|
|
||||||
function()
|
|
||||||
naughty.notify({
|
|
||||||
title = "System Notification",
|
|
||||||
app_name = "Bluetooth",
|
|
||||||
message = "Bluetooth deactivated"
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color["Grey900"]))
|
||||||
|
end,
|
||||||
|
bluetooth_widget
|
||||||
|
)
|
||||||
|
|
||||||
return bluetooth_widget
|
-- Signals
|
||||||
|
Hover_signal(bluetooth_widget, color["Blue200"])
|
||||||
|
|
||||||
|
bluetooth_widget:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"rfkill list bluetooth",
|
||||||
|
function(stdout)
|
||||||
|
if stdout:gsub("\n", "") ~= '' then
|
||||||
|
if bluetooth_state == "off" then
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[
|
||||||
|
rfkill unblock bluetooth
|
||||||
|
sleep 1
|
||||||
|
bluetoothctl power on
|
||||||
|
]],
|
||||||
|
function()
|
||||||
|
naughty.notification {
|
||||||
|
title = "System Notification",
|
||||||
|
app_name = "Bluetooth",
|
||||||
|
message = "Bluetooth activated"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
)
|
||||||
|
else
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[
|
||||||
|
bluetoothctl power off
|
||||||
|
rfkill block bluetooth
|
||||||
|
]],
|
||||||
|
function()
|
||||||
|
naughty.notification {
|
||||||
|
title = "System Notification",
|
||||||
|
app_name = "Bluetooth",
|
||||||
|
message = "Bluetooth deactivated"
|
||||||
|
}
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
return bluetooth_widget
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,63 +16,63 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/clock/"
|
|||||||
-- Returns the clock widget
|
-- Returns the clock widget
|
||||||
return function()
|
return function()
|
||||||
|
|
||||||
local clock_widget = wibox.widget {
|
local clock_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "clock.svg", color["Grey900"]),
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
id = "icon",
|
resize = false
|
||||||
image = gears.color.recolor_image(icondir .. "clock.svg", color["Grey900"]),
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
id = "label",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "clock_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
id = "icon_margin",
|
||||||
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["Orange200"],
|
spacing = dpi(10),
|
||||||
fg = color["Grey900"],
|
{
|
||||||
shape = function(cr, width, height)
|
id = "label",
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
align = "center",
|
||||||
end,
|
valign = "center",
|
||||||
widget = wibox.container.background
|
widget = wibox.widget.textbox
|
||||||
}
|
},
|
||||||
|
id = "clock_layout",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = dpi(8),
|
||||||
|
right = dpi(8),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Orange200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
local set_clock = function()
|
local set_clock = function()
|
||||||
clock_widget.container.clock_layout.label:set_text(os.date("%H:%M"))
|
clock_widget.container.clock_layout.label:set_text(os.date("%H:%M"))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Updates the clock every 5 seconds, worst case you are 5 seconds behind
|
||||||
|
-- ¯\_(ツ)_/¯
|
||||||
|
gears.timer {
|
||||||
|
timeout = 5,
|
||||||
|
autostart = true,
|
||||||
|
call_now = true,
|
||||||
|
callback = function()
|
||||||
|
set_clock()
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Updates the clock every 5 seconds, worst case you are 5 seconds behind
|
Hover_signal(clock_widget, color["Orange200"])
|
||||||
-- ¯\_(ツ)_/¯
|
|
||||||
local clock_update = gears.timer {
|
|
||||||
timeout = 5,
|
|
||||||
autostart = true,
|
|
||||||
call_now = true,
|
|
||||||
callback = function()
|
|
||||||
set_clock()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
Hover_signal(clock_widget, color["Orange200"])
|
return clock_widget
|
||||||
|
|
||||||
return clock_widget
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ local awful = require("awful")
|
|||||||
local color = require("src.theme.colors")
|
local color = require("src.theme.colors")
|
||||||
local dpi = require("beautiful").xresources.apply_dpi
|
local dpi = require("beautiful").xresources.apply_dpi
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local naughty = require("naughty")
|
|
||||||
local watch = awful.widget.watch
|
local watch = awful.widget.watch
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
require("src.core.signals")
|
require("src.core.signals")
|
||||||
|
|||||||
@@ -16,77 +16,77 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/date/"
|
|||||||
-- Returns the date widget
|
-- Returns the date widget
|
||||||
return function()
|
return function()
|
||||||
|
|
||||||
local date_widget = wibox.widget {
|
local date_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "calendar.svg", color["Grey900"]),
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
id = "icon",
|
resize = false
|
||||||
image = gears.color.recolor_image(icondir .. "calendar.svg", color["Grey900"]),
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
id = "label",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "date_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
id = "icon_margin",
|
||||||
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["Teal200"],
|
spacing = dpi(10),
|
||||||
fg = color["Grey900"],
|
{
|
||||||
shape = function(cr, width, height)
|
id = "label",
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
align = "center",
|
||||||
end,
|
valign = "center",
|
||||||
widget = wibox.container.background
|
widget = wibox.widget.textbox
|
||||||
}
|
},
|
||||||
|
id = "date_layout",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = dpi(8),
|
||||||
|
right = dpi(8),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Teal200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
local set_date = function()
|
local set_date = function()
|
||||||
date_widget.container.date_layout.label:set_text(os.date("%a, %b %d"))
|
date_widget.container.date_layout.label:set_text(os.date("%a, %b %d"))
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Updates the date every minute, dont blame me if you miss silvester
|
||||||
|
gears.timer {
|
||||||
|
timeout = 60,
|
||||||
|
autostart = true,
|
||||||
|
call_now = true,
|
||||||
|
callback = function()
|
||||||
|
set_date()
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
|
||||||
-- Updates the date every minute, dont blame me if you miss silvester
|
-- Signals
|
||||||
local date_updater = gears.timer {
|
Hover_signal(date_widget, color["Teal200"])
|
||||||
timeout = 60,
|
|
||||||
autostart = true,
|
|
||||||
call_now = true,
|
|
||||||
callback = function()
|
|
||||||
set_date()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Signals
|
date_widget:connect_signal(
|
||||||
Hover_signal(date_widget, color["Teal200"])
|
"mouse::enter",
|
||||||
|
function()
|
||||||
|
awesome.emit_signal("widget::calendar_osd:stop", true)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
date_widget:connect_signal(
|
date_widget:connect_signal(
|
||||||
"mouse::enter",
|
"mouse::leave",
|
||||||
function()
|
function()
|
||||||
awesome.emit_signal("widget::calendar_osd:stop", true)
|
awesome.emit_signal("widget::calendar_osd:rerun", true)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
date_widget:connect_signal(
|
return date_widget
|
||||||
"mouse::leave",
|
|
||||||
function()
|
|
||||||
awesome.emit_signal("widget::calendar_osd:rerun", true)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
return date_widget
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ local awful = require("awful")
|
|||||||
local color = require("src.theme.colors")
|
local color = require("src.theme.colors")
|
||||||
local dpi = require("beautiful").xresources.apply_dpi
|
local dpi = require("beautiful").xresources.apply_dpi
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local naughty = require("naughty")
|
|
||||||
local watch = awful.widget.watch
|
local watch = awful.widget.watch
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
require("src.core.signals")
|
require("src.core.signals")
|
||||||
|
|||||||
@@ -14,326 +14,380 @@ require("src.core.signals")
|
|||||||
local icondir = awful.util.getdir("config") .. "src/assets/icons/kblayout/"
|
local icondir = awful.util.getdir("config") .. "src/assets/icons/kblayout/"
|
||||||
|
|
||||||
return function(s)
|
return function(s)
|
||||||
local kblayout_widget = wibox.widget {
|
local kblayout_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
{
|
resize = false,
|
||||||
id = "icon",
|
image = gears.color.recolor_image(icondir .. "keyboard.svg", color["Grey900"])
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false,
|
|
||||||
image = gears.color.recolor_image(icondir .. "keyboard.svg", color["Grey900"])
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
id = "icon_margin"
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
id = "label",
|
|
||||||
align = "center",
|
|
||||||
valign = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "kblayout_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin,
|
||||||
|
id = "icon_margin"
|
||||||
},
|
},
|
||||||
bg = color["Green200"],
|
spacing = dpi(10),
|
||||||
fg = color["Grey900"],
|
{
|
||||||
shape = function(cr, width, height)
|
id = "label",
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
align = "center",
|
||||||
end,
|
valign = "center",
|
||||||
widget = wibox.container.background
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "kblayout_layout",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = dpi(8),
|
||||||
|
right = dpi(8),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Green200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
|
local function get_kblayout()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
|
||||||
|
function(stdout)
|
||||||
|
local layout = stdout:gsub("\n", "")
|
||||||
|
kblayout_widget.container.kblayout_layout.label.text = layout
|
||||||
|
awesome.emit_signal("update::background:kblayout")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function create_kb_layout_item(keymap)
|
||||||
|
-- TODO: Add more, too lazy rn
|
||||||
|
local longname, shortname
|
||||||
|
|
||||||
|
local xkeyboard_country_code = {
|
||||||
|
{ "af", "أفغانيش(Afghanistan)", "AFG" }, -- Afghanistan
|
||||||
|
{ "al", "shqip(Albania)", "ALB" }, -- Albania
|
||||||
|
{ "am", "հայերեն(Armenia)", "ARM" }, -- Armenia
|
||||||
|
{ "ara", "عربي(Arab)", "ARB" }, -- Arabic
|
||||||
|
{ "at", "Österreichisch (Austria)", "AUT" }, -- Austria
|
||||||
|
{ "az", "Azərbaycan(Azerbaijan)", "AZE" }, -- Azerbaijan
|
||||||
|
{ "ba", "bosanski(Bosnia and Herzegovina)", "BIH" }, -- Bosnia and Herzegovina
|
||||||
|
{ "bd", "", "BGD" }, -- Bangladesh
|
||||||
|
{ "be", "", "BEL" }, -- Belgium
|
||||||
|
{ "bg", "", "BGR" }, -- Bulgaria
|
||||||
|
{ "br", "", "BRA" }, -- Brazil
|
||||||
|
{ "bt", "", "BTN" }, -- Bhutan
|
||||||
|
{ "bw", "", "BWA" }, -- Botswana
|
||||||
|
{ "by", "", "BLR" }, -- Belarus
|
||||||
|
{ "ca", "", "CAN" }, -- Canada
|
||||||
|
{ "cd", "", "COD" }, -- Congo
|
||||||
|
{ "ch", "", "CHE" }, -- Switzerland
|
||||||
|
{ "cm", "", "CMR" }, -- Cameroon
|
||||||
|
{ "cn", "", "CHN" }, -- China
|
||||||
|
{ "cz", "", "CZE" }, -- Czechia
|
||||||
|
{ "de", "Deutsch (Germany)", "GER" }, -- Germany
|
||||||
|
{ "dk", "", "DNK" }, -- Denmark
|
||||||
|
{ "ee", "", "EST" }, -- Estonia
|
||||||
|
{ "es", "", "ESP" }, -- Spain
|
||||||
|
{ "et", "", "ETH" }, -- Ethiopia
|
||||||
|
{ "eu", "?", "?" }, -- EurKey
|
||||||
|
{ "fi", "", "FIN" }, -- Finland
|
||||||
|
{ "fo", "", "FRO" }, -- Faroe Islands
|
||||||
|
{ "fr", "", "FRA" }, -- France
|
||||||
|
{ "gb", "English (Bri'ish)", "ENG" }, -- United Kingdom
|
||||||
|
{ "ge", "", "GEO" }, -- Georgia
|
||||||
|
{ "gh", "", "GHA" }, -- Ghana
|
||||||
|
{ "gn", "", "GIN" }, -- Guinea
|
||||||
|
{ "gr", "", "GRC" }, -- Greece
|
||||||
|
{ "hr", "", "HRV" }, -- Croatia
|
||||||
|
{ "hu", "", "HUN" }, -- Hungary
|
||||||
|
{ "ie", "", "IRL" }, -- Ireland
|
||||||
|
{ "il", "", "ISR" }, -- Israel
|
||||||
|
{ "in", "", "IND" }, -- India
|
||||||
|
{ "iq", "", "IRQ" }, -- Iraq
|
||||||
|
{ "ir", "", "IRN" }, -- Iran
|
||||||
|
{ "is", "", "ISL" }, -- Iceland
|
||||||
|
{ "it", "", "ITA" }, -- Italy
|
||||||
|
{ "jp", "", "JPN" }, -- Japan
|
||||||
|
{ "ke", "", "KEN" }, -- Kenya
|
||||||
|
{ "kg", "", "KGZ" }, -- Kyrgyzstan
|
||||||
|
{ "kh", "", "KHM" }, -- Cambodia
|
||||||
|
{ "kr", "", "KOR" }, -- Korea
|
||||||
|
{ "kz", "", "KAZ" }, -- Kazakhstan
|
||||||
|
{ "la", "", "LAO" }, -- Laos
|
||||||
|
{ "latam", "?", "?" }, -- Latin America
|
||||||
|
{ "latin", "?", "?" }, -- Latin
|
||||||
|
{ "lk", "", "LKA" }, -- Sri Lanka
|
||||||
|
{ "lt", "", "LTU" }, -- Lithuania
|
||||||
|
{ "lv", "", "LVA" }, -- Latvia
|
||||||
|
{ "ma", "", "MAR" }, -- Morocco
|
||||||
|
{ "mao", "?", "?" }, -- Maori
|
||||||
|
{ "me", "", "MNE" }, -- Montenegro
|
||||||
|
{ "mk", "", "MKD" }, -- Macedonia
|
||||||
|
{ "ml", "", "MLI" }, -- Mali
|
||||||
|
{ "mm", "", "MMR" }, -- Myanmar
|
||||||
|
{ "mn", "", "MNG" }, -- Mongolia
|
||||||
|
{ "mt", "", "MLT" }, -- Malta
|
||||||
|
{ "mv", "", "MDV" }, -- Maldives
|
||||||
|
{ "ng", "", "NGA" }, -- Nigeria
|
||||||
|
{ "nl", "", "NLD" }, -- Netherlands
|
||||||
|
{ "no", "", "NOR" }, -- Norway
|
||||||
|
{ "np", "", "NRL" }, -- Nepal
|
||||||
|
{ "ph", "", "PHL" }, -- Philippines
|
||||||
|
{ "pk", "", "PAK" }, -- Pakistan
|
||||||
|
{ "pl", "", "POL" }, -- Poland
|
||||||
|
{ "pt", "", "PRT" }, -- Portugal
|
||||||
|
{ "ro", "", "ROU" }, -- Romania
|
||||||
|
{ "rs", "", "SRB" }, -- Serbia
|
||||||
|
{ "ru", "Русский (Russia)", "RUS" }, -- Russia
|
||||||
|
{ "se", "", "SWE" }, -- Sweden
|
||||||
|
{ "si", "", "SVN" }, -- Slovenia
|
||||||
|
{ "sk", "", "SVK" }, -- Slovakia
|
||||||
|
{ "sn", "", "SEN" }, -- Senegal
|
||||||
|
{ "sy", "", "SYR" }, -- Syria
|
||||||
|
{ "th", "", "THA" }, -- Thailand
|
||||||
|
{ "tj", "", "TJK" }, -- Tajikistan
|
||||||
|
{ "tm", "", "TKM" }, -- Turkmenistan
|
||||||
|
{ "tr", "", "TUR" }, -- Turkey
|
||||||
|
{ "tw", "", "TWN" }, -- Taiwan
|
||||||
|
{ "tz", "", "TZA" }, -- Tanzania
|
||||||
|
{ "ua", "", "UKR" }, -- Ukraine
|
||||||
|
{ "us", "English (United States)", "USA" }, -- USA
|
||||||
|
{ "uz", "", "UZB" }, -- Uzbekistan
|
||||||
|
{ "vn", "", "VNM" }, -- Vietnam
|
||||||
|
{ "za", "", "ZAF" } -- South Africa
|
||||||
}
|
}
|
||||||
|
|
||||||
local layout = "";
|
for _, c in ipairs(xkeyboard_country_code) do
|
||||||
local get_kblayout = function()
|
if c[1] == keymap then
|
||||||
awful.spawn.easy_async_with_shell(
|
longname = c[2]
|
||||||
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
|
shortname = c[3]
|
||||||
function(stdout)
|
end
|
||||||
layout = stdout:gsub("\n", "")
|
|
||||||
kblayout_widget.container.kblayout_layout.label.text = layout
|
|
||||||
return layout
|
|
||||||
end
|
|
||||||
)
|
|
||||||
return layout
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local kb_layout_item = wibox.widget {
|
||||||
local function create_kb_layout_item(keymap)
|
{
|
||||||
-- TODO: Add more, too lazy rn
|
{
|
||||||
local longname, shortname
|
-- Short name e.g. GER, ENG, RUS
|
||||||
|
{
|
||||||
local xkeyboard_country_code = {
|
|
||||||
{ "ad", "", "AND" }, -- Andorra
|
|
||||||
{ "af", "", "AFG" }, -- Afghanistan
|
|
||||||
{ "al", "", "ALB" }, -- Albania
|
|
||||||
{ "am", "", "ARM" }, -- Armenia
|
|
||||||
{ "ara", "", "ARB" }, -- Arabic
|
|
||||||
{ "at", "", "AUT" }, -- Austria
|
|
||||||
{ "az", "", "AZE" }, -- Azerbaijan
|
|
||||||
{ "ba", "", "BIH" }, -- Bosnia and Herzegovina
|
|
||||||
{ "bd", "", "BGD" }, -- Bangladesh
|
|
||||||
{ "be", "", "BEL" }, -- Belgium
|
|
||||||
{ "bg", "", "BGR" }, -- Bulgaria
|
|
||||||
{ "br", "", "BRA" }, -- Brazil
|
|
||||||
{ "bt", "", "BTN" }, -- Bhutan
|
|
||||||
{ "bw", "", "BWA" }, -- Botswana
|
|
||||||
{ "by", "", "BLR" }, -- Belarus
|
|
||||||
{ "ca", "", "CAN" }, -- Canada
|
|
||||||
{ "cd", "", "COD" }, -- Congo
|
|
||||||
{ "ch", "", "CHE" }, -- Switzerland
|
|
||||||
{ "cm", "", "CMR" }, -- Cameroon
|
|
||||||
{ "cn", "", "CHN" }, -- China
|
|
||||||
{ "cz", "", "CZE" }, -- Czechia
|
|
||||||
{ "de", "Deutsch (Germany)", "GER" }, -- Germany
|
|
||||||
{ "dk", "", "DNK" }, -- Denmark
|
|
||||||
{ "ee", "", "EST" }, -- Estonia
|
|
||||||
{ "es", "", "ESP" }, -- Spain
|
|
||||||
{ "et", "", "ETH" }, -- Ethiopia
|
|
||||||
{ "eu", "?", "?" }, -- EurKey
|
|
||||||
{ "fi", "", "FIN" }, -- Finland
|
|
||||||
{ "fo", "", "FRO" }, -- Faroe Islands
|
|
||||||
{ "fr", "", "FRA" }, -- France
|
|
||||||
{ "gb", "English (Bri'ish)", "ENG" }, -- United Kingdom
|
|
||||||
{ "ge", "", "GEO" }, -- Georgia
|
|
||||||
{ "gh", "", "GHA" }, -- Ghana
|
|
||||||
{ "gn", "", "GIN" }, -- Guinea
|
|
||||||
{ "gr", "", "GRC" }, -- Greece
|
|
||||||
{ "hr", "", "HRV" }, -- Croatia
|
|
||||||
{ "hu", "", "HUN" }, -- Hungary
|
|
||||||
{ "ie", "", "IRL" }, -- Ireland
|
|
||||||
{ "il", "", "ISR" }, -- Israel
|
|
||||||
{ "in", "", "IND" }, -- India
|
|
||||||
{ "iq", "", "IRQ" }, -- Iraq
|
|
||||||
{ "ir", "", "IRN" }, -- Iran
|
|
||||||
{ "is", "", "ISL" }, -- Iceland
|
|
||||||
{ "it", "", "ITA" }, -- Italy
|
|
||||||
{ "jp", "", "JPN" }, -- Japan
|
|
||||||
{ "ke", "", "KEN" }, -- Kenya
|
|
||||||
{ "kg", "", "KGZ" }, -- Kyrgyzstan
|
|
||||||
{ "kh", "", "KHM" }, -- Cambodia
|
|
||||||
{ "kr", "", "KOR" }, -- Korea
|
|
||||||
{ "kz", "", "KAZ" }, -- Kazakhstan
|
|
||||||
{ "la", "", "LAO" }, -- Laos
|
|
||||||
{ "latam", "?", "?" }, -- Latin America
|
|
||||||
{ "latin", "?", "?" }, -- Latin
|
|
||||||
{ "lk", "", "LKA" }, -- Sri Lanka
|
|
||||||
{ "lt", "", "LTU" }, -- Lithuania
|
|
||||||
{ "lv", "", "LVA" }, -- Latvia
|
|
||||||
{ "ma", "", "MAR" }, -- Morocco
|
|
||||||
{ "mao", "?", "?" }, -- Maori
|
|
||||||
{ "me", "", "MNE" }, -- Montenegro
|
|
||||||
{ "mk", "", "MKD" }, -- Macedonia
|
|
||||||
{ "ml", "", "MLI" }, -- Mali
|
|
||||||
{ "mm", "", "MMR" }, -- Myanmar
|
|
||||||
{ "mn", "", "MNG" }, -- Mongolia
|
|
||||||
{ "mt", "", "MLT" }, -- Malta
|
|
||||||
{ "mv", "", "MDV" }, -- Maldives
|
|
||||||
{ "ng", "", "NGA" }, -- Nigeria
|
|
||||||
{ "nl", "", "NLD" }, -- Netherlands
|
|
||||||
{ "no", "", "NOR" }, -- Norway
|
|
||||||
{ "np", "", "NRL" }, -- Nepal
|
|
||||||
{ "ph", "", "PHL" }, -- Philippines
|
|
||||||
{ "pk", "", "PAK" }, -- Pakistan
|
|
||||||
{ "pl", "", "POL" }, -- Poland
|
|
||||||
{ "pt", "", "PRT" }, -- Portugal
|
|
||||||
{ "ro", "", "ROU" }, -- Romania
|
|
||||||
{ "rs", "", "SRB" }, -- Serbia
|
|
||||||
{ "ru", "Русски (Russia)", "RUS" }, -- Russia
|
|
||||||
{ "se", "", "SWE" }, -- Sweden
|
|
||||||
{ "si", "", "SVN" }, -- Slovenia
|
|
||||||
{ "sk", "", "SVK" }, -- Slovakia
|
|
||||||
{ "sn", "", "SEN" }, -- Senegal
|
|
||||||
{ "sy", "", "SYR" }, -- Syria
|
|
||||||
{ "th", "", "THA" }, -- Thailand
|
|
||||||
{ "tj", "", "TJK" }, -- Tajikistan
|
|
||||||
{ "tm", "", "TKM" }, -- Turkmenistan
|
|
||||||
{ "tr", "", "TUR" }, -- Turkey
|
|
||||||
{ "tw", "", "TWN" }, -- Taiwan
|
|
||||||
{ "tz", "", "TZA" }, -- Tanzania
|
|
||||||
{ "ua", "", "UKR" }, -- Ukraine
|
|
||||||
{ "us", "English (United States)", "USA" }, -- USA
|
|
||||||
{ "uz", "", "UZB" }, -- Uzbekistan
|
|
||||||
{ "vn", "", "VNM" }, -- Vietnam
|
|
||||||
{ "za", "", "ZAF" } -- South Africa
|
|
||||||
}
|
|
||||||
|
|
||||||
for i, c in ipairs(xkeyboard_country_code) do
|
|
||||||
if c[1] == keymap then
|
|
||||||
longname = c[2]
|
|
||||||
shortname = c[3]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local kb_layout_item = wibox.widget {
|
|
||||||
{
|
{
|
||||||
{
|
text = shortname,
|
||||||
{
|
widget = wibox.widget.textbox,
|
||||||
-- Short name e.g. GER, ENG, RUS
|
font = user_vars.font.extrabold,
|
||||||
{
|
id = "shortname"
|
||||||
{
|
|
||||||
text = shortname,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
font = user_vars.font.extrabold,
|
|
||||||
id = "kbmapname"
|
|
||||||
},
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
id = "margin2"
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
{
|
|
||||||
{
|
|
||||||
text = longname,
|
|
||||||
widget = wibox.widget.textbox,
|
|
||||||
font = user_vars.font.bold,
|
|
||||||
|
|
||||||
},
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
spacing = dpi(15),
|
|
||||||
layout = wibox.layout.fixed.horizontal,
|
|
||||||
id = "container"
|
|
||||||
},
|
|
||||||
margins = dpi(10),
|
|
||||||
widget = wibox.container.margin,
|
|
||||||
id = "margin"
|
|
||||||
},
|
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 10)
|
|
||||||
end,
|
|
||||||
bg = color["Grey800"],
|
|
||||||
fg = color["White"],
|
|
||||||
widget = wibox.container.background,
|
|
||||||
id = "background"
|
|
||||||
},
|
},
|
||||||
margins = dpi(5),
|
fg = color["Red200"],
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.background,
|
||||||
}
|
id = "background2"
|
||||||
Hover_signal(kb_layout_item.background, color["White"], color["Grey900"])
|
},
|
||||||
kb_layout_item:connect_signal(
|
{
|
||||||
"button::press",
|
{
|
||||||
function()
|
text = longname,
|
||||||
awful.spawn.easy_async_with_shell(
|
widget = wibox.widget.textbox,
|
||||||
"setxkbmap " .. keymap,
|
font = user_vars.font.bold,
|
||||||
function(stdout)
|
id = "longname",
|
||||||
awesome.emit_signal("kblayout::hide:kbmenu")
|
},
|
||||||
get_kblayout()
|
fg = color["Purple200"],
|
||||||
end
|
widget = wibox.container.background,
|
||||||
)
|
id = "background1"
|
||||||
end
|
},
|
||||||
)
|
spacing = dpi(15),
|
||||||
return kb_layout_item
|
layout = wibox.layout.fixed.horizontal,
|
||||||
end
|
id = "container"
|
||||||
|
},
|
||||||
local function get_kblist()
|
margins = dpi(10),
|
||||||
local kb_layout_items = {
|
widget = wibox.container.margin,
|
||||||
layout = wibox.layout.fixed.vertical
|
id = "margin"
|
||||||
}
|
},
|
||||||
for i, keymap in pairs(user_vars.kblayout) do
|
shape = function(cr, width, height)
|
||||||
kb_layout_items[i] = create_kb_layout_item(keymap)
|
gears.shape.rounded_rect(cr, width, height, 8)
|
||||||
end
|
end,
|
||||||
return kb_layout_items
|
bg = color["Grey800"],
|
||||||
end
|
fg = color["White"],
|
||||||
|
widget = wibox.container.background,
|
||||||
local kb_menu_widget = awful.popup {
|
id = "background",
|
||||||
screen = s,
|
keymap = keymap
|
||||||
shape = function(cr, width, height)
|
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
|
||||||
end,
|
|
||||||
widget = wibox.container.background,
|
|
||||||
bg = color["Grey900"],
|
|
||||||
fg = color["White"],
|
|
||||||
width = dpi(100),
|
|
||||||
max_height = dpi(600),
|
|
||||||
visible = false,
|
|
||||||
ontop = true,
|
|
||||||
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(255), top = dpi(60) } }) end
|
|
||||||
}
|
}
|
||||||
|
|
||||||
kb_menu_widget:setup(
|
-- TODO: Hover effects, this is more pain than I'm willing to take for now
|
||||||
get_kblist()
|
awesome.connect_signal(
|
||||||
)
|
"update::background:kblayout",
|
||||||
|
function()
|
||||||
local function toggle_kb_layout()
|
awful.spawn.easy_async_with_shell(
|
||||||
awful.spawn.easy_async_with_shell(
|
[[ setxkbmap -query | grep layout | awk '{print $2}' ]],
|
||||||
"setxkbmap -query | grep layout: | awk '{print $2}'",
|
function(stdout)
|
||||||
function(stdout)
|
local layout = stdout:gsub("\n", "")
|
||||||
for j, n in ipairs(user_vars.kblayout) do
|
if kb_layout_item.keymap == layout then
|
||||||
if stdout:match(n) then
|
kb_layout_item.bg = color["DeepPurple200"]
|
||||||
if j == #user_vars.kblayout then
|
kb_layout_item:get_children_by_id("background2")[1].fg = color["Grey900"]
|
||||||
awful.spawn.easy_async_with_shell(
|
kb_layout_item:get_children_by_id("background1")[1].fg = color["Grey900"]
|
||||||
"setxkbmap " .. user_vars.kblayout[1],
|
else
|
||||||
function()
|
kb_layout_item.bg = color["Grey800"]
|
||||||
get_kblayout()
|
kb_layout_item:get_children_by_id("background2")[1].fg = color["Red200"]
|
||||||
end
|
kb_layout_item:get_children_by_id("background1")[1].fg = color["Purple200"]
|
||||||
)
|
end
|
||||||
else
|
end
|
||||||
awful.spawn.easy_async_with_shell(
|
)
|
||||||
"setxkbmap " .. user_vars.kblayout[j + 1],
|
|
||||||
function()
|
|
||||||
get_kblayout()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"kblayout::toggle",
|
|
||||||
function()
|
|
||||||
toggle_kb_layout()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
--kb_menu_widget:move_next_to(mouse.current_widget_geometry)
|
|
||||||
-- Signals
|
|
||||||
Hover_signal(kblayout_widget, color["Green200"])
|
|
||||||
|
|
||||||
local kblayout_keygrabber = awful.keygrabber {
|
|
||||||
autostart = false,
|
|
||||||
stop_event = 'release',
|
|
||||||
keypressed_callback = function(self, mod, key, command)
|
|
||||||
if key == 'Escape' then
|
|
||||||
awesome.emit_signal("kblayout::hide:kbmenu")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
kblayout_widget:connect_signal(
|
|
||||||
"button::press",
|
|
||||||
function()
|
|
||||||
if kb_menu_widget.visible then
|
|
||||||
kb_menu_widget.visible = false
|
|
||||||
kblayout_keygrabber:stop()
|
|
||||||
else
|
|
||||||
kb_menu_widget.visible = true
|
|
||||||
kblayout_keygrabber:start()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
awesome.connect_signal(
|
|
||||||
"kblayout::hide:kbmenu",
|
|
||||||
function()
|
|
||||||
kb_menu_widget.visible = false
|
|
||||||
kblayout_keygrabber:stop()
|
|
||||||
end
|
|
||||||
)
|
)
|
||||||
|
|
||||||
get_kblayout()
|
get_kblayout()
|
||||||
|
|
||||||
|
kb_layout_item:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"setxkbmap " .. keymap,
|
||||||
|
function()
|
||||||
|
awesome.emit_signal("kblayout::hide:kbmenu")
|
||||||
|
mousegrabber.stop()
|
||||||
|
get_kblayout()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
return kb_layout_item
|
||||||
|
end
|
||||||
|
|
||||||
|
local function get_kblist()
|
||||||
|
local kb_layout_items = {
|
||||||
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
spacing = dpi(10)
|
||||||
|
}
|
||||||
|
for i, keymap in pairs(user_vars.kblayout) do
|
||||||
|
kb_layout_items[i] = create_kb_layout_item(keymap)
|
||||||
|
end
|
||||||
|
local cont = {
|
||||||
|
{
|
||||||
|
kb_layout_items,
|
||||||
|
margins = dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
}
|
||||||
|
return cont
|
||||||
|
end
|
||||||
|
|
||||||
|
local kb_menu_widget = awful.popup {
|
||||||
|
screen = s,
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 12)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background,
|
||||||
|
bg = color["Grey900"],
|
||||||
|
fg = color["White"],
|
||||||
|
border_width = dpi(4),
|
||||||
|
border_color = color["Grey800"],
|
||||||
|
width = dpi(100),
|
||||||
|
max_height = dpi(600),
|
||||||
|
visible = false,
|
||||||
|
ontop = true,
|
||||||
|
placement = function(c) awful.placement.align(c, { position = "top_right", margins = { right = dpi(255), top = dpi(60) } }) end
|
||||||
|
}
|
||||||
|
|
||||||
|
kb_menu_widget:connect_signal(
|
||||||
|
"mouse::leave",
|
||||||
|
function()
|
||||||
|
mousegrabber.run(
|
||||||
|
function()
|
||||||
|
kblayout_widget.bg = color["Green200"]
|
||||||
|
if mouse.is_left_mouse_button_pressed then
|
||||||
|
awesome.emit_signal("kblayout::hide:kbmenu")
|
||||||
|
mousegrabber.stop()
|
||||||
|
end
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
"arrow"
|
||||||
|
)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
kb_menu_widget:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
function()
|
||||||
|
mousegrabber.stop()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
kb_menu_widget:setup(
|
||||||
|
get_kblist()
|
||||||
|
)
|
||||||
|
|
||||||
|
local function toggle_kb_layout()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"setxkbmap -query | grep layout: | awk '{print $2}'",
|
||||||
|
function(stdout)
|
||||||
|
for j, n in ipairs(user_vars.kblayout) do
|
||||||
|
if stdout:match(n) then
|
||||||
|
if j == #user_vars.kblayout then
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"setxkbmap " .. user_vars.kblayout[1],
|
||||||
|
function()
|
||||||
|
get_kblayout()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
else
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
"setxkbmap " .. user_vars.kblayout[j + 1],
|
||||||
|
function()
|
||||||
|
get_kblayout()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"kblayout::toggle",
|
||||||
|
function()
|
||||||
|
toggle_kb_layout()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
-- Signals
|
||||||
|
Hover_signal(kblayout_widget, color["Green200"])
|
||||||
|
|
||||||
|
local kblayout_keygrabber = awful.keygrabber {
|
||||||
|
autostart = false,
|
||||||
|
stop_event = 'release',
|
||||||
|
keypressed_callback = function(self, mod, key, command)
|
||||||
|
awesome.emit_signal("kblayout::hide:kbmenu")
|
||||||
|
mousegrabber.stop()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
kblayout_widget:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
mousegrabber.stop()
|
||||||
|
if kb_menu_widget.visible then
|
||||||
|
kb_menu_widget.visible = false
|
||||||
|
kblayout_keygrabber:stop()
|
||||||
|
else
|
||||||
|
kb_menu_widget.visible = true
|
||||||
|
kblayout_keygrabber:start()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
awesome.connect_signal(
|
||||||
|
"kblayout::hide:kbmenu",
|
||||||
|
function()
|
||||||
kb_menu_widget.visible = false
|
kb_menu_widget.visible = false
|
||||||
return kblayout_widget
|
kblayout_keygrabber:stop()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
get_kblayout()
|
||||||
|
kb_menu_widget.visible = false
|
||||||
|
return kblayout_widget
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,35 +12,35 @@ require("src.core.signals")
|
|||||||
|
|
||||||
-- Returns the layoutbox widget
|
-- Returns the layoutbox widget
|
||||||
return function()
|
return function()
|
||||||
local layout = wibox.widget {
|
local layout = wibox.widget {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
awful.widget.layoutbox(),
|
awful.widget.layoutbox(),
|
||||||
id = "icon_layout",
|
id = "icon_layout",
|
||||||
widget = wibox.container.place
|
widget = wibox.container.place
|
||||||
},
|
},
|
||||||
id = "icon_margin",
|
id = "icon_margin",
|
||||||
left = dpi(5),
|
left = dpi(5),
|
||||||
right = dpi(5),
|
right = dpi(5),
|
||||||
forced_width = dpi(40),
|
forced_width = dpi(40),
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["LightBlue200"],
|
bg = color["LightBlue200"],
|
||||||
shape = function(cr, width, height)
|
shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
end,
|
end,
|
||||||
widget = wibox.container.background
|
widget = wibox.container.background
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Signals
|
-- Signals
|
||||||
Hover_signal(layout, color["LightBlue200"])
|
Hover_signal(layout, color["LightBlue200"])
|
||||||
|
|
||||||
layout:connect_signal(
|
layout:connect_signal(
|
||||||
"button::press",
|
"button::press",
|
||||||
function()
|
function()
|
||||||
awful.layout.inc(-1)
|
awful.layout.inc(-1)
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
return layout
|
return layout
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,68 +16,68 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/network/"
|
|||||||
|
|
||||||
-- Insert your interfaces here, get the from ip a
|
-- Insert your interfaces here, get the from ip a
|
||||||
local interfaces = {
|
local interfaces = {
|
||||||
wlan_interface = user_vars.network.wlan,
|
wlan_interface = user_vars.network.wlan,
|
||||||
lan_interface = user_vars.network.ethernet
|
lan_interface = user_vars.network.ethernet
|
||||||
}
|
}
|
||||||
|
|
||||||
local network_mode = nil
|
local network_mode = nil
|
||||||
|
|
||||||
-- Returns the network widget
|
-- Returns the network widget
|
||||||
return function()
|
return function()
|
||||||
local startup = true
|
local startup = true
|
||||||
local reconnect_startup = true
|
local reconnect_startup = true
|
||||||
local wifi_strength
|
local wifi_strength
|
||||||
local network_widget = wibox.widget {
|
local network_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = 'icon',
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "no-internet" .. ".svg", color["Grey900"]),
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
id = 'icon',
|
resize = false
|
||||||
image = gears.color.recolor_image(icondir .. "no-internet" .. ".svg", color["Grey900"]),
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
spacing = dpi(10),
|
|
||||||
{
|
|
||||||
id = "label",
|
|
||||||
visible = false,
|
|
||||||
valign = "center",
|
|
||||||
align = "center",
|
|
||||||
widget = wibox.widget.textbox
|
|
||||||
},
|
|
||||||
id = "network_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
id = "icon_margin",
|
||||||
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["Red200"],
|
spacing = dpi(10),
|
||||||
fg = color["Grey900"],
|
{
|
||||||
shape = function(cr, width, height)
|
id = "label",
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
visible = false,
|
||||||
end,
|
valign = "center",
|
||||||
widget = wibox.container.background
|
align = "center",
|
||||||
}
|
widget = wibox.widget.textbox
|
||||||
|
},
|
||||||
|
id = "network_layout",
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = dpi(8),
|
||||||
|
right = dpi(8),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Red200"],
|
||||||
|
fg = color["Grey900"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
local network_tooltip = awful.tooltip {
|
local network_tooltip = awful.tooltip {
|
||||||
text = "Loading",
|
text = "Loading",
|
||||||
objects = { network_widget },
|
objects = { network_widget },
|
||||||
mode = "inside",
|
mode = "inside",
|
||||||
preferred_alignments = "middle",
|
preferred_alignments = "middle",
|
||||||
margins = dpi(10)
|
margins = dpi(10)
|
||||||
}
|
}
|
||||||
|
|
||||||
local check_for_internet = [=[
|
local check_for_internet = [=[
|
||||||
status_ping=0
|
status_ping=0
|
||||||
packets="$(ping -q -w2 -c2 1.1.1.1 | grep -o "100% packet loss")"
|
packets="$(ping -q -w2 -c2 1.1.1.1 | grep -o "100% packet loss")"
|
||||||
if [ ! -z "${packets}" ];
|
if [ ! -z "${packets}" ];
|
||||||
@@ -92,181 +92,181 @@ return function()
|
|||||||
fi
|
fi
|
||||||
]=]
|
]=]
|
||||||
|
|
||||||
local update_startup = function()
|
local update_startup = function()
|
||||||
if startup then
|
if startup then
|
||||||
startup = false
|
startup = false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_reconnect_startup = function(status)
|
||||||
|
reconnect_startup = status
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_tooltip = function(message)
|
||||||
|
network_tooltip:set_markup(message)
|
||||||
|
end
|
||||||
|
|
||||||
|
local network_notify = function(message, title, app_name, icon)
|
||||||
|
naughty.notification {
|
||||||
|
text = message,
|
||||||
|
title = title,
|
||||||
|
app_name = app_name,
|
||||||
|
icon = gears.color.recolor_image(icon, color["White"]),
|
||||||
|
timeout = 3
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_wireless = function()
|
||||||
|
network_mode = "wireless"
|
||||||
|
|
||||||
|
local notify_connected = function(essid)
|
||||||
|
local message = "You are now connected to " .. essid
|
||||||
|
local title = "Connection successfull"
|
||||||
|
local app_name = "System Notification"
|
||||||
|
local icon = icondir .. "wifi-strength-4.svg"
|
||||||
|
network_notify(message, title, app_name, icon)
|
||||||
end
|
end
|
||||||
|
|
||||||
local update_reconnect_startup = function(status)
|
local update_wireless_data = function(healthy)
|
||||||
reconnect_startup = status
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
|
||||||
|
function(stdout)
|
||||||
|
local essid = stdout:match("SSID: (.-)\n") or "N/A"
|
||||||
|
local bitrate = stdout:match("tx bitrate: (.+/s)") or "N/A"
|
||||||
|
local message = "Connected to <b>" .. essid .. "</b>\nSignal strength <b>" .. tostring(wifi_strength) .. "%</b>\n" .. "Bit rate <b>" .. tostring(bitrate) .. "</b>"
|
||||||
|
|
||||||
|
if healthy then
|
||||||
|
update_tooltip(message)
|
||||||
|
else
|
||||||
|
update_tooltip("You are connected but have no internet" .. message)
|
||||||
|
end
|
||||||
|
|
||||||
|
if reconnect_startup or startup then
|
||||||
|
notify_connected(essid)
|
||||||
|
update_reconnect_startup(false)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local update_tooltip = function(message)
|
local update_wireless_icon = function(strength)
|
||||||
network_tooltip:set_markup(message)
|
awful.spawn.easy_async_with_shell(
|
||||||
end
|
check_for_internet,
|
||||||
|
function(stdout)
|
||||||
local network_notify = function(message, title, app_name, icon)
|
local icon = "wifi-strength"
|
||||||
naughty.notify({
|
if not stdout:match("Connected but no internet") then
|
||||||
text = message,
|
if startup or reconnect_startup then
|
||||||
title = title,
|
awesome.emit_signal("system::network_connected")
|
||||||
app_name = app_name,
|
end
|
||||||
icon = gears.color.recolor_image(icon, color["White"]),
|
icon = icon .. '-' .. tostring(strength)
|
||||||
timeout = 3
|
update_wireless_data(true)
|
||||||
})
|
else
|
||||||
end
|
icon = icon .. "-" .. tostring(strength)
|
||||||
|
update_wireless_data(false)
|
||||||
local update_wireless = function()
|
|
||||||
network_mode = "wireless"
|
|
||||||
|
|
||||||
local notify_connected = function(essid)
|
|
||||||
local message = "You are now connected to " .. essid
|
|
||||||
local title = "Connection successfull"
|
|
||||||
local app_name = "System Notification"
|
|
||||||
local icon = icondir .. "wifi-strength-4.svg"
|
|
||||||
network_notify(message, title, app_name, icon)
|
|
||||||
end
|
end
|
||||||
|
network_widget.container.network_layout.spacing = dpi(8)
|
||||||
local update_wireless_data = function(healthy)
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[ iw dev ]] .. interfaces.wlan_interface .. [[ link ]],
|
|
||||||
function(stdout)
|
|
||||||
local essid = stdout:match("SSID: (.-)\n") or "N/A"
|
|
||||||
local bitrate = stdout:match("tx bitrate: (.+/s)") or "N/A"
|
|
||||||
local message = "Connected to <b>" .. essid .. "</b>\nSignal strength <b>" .. tostring(wifi_strength) .. "%</b>\n" .. "Bit rate <b>" .. tostring(bitrate) .. "</b>"
|
|
||||||
|
|
||||||
if healthy then
|
|
||||||
update_tooltip(message)
|
|
||||||
else
|
|
||||||
update_tooltip("You are connected but have no internet" .. message)
|
|
||||||
end
|
|
||||||
|
|
||||||
if reconnect_startup or startup then
|
|
||||||
notify_connected(essid)
|
|
||||||
update_reconnect_startup(false)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_wireless_icon = function(strength)
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
check_for_internet,
|
|
||||||
function(stdout)
|
|
||||||
local icon = "wifi-strength"
|
|
||||||
if not stdout:match("Connected but no internet") then
|
|
||||||
if startup or reconnect_startup then
|
|
||||||
awesome.emit_signal("system::network_connected")
|
|
||||||
end
|
|
||||||
icon = icon .. '-' .. tostring(strength)
|
|
||||||
update_wireless_data(true)
|
|
||||||
else
|
|
||||||
icon = icon .. "-" .. tostring(strength)
|
|
||||||
update_wireless_data(false)
|
|
||||||
end
|
|
||||||
network_widget.container.network_layout.spacing = dpi(8)
|
|
||||||
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color["Grey900"]))
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_wireless_strength = function()
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
[[ awk 'NR==3 {printf "%3.0f", ($3/70)*100}' /proc/net/wireless ]],
|
|
||||||
function(stdout)
|
|
||||||
if not tonumber(stdout) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
wifi_strength = tonumber(stdout)
|
|
||||||
network_widget.container.network_layout.spacing = dpi(8)
|
|
||||||
network_widget.container.network_layout.label.visible = true
|
|
||||||
network_widget.container.network_layout.label:set_text(tostring(wifi_strength .. "%"))
|
|
||||||
local wifi_strength_rounded = math.floor(wifi_strength / 25 + 0.5)
|
|
||||||
update_wireless_icon(wifi_strength_rounded)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
update_wireless_strength()
|
|
||||||
update_startup()
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_wired = function()
|
|
||||||
network_mode = "wired"
|
|
||||||
|
|
||||||
local notify_connected = function()
|
|
||||||
local message = "You are now connected to " .. interfaces.lan_interface
|
|
||||||
local title = "Connection successfull"
|
|
||||||
local app_name = "System Notification"
|
|
||||||
local icon = icondir .. "ethernet.svg"
|
|
||||||
network_notify(message, title, app_name, icon)
|
|
||||||
end
|
|
||||||
|
|
||||||
awful.spawn.easy_async_with_shell(
|
|
||||||
check_for_internet,
|
|
||||||
function(stdout)
|
|
||||||
local icon = "ethernet"
|
|
||||||
|
|
||||||
if stdout:match("Connected but no internet") then
|
|
||||||
icon = "no-internet"
|
|
||||||
update_tooltip(
|
|
||||||
"No internet"
|
|
||||||
)
|
|
||||||
else
|
|
||||||
update_tooltip("You are connected to:\nEthernet Interface <b>" .. interfaces.lan_interface .. "</b>")
|
|
||||||
if startup or reconnect_startup then
|
|
||||||
awesome.emit_signal("system::network_connected")
|
|
||||||
notify_connected()
|
|
||||||
update_startup()
|
|
||||||
end
|
|
||||||
update_reconnect_startup(false)
|
|
||||||
end
|
|
||||||
network_widget.container.network_layout.label.visible = false
|
|
||||||
network_widget.container.network_layout.spacing = dpi(0)
|
|
||||||
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(icondir .. icon .. ".svg")
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
local update_disconnected = function()
|
|
||||||
local notify_wireless_disconnected = function(essid)
|
|
||||||
local message = "WiFi has been disconnected"
|
|
||||||
local title = "Connection lost"
|
|
||||||
local app_name = "System Notification"
|
|
||||||
local icon = icondir .. "wifi-strength-off-outline.svg"
|
|
||||||
network_notify(message, title, app_name, icon)
|
|
||||||
end
|
|
||||||
local notify_wired_disconnected = function(essid)
|
|
||||||
local message = "Ethernet has been unplugged"
|
|
||||||
local title = "Connection lost"
|
|
||||||
local app_name = "System Notification"
|
|
||||||
local icon = icondir .. "no-internet.svg"
|
|
||||||
network_notify(message, title, app_name, icon)
|
|
||||||
end
|
|
||||||
local icon = "wifi-strength-off-outline"
|
|
||||||
if network_mode == "wireless" then
|
|
||||||
icon = "wifi-strength-off-outline"
|
|
||||||
if not reconnect_startup then
|
|
||||||
update_reconnect_startup(true)
|
|
||||||
notify_wireless_disconnected()
|
|
||||||
end
|
|
||||||
elseif network_mode == "wired" then
|
|
||||||
icon = "no-internet"
|
|
||||||
if not reconnect_startup then
|
|
||||||
update_reconnect_startup(true)
|
|
||||||
notify_wired_disconnected()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
network_widget.container.network_layout.label.visible = false
|
|
||||||
update_tooltip("Network unreachable")
|
|
||||||
network_widget.container.network_layout.spacing = dpi(0)
|
|
||||||
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color["Grey900"]))
|
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color["Grey900"]))
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local check_network_mode = function()
|
local update_wireless_strength = function()
|
||||||
awful.spawn.easy_async_with_shell(
|
awful.spawn.easy_async_with_shell(
|
||||||
[=[
|
[[ awk 'NR==3 {printf "%3.0f", ($3/70)*100}' /proc/net/wireless ]],
|
||||||
|
function(stdout)
|
||||||
|
if not tonumber(stdout) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
wifi_strength = tonumber(stdout)
|
||||||
|
network_widget.container.network_layout.spacing = dpi(8)
|
||||||
|
network_widget.container.network_layout.label.visible = true
|
||||||
|
network_widget.container.network_layout.label:set_text(tostring(wifi_strength .. "%"))
|
||||||
|
local wifi_strength_rounded = math.floor(wifi_strength / 25 + 0.5)
|
||||||
|
update_wireless_icon(wifi_strength_rounded)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_wireless_strength()
|
||||||
|
update_startup()
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_wired = function()
|
||||||
|
network_mode = "wired"
|
||||||
|
|
||||||
|
local notify_connected = function()
|
||||||
|
local message = "You are now connected to " .. interfaces.lan_interface
|
||||||
|
local title = "Connection successfull"
|
||||||
|
local app_name = "System Notification"
|
||||||
|
local icon = icondir .. "ethernet.svg"
|
||||||
|
network_notify(message, title, app_name, icon)
|
||||||
|
end
|
||||||
|
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
check_for_internet,
|
||||||
|
function(stdout)
|
||||||
|
local icon = "ethernet"
|
||||||
|
|
||||||
|
if stdout:match("Connected but no internet") then
|
||||||
|
icon = "no-internet"
|
||||||
|
update_tooltip(
|
||||||
|
"No internet"
|
||||||
|
)
|
||||||
|
else
|
||||||
|
update_tooltip("You are connected to:\nEthernet Interface <b>" .. interfaces.lan_interface .. "</b>")
|
||||||
|
if startup or reconnect_startup then
|
||||||
|
awesome.emit_signal("system::network_connected")
|
||||||
|
notify_connected()
|
||||||
|
update_startup()
|
||||||
|
end
|
||||||
|
update_reconnect_startup(false)
|
||||||
|
end
|
||||||
|
network_widget.container.network_layout.label.visible = false
|
||||||
|
network_widget.container.network_layout.spacing = dpi(0)
|
||||||
|
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(icondir .. icon .. ".svg")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_disconnected = function()
|
||||||
|
local notify_wireless_disconnected = function(essid)
|
||||||
|
local message = "WiFi has been disconnected"
|
||||||
|
local title = "Connection lost"
|
||||||
|
local app_name = "System Notification"
|
||||||
|
local icon = icondir .. "wifi-strength-off-outline.svg"
|
||||||
|
network_notify(message, title, app_name, icon)
|
||||||
|
end
|
||||||
|
local notify_wired_disconnected = function(essid)
|
||||||
|
local message = "Ethernet has been unplugged"
|
||||||
|
local title = "Connection lost"
|
||||||
|
local app_name = "System Notification"
|
||||||
|
local icon = icondir .. "no-internet.svg"
|
||||||
|
network_notify(message, title, app_name, icon)
|
||||||
|
end
|
||||||
|
local icon = "wifi-strength-off-outline"
|
||||||
|
if network_mode == "wireless" then
|
||||||
|
icon = "wifi-strength-off-outline"
|
||||||
|
if not reconnect_startup then
|
||||||
|
update_reconnect_startup(true)
|
||||||
|
notify_wireless_disconnected()
|
||||||
|
end
|
||||||
|
elseif network_mode == "wired" then
|
||||||
|
icon = "no-internet"
|
||||||
|
if not reconnect_startup then
|
||||||
|
update_reconnect_startup(true)
|
||||||
|
notify_wired_disconnected()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
network_widget.container.network_layout.label.visible = false
|
||||||
|
update_tooltip("Network unreachable")
|
||||||
|
network_widget.container.network_layout.spacing = dpi(0)
|
||||||
|
network_widget.container.network_layout.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icondir .. icon .. ".svg", color["Grey900"]))
|
||||||
|
end
|
||||||
|
|
||||||
|
local check_network_mode = function()
|
||||||
|
awful.spawn.easy_async_with_shell(
|
||||||
|
[=[
|
||||||
wireless="]=] .. tostring(interfaces.wlan_interface) .. [=["
|
wireless="]=] .. tostring(interfaces.wlan_interface) .. [=["
|
||||||
wired="]=] .. tostring(interfaces.lan_interface) .. [=["
|
wired="]=] .. tostring(interfaces.lan_interface) .. [=["
|
||||||
net="/sys/class/net/"
|
net="/sys/class/net/"
|
||||||
@@ -301,37 +301,37 @@ return function()
|
|||||||
}
|
}
|
||||||
print_network_mode
|
print_network_mode
|
||||||
]=],
|
]=],
|
||||||
function(stdout)
|
function(stdout)
|
||||||
local mode = stdout:gsub("%\n", "")
|
local mode = stdout:gsub("%\n", "")
|
||||||
if stdout:match("No internet connected") then
|
if stdout:match("No internet connected") then
|
||||||
update_disconnected()
|
update_disconnected()
|
||||||
elseif stdout:match("wireless") then
|
elseif stdout:match("wireless") then
|
||||||
update_wireless()
|
update_wireless()
|
||||||
elseif stdout:match("wired") then
|
elseif stdout:match("wired") then
|
||||||
update_wired()
|
update_wired()
|
||||||
end
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local network_updater = gears.timer {
|
|
||||||
timeout = 5,
|
|
||||||
autostart = true,
|
|
||||||
call_now = true,
|
|
||||||
callback = function()
|
|
||||||
check_network_mode()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Signals
|
|
||||||
Hover_signal(network_widget, color["Red200"])
|
|
||||||
|
|
||||||
network_widget:connect_signal(
|
|
||||||
"button::press",
|
|
||||||
function()
|
|
||||||
awful.spawn("gnome-control-center wlan")
|
|
||||||
end
|
|
||||||
)
|
)
|
||||||
|
end
|
||||||
|
|
||||||
return network_widget
|
gears.timer {
|
||||||
|
timeout = 5,
|
||||||
|
autostart = true,
|
||||||
|
call_now = true,
|
||||||
|
callback = function()
|
||||||
|
check_network_mode()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Signals
|
||||||
|
Hover_signal(network_widget, color["Red200"])
|
||||||
|
|
||||||
|
network_widget:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
awful.spawn("gnome-control-center wlan")
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
return network_widget
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,49 +15,49 @@ local icondir = awful.util.getdir("config") .. "src/assets/icons/power/"
|
|||||||
|
|
||||||
return function()
|
return function()
|
||||||
|
|
||||||
local power_widget = wibox.widget {
|
local power_widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
|
{
|
||||||
{
|
{
|
||||||
{
|
id = "icon",
|
||||||
{
|
image = gears.color.recolor_image(icondir .. "power.svg", color["Grey900"]),
|
||||||
{
|
widget = wibox.widget.imagebox,
|
||||||
id = "icon",
|
resize = false
|
||||||
image = gears.color.recolor_image(icondir .. "power.svg", color["Grey900"]),
|
|
||||||
widget = wibox.widget.imagebox,
|
|
||||||
resize = false
|
|
||||||
},
|
|
||||||
id = "icon_layout",
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
id = "icon_margin",
|
|
||||||
top = dpi(2),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
},
|
|
||||||
id = "power_layout",
|
|
||||||
layout = wibox.layout.fixed.horizontal
|
|
||||||
},
|
},
|
||||||
id = "container",
|
id = "icon_layout",
|
||||||
left = dpi(8),
|
widget = wibox.container.place
|
||||||
right = dpi(8),
|
},
|
||||||
widget = wibox.container.margin
|
id = "icon_margin",
|
||||||
|
top = dpi(2),
|
||||||
|
widget = wibox.container.margin
|
||||||
},
|
},
|
||||||
bg = color["Red200"],
|
id = "power_layout",
|
||||||
fg = color["Grey800"],
|
layout = wibox.layout.fixed.horizontal
|
||||||
shape = function(cr, width, height)
|
},
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
id = "container",
|
||||||
end,
|
left = dpi(8),
|
||||||
widget = wibox.container.background
|
right = dpi(8),
|
||||||
}
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg = color["Red200"],
|
||||||
|
fg = color["Grey800"],
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
-- Signals
|
-- Signals
|
||||||
Hover_signal(power_widget, color["Red200"])
|
Hover_signal(power_widget, color["Red200"])
|
||||||
|
|
||||||
power_widget:connect_signal(
|
power_widget:connect_signal(
|
||||||
"button::release",
|
"button::release",
|
||||||
function()
|
function()
|
||||||
awesome.emit_signal("module::powermenu:show")
|
awesome.emit_signal("module::powermenu:show")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
return power_widget
|
return power_widget
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ local awful = require("awful")
|
|||||||
local color = require("src.theme.colors")
|
local color = require("src.theme.colors")
|
||||||
local dpi = require("beautiful").xresources.apply_dpi
|
local dpi = require("beautiful").xresources.apply_dpi
|
||||||
local gears = require("gears")
|
local gears = require("gears")
|
||||||
local naughty = require("naughty")
|
|
||||||
local watch = awful.widget.watch
|
local watch = awful.widget.watch
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
require("src.core.signals")
|
require("src.core.signals")
|
||||||
|
|||||||
@@ -12,37 +12,37 @@ local wibox = require("wibox")
|
|||||||
require("src.core.signals")
|
require("src.core.signals")
|
||||||
|
|
||||||
return function(s)
|
return function(s)
|
||||||
local systray = wibox.widget {
|
local systray = wibox.widget {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
widget = wibox.container.margin,
|
widget = wibox.container.margin,
|
||||||
id = 'st'
|
id = 'st'
|
||||||
},
|
},
|
||||||
strategy = "exact",
|
strategy = "exact",
|
||||||
layout = wibox.container.constraint,
|
layout = wibox.container.constraint,
|
||||||
id = "container"
|
id = "container"
|
||||||
},
|
},
|
||||||
widget = wibox.container.background,
|
widget = wibox.container.background,
|
||||||
shape = function(cr, width, height)
|
shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
end,
|
end,
|
||||||
bg = color["BlueGrey800"]
|
bg = color["BlueGrey800"]
|
||||||
}
|
}
|
||||||
-- Signals
|
-- Signals
|
||||||
Hover_signal(systray.container, color["Red200"])
|
Hover_signal(systray.container, color["Red200"])
|
||||||
|
|
||||||
awesome.connect_signal("systray::update", function()
|
awesome.connect_signal("systray::update", function()
|
||||||
local num_entries = awesome.systray()
|
local num_entries = awesome.systray()
|
||||||
|
|
||||||
if num_entries == 0 then
|
if num_entries == 0 then
|
||||||
systray.container.st:set_margins(0)
|
systray.container.st:set_margins(0)
|
||||||
else
|
else
|
||||||
systray.container.st:set_margins(dpi(6))
|
systray.container.st:set_margins(dpi(6))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
systray.container.st.widget:set_base_size(dpi(20))
|
systray.container.st.widget:set_base_size(dpi(20))
|
||||||
|
|
||||||
return systray
|
return systray
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,235 +6,235 @@ local color = require("src.theme.colors")
|
|||||||
require("src.tools.icon_handler")
|
require("src.tools.icon_handler")
|
||||||
|
|
||||||
local list_update = function(widget, buttons, label, data, objects)
|
local list_update = function(widget, buttons, label, data, objects)
|
||||||
widget:reset()
|
widget:reset()
|
||||||
|
|
||||||
for i, object in ipairs(objects) do
|
for i, object in ipairs(objects) do
|
||||||
|
|
||||||
local tag_icon = wibox.widget {
|
local tag_icon = wibox.widget {
|
||||||
nil,
|
nil,
|
||||||
{
|
{
|
||||||
id = "icon",
|
id = "icon",
|
||||||
resize = true,
|
resize = true,
|
||||||
widget = wibox.widget.imagebox
|
widget = wibox.widget.imagebox
|
||||||
},
|
},
|
||||||
nil,
|
nil,
|
||||||
layout = wibox.layout.align.horizontal
|
layout = wibox.layout.align.horizontal
|
||||||
}
|
}
|
||||||
|
|
||||||
local tag_icon_margin = wibox.widget {
|
local tag_icon_margin = wibox.widget {
|
||||||
tag_icon,
|
tag_icon,
|
||||||
forced_width = dpi(33),
|
forced_width = dpi(33),
|
||||||
margins = dpi(3),
|
margins = dpi(3),
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.margin
|
||||||
}
|
}
|
||||||
|
|
||||||
local tag_label = wibox.widget {
|
local tag_label = wibox.widget {
|
||||||
text = "",
|
text = "",
|
||||||
align = "center",
|
align = "center",
|
||||||
valign = "center",
|
valign = "center",
|
||||||
visible = true,
|
visible = true,
|
||||||
font = user_vars.font.extrabold,
|
font = user_vars.font.extrabold,
|
||||||
forced_width = dpi(25),
|
forced_width = dpi(25),
|
||||||
widget = wibox.widget.textbox
|
widget = wibox.widget.textbox
|
||||||
}
|
}
|
||||||
|
|
||||||
local tag_label_margin = wibox.widget {
|
local tag_label_margin = wibox.widget {
|
||||||
tag_label,
|
tag_label,
|
||||||
left = dpi(5),
|
left = dpi(5),
|
||||||
right = dpi(5),
|
right = dpi(5),
|
||||||
widget = wibox.container.margin
|
widget = wibox.container.margin
|
||||||
}
|
}
|
||||||
|
|
||||||
local tag_widget = wibox.widget {
|
local tag_widget = wibox.widget {
|
||||||
|
|
||||||
id = "widget_margin",
|
id = "widget_margin",
|
||||||
{
|
{
|
||||||
id = "container",
|
id = "container",
|
||||||
tag_label_margin,
|
tag_label_margin,
|
||||||
layout = wibox.layout.fixed.horizontal
|
layout = wibox.layout.fixed.horizontal
|
||||||
},
|
},
|
||||||
|
|
||||||
fg = color["White"],
|
fg = color["White"],
|
||||||
shape = function(cr, width, height)
|
shape = function(cr, width, height)
|
||||||
gears.shape.rounded_rect(cr, width, height, 5)
|
gears.shape.rounded_rect(cr, width, height, 5)
|
||||||
|
end,
|
||||||
|
widget = wibox.container.background
|
||||||
|
}
|
||||||
|
|
||||||
|
local function create_buttons(buttons, object)
|
||||||
|
if buttons then
|
||||||
|
local btns = {}
|
||||||
|
for _, b in ipairs(buttons) do
|
||||||
|
local btn = awful.button {
|
||||||
|
modifiers = b.modifiers,
|
||||||
|
button = b.button,
|
||||||
|
on_press = function()
|
||||||
|
b:emit_signal('press', object)
|
||||||
end,
|
end,
|
||||||
widget = wibox.container.background
|
on_release = function()
|
||||||
}
|
b:emit_signal('release', object)
|
||||||
|
|
||||||
local function create_buttons(buttons, object)
|
|
||||||
if buttons then
|
|
||||||
local btns = {}
|
|
||||||
for _, b in ipairs(buttons) do
|
|
||||||
local btn = awful.button {
|
|
||||||
modifiers = b.modifiers,
|
|
||||||
button = b.button,
|
|
||||||
on_press = function()
|
|
||||||
b:emit_signal('press', object)
|
|
||||||
end,
|
|
||||||
on_release = function()
|
|
||||||
b:emit_signal('release', object)
|
|
||||||
end
|
|
||||||
}
|
|
||||||
btns[#btns + 1] = btn
|
|
||||||
end
|
|
||||||
return btns
|
|
||||||
end
|
end
|
||||||
|
}
|
||||||
|
btns[#btns + 1] = btn
|
||||||
end
|
end
|
||||||
|
return btns
|
||||||
tag_widget:buttons(create_buttons(buttons, object))
|
end
|
||||||
|
|
||||||
local text, bg_color, bg_image, icon, args = label(object, tag_label)
|
|
||||||
tag_label:set_text(object.index)
|
|
||||||
if object.urgent == true then
|
|
||||||
tag_widget:set_bg(color["RedA200"])
|
|
||||||
tag_widget:set_fg(color["Grey900"])
|
|
||||||
elseif object == awful.screen.focused().selected_tag then
|
|
||||||
tag_widget:set_bg(color["White"])
|
|
||||||
tag_widget:set_fg(color["Grey900"])
|
|
||||||
else
|
|
||||||
tag_widget:set_bg("#3A475C")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Set the icon for each client
|
|
||||||
for _, client in ipairs(object:clients()) do
|
|
||||||
tag_label_margin:set_right(0)
|
|
||||||
local icon = wibox.widget {
|
|
||||||
{
|
|
||||||
id = "icon_container",
|
|
||||||
{
|
|
||||||
id = "icon",
|
|
||||||
resize = true,
|
|
||||||
widget = wibox.widget.imagebox
|
|
||||||
},
|
|
||||||
widget = wibox.container.place
|
|
||||||
},
|
|
||||||
tag_icon_margin,
|
|
||||||
forced_width = dpi(33),
|
|
||||||
margins = dpi(6),
|
|
||||||
widget = wibox.container.margin
|
|
||||||
}
|
|
||||||
icon.icon_container.icon:set_image(Get_icon(user_vars.icon_theme, client))
|
|
||||||
tag_widget.container:setup({
|
|
||||||
icon,
|
|
||||||
strategy = "exact",
|
|
||||||
layout = wibox.container.constraint,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
|
|
||||||
local old_wibox, old_cursor, old_bg
|
|
||||||
tag_widget:connect_signal(
|
|
||||||
"mouse::enter",
|
|
||||||
function()
|
|
||||||
old_bg = tag_widget.bg
|
|
||||||
if object == awful.screen.focused().selected_tag then
|
|
||||||
tag_widget.bg = '#dddddd' .. 'dd'
|
|
||||||
else
|
|
||||||
tag_widget.bg = '#3A475C' .. 'dd'
|
|
||||||
end
|
|
||||||
local w = mouse.current_wibox
|
|
||||||
if w then
|
|
||||||
old_cursor, old_wibox = w.cursor, w
|
|
||||||
w.cursor = "hand1"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
tag_widget:connect_signal(
|
|
||||||
"button::press",
|
|
||||||
function()
|
|
||||||
if object == awful.screen.focused().selected_tag then
|
|
||||||
tag_widget.bg = '#bbbbbb' .. 'dd'
|
|
||||||
else
|
|
||||||
tag_widget.bg = '#3A475C' .. 'dd'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
tag_widget:connect_signal(
|
|
||||||
"button::release",
|
|
||||||
function()
|
|
||||||
if object == awful.screen.focused().selected_tag then
|
|
||||||
tag_widget.bg = '#dddddd' .. 'dd'
|
|
||||||
else
|
|
||||||
tag_widget.bg = '#3A475C' .. 'dd'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
tag_widget:connect_signal(
|
|
||||||
"mouse::leave",
|
|
||||||
function()
|
|
||||||
tag_widget.bg = old_bg
|
|
||||||
if old_wibox then
|
|
||||||
old_wibox.cursor = old_cursor
|
|
||||||
old_wibox = nil
|
|
||||||
end
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
widget:add(tag_widget)
|
|
||||||
widget:set_spacing(dpi(6))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
tag_widget:buttons(create_buttons(buttons, object))
|
||||||
|
|
||||||
|
local text, bg_color, bg_image, icon, args = label(object, tag_label)
|
||||||
|
tag_label:set_text(object.index)
|
||||||
|
if object.urgent == true then
|
||||||
|
tag_widget:set_bg(color["RedA200"])
|
||||||
|
tag_widget:set_fg(color["Grey900"])
|
||||||
|
elseif object == awful.screen.focused().selected_tag then
|
||||||
|
tag_widget:set_bg(color["White"])
|
||||||
|
tag_widget:set_fg(color["Grey900"])
|
||||||
|
else
|
||||||
|
tag_widget:set_bg("#3A475C")
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Set the icon for each client
|
||||||
|
for _, client in ipairs(object:clients()) do
|
||||||
|
tag_label_margin:set_right(0)
|
||||||
|
local icon = wibox.widget {
|
||||||
|
{
|
||||||
|
id = "icon_container",
|
||||||
|
{
|
||||||
|
id = "icon",
|
||||||
|
resize = true,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
tag_icon_margin,
|
||||||
|
forced_width = dpi(33),
|
||||||
|
margins = dpi(6),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
}
|
||||||
|
icon.icon_container.icon:set_image(Get_icon(user_vars.icon_theme, client))
|
||||||
|
tag_widget.container:setup({
|
||||||
|
icon,
|
||||||
|
strategy = "exact",
|
||||||
|
layout = wibox.container.constraint,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
local old_wibox, old_cursor, old_bg
|
||||||
|
tag_widget:connect_signal(
|
||||||
|
"mouse::enter",
|
||||||
|
function()
|
||||||
|
old_bg = tag_widget.bg
|
||||||
|
if object == awful.screen.focused().selected_tag then
|
||||||
|
tag_widget.bg = '#dddddd' .. 'dd'
|
||||||
|
else
|
||||||
|
tag_widget.bg = '#3A475C' .. 'dd'
|
||||||
|
end
|
||||||
|
local w = mouse.current_wibox
|
||||||
|
if w then
|
||||||
|
old_cursor, old_wibox = w.cursor, w
|
||||||
|
w.cursor = "hand1"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
tag_widget:connect_signal(
|
||||||
|
"button::press",
|
||||||
|
function()
|
||||||
|
if object == awful.screen.focused().selected_tag then
|
||||||
|
tag_widget.bg = '#bbbbbb' .. 'dd'
|
||||||
|
else
|
||||||
|
tag_widget.bg = '#3A475C' .. 'dd'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
tag_widget:connect_signal(
|
||||||
|
"button::release",
|
||||||
|
function()
|
||||||
|
if object == awful.screen.focused().selected_tag then
|
||||||
|
tag_widget.bg = '#dddddd' .. 'dd'
|
||||||
|
else
|
||||||
|
tag_widget.bg = '#3A475C' .. 'dd'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
tag_widget:connect_signal(
|
||||||
|
"mouse::leave",
|
||||||
|
function()
|
||||||
|
tag_widget.bg = old_bg
|
||||||
|
if old_wibox then
|
||||||
|
old_wibox.cursor = old_cursor
|
||||||
|
old_wibox = nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
widget:add(tag_widget)
|
||||||
|
widget:set_spacing(dpi(6))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local tag_list = function(s)
|
local tag_list = function(s)
|
||||||
return awful.widget.taglist(
|
return awful.widget.taglist(
|
||||||
s,
|
s,
|
||||||
awful.widget.taglist.filter.noempty,
|
awful.widget.taglist.filter.noempty,
|
||||||
gears.table.join(
|
gears.table.join(
|
||||||
awful.button(
|
awful.button(
|
||||||
{},
|
|
||||||
1,
|
|
||||||
function(t)
|
|
||||||
t:view_only()
|
|
||||||
end
|
|
||||||
),
|
|
||||||
awful.button(
|
|
||||||
{ modkey },
|
|
||||||
1,
|
|
||||||
function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:move_to_tag(t)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
),
|
|
||||||
awful.button(
|
|
||||||
{},
|
|
||||||
3,
|
|
||||||
function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:toggle_tag(t)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
),
|
|
||||||
awful.button(
|
|
||||||
{ modkey },
|
|
||||||
3,
|
|
||||||
function(t)
|
|
||||||
if client.focus then
|
|
||||||
client.focus:toggle_tag(t)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
),
|
|
||||||
awful.button(
|
|
||||||
{},
|
|
||||||
4,
|
|
||||||
function(t)
|
|
||||||
awful.tag.viewnext(t.screen)
|
|
||||||
end
|
|
||||||
),
|
|
||||||
awful.button(
|
|
||||||
{},
|
|
||||||
5,
|
|
||||||
function(t)
|
|
||||||
awful.tag.viewprev(t.screen)
|
|
||||||
end
|
|
||||||
)
|
|
||||||
),
|
|
||||||
{},
|
{},
|
||||||
list_update,
|
1,
|
||||||
wibox.layout.fixed.horizontal()
|
function(t)
|
||||||
)
|
t:view_only()
|
||||||
|
end
|
||||||
|
),
|
||||||
|
awful.button(
|
||||||
|
{ modkey },
|
||||||
|
1,
|
||||||
|
function(t)
|
||||||
|
if client.focus then
|
||||||
|
client.focus:move_to_tag(t)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
),
|
||||||
|
awful.button(
|
||||||
|
{},
|
||||||
|
3,
|
||||||
|
function(t)
|
||||||
|
if client.focus then
|
||||||
|
client.focus:toggle_tag(t)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
),
|
||||||
|
awful.button(
|
||||||
|
{ modkey },
|
||||||
|
3,
|
||||||
|
function(t)
|
||||||
|
if client.focus then
|
||||||
|
client.focus:toggle_tag(t)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
),
|
||||||
|
awful.button(
|
||||||
|
{},
|
||||||
|
4,
|
||||||
|
function(t)
|
||||||
|
awful.tag.viewnext(t.screen)
|
||||||
|
end
|
||||||
|
),
|
||||||
|
awful.button(
|
||||||
|
{},
|
||||||
|
5,
|
||||||
|
function(t)
|
||||||
|
awful.tag.viewprev(t.screen)
|
||||||
|
end
|
||||||
|
)
|
||||||
|
),
|
||||||
|
{},
|
||||||
|
list_update,
|
||||||
|
wibox.layout.fixed.horizontal()
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
return tag_list
|
return tag_list
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ local color = require('src.theme.colors')
|
|||||||
|
|
||||||
local list_update = function(widget, buttons, label, data, objects)
|
local list_update = function(widget, buttons, label, data, objects)
|
||||||
widget:reset()
|
widget:reset()
|
||||||
local count
|
for _, object in ipairs(objects) do
|
||||||
for i, object in ipairs(objects) do
|
|
||||||
count = i
|
|
||||||
local task_widget = wibox.widget {
|
local task_widget = wibox.widget {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
@@ -56,7 +54,10 @@ local list_update = function(widget, buttons, label, data, objects)
|
|||||||
local task_tool_tip = awful.tooltip {
|
local task_tool_tip = awful.tooltip {
|
||||||
objects = { task_widget },
|
objects = { task_widget },
|
||||||
mode = "inside",
|
mode = "inside",
|
||||||
align = "right",
|
preferred_alignments = "middle",
|
||||||
|
preferred_positions = "bottom",
|
||||||
|
margins = dpi(10),
|
||||||
|
gaps = 0,
|
||||||
delay_show = 1
|
delay_show = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -115,51 +116,51 @@ local list_update = function(widget, buttons, label, data, objects)
|
|||||||
task_widget:connect_signal(
|
task_widget:connect_signal(
|
||||||
"mouse::enter",
|
"mouse::enter",
|
||||||
function()
|
function()
|
||||||
old_bg = task_widget.bg
|
old_bg = task_widget.bg
|
||||||
if object == client.focus then
|
if object == client.focus then
|
||||||
task_widget.bg = '#dddddddd'
|
task_widget.bg = '#dddddddd'
|
||||||
else
|
else
|
||||||
task_widget.bg = '#3A475Cdd'
|
task_widget.bg = '#3A475Cdd'
|
||||||
end
|
|
||||||
local w = mouse.current_wibox
|
|
||||||
if w then
|
|
||||||
old_cursor, old_wibox = w.cursor, w
|
|
||||||
w.cursor = "hand1"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
local w = mouse.current_wibox
|
||||||
|
if w then
|
||||||
|
old_cursor, old_wibox = w.cursor, w
|
||||||
|
w.cursor = "hand1"
|
||||||
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
task_widget:connect_signal(
|
task_widget:connect_signal(
|
||||||
"button::press",
|
"button::press",
|
||||||
function()
|
function()
|
||||||
if object == client.focus then
|
if object == client.focus then
|
||||||
task_widget.bg = "#ffffffaa"
|
task_widget.bg = "#ffffffaa"
|
||||||
else
|
else
|
||||||
task_widget.bg = '#3A475Caa'
|
task_widget.bg = '#3A475Caa'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
task_widget:connect_signal(
|
task_widget:connect_signal(
|
||||||
"button::release",
|
"button::release",
|
||||||
function()
|
function()
|
||||||
if object == client.focus then
|
if object == client.focus then
|
||||||
task_widget.bg = "#ffffffdd"
|
task_widget.bg = "#ffffffdd"
|
||||||
else
|
else
|
||||||
task_widget.bg = '#3A475Cdd'
|
task_widget.bg = '#3A475Cdd'
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
task_widget:connect_signal(
|
task_widget:connect_signal(
|
||||||
"mouse::leave",
|
"mouse::leave",
|
||||||
function()
|
function()
|
||||||
task_widget.bg = old_bg
|
task_widget.bg = old_bg
|
||||||
if old_wibox then
|
if old_wibox then
|
||||||
old_wibox.cursor = old_cursor
|
old_wibox.cursor = old_cursor
|
||||||
old_wibox = nil
|
old_wibox = nil
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
return widget
|
return widget
|
||||||
@@ -174,24 +175,24 @@ local tasklist = function(s)
|
|||||||
{},
|
{},
|
||||||
1,
|
1,
|
||||||
function(c)
|
function(c)
|
||||||
if c == client.focus then
|
if c == client.focus then
|
||||||
c.minimized = true
|
c.minimized = true
|
||||||
else
|
else
|
||||||
c.minimized = false
|
c.minimized = false
|
||||||
if not c:isvisible() and c.first_tag then
|
if not c:isvisible() and c.first_tag then
|
||||||
c.first_tag:view_only()
|
c.first_tag:view_only()
|
||||||
end
|
|
||||||
c:emit_signal('request::activate')
|
|
||||||
c:raise()
|
|
||||||
end
|
end
|
||||||
|
c:emit_signal('request::activate')
|
||||||
|
c:raise()
|
||||||
end
|
end
|
||||||
|
end
|
||||||
),
|
),
|
||||||
awful.button(
|
awful.button(
|
||||||
{},
|
{},
|
||||||
3,
|
3,
|
||||||
function(c)
|
function(c)
|
||||||
c:kill()
|
c:kill()
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
{},
|
{},
|
||||||
|
|||||||