diff options
Diffstat (limited to 'awesome/.config/awesome/rc.lua')
-rw-r--r-- | awesome/.config/awesome/rc.lua | 76 |
1 files changed, 46 insertions, 30 deletions
diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index 357a6be..52dbef0 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -1,9 +1,14 @@ +-- Standard library +local pi = math.pi + -- Awesome library local awful = require"awful" +local cairo = require"lgi".cairo local beautiful = require"beautiful" local gears = require"gears" local menubar = require"menubar" local naughty = require"naughty" +local shape = gears.shape local wibox = require"wibox" -- Awful submodules @@ -46,7 +51,7 @@ end -- {{{ Variable definitions -- Themes define colours, icons, font and wallpapers. -beautiful.init"~/.config/awesome/themes/srcery/theme.lua" +beautiful.init"~/.config/awesome/themes/tempus-fugit/theme.lua" -- This is used later as the default terminal and editor to run. local terminal = "urxvt" @@ -54,7 +59,7 @@ local editor = terminal .. " -e vim" -- And some additional applications local root_terminal = terminal .. " -e su -" local ranger = terminal .. " -e ranger" -local python = terminal .. " -e python" +local python = terminal .. " -e python3" local guile = terminal .. " -e guile" local calcurse = terminal .. " -e calcurse" local aerc = terminal .. " -e aerc" @@ -85,9 +90,9 @@ local modkey = "Mod4" awful.layout.layouts = { awful.layout.suit.fair, --awful.layout.suit.fair.horizontal, - --awful.layout.suit.tile, + awful.layout.suit.tile, --awful.layout.suit.tile.left, - awful.layout.suit.tile.bottom, + --awful.layout.suit.tile.bottom, --awful.layout.suit.tile.top, --awful.layout.suit.spiral, --awful.layout.suit.spiral.dwindle, @@ -312,17 +317,7 @@ local tasklist_buttons = awful.util.table.join( ) local function set_wallpaper(s) - -- Wallpaper - if beautiful.wallpaper then - local wallpaper = beautiful.wallpaper - if s.geometry.width > 2880 then - wallpaper = beautiful.wallpaper_wide - end - if type(wallpaper) == "function" then - wallpaper = wallpaper(s) - end - gears.wallpaper.maximized(wallpaper, s, true) - end + gears.wallpaper.set(beautiful.bg_normal) end local function restore() @@ -334,14 +329,34 @@ local function restore() end end +local function arrow(fg, bg) + local img = cairo.ImageSurface.create(cairo.Format.ARGB32, 14, 28) + local cr = cairo.Context(img) + cr:set_source(gears.color(bg)) + cr:rectangle(0, 0, 14, 28) + cr:fill() + cr:set_source(gears.color(fg)) + local trigon = shape.transform(shape.isosceles_triangle) + trigon:translate(0, 14):rotate_at(14, 14, pi/2)(cr, 28, 14) + cr:fill() + return img +end + -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) screen.connect_signal("property::geometry", set_wallpaper) awful.screen.connect_for_each_screen(function (s) set_wallpaper(s) -- Each screen has its own tag table. - awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, - s, awful.layout.suit.fair) + -- Wallpaper + if s.geometry.width > s.geometry.height then + awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, + s, awful.layout.suit.fair) + else + awful.tag({"1", "2", "3", "4", "5", "6", "7", "8", "9"}, + s, awful.layout.suit.tile) + for _, t in ipairs(s.tags) do t.master_count = 0 end + end -- Create a promptbox for each screen s.mypromptbox = awful.widget.prompt{prompt = " "} @@ -383,28 +398,28 @@ awful.screen.connect_for_each_screen(function (s) bg = beautiful.red, fg = beautiful.gray, widget = wibox.container.background}, - wibox.widget.imagebox(beautiful.arrow0), + wibox.widget.imagebox(arrow(beautiful.red, beautiful.yellow)), {mycpuusage, - bg = beautiful.orange, + bg = beautiful.yellow, fg = beautiful.gray, widget = wibox.container.background}, - wibox.widget.imagebox(beautiful.arrow1), + wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.green)), {mymemusage, - bg = beautiful.yellow, + bg = beautiful.green, fg = beautiful.gray, widget = wibox.container.background}, - wibox.widget.imagebox(beautiful.arrow2), - mybattery, - wibox.widget.imagebox(beautiful.arrow3), - myvolume, - wibox.widget.imagebox(beautiful.arrow4), + --wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.green)), + --mybattery, + --wibox.widget.imagebox(arrow(beautiful.yellow, beautiful.cyan)), + --myvolume, + wibox.widget.imagebox(arrow(beautiful.green, beautiful.blue)), {myweather, bg = beautiful.blue, fg = beautiful.gray, widget = wibox.container.background}, - wibox.widget.imagebox(beautiful.arrow5), + wibox.widget.imagebox(arrow(beautiful.blue, beautiful.magenta)), myplayer, - wibox.widget.imagebox(beautiful.arrow6), + wibox.widget.imagebox(arrow(beautiful.magenta, beautiful.bg_normal)), s.mypromptbox }, {-- Middle widget @@ -869,14 +884,15 @@ client.connect_signal( awful.client.focus.filter(c) then client.focus = c end - end -) + end) client.connect_signal("focus", function (c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function (c) c.border_color = beautiful.border_normal end) +gears.timer{timeout = 67, autostart = true, callback = spawner"mbsync --all"} + -- Show titlebar if client is floating, hide otherwise. --tag.connect_signal( -- "property::layout", |