From 6737421e588a01993cbba241d216c1e90808bf9e Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Thu, 11 Nov 2021 08:13:34 +1100 Subject: [PATCH] oh haruhi where to begin --- rc.lua | 42 +++++++++++++++++++++++++++++++----------- theme.lua | 2 +- 2 files changed, 32 insertions(+), 12 deletions(-) diff --git a/rc.lua b/rc.lua index 5d20739..a4d54bb 100644 --- a/rc.lua +++ b/rc.lua @@ -259,6 +259,13 @@ awful.screen.connect_for_each_screen(function(s) else -- portrait awful.tag(tags, s, awful.layout.suit.fair.horizontal) end + --[[ + awful.tag.attached_connect_signal(nil, "tagged", function(tag) + for _,c in pairs(tag:clients()) do + c.titlebars_enabled = tag.layout == awful.layout.suit.floating + end + end) + ]] -- Create a promptbox for each screen s.mypromptbox = awful.widget.prompt() @@ -328,6 +335,7 @@ awful.screen.connect_for_each_screen(function(s) } end end) + -- }}} -- {{{ Mouse bindings @@ -666,12 +674,14 @@ awful.rules.rules = { properties = {tag = "6"} }, { rule = { class = "Gajim", name = ".*File Transfer.*"}, properties = {tag = "5", floating = true } }, - { rule_any = { class = {"RimWorldLinux", "Minecraft.*"} }, + { rule_any = { class = {"RimWorldLinux", "Minecraft.*", "valheim.x86_64"} }, properties = {fullscreen = true, tag = "4" } }, { rule = { class = "Waterfox-classic" }, properties = {tag = "8"} }, { rule = { class = "QuiteRss" }, properties = {tag = "9"} }, + { rule = { class = "fcw32.exe", name = "" }, + properties = {titlebars_enabled = false } }, } -- }}} @@ -692,15 +702,30 @@ end) -- Add a titlebar if titlebars_enabled is set to true in the rules. client.connect_signal("request::titlebars", function(c) + if c.first_tag.layout ~= awful.layout.suit.floating then return end -- buttons for the titlebar local buttons = gears.table.join( awful.button({ }, 1, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.move(c) end), - awful.button({ }, 3, function() + awful.button({ }, 2, function() c:emit_signal("request::activate", "titlebar", {raise = true}) awful.mouse.client.resize(c) + end), + awful.button({ }, 3, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + local wmenu = { + {"Toggle Floating",function() c.floating = not c.floating end}, + {"Toggle Maximised",function() c.maximized = not c.maximized end}, + {"Toggle Minimised",function() c.minimized = not c.minimized end}, + {"Toggle Sticky",function() c.sticky = not c.sticky end}, + {"Toggle Ontop",function() c.ontop = not c.ontop end}, + {"Toggle Fullscreen",function() c.fullscreen = not c.fullscreen end}, + {"Close",function() c:kill() end}, + theme = { width = 150 } + } + awful.menu(wmenu):show() end) ) @@ -719,30 +744,25 @@ client.connect_signal("request::titlebars", function(c) layout = wibox.layout.flex.horizontal }, { -- Right - awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.minimizebutton(c), awful.titlebar.widget.maximizedbutton(c), - awful.titlebar.widget.stickybutton (c), - awful.titlebar.widget.ontopbutton (c), awful.titlebar.widget.closebutton (c), layout = wibox.layout.fixed.horizontal() }, layout = wibox.layout.align.horizontal } 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) awful.spawn.with_shell( 'if (xrdb -query | grep -q "^awesome\\.started:\\s*true$"); then exit; fi;' .. 'xrdb -merge <<< "awesome.started:true";' .. 'corectrl &' .. 'nextcloud &' .. + 'blueberry &' .. 'SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/lib/ssh/ssh-askpass ssh-add &' .. 'xinput set-prop "Logitech MX518 Gaming Mouse" "libinput Accel Profile Enabled" 0, 0;' .. 'xinput set-prop "TPPS/2 IBM TrackPoint" "libinput Accel Profile Enabled" 0, 0;' .. 'dex --environment Awesome --autostart --search-paths "$XDG_CONFIG_DIRS/autostart:$XDG_CONFIG_HOME/autostart";' -- https://github.com/jceb/dex ) gears.wallpaper.set("#000000") ---awful.spawn.with_shell("SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/lib/ssh/ssh-askpass ssh-add") ---[[ -awful.spawn.with_shell("corectrl") -awful.spawn.with_shell("nextcloud") -awful.spawn.with_shell('xinput set-prop "Logitech MX518 Gaming Mouse" "libinput Accel Profile Enabled" 0, 0') -]]-- diff --git a/theme.lua b/theme.lua index 998edc8..f1049ca 100644 --- a/theme.lua +++ b/theme.lua @@ -40,7 +40,7 @@ theme.fg_focus = "#ffffff" theme.fg_urgent = "#ffffff" theme.fg_minimize = "#1268a4" -theme.border_width = "0" +theme.border_width = dpi(1) theme.border_normal = "#000000" theme.border_focus = "#1268a4" theme.border_marked = "#91231c"