mirror of
https://github.com/lcpz/awesome-copycats.git
synced 2026-03-23 05:55:12 +00:00
format
This commit is contained in:
parent
3a9b8ba038
commit
c09197f0da
File diff suppressed because it is too large
Load diff
|
|
@ -1,31 +1,31 @@
|
||||||
local settings = {
|
local settings = {
|
||||||
themes = {
|
themes = {
|
||||||
"powerarrow-dark", -- 1 DEFAULT
|
"powerarrow-dark", -- 1 DEFAULT
|
||||||
"vertex", -- 2
|
"vertex", -- 2
|
||||||
},
|
},
|
||||||
|
|
||||||
chosen_theme = 2,
|
chosen_theme = 2,
|
||||||
|
|
||||||
modkey = "Mod4",
|
modkey = "Mod4",
|
||||||
altkey = "Mod1",
|
altkey = "Mod1",
|
||||||
|
|
||||||
-- Pref browser
|
-- Pref browser
|
||||||
terminal = "alacritty",
|
terminal = "alacritty",
|
||||||
|
|
||||||
vi_focus = false, -- vi-like client focus https://github.com/lcpz/awesome-copycats/issues/275
|
vi_focus = false, -- vi-like client focus https://github.com/lcpz/awesome-copycats/issues/275
|
||||||
cycle_prev = true, -- cycle with only the previously focused client or all https://github.com/lcpz/awesome-copycats/issues/274
|
cycle_prev = true, -- cycle with only the previously focused client or all https://github.com/lcpz/awesome-copycats/issues/274
|
||||||
|
|
||||||
-- Pref editor
|
-- Pref editor
|
||||||
editor = "nvim",
|
editor = "nvim",
|
||||||
|
|
||||||
-- Pref browser
|
-- Pref browser
|
||||||
browser = "librewolf",
|
browser = "librewolf",
|
||||||
|
|
||||||
-- Bluetooth
|
-- Bluetooth
|
||||||
BLUESTATUS = false,
|
BLUESTATUS = false,
|
||||||
|
|
||||||
-- Gaps
|
-- Gaps
|
||||||
useless_gap = 8,
|
useless_gap = 8,
|
||||||
}
|
}
|
||||||
|
|
||||||
return settings
|
return settings
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
local awful = require("awful")
|
local awful = require("awful")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
local startup =
|
local startup = {
|
||||||
{
|
awful.spawn.with_shell("nitrogen --set-zoom-fill --no-recurse --random --head=0 ~/Pictures/SFW/Nature"),
|
||||||
awful.spawn.with_shell("nitrogen --set-zoom-fill --no-recurse --random --head=0 ~/Pictures/SFW/Nature"),
|
awful.spawn.with_shell("optimus-manager-qt"),
|
||||||
awful.spawn.with_shell("optimus-manager-qt"),
|
awful.spawn.with_shell("picom -b"),
|
||||||
awful.spawn.with_shell("picom -b"),
|
|
||||||
|
|
||||||
-- Mute volume on startup
|
-- Mute volume on startup
|
||||||
os.execute(string.format("amixer set Master 0%%")),
|
os.execute(string.format("amixer set Master 0%%")),
|
||||||
beautiful.volume.update(),
|
beautiful.volume.update(),
|
||||||
}
|
}
|
||||||
|
|
||||||
return startup
|
return startup
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
Vertex Awesome WM theme
|
Vertex Awesome WM theme
|
||||||
github.com/lcpz
|
github.com/lcpz
|
||||||
|
|
||||||
--]] 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")
|
||||||
|
|
@ -108,7 +109,7 @@ theme.widget_cpu = theme.icon_dir .. "/cpu.png"
|
||||||
theme.widget_mem = theme.icon_dir .. "/mem.png"
|
theme.widget_mem = theme.icon_dir .. "/mem.png"
|
||||||
|
|
||||||
-- http://fontawesome.io/cheatsheet
|
-- http://fontawesome.io/cheatsheet
|
||||||
awful.util.tagnames = {"", "", "", "", "", ""}
|
awful.util.tagnames = { "", "", "", "", "", "" }
|
||||||
|
|
||||||
local markup = lain.util.markup
|
local markup = lain.util.markup
|
||||||
|
|
||||||
|
|
@ -118,21 +119,21 @@ local markup = lain.util.markup
|
||||||
local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "%H:%M"))
|
local mytextclock = wibox.widget.textclock(markup("#FFFFFF", "%H:%M"))
|
||||||
mytextclock.font = theme.font
|
mytextclock.font = theme.font
|
||||||
theme.cal = lain.widget.cal({
|
theme.cal = lain.widget.cal({
|
||||||
attach_to = {mytextclock},
|
attach_to = { mytextclock },
|
||||||
notification_preset = {
|
notification_preset = {
|
||||||
fg = "#FFFFFF",
|
fg = "#FFFFFF",
|
||||||
bg = theme.bg_normal,
|
bg = theme.bg_normal,
|
||||||
position = "top_middle",
|
position = "top_middle",
|
||||||
font = theme.font
|
font = theme.font
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Battery
|
-- Battery
|
||||||
local baticon = wibox.widget.imagebox(theme.bat000)
|
local baticon = wibox.widget.imagebox(theme.bat000)
|
||||||
local battooltip = awful.tooltip({
|
local battooltip = awful.tooltip({
|
||||||
objects = {baticon},
|
objects = { baticon },
|
||||||
margin_leftright = dpi(15),
|
margin_leftright = dpi(15),
|
||||||
margin_topbottom = dpi(4)
|
margin_topbottom = dpi(4)
|
||||||
})
|
})
|
||||||
battooltip.wibox.fg = "#fcfbf7"
|
battooltip.wibox.fg = "#fcfbf7"
|
||||||
battooltip.wibox.widget.bg = "#404040"
|
battooltip.wibox.widget.bg = "#404040"
|
||||||
|
|
@ -143,30 +144,30 @@ battooltip.timeout = 0
|
||||||
-- gears.shape.rounded_bar(cr, width, height)
|
-- gears.shape.rounded_bar(cr, width, height)
|
||||||
-- end)
|
-- end)
|
||||||
local bat = lain.widget.bat({
|
local bat = lain.widget.bat({
|
||||||
settings = function()
|
settings = function()
|
||||||
local index, perc = "bat", tonumber(bat_now.perc) or 0
|
local index, perc = "bat", tonumber(bat_now.perc) or 0
|
||||||
|
|
||||||
if perc <= 7 then
|
if perc <= 7 then
|
||||||
index = index .. "000"
|
index = index .. "000"
|
||||||
elseif perc <= 20 then
|
elseif perc <= 20 then
|
||||||
index = index .. "020"
|
index = index .. "020"
|
||||||
elseif perc <= 40 then
|
elseif perc <= 40 then
|
||||||
index = index .. "040"
|
index = index .. "040"
|
||||||
elseif perc <= 60 then
|
elseif perc <= 60 then
|
||||||
index = index .. "060"
|
index = index .. "060"
|
||||||
elseif perc <= 80 then
|
elseif perc <= 80 then
|
||||||
index = index .. "080"
|
index = index .. "080"
|
||||||
elseif perc <= 100 then
|
elseif perc <= 100 then
|
||||||
index = index .. "100"
|
index = index .. "100"
|
||||||
end
|
|
||||||
|
|
||||||
if bat_now.ac_status == 1 then
|
|
||||||
index = index .. "charging"
|
|
||||||
end
|
|
||||||
|
|
||||||
baticon:set_image(theme[index])
|
|
||||||
battooltip:set_markup(string.format("%s%% | %s", perc, bat_now.time))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if bat_now.ac_status == 1 then
|
||||||
|
index = index .. "charging"
|
||||||
|
end
|
||||||
|
|
||||||
|
baticon:set_image(theme[index])
|
||||||
|
battooltip:set_markup(string.format("%s%% | %s", perc, bat_now.time))
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- MPD
|
-- MPD
|
||||||
|
|
@ -191,11 +192,11 @@ local bat = lain.widget.bat({
|
||||||
-- ALSA volume
|
-- ALSA volume
|
||||||
local volicon = wibox.widget.imagebox()
|
local volicon = wibox.widget.imagebox()
|
||||||
local voltooltip = awful.tooltip({
|
local voltooltip = awful.tooltip({
|
||||||
objects = {volicon},
|
objects = { volicon },
|
||||||
margin_leftright = dpi(15),
|
margin_leftright = dpi(15),
|
||||||
margin_topbottom = dpi(4),
|
margin_topbottom = dpi(4),
|
||||||
preferred_alignments = {"middle", "front", "back"},
|
preferred_alignments = { "middle", "front", "back" },
|
||||||
preferred_positions = {"bottom", "left", "right", "top"}
|
preferred_positions = { "bottom", "left", "right", "top" }
|
||||||
|
|
||||||
})
|
})
|
||||||
voltooltip.wibox.fg = "#fcfbf7"
|
voltooltip.wibox.fg = "#fcfbf7"
|
||||||
|
|
@ -207,110 +208,110 @@ voltooltip.timeout = 0
|
||||||
-- gears.shape.rounded_bar(cr, width, height)
|
-- gears.shape.rounded_bar(cr, width, height)
|
||||||
-- end)
|
-- end)
|
||||||
theme.volume = lain.widget.alsabar({
|
theme.volume = lain.widget.alsabar({
|
||||||
-- togglechannel = "IEC958,3",
|
-- togglechannel = "IEC958,3",
|
||||||
notification_preset = {
|
notification_preset = {
|
||||||
font = theme.font,
|
font = theme.font,
|
||||||
fg = theme.fg_normal
|
fg = theme.fg_normal
|
||||||
},
|
},
|
||||||
settings = function()
|
settings = function()
|
||||||
local index, perc = "", tonumber(volume_now.level) or 0
|
local index, perc = "", tonumber(volume_now.level) or 0
|
||||||
|
|
||||||
if volume_now.status == "off" then
|
if volume_now.status == "off" then
|
||||||
index = "volmutedblocked"
|
index = "volmutedblocked"
|
||||||
else
|
else
|
||||||
if perc <= 5 then
|
if perc <= 5 then
|
||||||
index = "volmuted"
|
index = "volmuted"
|
||||||
elseif perc <= 25 then
|
elseif perc <= 25 then
|
||||||
index = "vollow"
|
index = "vollow"
|
||||||
elseif perc <= 75 then
|
elseif perc <= 75 then
|
||||||
index = "volmed"
|
index = "volmed"
|
||||||
else
|
else
|
||||||
index = "volhigh"
|
index = "volhigh"
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
volicon:set_image(theme[index])
|
|
||||||
voltooltip:set_markup(string.format("%s%% | 100%%", perc))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
volicon:set_image(theme[index])
|
||||||
|
voltooltip:set_markup(string.format("%s%% | 100%%", perc))
|
||||||
|
end
|
||||||
})
|
})
|
||||||
volicon:buttons(my_table.join(awful.button({}, 1, function()
|
volicon:buttons(my_table.join(awful.button({}, 1, function()
|
||||||
awful.spawn(string.format("%s -e alsamixer", awful.util.terminal))
|
awful.spawn(string.format("%s -e alsamixer", awful.util.terminal))
|
||||||
end), awful.button({}, 2, function()
|
end), awful.button({}, 2, function()
|
||||||
os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel))
|
os.execute(string.format("%s set %s 100%%", theme.volume.cmd, theme.volume.channel))
|
||||||
theme.volume.notify()
|
theme.volume.notify()
|
||||||
end), awful.button({}, 3, function()
|
end), awful.button({}, 3, function()
|
||||||
os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel))
|
os.execute(string.format("%s set %s toggle", theme.volume.cmd, theme.volume.togglechannel or theme.volume.channel))
|
||||||
theme.volume.notify()
|
theme.volume.notify()
|
||||||
end), awful.button({}, 4, function()
|
end), awful.button({}, 4, function()
|
||||||
os.execute(string.format("%s set %s 5%%+", theme.volume.cmd, theme.volume.channel))
|
os.execute(string.format("%s set %s 5%%+", theme.volume.cmd, theme.volume.channel))
|
||||||
theme.volume.notify()
|
theme.volume.notify()
|
||||||
end), awful.button({}, 5, function()
|
end), awful.button({}, 5, function()
|
||||||
os.execute(string.format("%s set %s 5%%-", theme.volume.cmd, theme.volume.channel))
|
os.execute(string.format("%s set %s 5%%-", theme.volume.cmd, theme.volume.channel))
|
||||||
theme.volume.notify()
|
theme.volume.notify()
|
||||||
end)))
|
end)))
|
||||||
|
|
||||||
-- MEM
|
-- MEM
|
||||||
function round_one_decimal(num)
|
function round_one_decimal(num)
|
||||||
return math.floor(num * 10) / 10
|
return math.floor(num * 10) / 10
|
||||||
end
|
end
|
||||||
|
|
||||||
local memicon = wibox.widget.imagebox(theme.widget_mem)
|
local memicon = wibox.widget.imagebox(theme.widget_mem)
|
||||||
local mem = lain.widget.mem({
|
local mem = lain.widget.mem({
|
||||||
settings = function()
|
settings = function()
|
||||||
local mem_used = mem_now.used
|
local mem_used = mem_now.used
|
||||||
if mem_used >= 1000 then
|
if mem_used >= 1000 then
|
||||||
mem_used = round_one_decimal(mem_used / 1000)
|
mem_used = round_one_decimal(mem_used / 1000)
|
||||||
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " Gb "))
|
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " Gb "))
|
||||||
else
|
else
|
||||||
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " MB "))
|
widget:set_markup(markup.font(theme.font, " " .. mem_used .. " MB "))
|
||||||
end
|
|
||||||
end
|
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()
|
||||||
widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% "))
|
widget:set_markup(markup.font(theme.font, " " .. cpu_now.usage .. "% "))
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Network
|
-- Network
|
||||||
local net = lain.widget.net({
|
local net = lain.widget.net({
|
||||||
settings = function()
|
settings = function()
|
||||||
widget:set_markup(markup.font(theme.font,
|
widget:set_markup(markup.font(theme.font,
|
||||||
markup("#7AC82E", " " .. string.format("%06.1f", net_now.received)) .. " " ..
|
markup("#7AC82E", " " .. string.format("%06.1f", net_now.received)) .. " " ..
|
||||||
markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " ")))
|
markup("#46A8C3", " " .. string.format("%06.1f", net_now.sent) .. " ")))
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Wifi carrier and signal strength
|
-- Wifi carrier and signal strength
|
||||||
local wificon = wibox.widget.imagebox(theme.wifidisc)
|
local wificon = wibox.widget.imagebox(theme.wifidisc)
|
||||||
local mywifisig = awful.widget.watch({awful.util.shell, "-c",
|
local mywifisig = awful.widget.watch({ awful.util.shell, "-c",
|
||||||
"awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link"},
|
"awk 'NR==3 {printf(\"%d-%.0f\\n\",$2, $3*10/7)}' /proc/net/wireless; iw dev wlan0 link" },
|
||||||
2, function(widget, stdout)
|
2, function(widget, stdout)
|
||||||
local carrier, perc = stdout:match("(%d)-(%d+)")
|
local carrier, perc = stdout:match("(%d)-(%d+)")
|
||||||
local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "")
|
local tiptext = stdout:gsub("(%d)-(%d+)", ""):gsub("%s+$", "")
|
||||||
perc = tonumber(perc)
|
perc = tonumber(perc)
|
||||||
|
|
||||||
if carrier == "1" or not perc then
|
if carrier == "1" or not perc then
|
||||||
wificon:set_image(theme.wifidisc)
|
wificon:set_image(theme.wifidisc)
|
||||||
wifitooltip:set_markup("No carrier")
|
wifitooltip:set_markup("No carrier")
|
||||||
else
|
else
|
||||||
if perc <= 5 then
|
if perc <= 5 then
|
||||||
wificon:set_image(theme.wifinone)
|
wificon:set_image(theme.wifinone)
|
||||||
elseif perc <= 25 then
|
elseif perc <= 25 then
|
||||||
wificon:set_image(theme.wifilow)
|
wificon:set_image(theme.wifilow)
|
||||||
elseif perc <= 50 then
|
elseif perc <= 50 then
|
||||||
wificon:set_image(theme.wifimed)
|
wificon:set_image(theme.wifimed)
|
||||||
elseif perc <= 75 then
|
elseif perc <= 75 then
|
||||||
wificon:set_image(theme.wifihigh)
|
wificon:set_image(theme.wifihigh)
|
||||||
else
|
else
|
||||||
wificon:set_image(theme.wififull)
|
wificon:set_image(theme.wififull)
|
||||||
end
|
end
|
||||||
wifitooltip:set_markup(tiptext)
|
wifitooltip:set_markup(tiptext)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- Launcher
|
-- Launcher
|
||||||
-- local mylauncher = awful.widget.button({
|
-- local mylauncher = awful.widget.button({
|
||||||
|
|
@ -322,7 +323,7 @@ local mywifisig = awful.widget.watch({awful.util.shell, "-c",
|
||||||
|
|
||||||
-- Separators
|
-- Separators
|
||||||
local space = wibox.widget.textbox(" ")
|
local space = wibox.widget.textbox(" ")
|
||||||
-- horizontal space
|
-- horizontal space
|
||||||
local hspace = wibox.widget.textbox()
|
local hspace = wibox.widget.textbox()
|
||||||
hspace.forced_width = dpi(18)
|
hspace.forced_width = dpi(18)
|
||||||
-- vertical space
|
-- vertical space
|
||||||
|
|
@ -330,230 +331,230 @@ local vspace = wibox.widget.textbox()
|
||||||
vspace.forced_height = dpi(18)
|
vspace.forced_height = dpi(18)
|
||||||
|
|
||||||
local barcolor = gears.color({
|
local barcolor = gears.color({
|
||||||
type = "linear",
|
type = "linear",
|
||||||
from = {0, dpi(46)},
|
from = { 0, dpi(46) },
|
||||||
to = {dpi(46), dpi(46)},
|
to = { dpi(46), dpi(46) },
|
||||||
stops = {{0, theme.bg_focus}, {0.9, theme.bg_focus2}}
|
stops = { { 0, theme.bg_focus }, { 0.9, theme.bg_focus2 } }
|
||||||
})
|
})
|
||||||
|
|
||||||
local barcolor2 = gears.color({
|
local barcolor2 = gears.color({
|
||||||
type = "linear",
|
type = "linear",
|
||||||
from = {0, dpi(46)},
|
from = { 0, dpi(46) },
|
||||||
to = {dpi(46), dpi(46)},
|
to = { dpi(46), dpi(46) },
|
||||||
stops = {{0, "#323232"}, {1, theme.bg_normal}}
|
stops = { { 0, "#323232" }, { 1, theme.bg_normal } }
|
||||||
})
|
})
|
||||||
|
|
||||||
local dockshape = function(cr, width, height)
|
local dockshape = function(cr, width, height)
|
||||||
gears.shape.partially_rounded_rect(cr, width, height, false, true, true, false, 6)
|
gears.shape.partially_rounded_rect(cr, width, height, false, true, true, false, 6)
|
||||||
end
|
end
|
||||||
|
|
||||||
function theme.vertical_wibox(s)
|
function theme.vertical_wibox(s)
|
||||||
-- Create the vertical wibox
|
-- Create the vertical wibox
|
||||||
s.dockheight = (25.5 * s.workarea.height) / 100
|
s.dockheight = (25.5 * s.workarea.height) / 100
|
||||||
|
|
||||||
s.myleftwibox = wibox({
|
s.myleftwibox = wibox({
|
||||||
screen = s,
|
screen = s,
|
||||||
x = 0,
|
x = 0,
|
||||||
y = s.workarea.height / 2 - s.dockheight / 2,
|
y = s.workarea.height / 2 - s.dockheight / 2,
|
||||||
width = dpi(6),
|
width = dpi(6),
|
||||||
height = s.dockheight,
|
height = s.dockheight,
|
||||||
fg = theme.fg_normal,
|
fg = theme.fg_normal,
|
||||||
bg = barcolor2,
|
bg = barcolor2,
|
||||||
ontop = true,
|
ontop = true,
|
||||||
visible = true,
|
visible = true,
|
||||||
type = "dock"
|
type = "dock"
|
||||||
})
|
})
|
||||||
|
|
||||||
if s.index > 1 and s.myleftwibox.y == 0 then
|
if s.index > 1 and s.myleftwibox.y == 0 then
|
||||||
s.myleftwibox.y = screen[1].myleftwibox.y
|
s.myleftwibox.y = screen[1].myleftwibox.y
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Add widgets to the vertical wibox
|
||||||
|
s.myleftwibox:setup {
|
||||||
|
layout = wibox.layout.align.vertical,
|
||||||
|
{
|
||||||
|
layout = wibox.layout.fixed.vertical,
|
||||||
|
vspace,
|
||||||
|
s.mytaglist
|
||||||
|
-- s.layoutb,
|
||||||
|
-- wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Add toggling functionalities
|
||||||
|
s.docktimer = gears.timer {
|
||||||
|
timeout = 2
|
||||||
|
}
|
||||||
|
s.docktimer:connect_signal("timeout", function()
|
||||||
|
local s = awful.screen.focused()
|
||||||
|
s.myleftwibox.width = dpi(9)
|
||||||
|
-- s.layoutb.visible = false
|
||||||
|
-- mylauncher.visible = false
|
||||||
|
if s.docktimer.started then
|
||||||
|
s.docktimer:stop()
|
||||||
end
|
end
|
||||||
|
end)
|
||||||
|
tag.connect_signal("property::selected", function(t)
|
||||||
|
local s = t.screen or awful.screen.focused()
|
||||||
|
s.myleftwibox.width = dpi(38)
|
||||||
|
-- s.layoutb.visible = true
|
||||||
|
-- mylauncher.visible = true
|
||||||
|
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
||||||
|
if not s.docktimer.started then
|
||||||
|
s.docktimer:start()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
-- Add widgets to the vertical wibox
|
s.myleftwibox:connect_signal("mouse::leave", function()
|
||||||
s.myleftwibox:setup{
|
local s = awful.screen.focused()
|
||||||
layout = wibox.layout.align.vertical,
|
s.myleftwibox.width = dpi(9)
|
||||||
{
|
-- s.layoutb.visible = false
|
||||||
layout = wibox.layout.fixed.vertical,
|
-- mylauncher.visible = false
|
||||||
vspace,
|
end)
|
||||||
s.mytaglist
|
|
||||||
-- s.layoutb,
|
|
||||||
-- wibox.container.margin(mylauncher, dpi(5), dpi(8), dpi(13), dpi(0)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Add toggling functionalities
|
s.myleftwibox:connect_signal("mouse::enter", function()
|
||||||
s.docktimer = gears.timer {
|
local s = awful.screen.focused()
|
||||||
timeout = 2
|
s.myleftwibox.width = dpi(38)
|
||||||
}
|
-- s.layoutb.visible = true
|
||||||
s.docktimer:connect_signal("timeout", function()
|
-- mylauncher.visible = true
|
||||||
local s = awful.screen.focused()
|
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
||||||
s.myleftwibox.width = dpi(9)
|
end)
|
||||||
-- s.layoutb.visible = false
|
|
||||||
-- mylauncher.visible = false
|
|
||||||
if s.docktimer.started then
|
|
||||||
s.docktimer:stop()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
tag.connect_signal("property::selected", function(t)
|
|
||||||
local s = t.screen or awful.screen.focused()
|
|
||||||
s.myleftwibox.width = dpi(38)
|
|
||||||
-- s.layoutb.visible = true
|
|
||||||
-- mylauncher.visible = true
|
|
||||||
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
|
||||||
if not s.docktimer.started then
|
|
||||||
s.docktimer:start()
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
s.myleftwibox:connect_signal("mouse::leave", function()
|
|
||||||
local s = awful.screen.focused()
|
|
||||||
s.myleftwibox.width = dpi(9)
|
|
||||||
-- s.layoutb.visible = false
|
|
||||||
-- mylauncher.visible = false
|
|
||||||
end)
|
|
||||||
|
|
||||||
s.myleftwibox:connect_signal("mouse::enter", function()
|
|
||||||
local s = awful.screen.focused()
|
|
||||||
s.myleftwibox.width = dpi(38)
|
|
||||||
-- s.layoutb.visible = true
|
|
||||||
-- mylauncher.visible = true
|
|
||||||
gears.surface.apply_shape_bounding(s.myleftwibox, dockshape)
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function theme.at_screen_connect(s)
|
function theme.at_screen_connect(s)
|
||||||
-- Quake application
|
-- Quake application
|
||||||
s.quake = lain.util.quake({
|
s.quake = lain.util.quake({
|
||||||
app = awful.util.terminal,
|
app = awful.util.terminal,
|
||||||
border = theme.border_width
|
border = theme.border_width
|
||||||
})
|
})
|
||||||
|
|
||||||
-- 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()
|
||||||
s.mypromptbox.bg = "#00000000"
|
s.mypromptbox.bg = "#00000000"
|
||||||
|
|
||||||
-- 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(awful.button({}, 1, function()
|
s.mylayoutbox:buttons(my_table.join(awful.button({}, 1, function()
|
||||||
awful.layout.inc(1)
|
awful.layout.inc(1)
|
||||||
end), awful.button({}, 2, function()
|
end), awful.button({}, 2, function()
|
||||||
awful.layout.set(awful.layout.layouts[1])
|
awful.layout.set(awful.layout.layouts[1])
|
||||||
end), awful.button({}, 3, function()
|
end), awful.button({}, 3, function()
|
||||||
awful.layout.inc(-1)
|
awful.layout.inc(-1)
|
||||||
end), awful.button({}, 4, function()
|
end), awful.button({}, 4, function()
|
||||||
awful.layout.inc(1)
|
awful.layout.inc(1)
|
||||||
end), awful.button({}, 5, function()
|
end), awful.button({}, 5, function()
|
||||||
awful.layout.inc(-1)
|
awful.layout.inc(-1)
|
||||||
end)))
|
end)))
|
||||||
s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3))
|
s.layoutb = wibox.container.margin(s.mylayoutbox, dpi(8), dpi(11), dpi(3), dpi(3))
|
||||||
|
|
||||||
-- Create a taglist widget
|
-- Create a taglist widget
|
||||||
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons, {
|
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons, {
|
||||||
font = theme.taglist_font,
|
font = theme.taglist_font,
|
||||||
shape = gears.shape.rectangle,
|
shape = gears.shape.rectangle,
|
||||||
spacing = dpi(10),
|
spacing = dpi(10),
|
||||||
square_unsel = theme.square_unsel,
|
square_unsel = theme.square_unsel,
|
||||||
bg_focus = barcolor
|
bg_focus = barcolor
|
||||||
}, nil, wibox.layout.fixed.vertical())
|
}, nil, wibox.layout.fixed.vertical())
|
||||||
|
|
||||||
-- 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, {
|
||||||
bg_focus = theme.panelbg,
|
bg_focus = theme.panelbg,
|
||||||
bg_normal = theme.panelbg
|
bg_normal = theme.panelbg
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Create the wibox
|
-- Create the wibox
|
||||||
s.mywibox = awful.wibar({
|
s.mywibox = awful.wibar({
|
||||||
position = "top",
|
position = "top",
|
||||||
screen = s,
|
screen = s,
|
||||||
height = dpi(25),
|
height = dpi(25),
|
||||||
bg = gears.color.create_png_pattern(theme.panelbg)
|
bg = gears.color.create_png_pattern(theme.panelbg)
|
||||||
})
|
})
|
||||||
|
|
||||||
-- LogOut widget
|
-- LogOut widget
|
||||||
local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu")
|
local logout_menu_widget = require("awesome-wm-widgets.logout-menu-widget.logout-menu")
|
||||||
|
|
||||||
-- BrightnessWidget
|
-- BrightnessWidget
|
||||||
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
|
local brightness_widget = require("awesome-wm-widgets.brightness-widget.brightness")
|
||||||
|
|
||||||
-- Weatherwidget
|
-- Weatherwidget
|
||||||
local weather_widget = require("awesome-wm-widgets.weather-widget.weather")
|
local weather_widget = require("awesome-wm-widgets.weather-widget.weather")
|
||||||
|
|
||||||
-- 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,
|
||||||
expand = "none",
|
expand = "none",
|
||||||
{ -- Left widgets
|
{ -- Left widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
hspace,
|
hspace,
|
||||||
s.layoutb,
|
s.layoutb,
|
||||||
hspace,
|
hspace,
|
||||||
s.mypromptbox,
|
s.mypromptbox,
|
||||||
hspace,
|
hspace,
|
||||||
s.mytasklist
|
s.mytasklist
|
||||||
},
|
},
|
||||||
{ -- Middle widgets
|
{ -- Middle widgets
|
||||||
layout = wibox.layout.flex.horizontal,
|
layout = wibox.layout.flex.horizontal,
|
||||||
max_widget_size = 1500,
|
max_widget_size = 1500,
|
||||||
mytextclock
|
mytextclock
|
||||||
},
|
},
|
||||||
{ -- Right widgets
|
{ -- Right widgets
|
||||||
layout = wibox.layout.fixed.horizontal,
|
layout = wibox.layout.fixed.horizontal,
|
||||||
-- wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal },
|
-- wibox.widget { nil, nil, theme.mpd.widget, layout = wibox.layout.align.horizontal },
|
||||||
hspace,
|
hspace,
|
||||||
wibox.widget.systray(),
|
wibox.widget.systray(),
|
||||||
hspace,
|
hspace,
|
||||||
wificon,
|
wificon,
|
||||||
net.widget,
|
net.widget,
|
||||||
hspace,
|
hspace,
|
||||||
cpuicon,
|
cpuicon,
|
||||||
cpu.widget,
|
cpu.widget,
|
||||||
hspace,
|
hspace,
|
||||||
memicon,
|
memicon,
|
||||||
mem.widget,
|
mem.widget,
|
||||||
hspace,
|
hspace,
|
||||||
weather_widget({
|
weather_widget({
|
||||||
api_key = 'aeec45216dbe6d619167d2e9c9380fd7',
|
api_key = 'aeec45216dbe6d619167d2e9c9380fd7',
|
||||||
coordinates = {45.95, 24.14},
|
coordinates = { 45.95, 24.14 },
|
||||||
time_format_12h = true,
|
time_format_12h = true,
|
||||||
units = 'metric',
|
units = 'metric',
|
||||||
both_units_widget = true,
|
both_units_widget = true,
|
||||||
font_name = 'Carter One',
|
font_name = 'Carter One',
|
||||||
icons = 'VitalyGorbachev',
|
icons = 'VitalyGorbachev',
|
||||||
icons_extension = '.svg',
|
icons_extension = '.svg',
|
||||||
show_hourly_forecast = true,
|
show_hourly_forecast = true,
|
||||||
show_daily_forecast = true
|
show_daily_forecast = true
|
||||||
}),
|
}),
|
||||||
hspace,
|
hspace,
|
||||||
brightness_widget({
|
brightness_widget({
|
||||||
type = 'icon_and_text',
|
type = 'icon_and_text',
|
||||||
program = 'light',
|
program = 'light',
|
||||||
step = 10,
|
step = 10,
|
||||||
base = 20
|
base = 20
|
||||||
}),
|
}),
|
||||||
hspace,
|
hspace,
|
||||||
volicon,
|
volicon,
|
||||||
hspace,
|
hspace,
|
||||||
baticon,
|
baticon,
|
||||||
hspace,
|
hspace,
|
||||||
logout_menu_widget({
|
logout_menu_widget({
|
||||||
font = theme.font
|
font = theme.font
|
||||||
}),
|
}),
|
||||||
hspace
|
hspace
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gears.timer.delayed_call(theme.vertical_wibox, s)
|
gears.timer.delayed_call(theme.vertical_wibox, s)
|
||||||
end
|
end
|
||||||
|
|
||||||
return theme
|
return theme
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue