Added stylua config and ran it
This commit is contained in:
parent
f0a0ff2855
commit
58d2046ff9
@ -5,101 +5,105 @@ local root = client
|
|||||||
local naughty = require('naughty')
|
local naughty = require('naughty')
|
||||||
|
|
||||||
local state = {
|
local state = {
|
||||||
client = nil,
|
client = nil,
|
||||||
signals = {}
|
signals = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
local function notify(msg, keep) -- {{{1
|
local function notify(msg, keep) -- {{{1
|
||||||
local timeout = 3
|
local timeout = 3
|
||||||
if keep then timeout = 0 end
|
if keep then
|
||||||
|
timeout = 0
|
||||||
|
end
|
||||||
|
|
||||||
naughty.notify({ text = msg, timeout = timeout })
|
naughty.notify({ text = msg, timeout = timeout })
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_bounds() -- {{{1
|
local function set_bounds() -- {{{1
|
||||||
local c = state.client
|
local c = state.client
|
||||||
state.x_min = c.x + 5
|
state.x_min = c.x + 5
|
||||||
state.x_max = c.x + c.width - 5
|
state.x_max = c.x + c.width - 5
|
||||||
state.y_min = c.y + 5
|
state.y_min = c.y + 5
|
||||||
state.y_max = c.y + c.height - 5
|
state.y_max = c.y + c.height - 5
|
||||||
end
|
end
|
||||||
|
|
||||||
local function reposition() -- {{{1
|
local function reposition() -- {{{1
|
||||||
local pos = mouse.coords()
|
local pos = mouse.coords()
|
||||||
local new_pos = {}
|
local new_pos = {}
|
||||||
|
|
||||||
if pos.x > state.x_max then
|
if pos.x > state.x_max then
|
||||||
new_pos.x = state.x_max
|
new_pos.x = state.x_max
|
||||||
elseif pos.x < state.x_min then
|
elseif pos.x < state.x_min then
|
||||||
new_pos.x = state.x_min
|
new_pos.x = state.x_min
|
||||||
else
|
else
|
||||||
new_pos.x = pos.x
|
new_pos.x = pos.x
|
||||||
end
|
end
|
||||||
|
|
||||||
if pos.y > state.y_max then
|
if pos.y > state.y_max then
|
||||||
new_pos.y = state.y_max
|
new_pos.y = state.y_max
|
||||||
elseif pos.y < state.y_min then
|
elseif pos.y < state.y_min then
|
||||||
new_pos.y = state.y_min
|
new_pos.y = state.y_min
|
||||||
else
|
else
|
||||||
new_pos.y = pos.y
|
new_pos.y = pos.y
|
||||||
end
|
end
|
||||||
--new_pos.x = state.x_min + (state.x_max - state.x_min) / 2
|
--new_pos.x = state.x_min + (state.x_max - state.x_min) / 2
|
||||||
--new_pos.y = state.y_min + (state.y_max - state.y_min) / 2
|
--new_pos.y = state.y_min + (state.y_max - state.y_min) / 2
|
||||||
|
|
||||||
mouse.coords(new_pos, false)
|
mouse.coords(new_pos, false)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function connect(signal, func) -- {{{1
|
local function connect(signal, func) -- {{{1
|
||||||
state.client:connect_signal(signal, func)
|
state.client:connect_signal(signal, func)
|
||||||
state.signals[signal] = func
|
state.signals[signal] = func
|
||||||
end
|
end
|
||||||
|
|
||||||
local function disconnect() -- {{{1
|
local function disconnect() -- {{{1
|
||||||
for signal, func in pairs(state.signals) do
|
for signal, func in pairs(state.signals) do
|
||||||
state.client:disconnect_signal(signal, func)
|
state.client:disconnect_signal(signal, func)
|
||||||
state.signals[signal] = nil
|
state.signals[signal] = nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function release() -- {{{1
|
local function release() -- {{{1
|
||||||
disconnect()
|
disconnect()
|
||||||
|
|
||||||
root.disconnect_signal("mouse::move", reposition)
|
root.disconnect_signal('mouse::move', reposition)
|
||||||
root.disconnect_signal("mouse::leave", reposition)
|
root.disconnect_signal('mouse::leave', reposition)
|
||||||
|
|
||||||
notify("Mouse released")
|
notify('Mouse released')
|
||||||
|
|
||||||
state.client = nil
|
state.client = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
local function constrain(c) -- {{{1
|
local function constrain(c) -- {{{1
|
||||||
state.client = c or mouse.current_client
|
state.client = c or mouse.current_client
|
||||||
|
|
||||||
if state.client == nil then return end
|
if state.client == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
set_bounds()
|
set_bounds()
|
||||||
|
|
||||||
notify("Constrainging mouse to " .. state.client.name)
|
notify('Constrainging mouse to ' .. state.client.name)
|
||||||
|
|
||||||
root.connect_signal("mouse::move", reposition)
|
root.connect_signal('mouse::move', reposition)
|
||||||
root.connect_signal("mouse::leave", reposition)
|
root.connect_signal('mouse::leave', reposition)
|
||||||
|
|
||||||
connect("mouse::move", reposition)
|
connect('mouse::move', reposition)
|
||||||
connect("mouse::leave", reposition)
|
connect('mouse::leave', reposition)
|
||||||
connect("property::size", set_bounds)
|
connect('property::size', set_bounds)
|
||||||
connect("property::position", set_bounds)
|
connect('property::position', set_bounds)
|
||||||
connect("unmanage", release)
|
connect('unmanage', release)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- public interface -- {{{1
|
-- public interface -- {{{1
|
||||||
return {
|
return {
|
||||||
constrain = constrain,
|
constrain = constrain,
|
||||||
release = release,
|
release = release,
|
||||||
toggle = function(c)
|
toggle = function(c)
|
||||||
if state.client then
|
if state.client then
|
||||||
release()
|
release()
|
||||||
else
|
else
|
||||||
constrain(c)
|
constrain(c)
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
}
|
}
|
||||||
|
1148
awesome/rc.lua
1148
awesome/rc.lua
File diff suppressed because it is too large
Load Diff
2
awesome/stylua.toml
Normal file
2
awesome/stylua.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
quote_style = "AutoPreferSingle"
|
||||||
|
|
@ -5,136 +5,142 @@
|
|||||||
|
|
||||||
--]]
|
--]]
|
||||||
|
|
||||||
local gears = require("gears")
|
local gears = require('gears')
|
||||||
local lain = require("lain")
|
local lain = require('lain')
|
||||||
local awful = require("awful")
|
local awful = require('awful')
|
||||||
local wibox = require("wibox")
|
local wibox = require('wibox')
|
||||||
local dpi = require("beautiful.xresources").apply_dpi
|
local dpi = require('beautiful.xresources').apply_dpi
|
||||||
|
|
||||||
local os = os
|
local os = os
|
||||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||||
|
|
||||||
local theme = {}
|
local theme = {}
|
||||||
theme.confdir = os.getenv("HOME") .. "/.config/awesome/"
|
theme.confdir = os.getenv('HOME') .. '/.config/awesome/'
|
||||||
theme.wallpaper = os.getenv("HOME") .. "/.config/awesome/wall.png"
|
theme.wallpaper = os.getenv('HOME') .. '/.config/awesome/wall.png'
|
||||||
theme.font = "Terminus 8"
|
theme.font = 'Terminus 8'
|
||||||
theme.menu_bg_normal = "#000000"
|
theme.menu_bg_normal = '#000000'
|
||||||
theme.menu_bg_focus = "#000000"
|
theme.menu_bg_focus = '#000000'
|
||||||
theme.bg_normal = "#000000"
|
theme.bg_normal = '#000000'
|
||||||
theme.bg_focus = "#000000"
|
theme.bg_focus = '#000000'
|
||||||
theme.bg_urgent = "#000000"
|
theme.bg_urgent = '#000000'
|
||||||
theme.fg_normal = "#aaaaaa"
|
theme.fg_normal = '#aaaaaa'
|
||||||
theme.fg_focus = "#ff8c00"
|
theme.fg_focus = '#ff8c00'
|
||||||
theme.fg_urgent = "#af1d18"
|
theme.fg_urgent = '#af1d18'
|
||||||
theme.fg_minimize = "#ffffff"
|
theme.fg_minimize = '#ffffff'
|
||||||
theme.border_width = dpi(1)
|
theme.border_width = dpi(1)
|
||||||
theme.border_normal = "#1c2022"
|
theme.border_normal = '#1c2022'
|
||||||
theme.border_focus = "#606060"
|
theme.border_focus = '#606060'
|
||||||
theme.border_marked = "#3ca4d8"
|
theme.border_marked = '#3ca4d8'
|
||||||
theme.menu_border_width = 0
|
theme.menu_border_width = 0
|
||||||
theme.menu_width = dpi(130)
|
theme.menu_width = dpi(130)
|
||||||
theme.menu_submenu_icon = theme.confdir .. "/icons/submenu.png"
|
theme.menu_submenu_icon = theme.confdir .. '/icons/submenu.png'
|
||||||
theme.menu_fg_normal = "#aaaaaa"
|
theme.menu_fg_normal = '#aaaaaa'
|
||||||
theme.menu_fg_focus = "#ff8c00"
|
theme.menu_fg_focus = '#ff8c00'
|
||||||
theme.menu_bg_normal = "#050505dd"
|
theme.menu_bg_normal = '#050505dd'
|
||||||
theme.menu_bg_focus = "#050505dd"
|
theme.menu_bg_focus = '#050505dd'
|
||||||
theme.widget_temp = theme.confdir .. "/icons/temp.png"
|
theme.widget_temp = theme.confdir .. '/icons/temp.png'
|
||||||
theme.widget_uptime = theme.confdir .. "/icons/ac.png"
|
theme.widget_uptime = theme.confdir .. '/icons/ac.png'
|
||||||
theme.widget_cpu = theme.confdir .. "/icons/cpu.png"
|
theme.widget_cpu = theme.confdir .. '/icons/cpu.png'
|
||||||
theme.widget_weather = theme.confdir .. "/icons/dish.png"
|
theme.widget_weather = theme.confdir .. '/icons/dish.png'
|
||||||
theme.widget_fs = theme.confdir .. "/icons/fs.png"
|
theme.widget_fs = theme.confdir .. '/icons/fs.png'
|
||||||
theme.widget_mem = theme.confdir .. "/icons/mem.png"
|
theme.widget_mem = theme.confdir .. '/icons/mem.png'
|
||||||
theme.widget_note = theme.confdir .. "/icons/note.png"
|
theme.widget_note = theme.confdir .. '/icons/note.png'
|
||||||
theme.widget_note_on = theme.confdir .. "/icons/note_on.png"
|
theme.widget_note_on = theme.confdir .. '/icons/note_on.png'
|
||||||
theme.widget_netdown = theme.confdir .. "/icons/net_down.png"
|
theme.widget_netdown = theme.confdir .. '/icons/net_down.png'
|
||||||
theme.widget_netup = theme.confdir .. "/icons/net_up.png"
|
theme.widget_netup = theme.confdir .. '/icons/net_up.png'
|
||||||
theme.widget_mail = theme.confdir .. "/icons/mail.png"
|
theme.widget_mail = theme.confdir .. '/icons/mail.png'
|
||||||
theme.widget_batt = theme.confdir .. "/icons/bat.png"
|
theme.widget_batt = theme.confdir .. '/icons/bat.png'
|
||||||
theme.widget_clock = theme.confdir .. "/icons/clock.png"
|
theme.widget_clock = theme.confdir .. '/icons/clock.png'
|
||||||
theme.widget_vol = theme.confdir .. "/icons/spkr.png"
|
theme.widget_vol = theme.confdir .. '/icons/spkr.png'
|
||||||
theme.taglist_squares_sel = theme.confdir .. "/icons/square_a.png"
|
theme.taglist_squares_sel = theme.confdir .. '/icons/square_a.png'
|
||||||
theme.taglist_squares_unsel = theme.confdir .. "/icons/square_b.png"
|
theme.taglist_squares_unsel = theme.confdir .. '/icons/square_b.png'
|
||||||
theme.tasklist_plain_task_name = true
|
theme.tasklist_plain_task_name = true
|
||||||
theme.tasklist_disable_icon = true
|
theme.tasklist_disable_icon = true
|
||||||
theme.useless_gap = 0
|
theme.useless_gap = 0
|
||||||
theme.layout_tile = theme.confdir .. "/icons/tile.png"
|
theme.layout_tile = theme.confdir .. '/icons/tile.png'
|
||||||
theme.layout_tilegaps = theme.confdir .. "/icons/tilegaps.png"
|
theme.layout_tilegaps = theme.confdir .. '/icons/tilegaps.png'
|
||||||
theme.layout_tileleft = theme.confdir .. "/icons/tileleft.png"
|
theme.layout_tileleft = theme.confdir .. '/icons/tileleft.png'
|
||||||
theme.layout_tilebottom = theme.confdir .. "/icons/tilebottom.png"
|
theme.layout_tilebottom = theme.confdir .. '/icons/tilebottom.png'
|
||||||
theme.layout_tiletop = theme.confdir .. "/icons/tiletop.png"
|
theme.layout_tiletop = theme.confdir .. '/icons/tiletop.png'
|
||||||
theme.layout_fairv = theme.confdir .. "/icons/fairv.png"
|
theme.layout_fairv = theme.confdir .. '/icons/fairv.png'
|
||||||
theme.layout_fairh = theme.confdir .. "/icons/fairh.png"
|
theme.layout_fairh = theme.confdir .. '/icons/fairh.png'
|
||||||
theme.layout_spiral = theme.confdir .. "/icons/spiral.png"
|
theme.layout_spiral = theme.confdir .. '/icons/spiral.png'
|
||||||
theme.layout_dwindle = theme.confdir .. "/icons/dwindle.png"
|
theme.layout_dwindle = theme.confdir .. '/icons/dwindle.png'
|
||||||
theme.layout_max = theme.confdir .. "/icons/max.png"
|
theme.layout_max = theme.confdir .. '/icons/max.png'
|
||||||
theme.layout_fullscreen = theme.confdir .. "/icons/fullscreen.png"
|
theme.layout_fullscreen = theme.confdir .. '/icons/fullscreen.png'
|
||||||
theme.layout_magnifier = theme.confdir .. "/icons/magnifier.png"
|
theme.layout_magnifier = theme.confdir .. '/icons/magnifier.png'
|
||||||
theme.layout_floating = theme.confdir .. "/icons/floating.png"
|
theme.layout_floating = theme.confdir .. '/icons/floating.png'
|
||||||
theme.titlebar_close_button_normal = theme.confdir .. "/icons/titlebar/close_normal.png"
|
theme.titlebar_close_button_normal = theme.confdir .. '/icons/titlebar/close_normal.png'
|
||||||
theme.titlebar_close_button_focus = theme.confdir .. "/icons/titlebar/close_focus.png"
|
theme.titlebar_close_button_focus = theme.confdir .. '/icons/titlebar/close_focus.png'
|
||||||
theme.titlebar_minimize_button_normal = theme.confdir .. "/icons/titlebar/minimize_normal.png"
|
theme.titlebar_minimize_button_normal = theme.confdir .. '/icons/titlebar/minimize_normal.png'
|
||||||
theme.titlebar_minimize_button_focus = theme.confdir .. "/icons/titlebar/minimize_focus.png"
|
theme.titlebar_minimize_button_focus = theme.confdir .. '/icons/titlebar/minimize_focus.png'
|
||||||
theme.titlebar_ontop_button_normal_inactive = theme.confdir .. "/icons/titlebar/ontop_normal_inactive.png"
|
theme.titlebar_ontop_button_normal_inactive = theme.confdir .. '/icons/titlebar/ontop_normal_inactive.png'
|
||||||
theme.titlebar_ontop_button_focus_inactive = theme.confdir .. "/icons/titlebar/ontop_focus_inactive.png"
|
theme.titlebar_ontop_button_focus_inactive = theme.confdir .. '/icons/titlebar/ontop_focus_inactive.png'
|
||||||
theme.titlebar_ontop_button_normal_active = theme.confdir .. "/icons/titlebar/ontop_normal_active.png"
|
theme.titlebar_ontop_button_normal_active = theme.confdir .. '/icons/titlebar/ontop_normal_active.png'
|
||||||
theme.titlebar_ontop_button_focus_active = theme.confdir .. "/icons/titlebar/ontop_focus_active.png"
|
theme.titlebar_ontop_button_focus_active = theme.confdir .. '/icons/titlebar/ontop_focus_active.png'
|
||||||
theme.titlebar_sticky_button_normal_inactive = theme.confdir .. "/icons/titlebar/sticky_normal_inactive.png"
|
theme.titlebar_sticky_button_normal_inactive = theme.confdir .. '/icons/titlebar/sticky_normal_inactive.png'
|
||||||
theme.titlebar_sticky_button_focus_inactive = theme.confdir .. "/icons/titlebar/sticky_focus_inactive.png"
|
theme.titlebar_sticky_button_focus_inactive = theme.confdir .. '/icons/titlebar/sticky_focus_inactive.png'
|
||||||
theme.titlebar_sticky_button_normal_active = theme.confdir .. "/icons/titlebar/sticky_normal_active.png"
|
theme.titlebar_sticky_button_normal_active = theme.confdir .. '/icons/titlebar/sticky_normal_active.png'
|
||||||
theme.titlebar_sticky_button_focus_active = theme.confdir .. "/icons/titlebar/sticky_focus_active.png"
|
theme.titlebar_sticky_button_focus_active = theme.confdir .. '/icons/titlebar/sticky_focus_active.png'
|
||||||
theme.titlebar_floating_button_normal_inactive = theme.confdir .. "/icons/titlebar/floating_normal_inactive.png"
|
theme.titlebar_floating_button_normal_inactive = theme.confdir .. '/icons/titlebar/floating_normal_inactive.png'
|
||||||
theme.titlebar_floating_button_focus_inactive = theme.confdir .. "/icons/titlebar/floating_focus_inactive.png"
|
theme.titlebar_floating_button_focus_inactive = theme.confdir .. '/icons/titlebar/floating_focus_inactive.png'
|
||||||
theme.titlebar_floating_button_normal_active = theme.confdir .. "/icons/titlebar/floating_normal_active.png"
|
theme.titlebar_floating_button_normal_active = theme.confdir .. '/icons/titlebar/floating_normal_active.png'
|
||||||
theme.titlebar_floating_button_focus_active = theme.confdir .. "/icons/titlebar/floating_focus_active.png"
|
theme.titlebar_floating_button_focus_active = theme.confdir .. '/icons/titlebar/floating_focus_active.png'
|
||||||
theme.titlebar_maximized_button_normal_inactive = theme.confdir .. "/icons/titlebar/maximized_normal_inactive.png"
|
theme.titlebar_maximized_button_normal_inactive = theme.confdir .. '/icons/titlebar/maximized_normal_inactive.png'
|
||||||
theme.titlebar_maximized_button_focus_inactive = theme.confdir .. "/icons/titlebar/maximized_focus_inactive.png"
|
theme.titlebar_maximized_button_focus_inactive = theme.confdir .. '/icons/titlebar/maximized_focus_inactive.png'
|
||||||
theme.titlebar_maximized_button_normal_active = theme.confdir .. "/icons/titlebar/maximized_normal_active.png"
|
theme.titlebar_maximized_button_normal_active = theme.confdir .. '/icons/titlebar/maximized_normal_active.png'
|
||||||
theme.titlebar_maximized_button_focus_active = theme.confdir .. "/icons/titlebar/maximized_focus_active.png"
|
theme.titlebar_maximized_button_focus_active = theme.confdir .. '/icons/titlebar/maximized_focus_active.png'
|
||||||
|
|
||||||
local markup = lain.util.markup
|
local markup = lain.util.markup
|
||||||
|
|
||||||
-- Textclock
|
-- Textclock
|
||||||
os.setlocale(os.getenv("LANG")) -- to localize the clock
|
os.setlocale(os.getenv('LANG')) -- to localize the clock
|
||||||
local clockicon = wibox.widget.imagebox(theme.widget_clock)
|
local clockicon = wibox.widget.imagebox(theme.widget_clock)
|
||||||
local mytextclock = wibox.widget.textclock(
|
local mytextclock =
|
||||||
markup("#7788af", "%A %d %B ") .. markup("#ab7367", ">") .. markup("#de5e1e", " %H:%M ")
|
wibox.widget.textclock(markup('#7788af', '%A %d %B ') .. markup('#ab7367', '>') .. markup('#de5e1e', ' %H:%M '))
|
||||||
)
|
|
||||||
mytextclock.font = theme.font
|
mytextclock.font = theme.font
|
||||||
|
|
||||||
-- Calendar
|
-- Calendar
|
||||||
theme.cal = lain.widget.cal({
|
theme.cal = lain.widget.cal({
|
||||||
attach_to = { mytextclock },
|
attach_to = { mytextclock },
|
||||||
notification_preset = {
|
notification_preset = {
|
||||||
font = "Monospace 10",
|
font = 'Monospace 10',
|
||||||
fg = theme.fg_normal,
|
fg = theme.fg_normal,
|
||||||
bg = theme.bg_normal
|
bg = theme.bg_normal,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- / fs
|
-- / fs
|
||||||
local fsicon = wibox.widget.imagebox(theme.widget_fs)
|
local fsicon = wibox.widget.imagebox(theme.widget_fs)
|
||||||
theme.fs = lain.widget.fs({
|
theme.fs = lain.widget.fs({
|
||||||
notification_preset = { font = "Monospace 10", fg = theme.fg_normal },
|
notification_preset = { font = 'Monospace 10', fg = theme.fg_normal },
|
||||||
settings = function()
|
settings = function()
|
||||||
-- luacheck: max line length 150, globals widget fs_now
|
-- luacheck: max line length 150, globals widget fs_now
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#80d9d8",
|
widget:set_markup(
|
||||||
fs_now["/"].percentage .. "% (" .. string.format("%.3f", fs_now["/"].free) .. " " .. fs_now["/"].units .. " left)")
|
markup.fontfg(
|
||||||
)
|
theme.font,
|
||||||
end
|
'#80d9d8',
|
||||||
|
fs_now['/'].percentage
|
||||||
|
.. '% ('
|
||||||
|
.. string.format('%.3f', fs_now['/'].free)
|
||||||
|
.. ' '
|
||||||
|
.. fs_now['/'].units
|
||||||
|
.. ' left)'
|
||||||
|
)
|
||||||
|
)
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
theme.fs.widget:buttons(gears.table.join(
|
theme.fs.widget:buttons(gears.table.join(awful.button({}, 1, function()
|
||||||
awful.button({}, 1, function()
|
awful.spawn('Thunar')
|
||||||
awful.spawn("Thunar")
|
end)))
|
||||||
end)
|
|
||||||
))
|
|
||||||
|
|
||||||
-- CPU
|
-- CPU
|
||||||
local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
|
local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
|
||||||
local cpu = lain.widget.cpu({
|
local cpu = lain.widget.cpu({
|
||||||
settings = function()
|
settings = function()
|
||||||
-- luacheck: globals widget cpu_now
|
-- luacheck: globals widget cpu_now
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#e33a6e", cpu_now.usage .. "% "))
|
widget:set_markup(markup.fontfg(theme.font, '#e33a6e', cpu_now.usage .. '% '))
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Coretemp
|
-- Coretemp
|
||||||
@ -143,7 +149,8 @@ local temp = lain.widget.temp({
|
|||||||
settings = function()
|
settings = function()
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#f1af5f", coretemp_now .. "°C "))
|
widget:set_markup(markup.fontfg(theme.font, "#f1af5f", coretemp_now .. "°C "))
|
||||||
end
|
end
|
||||||
})]]--
|
})]]
|
||||||
|
--
|
||||||
|
|
||||||
-- Battery
|
-- Battery
|
||||||
--[[local baticon = wibox.widget.imagebox(theme.widget_batt)
|
--[[local baticon = wibox.widget.imagebox(theme.widget_batt)
|
||||||
@ -157,29 +164,30 @@ local bat = lain.widget.bat({
|
|||||||
|
|
||||||
widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, perc .. " "))
|
widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, perc .. " "))
|
||||||
end
|
end
|
||||||
})]]--
|
})]]
|
||||||
|
--
|
||||||
|
|
||||||
-- ALSA volume
|
-- ALSA volume
|
||||||
local volicon = wibox.widget.imagebox(theme.widget_vol)
|
local volicon = wibox.widget.imagebox(theme.widget_vol)
|
||||||
theme.volume = lain.widget.alsa({
|
theme.volume = lain.widget.alsa({
|
||||||
settings = function()
|
settings = function()
|
||||||
-- luacheck: globals widget volume_now
|
-- luacheck: globals widget volume_now
|
||||||
if volume_now.status == "off" then
|
if volume_now.status == 'off' then
|
||||||
volume_now.level = volume_now.level .. "M"
|
volume_now.level = volume_now.level .. 'M'
|
||||||
end
|
end
|
||||||
|
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#7493d2", volume_now.level .. "% "))
|
widget:set_markup(markup.fontfg(theme.font, '#7493d2', volume_now.level .. '% '))
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
theme.volume.widget:buttons(awful.util.table.join(
|
theme.volume.widget:buttons(awful.util.table.join(
|
||||||
awful.button({}, 4, function()
|
awful.button({}, 4, function()
|
||||||
os.execute(string.format("%s set %s 1%%+", theme.volume.cmd, theme.volume.channel))
|
os.execute(string.format('%s set %s 1%%+', theme.volume.cmd, theme.volume.channel))
|
||||||
theme.volume.update()
|
theme.volume.update()
|
||||||
end),
|
end),
|
||||||
awful.button({}, 5, function()
|
awful.button({}, 5, function()
|
||||||
os.execute(string.format("%s set %s 1%%-", theme.volume.cmd, theme.volume.channel))
|
os.execute(string.format('%s set %s 1%%-', theme.volume.cmd, theme.volume.channel))
|
||||||
theme.volume.update()
|
theme.volume.update()
|
||||||
end)
|
end)
|
||||||
))
|
))
|
||||||
|
|
||||||
-- Net
|
-- Net
|
||||||
@ -187,20 +195,20 @@ local netdownicon = wibox.widget.imagebox(theme.widget_netdown)
|
|||||||
local netdowninfo = wibox.widget.textbox()
|
local netdowninfo = wibox.widget.textbox()
|
||||||
local netupicon = wibox.widget.imagebox(theme.widget_netup)
|
local netupicon = wibox.widget.imagebox(theme.widget_netup)
|
||||||
local netupinfo = lain.widget.net({
|
local netupinfo = lain.widget.net({
|
||||||
settings = function()
|
settings = function()
|
||||||
-- luacheck: globals widget net_now
|
-- luacheck: globals widget net_now
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#e54c62", net_now.sent .. " "))
|
widget:set_markup(markup.fontfg(theme.font, '#e54c62', net_now.sent .. ' '))
|
||||||
netdowninfo:set_markup(markup.fontfg(theme.font, "#87af5f", net_now.received .. " "))
|
netdowninfo:set_markup(markup.fontfg(theme.font, '#87af5f', net_now.received .. ' '))
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- MEM
|
-- MEM
|
||||||
local memicon = wibox.widget.imagebox(theme.widget_mem)
|
local memicon = wibox.widget.imagebox(theme.widget_mem)
|
||||||
local memory = lain.widget.mem({
|
local memory = lain.widget.mem({
|
||||||
settings = function()
|
settings = function()
|
||||||
-- luacheck: globals widget mem_now
|
-- luacheck: globals widget mem_now
|
||||||
widget:set_markup(markup.fontfg(theme.font, "#e0da37", mem_now.used .. "M "))
|
widget:set_markup(markup.fontfg(theme.font, '#e0da37', mem_now.used .. 'M '))
|
||||||
end
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- MPD
|
-- MPD
|
||||||
@ -231,84 +239,95 @@ theme.mpd = lain.widget.mpd({
|
|||||||
widget:set_markup(markup.fontfg(theme.font, "#e54c62", artist) .. markup.fontfg(theme.font, "#b2b2b2", title))
|
widget:set_markup(markup.fontfg(theme.font, "#e54c62", artist) .. markup.fontfg(theme.font, "#b2b2b2", title))
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
]]--
|
]]
|
||||||
|
--
|
||||||
|
|
||||||
function theme.at_screen_connect(s)
|
function theme.at_screen_connect(s)
|
||||||
-- Quake application
|
-- Quake application
|
||||||
s.quake = lain.util.quake({ app = awful.util.terminal })
|
s.quake = lain.util.quake({ app = awful.util.terminal })
|
||||||
|
|
||||||
-- If wallpaper is a function, call it with the screen
|
-- If wallpaper is a function, call it with the screen
|
||||||
local wallpaper = theme.wallpaper
|
local wallpaper = theme.wallpaper
|
||||||
if type(wallpaper) == "function" then
|
if type(wallpaper) == 'function' then
|
||||||
wallpaper = wallpaper(s)
|
wallpaper = wallpaper(s)
|
||||||
end
|
end
|
||||||
gears.wallpaper.maximized(wallpaper, s, true)
|
gears.wallpaper.maximized(wallpaper, s, true)
|
||||||
|
|
||||||
-- Tags
|
-- Tags
|
||||||
awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
|
awful.tag(awful.util.tagnames, s, awful.layout.layouts[1])
|
||||||
|
|
||||||
-- Create a promptbox for each screen
|
-- Create a promptbox for each screen
|
||||||
s.mypromptbox = awful.widget.prompt()
|
s.mypromptbox = awful.widget.prompt()
|
||||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||||
-- We need one layoutbox per screen.
|
-- We need one layoutbox per screen.
|
||||||
s.mylayoutbox = awful.widget.layoutbox(s)
|
s.mylayoutbox = awful.widget.layoutbox(s)
|
||||||
s.mylayoutbox:buttons(my_table.join(
|
s.mylayoutbox:buttons(my_table.join(
|
||||||
awful.button({}, 1, function () awful.layout.inc( 1) end),
|
awful.button({}, 1, function()
|
||||||
awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
|
awful.layout.inc(1)
|
||||||
awful.button({}, 3, function () awful.layout.inc(-1) end),
|
end),
|
||||||
awful.button({}, 4, function () awful.layout.inc( 1) end),
|
awful.button({}, 2, function()
|
||||||
awful.button({}, 5, function () awful.layout.inc(-1) end)))
|
awful.layout.set(awful.layout.layouts[1])
|
||||||
-- Create a taglist widget
|
end),
|
||||||
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
|
awful.button({}, 3, function()
|
||||||
|
awful.layout.inc(-1)
|
||||||
|
end),
|
||||||
|
awful.button({}, 4, function()
|
||||||
|
awful.layout.inc(1)
|
||||||
|
end),
|
||||||
|
awful.button({}, 5, function()
|
||||||
|
awful.layout.inc(-1)
|
||||||
|
end)
|
||||||
|
))
|
||||||
|
-- Create a taglist widget
|
||||||
|
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
|
||||||
|
|
||||||
-- Create a tasklist widget
|
-- Create a tasklist widget
|
||||||
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
|
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
|
||||||
|
|
||||||
-- Create the wibox
|
-- Create the wibox
|
||||||
s.mywibox = awful.wibar(
|
s.mywibox =
|
||||||
{ position = "top", screen = s, height = dpi(19), bg = theme.bg_normal, fg = theme.fg_normal }
|
awful.wibar({ position = 'top', screen = s, height = dpi(19), bg = theme.bg_normal, fg = theme.fg_normal })
|
||||||
)
|
|
||||||
|
|
||||||
-- Add widgets to the wibox
|
-- Add widgets to the wibox
|
||||||
s.mywibox:setup {
|
s.mywibox:setup({
|
||||||
layout = wibox.layout.align.horizontal,
|
layout = wibox.layout.align.horizontal,
|
||||||
{ -- Left widgets
|
{ -- Left widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
s.mylayoutbox,
|
s.mylayoutbox,
|
||||||
s.mytaglist,
|
s.mytaglist,
|
||||||
s.mypromptbox,
|
s.mypromptbox,
|
||||||
--mpdicon,
|
--mpdicon,
|
||||||
--theme.mpd.widget,
|
--theme.mpd.widget,
|
||||||
},
|
},
|
||||||
--s.mytasklist, -- Middle widget
|
--s.mytasklist, -- Middle widget
|
||||||
nil,
|
nil,
|
||||||
{ -- Right widgets
|
{ -- Right widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
--mailicon,
|
--mailicon,
|
||||||
--theme.mail.widget,
|
--theme.mail.widget,
|
||||||
netdownicon,
|
netdownicon,
|
||||||
netdowninfo,
|
netdowninfo,
|
||||||
netupicon,
|
netupicon,
|
||||||
netupinfo.widget,
|
netupinfo.widget,
|
||||||
volicon,
|
volicon,
|
||||||
theme.volume.widget,
|
theme.volume.widget,
|
||||||
memicon,
|
memicon,
|
||||||
memory.widget,
|
memory.widget,
|
||||||
cpuicon,
|
cpuicon,
|
||||||
cpu.widget,
|
cpu.widget,
|
||||||
fsicon,
|
fsicon,
|
||||||
theme.fs.widget,
|
theme.fs.widget,
|
||||||
--weathericon,
|
--weathericon,
|
||||||
--theme.weather.widget,
|
--theme.weather.widget,
|
||||||
--tempicon,
|
--tempicon,
|
||||||
--temp.widget,
|
--temp.widget,
|
||||||
--baticon,
|
--baticon,
|
||||||
--bat.widget,
|
--bat.widget,
|
||||||
clockicon,
|
clockicon,
|
||||||
mytextclock,
|
mytextclock,
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
return theme
|
return theme
|
||||||
|
Loading…
Reference in New Issue
Block a user