Awesome config update

This commit is contained in:
Daan Vanoverloop 2021-02-07 16:18:39 +01:00
parent 27f9a245c6
commit 2fbe1bf195
1 changed files with 40 additions and 31 deletions

View File

@ -16,7 +16,7 @@ local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup") local hotkeys_popup = require("awful.hotkeys_popup")
local vicious = require("vicious") local vicious = require("vicious")
local timer = require("gears.timer") local timer = require("gears.timer")
local config = require("config_laptop") local config = require("config_desktop")
local quake = require("quake") local quake = require("quake")
-- Enable hotkeys help widget for VIM and other apps -- Enable hotkeys help widget for VIM and other apps
@ -396,6 +396,33 @@ local function load_widget_config(conf)
return t return t
end end
bar_timer = timer({ timeout = 0.2 })
bar_timer:connect_signal("timeout", function () disable_bars() end)
bar_mode = false
function enable_bars ()
if bar_timer.started then bar_timer:stop() end
if bar_mode == true then return else bar_mode = true end
for s in screen do
s.topwibox.visible = true
s.bottomwibox.visible = true
end
end
function disable_bars ()
--[[
if bar_timer.started then bar_timer:stop() end
if bar_mode == false then return else bar_mode = false end
for s in screen do
s.topwibox.visible = false
s.bottomwibox.visible = false
end
--]]
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) -- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper) screen.connect_signal("property::geometry", set_wallpaper)
@ -404,6 +431,8 @@ awful.screen.connect_for_each_screen(function(s)
-- Wallpaper -- Wallpaper
set_wallpaper(s) set_wallpaper(s)
beautiful.useless_gap = 3
-- Each screen has its own tag table. -- Each screen has its own tag table.
awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
@ -502,12 +531,13 @@ awful.screen.connect_for_each_screen(function(s)
s.dock_trigger = wibox({ bg = "#00000000", opacity = 0, ontop = true, visible = true }) s.dock_trigger = wibox({ bg = "#00000000", opacity = 0, ontop = true, visible = true })
s.dock_trigger:geometry({ width = 3, height = 3 }) s.dock_trigger:geometry({ width = 3, height = 3 })
s.topwibox:connect_signal("mouse::enter", function() enable_bars() end) enable_bars()
s.topwibox:connect_signal("mouse::leave", function() bar_timer:again() end) --s.topwibox:connect_signal("mouse::enter", function() enable_bars() end)
s.bottomwibox:connect_signal("mouse::enter", function() enable_bars() end) --s.topwibox:connect_signal("mouse::leave", function() bar_timer:again() end)
s.bottomwibox:connect_signal("mouse::leave", function() bar_timer:again() end) --s.bottomwibox:connect_signal("mouse::enter", function() enable_bars() end)
s.dock_trigger:connect_signal("mouse::enter", function() enable_bars() end) --s.bottomwibox:connect_signal("mouse::leave", function() bar_timer:again() end)
s.dock_trigger:connect_signal("mouse::leave", function() bar_timer:again() end) --s.dock_trigger:connect_signal("mouse::enter", function() enable_bars() end)
--s.dock_trigger:connect_signal("mouse::leave", function() bar_timer:again() end)
end) end)
-- }}} -- }}}
@ -530,9 +560,6 @@ switcher_layout = awful.layout.suit.fair
switcher_mode = false switcher_mode = false
switcher_timer = timer({ timeout = 1 }) switcher_timer = timer({ timeout = 1 })
switcher_timer:connect_signal("timeout", function () end_switcher() end) switcher_timer:connect_signal("timeout", function () end_switcher() end)
bar_timer = timer({ timeout = 0.2 })
bar_timer:connect_signal("timeout", function () disable_bars() end)
bar_mode = false
layout_table = {} layout_table = {}
previous_tags = {} previous_tags = {}
@ -564,7 +591,7 @@ function end_switcher ()
if switcher_timer.started then switcher_timer:stop() end if switcher_timer.started then switcher_timer:stop() end
if switcher_mode == false then return else switcher_mode = false end if switcher_mode == false then return else switcher_mode = false end
beautiful.useless_gap = 0 beautiful.useless_gap = 3
-- Restore layout of all tags -- Restore layout of all tags
for _, tag in ipairs(root.tags()) do for _, tag in ipairs(root.tags()) do
@ -596,26 +623,6 @@ function toggle_switcher ()
if switcher_mode then end_switcher() else start_switcher() end if switcher_mode then end_switcher() else start_switcher() end
end end
function enable_bars ()
if bar_timer.started then bar_timer:stop() end
if bar_mode == true then return else bar_mode = true end
for s in screen do
s.topwibox.visible = true
s.bottomwibox.visible = true
end
end
function disable_bars ()
if bar_timer.started then bar_timer:stop() end
if bar_mode == false then return else bar_mode = false end
for s in screen do
s.topwibox.visible = false
s.bottomwibox.visible = false
end
end
function set_borders (c) function set_borders (c)
c.border_width = beautiful.border_width c.border_width = beautiful.border_width
awful.titlebar.show(c) awful.titlebar.show(c)
@ -809,6 +816,8 @@ globalkeys = gears.table.join(
{description = "show the menubar", group = "launcher"}), {description = "show the menubar", group = "launcher"}),
awful.key({ modkey }, "d", function() rofi_spawn("rofi -show drun -me-select-entry '' -me-accept-entry 'MousePrimary'") end, awful.key({ modkey }, "d", function() rofi_spawn("rofi -show drun -me-select-entry '' -me-accept-entry 'MousePrimary'") end,
{description = "launch rofi", group = "launcher"}), {description = "launch rofi", group = "launcher"}),
awful.key({ modkey }, "c", function() rofi_spawn("rofi-pass") end,
{description = "launch rofi-pass", group = "launcher"}),
awful.key({ modkey, "Shift" }, "g", awful.key({ modkey, "Shift" }, "g",
function (c) function (c)
rofi_spawn("dmenu_script lutris.sh") rofi_spawn("dmenu_script lutris.sh")