Updates to awesome with fennel

This commit is contained in:
Chris Cochrun 2020-09-07 20:44:01 -05:00
parent ebf15f2270
commit 3d48649971
7 changed files with 63 additions and 78 deletions

19
awesome/bar.fnl Normal file
View file

@ -0,0 +1,19 @@
(local awful (require "awful"))
(local beautiful (require "beautiful"))
(local wibox (require "wibox"))
(local dpi xresources.apply_dpi)
(awful.screen.connect_for_each_screen(fn screen_bar [s]
"Adding a bar for each screen"
(awful.tag([ "◉", "◉", "◉", "◉"] s awful.layout.layouts[1]))
(let [yoffset (dpi 45)])
(let [xoffset (dpi 18)])
(let [mypanel (wibox
[
(let x (+ s.geometry.x xoffset))
(let y (- s.geometry.height yoffset))
(let height (dpi 30))
])])
))

View file

@ -3,7 +3,10 @@
(local rules (require "rules"))
(local beautiful (require "beautiful"))
(local gears (require "gears"))
(local keys (require "keys"))
;; (gears.wallpaper.set (beautiful.wallpaper))
(set awful.rules.rules rules)
(root.keys keys.globalkeys)

25
awesome/keys.fnl Normal file
View file

@ -0,0 +1,25 @@
(local awful (require "awful"))
(local beautiful (require "beautiful"))
(local hotkeys_popup (require "awful.hotkeys_popup"))
(local modifiers {
:mod "Mod4"
:shift "Shift"
:ctrl "Control"
:alt "Mod1"
})
(local globalkeys (gears.table.join
(key [:mod :alt] "m" (awful.spawn "mpv --player-operation-mode=pseudo-gui"))
(key [:mod] "s" hotkeys_popup.show_help)
))
(root.keys globalkeys)
keys
;; -- mpv
;; awful.key({ modkey, altkey }, "m", function () awful.spawn("mpv --player-operation-mode=pseudo-gui") end,
;; {description = "open mpv", group = "apps"}),

View file

@ -18,7 +18,6 @@ local beautiful = require("beautiful")
-- local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup")
local ruled = require("ruled")
local nice = require("nice")
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
@ -412,7 +411,7 @@ root.buttons(gears.table.join(
-- {{{ Key bindings
awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
awful.key({ modkey, }, "s", hotkeys_popup.keys,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
@ -486,9 +485,6 @@ awful.keyboard.append_global_keybindings({
-- dolphin
awful.key({ modkey, }, "d", function () awful.spawn("dolphin") end,
{description = "open dolphin file manager", group = "apps"}),
-- mpv
awful.key({ modkey, altkey }, "m", function () awful.spawn("mpv --player-operation-mode=pseudo-gui") end,
{description = "open mpv", group = "apps"}),
-- layout
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
@ -700,73 +696,6 @@ end)
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
ruled.client.connect_signal("request::rules", function()
-- All clients will match this rule.
ruled.client.append_rule {
id = "global",
rule = {},
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
},
}
-- make mpv specific
ruled.client.append_rule {
id = "mpv",
rule_any = {
class = {
"mpv"
}
},
properties = {
placement = awful.placement.centered,
floating = true,
ontop = true,
raise = true
},
}
-- Floating clients.
ruled.client.append_rule {
id = "floating",
rule_any = {
class = {
"Arandr",
"Blender",
"dolphin",
},
name = {
"Event Tester", -- xev.
"remove images?" -- darktable delete window.
},
role = {
"AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
}
},
properties = { floating = true },
}
-- Set Feh center
ruled.client.append_rule {
id = "feh",
rule = { class = "feh" },
properties = {
placement = awful.placement.centered,
floating = true
},
}
end)
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.

View file

@ -13,23 +13,32 @@
:border_color beautiful.border_normal
:focus awful.client.focus.filter
:raise true
:buttons keybindings.clientbuttons
:screen awful.screen.preferred
:placement (+ awful.placement.no_overlap awful.placement.no_offscreen)
}
}
;; floating
;; floating and centered
{
:rule_any {
:class [
"mpv"
"dolphin"
"feh"
"Arandr"
]
:name [
"Event Tester"
"remove images?"
]
:role [
"pop-up"
"GtkFileChooserDialog"
]}
:properties {:floating true}
:properties {
:placement awful.placement.centered
:floating true
}
}
])

View file

@ -85,7 +85,7 @@ shadow-offset-y = 0;
shadow-exclude = [
"name = 'Notification'",
"class_g = 'Conky'",
"class_g = 'firefox'",
# "class_g = 'firefox'",
"class_g ?= 'Notify-osd'",
"class_g = 'Cairo-clock'",
"class_g = 'slop'",

View file

@ -135,9 +135,9 @@
background: var(--tridactyl-bg) !important;
border: unset !important;
border: 1px var(--base0D) solid !important;
font-size: 9pt !important;
font-size: 7pt !important;
/*font-weight: 200 !important;*/
padding: 0.6ex !important;
padding: 0.3ex !important;
}
#completions .focused { background: var(--base0B);