Compare commits
6 Commits
d549a22794
...
b1c1c8faa6
Author | SHA1 | Date | |
---|---|---|---|
b1c1c8faa6 | |||
03e9fbe124 | |||
b70603504e | |||
765c4232a8 | |||
77106d60f4 | |||
8c59220b6a |
26
README.md
26
README.md
@ -1,16 +1,22 @@
|
|||||||
# Awesome Window Manager config scripts
|
# Mark's Awesomewm Config
|
||||||
|
|
||||||
|
## Setup
|
||||||
Copy config.lua.template into config.lua before using.
|
Copy config.lua.template into config.lua before using.
|
||||||
|
|
||||||
|
## Modules
|
||||||
|
See the [modules](./modules/README.md) README.
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
Some features require extra tools. Tools each module requires are listed below. If a module is disabled, its tool is not needed. Applications required by `core` MUST be installed.
|
||||||
|
|
||||||
|
- Core: `fish`
|
||||||
|
- Backlight: `xbacklight`
|
||||||
|
- Battery: `upower`
|
||||||
|
- Ibus: `ibus`
|
||||||
|
- Launcher: `rofi`
|
||||||
|
- Lock: `i3lock, imagemagick, scrot` or `lightdm` (For `dm-tool`), depending on configuration.
|
||||||
|
- MPC: `mpc`
|
||||||
|
- Picom: `picom`
|
||||||
|
- Screenshot: `flameshot`, `tesseract (and data)`, `xclip`, `lpr`
|
||||||
|
- Volume: `pamixer`
|
||||||
|
|
||||||
- rofi
|
|
||||||
- fish
|
|
||||||
- upower, xbacklight
|
|
||||||
- flameshot, xclip, tesseract
|
|
||||||
- pamixer
|
|
||||||
- sox
|
|
||||||
- ibus
|
|
||||||
- redshift
|
|
||||||
- mpc
|
|
||||||
|
@ -21,11 +21,11 @@ config.core = {
|
|||||||
-- Dynamic: a table of files and times
|
-- Dynamic: a table of files and times
|
||||||
-- {file = "path", start_time = {hour, minute}}
|
-- {file = "path", start_time = {hour, minute}}
|
||||||
--[[
|
--[[
|
||||||
config.wallpaper = {
|
wallpaper = {
|
||||||
{ file = "morning-file.png", start_time = {04, 00} },
|
{ file = "morning-file.png", start_time = {04, 00} },
|
||||||
{ file = "noon-file.png", start_time = {11, 00} },
|
{ file = "noon-file.png", start_time = {11, 00} },
|
||||||
{ file = "night-file.png", start_time = {19, 00} },
|
{ file = "night-file.png", start_time = {19, 00} },
|
||||||
}
|
},
|
||||||
]]--
|
]]--
|
||||||
|
|
||||||
-- The position of the bar on each screen
|
-- The position of the bar on each screen
|
||||||
@ -155,16 +155,16 @@ config.ibus = {
|
|||||||
indicator_code = "en",
|
indicator_code = "en",
|
||||||
ibus_engine = "xkb:us::eng",
|
ibus_engine = "xkb:us::eng",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title = "Russian",
|
|
||||||
indicator_code = "ru",
|
|
||||||
ibus_engine = "xkb:ru::rus"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title = "LaTeX",
|
title = "LaTeX",
|
||||||
indicator_code = "∫x",
|
indicator_code = "∫x",
|
||||||
ibus_engine = "table:latex",
|
ibus_engine = "table:latex",
|
||||||
requires_engine = "xkb:us::eng"
|
requires_engine = "xkb:us::eng"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title = "Russian",
|
||||||
|
indicator_code = "ru",
|
||||||
|
ibus_engine = "xkb:ru::rus"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -54,20 +54,23 @@ local function start()
|
|||||||
|
|
||||||
-- If timed wallpaper is enabled, load timed manager
|
-- If timed wallpaper is enabled, load timed manager
|
||||||
if (type(beautiful.wallpaper) == "table") then
|
if (type(beautiful.wallpaper) == "table") then
|
||||||
desktop.wallpaper = require("desktop.wallpaper")
|
local wallpaper = require("core.wallpaper")
|
||||||
screen.connect_signal("property::geometry", desktop.wallpaper.update)
|
screen.connect_signal(
|
||||||
desktop.wallpaper.update()
|
"property::geometry",
|
||||||
desktop.wallpaper.start()
|
wallpaper.update
|
||||||
|
)
|
||||||
|
wallpaper.update()
|
||||||
|
wallpaper.start()
|
||||||
else
|
else
|
||||||
|
-- Otherwise, set a static wallpaper
|
||||||
-- Otherwise, set static wallpaper on each screen
|
-- on each screen. We need to iterate
|
||||||
-- We loop over screens to prevent the wallpaper from being stretched over
|
-- because a single call to wallpaper.maximized
|
||||||
-- all displays. If, for some reason, you want that to happen, use a single
|
-- will stretch one image over all screens
|
||||||
-- call of "gears.wallpaper.maximized(beautiful.wallpaper)" instead of
|
|
||||||
-- this loop.
|
|
||||||
|
|
||||||
for s in screen do
|
for s in screen do
|
||||||
gears.wallpaper.maximized(beautiful.wallpaper, s)
|
gears.wallpaper.maximized(
|
||||||
|
beautiful.wallpaper,
|
||||||
|
s
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -92,13 +95,18 @@ local function start()
|
|||||||
-- Prepare screens
|
-- Prepare screens
|
||||||
awful.screen.connect_for_each_screen(
|
awful.screen.connect_for_each_screen(
|
||||||
function(s)
|
function(s)
|
||||||
-- s: the screen this function is being called for
|
|
||||||
-- Create tag table
|
|
||||||
|
|
||||||
|
-- Run module screen initialization methods
|
||||||
|
for _, mod in pairs(modules) do
|
||||||
|
if (mod["for_each_screen"] ~= nil) then
|
||||||
|
mod["for_each_screen"](s)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Create tag table
|
||||||
s.tagger = tagger:new(s)
|
s.tagger = tagger:new(s)
|
||||||
|
|
||||||
|
-- Create a promptbox for each screen
|
||||||
-- Create a promptbox for each s
|
|
||||||
s.mypromptbox = awful.widget.prompt()
|
s.mypromptbox = awful.widget.prompt()
|
||||||
|
|
||||||
-- Create the bar
|
-- Create the bar
|
||||||
|
@ -1,20 +1,3 @@
|
|||||||
# Mark's Awesomewm Config
|
|
||||||
|
|
||||||
## Dependencies
|
|
||||||
Some features require extra tools. Tools each module requires are listed below. If a module is disabled, its tool is not needed. Applications required by `core` MUST be installed.
|
|
||||||
|
|
||||||
- Core: `fish`
|
|
||||||
- Backlight: `xbacklight`
|
|
||||||
- Battery: `upower`
|
|
||||||
- Ibus: `ibus`
|
|
||||||
- Launcher: `rofi`
|
|
||||||
- Lock: `i3lock, imagemagick, scrot` or `lightdm` (For `dm-tool`), depending on configuration.
|
|
||||||
- MPC: `mpc`
|
|
||||||
- Picom: `picom`
|
|
||||||
- Screenshot: `flameshot`, `tesseract (and data)`, `xclip`, `lpr`
|
|
||||||
- Volume: `pamixer`
|
|
||||||
|
|
||||||
|
|
||||||
## Modules
|
## Modules
|
||||||
|
|
||||||
Modules are parts of this configuration that can be disabled. Nearly all features in this config are defined by a module.
|
Modules are parts of this configuration that can be disabled. Nearly all features in this config are defined by a module.
|
||||||
@ -29,8 +12,11 @@ Every directory in `modules/` is a module. Modules cannot be in subdirectories.
|
|||||||
Each module directory MUST have an ``init.lua``, which returns a table. That table can contain anything, but a few keys are special:
|
Each module directory MUST have an ``init.lua``, which returns a table. That table can contain anything, but a few keys are special:
|
||||||
|
|
||||||
``keybinds`` \
|
``keybinds`` \
|
||||||
Defines keybinds the module provides. It is audomatically loaded *if* the module is enabled. \
|
Defines keybinds the module provides. It is automatically loaded *if* the module is enabled. \
|
||||||
This MUST be a table formed by ``awful.key()``. See `ibus` or `screenshot` for examples.
|
This MUST be a table formed by ``awful.key()``. See `ibus` or `screenshot` for examples.
|
||||||
|
|
||||||
``init`` \
|
``init`` \
|
||||||
Defines an init method. This is called once when awesome starts.
|
Called once when awesome starts if defined. Takes no arguments.
|
||||||
|
|
||||||
|
``for_each_screen(s)`` \
|
||||||
|
Called for each screen at start if defined. Takes one argument, `s`, the screen.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
init = function()
|
init = function()
|
||||||
local conf = conf_dir .. "/modules/picom/picom.conf"
|
local conf = conf_dir .. "/modules/picom/picom.conf"
|
||||||
awful.spawn("picom -b --conf \"" .. conf .. "\"")
|
awful.spawn("picom -b --experimental-backends --conf \"" .. conf .. "\"")
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,29 @@
|
|||||||
shadow-radius = 0
|
shadow-radius = 0;
|
||||||
shadow-opacity = 0
|
shadow-opacity = 0;
|
||||||
|
|
||||||
// Enable fading initially.
|
// Enable fading initially.
|
||||||
// Finer config is in fade-exclude.
|
// Finer config is in fade-exclude.
|
||||||
fading = true
|
fading = true
|
||||||
fade-in-step = 0.04
|
fade-in-step = 0.04;
|
||||||
fade-out-step = 0.03
|
fade-out-step = 0.03;
|
||||||
fade-delta = 10
|
fade-delta = 10;
|
||||||
|
|
||||||
fade-exclude = [
|
fade-exclude = [
|
||||||
"class_g != 'awesome'"
|
"class_g != 'awesome'"
|
||||||
]
|
];
|
||||||
|
|
||||||
inactive-opacity = 1
|
backend = "glx";
|
||||||
active-opacity = 1
|
detect-rounded-corners = true;
|
||||||
inactive-dim = 0
|
blur-background-frame = false;
|
||||||
|
blur: {
|
||||||
|
method = "dual_kawase";
|
||||||
|
strength = 3;
|
||||||
|
};
|
||||||
|
blur-exclude = [
|
||||||
|
"class_g != 'awesome'"
|
||||||
|
];
|
||||||
|
|
||||||
|
inactive-opacity = 1;
|
||||||
|
active-opacity = 1;
|
||||||
|
inactive-dim = 0;
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
local volume = require("modules.volume.util")
|
local volume = require("modules.volume.util")
|
||||||
local widget = require("modules.volume.widget")
|
local widget = require("modules.volume.widget")
|
||||||
|
local popup = require("modules.volume.popup")
|
||||||
|
|
||||||
return {
|
return {
|
||||||
widget = require("modules.volume.widget").widget,
|
widget = require("modules.volume.widget").widget,
|
||||||
@ -10,5 +11,9 @@ return {
|
|||||||
volume.commands:unmute()
|
volume.commands:unmute()
|
||||||
-- Update volume widget at start
|
-- Update volume widget at start
|
||||||
volume.commands:get(widget.update)
|
volume.commands:get(widget.update)
|
||||||
|
end,
|
||||||
|
|
||||||
|
for_each_screen = function (s)
|
||||||
|
popup(s)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ return gears.table.join(
|
|||||||
awful.key( {}, "XF86AudioRaiseVolume",
|
awful.key( {}, "XF86AudioRaiseVolume",
|
||||||
function ()
|
function ()
|
||||||
volume.volume_up()
|
volume.volume_up()
|
||||||
|
awesome.emit_signal("module::volume_popup:show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Volume up",
|
description = "Volume up",
|
||||||
@ -14,6 +15,7 @@ return gears.table.join(
|
|||||||
awful.key( {}, "XF86AudioLowerVolume",
|
awful.key( {}, "XF86AudioLowerVolume",
|
||||||
function ()
|
function ()
|
||||||
volume.volume_down()
|
volume.volume_down()
|
||||||
|
awesome.emit_signal("module::volume_popup:show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Volume down",
|
description = "Volume down",
|
||||||
@ -24,6 +26,7 @@ return gears.table.join(
|
|||||||
awful.key( {}, "XF86AudioMute",
|
awful.key( {}, "XF86AudioMute",
|
||||||
function ()
|
function ()
|
||||||
volume.toggle_mute()
|
volume.toggle_mute()
|
||||||
|
awesome.emit_signal("module::volume_popup:show")
|
||||||
end,
|
end,
|
||||||
{
|
{
|
||||||
description = "Mute",
|
description = "Mute",
|
||||||
|
208
modules/volume/popup.lua
Normal file
208
modules/volume/popup.lua
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
local volume = req_rel(..., "util")
|
||||||
|
|
||||||
|
return function(s)
|
||||||
|
local widget = wibox.widget {
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{
|
||||||
|
{ -- Icon and margins
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
nil,
|
||||||
|
{
|
||||||
|
id = "icon",
|
||||||
|
forced_height = beautiful.dpi(100),
|
||||||
|
image = beautiful.icons.volume.high,
|
||||||
|
widget = wibox.widget.imagebox
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
expand = "none",
|
||||||
|
id = "icon_margin2",
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
},
|
||||||
|
nil,
|
||||||
|
id = "icon_margin1",
|
||||||
|
expand = "none",
|
||||||
|
layout = wibox.layout.align.horizontal
|
||||||
|
},
|
||||||
|
{ -- Text and percentage
|
||||||
|
{
|
||||||
|
id = "label",
|
||||||
|
text = "Volume",
|
||||||
|
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 = beautiful.dpi(48),
|
||||||
|
layout = wibox.layout.align.horizontal,
|
||||||
|
},
|
||||||
|
{ -- Progress bar
|
||||||
|
{
|
||||||
|
id = "volume_bar",
|
||||||
|
shape = gears.shape.rounded_bar,
|
||||||
|
forced_height = beautiful.dpi(10),
|
||||||
|
background_color = "#AAAAAA88",
|
||||||
|
bar_color = "#ffffff",
|
||||||
|
color = "#ffffff",
|
||||||
|
bar_shape = gears.shape.rounded_bar,
|
||||||
|
max_value = 100,
|
||||||
|
widget = wibox.widget.progressbar
|
||||||
|
},
|
||||||
|
id = "bar_layout",
|
||||||
|
forced_height = beautiful.dpi(24),
|
||||||
|
widget = wibox.container.place
|
||||||
|
},
|
||||||
|
id = "icon_bar_layout",
|
||||||
|
spacing = beautiful.dpi(0),
|
||||||
|
layout = wibox.layout.align.vertical
|
||||||
|
},
|
||||||
|
id = "popup_layout",
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
},
|
||||||
|
id = "container",
|
||||||
|
left = beautiful.dpi(20),
|
||||||
|
right = beautiful.dpi(20),
|
||||||
|
top = beautiful.dpi(10),
|
||||||
|
bottom = beautiful.dpi(10),
|
||||||
|
widget = wibox.container.margin
|
||||||
|
},
|
||||||
|
bg ="#000000AA",
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
visible = true,
|
||||||
|
type = "notification",
|
||||||
|
forced_height = beautiful.dpi(180),
|
||||||
|
forced_width = beautiful.dpi(300),
|
||||||
|
offset = beautiful.dpi(5),
|
||||||
|
}
|
||||||
|
|
||||||
|
local popup_container = awful.popup {
|
||||||
|
widget = wibox.container.background,
|
||||||
|
ontop = true,
|
||||||
|
bg = "#00000000",
|
||||||
|
stretch = false,
|
||||||
|
visible = false,
|
||||||
|
screen = s,
|
||||||
|
|
||||||
|
placement = function(c)
|
||||||
|
awful.placement.centered(
|
||||||
|
c,
|
||||||
|
{
|
||||||
|
honor_workarea = true,
|
||||||
|
margins = {
|
||||||
|
top = beautiful.dpi(200)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
end,
|
||||||
|
|
||||||
|
-- Only set corner radius here.
|
||||||
|
shape = function(cr, width, height)
|
||||||
|
gears.shape.rounded_rect(
|
||||||
|
cr,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
beautiful.dpi(20)
|
||||||
|
)
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
popup_container:setup {
|
||||||
|
widget,
|
||||||
|
layout = wibox.layout.fixed.horizontal
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
local function update_popup()
|
||||||
|
volume.commands:get(function(status)
|
||||||
|
|
||||||
|
awesome.emit_signal("widget::volume")
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
label_value_layout.
|
||||||
|
value:set_text(status.value .. "%")
|
||||||
|
|
||||||
|
awesome.emit_signal(
|
||||||
|
"widget::volume:update",
|
||||||
|
status.value
|
||||||
|
)
|
||||||
|
|
||||||
|
local icon
|
||||||
|
if status.mute then
|
||||||
|
icon = beautiful.icons.volume.mute
|
||||||
|
elseif status.value < 1 then
|
||||||
|
icon = beautiful.icons.volume.off
|
||||||
|
elseif status.value >= 1 and status.value < 34 then
|
||||||
|
icon = beautiful.icons.volume.low
|
||||||
|
elseif status.value >= 34 and status.value < 67 then
|
||||||
|
icon = beautiful.icons.volume.medium
|
||||||
|
elseif status.value >= 67 then
|
||||||
|
icon = beautiful.icons.volume.high
|
||||||
|
end
|
||||||
|
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
icon_margin1.
|
||||||
|
icon_margin2.
|
||||||
|
icon:set_image(icon)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local update_slider = function()
|
||||||
|
volume.commands:get(function(status)
|
||||||
|
widget.
|
||||||
|
container.
|
||||||
|
popup_layout.
|
||||||
|
icon_bar_layout.
|
||||||
|
bar_layout.
|
||||||
|
volume_bar:set_value(status.value)
|
||||||
|
update_popup()
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
update_slider()
|
||||||
|
|
||||||
|
local hide_popup_timer = gears.timer {
|
||||||
|
timeout = 1,
|
||||||
|
autostart = true,
|
||||||
|
callback = function()
|
||||||
|
popup_container.visible = false
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
awesome.connect_signal("module::volume_popup:show",
|
||||||
|
function()
|
||||||
|
update_slider()
|
||||||
|
if s == mouse.screen then
|
||||||
|
popup_container.visible = true
|
||||||
|
end
|
||||||
|
|
||||||
|
if hide_popup_timer.started then
|
||||||
|
hide_popup_timer:again()
|
||||||
|
else
|
||||||
|
hide_popup_timer:start()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
popup_container:connect_signal("button::press",
|
||||||
|
function()
|
||||||
|
popup_container.visible = false
|
||||||
|
hide_popup_timer:stop()
|
||||||
|
end
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
@ -90,6 +90,8 @@ widget.widget:connect_signal("button::press",
|
|||||||
elseif (button == 5) then
|
elseif (button == 5) then
|
||||||
volume.volume_down()
|
volume.volume_down()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
awesome.emit_signal("module::volume_popup:show")
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user