Compare commits

..

No commits in common. "b1c1c8faa6baec0bfa3e599b52f120b01239620c" and "d549a22794ae95faec116fa66e7667bf77dda2e7" have entirely different histories.

10 changed files with 62 additions and 291 deletions

View File

@ -1,22 +1,16 @@
# Mark's Awesomewm Config
# Awesome Window Manager config scripts
## Setup
Copy config.lua.template into config.lua before using.
## Modules
See the [modules](./modules/README.md) README.
## 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

View File

@ -21,11 +21,11 @@ config.core = {
-- Dynamic: a table of files and times
-- {file = "path", start_time = {hour, minute}}
--[[
wallpaper = {
config.wallpaper = {
{ file = "morning-file.png", start_time = {04, 00} },
{ file = "noon-file.png", start_time = {11, 00} },
{ file = "night-file.png", start_time = {19, 00} },
},
}
]]--
-- The position of the bar on each screen
@ -155,16 +155,16 @@ config.ibus = {
indicator_code = "en",
ibus_engine = "xkb:us::eng",
},
{
title = "Russian",
indicator_code = "ru",
ibus_engine = "xkb:ru::rus"
},
{
title = "LaTeX",
indicator_code = "∫x",
ibus_engine = "table:latex",
requires_engine = "xkb:us::eng"
},
{
title = "Russian",
indicator_code = "ru",
ibus_engine = "xkb:ru::rus"
}
}
}

View File

@ -54,23 +54,20 @@ local function start()
-- If timed wallpaper is enabled, load timed manager
if (type(beautiful.wallpaper) == "table") then
local wallpaper = require("core.wallpaper")
screen.connect_signal(
"property::geometry",
wallpaper.update
)
wallpaper.update()
wallpaper.start()
desktop.wallpaper = require("desktop.wallpaper")
screen.connect_signal("property::geometry", desktop.wallpaper.update)
desktop.wallpaper.update()
desktop.wallpaper.start()
else
-- Otherwise, set a static wallpaper
-- on each screen. We need to iterate
-- because a single call to wallpaper.maximized
-- will stretch one image over all screens
-- Otherwise, set static wallpaper on each screen
-- We loop over screens to prevent the wallpaper from being stretched over
-- all displays. If, for some reason, you want that to happen, use a single
-- call of "gears.wallpaper.maximized(beautiful.wallpaper)" instead of
-- this loop.
for s in screen do
gears.wallpaper.maximized(
beautiful.wallpaper,
s
)
gears.wallpaper.maximized(beautiful.wallpaper, s)
end
end
@ -95,18 +92,13 @@ local function start()
-- Prepare screens
awful.screen.connect_for_each_screen(
function(s)
-- 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
-- s: the screen this function is being called for
-- Create tag table
s.tagger = tagger:new(s)
-- Create a promptbox for each screen
-- Create a promptbox for each s
s.mypromptbox = awful.widget.prompt()
-- Create the bar

View File

@ -1,3 +1,20 @@
# 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 are parts of this configuration that can be disabled. Nearly all features in this config are defined by a module.
@ -12,11 +29,8 @@ 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:
``keybinds`` \
Defines keybinds the module provides. It is automatically loaded *if* the module is enabled. \
Defines keybinds the module provides. It is audomatically loaded *if* the module is enabled. \
This MUST be a table formed by ``awful.key()``. See `ibus` or `screenshot` for examples.
``init`` \
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.
Defines an init method. This is called once when awesome starts.

View File

@ -1,6 +1,6 @@
return {
init = function()
local conf = conf_dir .. "/modules/picom/picom.conf"
awful.spawn("picom -b --experimental-backends --conf \"" .. conf .. "\"")
awful.spawn("picom -b --conf \"" .. conf .. "\"")
end
}

View File

@ -1,29 +1,18 @@
shadow-radius = 0;
shadow-opacity = 0;
shadow-radius = 0
shadow-opacity = 0
// Enable fading initially.
// Finer config is in fade-exclude.
fading = true
fade-in-step = 0.04;
fade-out-step = 0.03;
fade-delta = 10;
fade-in-step = 0.04
fade-out-step = 0.03
fade-delta = 10
fade-exclude = [
"class_g != 'awesome'"
];
]
backend = "glx";
detect-rounded-corners = true;
blur-background-frame = false;
blur: {
method = "dual_kawase";
strength = 3;
};
blur-exclude = [
"class_g != 'awesome'"
];
inactive-opacity = 1;
active-opacity = 1;
inactive-dim = 0;
inactive-opacity = 1
active-opacity = 1
inactive-dim = 0

View File

@ -1,6 +1,5 @@
local volume = require("modules.volume.util")
local widget = require("modules.volume.widget")
local popup = require("modules.volume.popup")
return {
widget = require("modules.volume.widget").widget,
@ -11,9 +10,5 @@ return {
volume.commands:unmute()
-- Update volume widget at start
volume.commands:get(widget.update)
end,
for_each_screen = function (s)
popup(s)
end
}

View File

@ -4,7 +4,6 @@ return gears.table.join(
awful.key( {}, "XF86AudioRaiseVolume",
function ()
volume.volume_up()
awesome.emit_signal("module::volume_popup:show")
end,
{
description = "Volume up",
@ -15,7 +14,6 @@ return gears.table.join(
awful.key( {}, "XF86AudioLowerVolume",
function ()
volume.volume_down()
awesome.emit_signal("module::volume_popup:show")
end,
{
description = "Volume down",
@ -26,7 +24,6 @@ return gears.table.join(
awful.key( {}, "XF86AudioMute",
function ()
volume.toggle_mute()
awesome.emit_signal("module::volume_popup:show")
end,
{
description = "Mute",

View File

@ -1,208 +0,0 @@
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

View File

@ -90,8 +90,6 @@ widget.widget:connect_signal("button::press",
elseif (button == 5) then
volume.volume_down()
end
awesome.emit_signal("module::volume_popup:show")
end
)