finally have a proper determination of laptop

This commit is contained in:
Chris Cochrun 2022-04-01 07:31:51 -05:00
parent eabac7dcfa
commit eebfc39eb9
6 changed files with 3717 additions and 1539 deletions

@ -1 +1 @@
Subproject commit 048cf41e0aa5a391948d62e6168d6e54279cf627
Subproject commit 0fb85341916b6de1c5cd6ddf3e8472292a93a303

File diff suppressed because it is too large Load diff

View file

@ -81,13 +81,15 @@
(local shift "Shift")
(local ctrl "Control")
(local alt "Mod1")
(local comp [])
;; Set hostname so that we can utilize specific features on different machines
(awful.spawn.easy_async "cat /etc/hostname" (fn [ stdout stderr reason exit_code ]
(if (= "syl\n" stdout)
(global laptop true)
(global laptop false))))
(local laptop false)
;; determine whether using laptop
(local file (io.open "/etc/hostname"))
(io.input file)
(local laptop (if (= (io.read) "syl")
true
false))
(io.close file)
;; Table of layouts to cover with awful.layout.inc, order matters.
(set awful.layout.layouts [
@ -117,14 +119,14 @@
;; Create a launcher widget and a main menu
(global myawesomemenu [
[ "hotkeys" (fn [] (hotkeys_popup.show_help nil (awful.screen.focused))) ]
[ "manual" (.. terminal " -e man awesome") ]
[ "edit config" (.. editor_cmd " " awesome.conffile) ]
[ "restart" awesome.restart ]
[ "quit" (fn [] (awesome.quit)) ]])
[ "manual" (.. terminal " -e man awesome") ]
[ "edit config" (.. editor_cmd " " awesome.conffile) ]
[ "restart" awesome.restart ]
[ "quit" (fn [] (awesome.quit)) ]])
(global mymainmenu (awful.menu {:items [
[ "awesome" myawesomemenu beautiful.awesome_icon ]
[ "open terminal" terminal ]]}))
[ "open terminal" terminal ]]}))
(global mylauncher (awful.widget.launcher {:image beautiful.awesome_icon
:menu mymainmenu }))
@ -615,40 +617,40 @@
(client.connect_signal "request::default_keybindings"
(fn []
(awful.keyboard.append_client_keybindings [
(awful.key [modkey] "c" (fn [c] (: c :kill))
{:description "close" :group "client"})
(awful.key [ modkey ] "f" (fn [c] (set c.fullscreen (not c.fullscreen)) (: c :raise))
{:description "toggle fullscreen" :group "client"})
(awful.key [ modkey ctrl ] "space" awful.client.floating.toggle
{:description "toggle floating" :group "client"})
(awful.key [ modkey ctrl ] "Return" (fn [c] (: c :swap (awful.client.getmaster)))
{:description "move to master" :group "client"})
(awful.key [ modkey ] "o" (fn [c] (: c :move_to_screen))
{:description "move to screen" :group "client"})
(awful.key [ modkey ] "t" (fn [c] (set c.ontop (not c.ontop)))
{:description "toggle keep on top" :group "client"})
(awful.key [ modkey ] "n" (fn [c]
;; The client currently has the input focus, so it cannot be
;; minimized, since minimized clients can't have the focus.
(set c.minimized true))
{:description "minimize" :group "client"})
(awful.key [ modkey ] "m" (fn [c] (set c.maximized (not c.maximized)) (: c :raise))
{:description "(un)maximize" :group "client"})
(awful.key [ modkey ctrl ] "m" (fn [c] (set c.maximized_vertical (not c.maximized_vertical)) (: c :raise))
{:description "(un)maximize vertically" :group "client"})
(awful.key [modkey shift ] "m" (fn [c] (set c.maximized_horizontal (not c.maximized_horizontal)) (: c :raise))
{:description "(un)maximize horizontally" :group "client"})]
)))
(awful.keyboard.append_client_keybindings [
(awful.key [modkey] "c" (fn [c] (: c :kill))
{:description "close" :group "client"})
(awful.key [ modkey ] "f" (fn [c] (set c.fullscreen (not c.fullscreen)) (: c :raise))
{:description "toggle fullscreen" :group "client"})
(awful.key [ modkey ctrl ] "space" awful.client.floating.toggle
{:description "toggle floating" :group "client"})
(awful.key [ modkey ctrl ] "Return" (fn [c] (: c :swap (awful.client.getmaster)))
{:description "move to master" :group "client"})
(awful.key [ modkey ] "o" (fn [c] (: c :move_to_screen))
{:description "move to screen" :group "client"})
(awful.key [ modkey ] "t" (fn [c] (set c.ontop (not c.ontop)))
{:description "toggle keep on top" :group "client"})
(awful.key [ modkey ] "n" (fn [c]
;; The client currently has the input focus, so it cannot be
;; minimized, since minimized clients can't have the focus.
(set c.minimized true))
{:description "minimize" :group "client"})
(awful.key [ modkey ] "m" (fn [c] (set c.maximized (not c.maximized)) (: c :raise))
{:description "(un)maximize" :group "client"})
(awful.key [ modkey ctrl ] "m" (fn [c] (set c.maximized_vertical (not c.maximized_vertical)) (: c :raise))
{:description "(un)maximize vertically" :group "client"})
(awful.key [modkey shift ] "m" (fn [c] (set c.maximized_horizontal (not c.maximized_horizontal)) (: c :raise))
{:description "(un)maximize horizontally" :group "client"})]
)))
(client.connect_signal "request::default_mousebindings"
(fn []
(awful.mouse.append_client_mousebindings [
(awful.button [] 1 (fn [c] (: c :activate {:context "mouse_click"})))
(awful.button [modkey] 1 (fn [c] (: c :activate {:context "mouse_click" :action "mouse_move"})))
(awful.button [modkey] 3 (fn [c] (: c :activate {:context "mouse_click" :action "mouse_resize"})))
])))
(awful.mouse.append_client_mousebindings [
(awful.button [] 1 (fn [c] (: c :activate {:context "mouse_click"})))
(awful.button [modkey] 1 (fn [c] (: c :activate {:context "mouse_click" :action "mouse_move"})))
(awful.button [modkey] 3 (fn [c] (: c :activate {:context "mouse_click" :action "mouse_resize"})))
])))
;; Set keys
@ -660,7 +662,7 @@
(ruled.notification.connect_signal
"request::rules"
(fn []
(ruled.notification.append_rules notifications)))
(ruled.notification.append_rules notifications)))
;; Signals
;; Signal function to execute when a new client appears.
@ -668,61 +670,62 @@
"manage"
(fn [c]
;; Set the windows at the slave,
;; i.e. put it at the end of others instead of setting it master.
(when (not awesome.startup) (awful.client.setslave c))
;; Set the windows at the slave,
;; i.e. put it at the end of others instead of setting it master.
(when (not awesome.startup) (awful.client.setslave c))
(when (and awesome.startup
(not c.size_hints.user_position)
(not c.size_hints.program_position))
;; Prevent clients from being unreachable after screen count changes.
(awful.placement.no_offscreen c))
(when (and awesome.startup
(not c.size_hints.user_position)
(not c.size_hints.program_position))
;; Prevent clients from being unreachable after screen count changes.
(awful.placement.no_offscreen c))
;; MPV wasn't centering right
(when (= c.class "mpv") (awful.placement.centered c))
(when (= c.class "imv") (awful.placement.centered c))
(when (= c.class "Sxiv") (awful.placement.centered c))
(when (= c.name "Display Window") (set c.fullscreen true))
(awful.client.focus.byidx 1)
;; MPV wasn't centering right
(when (= c.class "mpv") (awful.placement.centered c))
(when (= c.class "imv") (awful.placement.centered c))
(when (= c.class "Sxiv") (awful.placement.centered c))
(when (= c.class "Libre Presenter") (awful.placement.centered c))
(when (= c.name "Display Window") (set c.fullscreen true))
(awful.client.focus.byidx 1)
;; Rounded windows done right
(when (and (not c.fullscreen) (not (= c.name "Display Window")))
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))
;; Rounded windows done right
(when (and (not c.fullscreen) (not (= c.name "Display Window")))
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))
(: c :activate [])))
(: c :activate [])))
;; make fullscreen clients no longer rounded and back afterwards
(client.connect_signal "property::fullscreen"
(fn [c]
(if c.fullscreen
(set c.shape (fn [cr w h]
(gears.shape.rectangle cr w h)))
(if c.fullscreen
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))))
(gears.shape.rectangle cr w h)))
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))))
(client.connect_signal "property::maximized"
(fn [c]
(when c.maximized
(when c.maximized
(set c.shape (fn [cr w h]
(gears.shape.rectangle cr w h)))
;; (let [s (c.screen)]
;; (naughty.notify {
;; :text "IDK!"
;; })
;; (set s.mywibox {
;; :x 0
;; :y s.geometry.height
;; :width s.geometry.width
;; :shape gears.shape.rounded_bar
;; }))
)
(if (not c.maximized)
(set c.shape (fn [cr w h]
(gears.shape.rectangle cr w h)))
;; (let [s (c.screen)]
;; (naughty.notify {
;; :text "IDK!"
;; })
;; (set s.mywibox {
;; :x 0
;; :y s.geometry.height
;; :width s.geometry.width
;; :shape gears.shape.rounded_bar
;; }))
)
(if (not c.maximized)
(set c.shape (fn [cr w h]
(gears.shape.rounded_rect cr w h (dpi 15)))))))
(gears.shape.rounded_rect cr w h (dpi 15)))))))
(client.connect_signal "focus" (fn [c] (set c.border_color beautiful.border_focus)))
(client.connect_signal "unfocus" (fn [c] (set c.border_color beautiful.border_normal)))

View file

@ -172,7 +172,7 @@
{:description "select pass" :group "apps" })
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
{:description "Open Writer" :group "apps" })
(awful.key [modkey] "b" (fn [] (awful.spawn "fflof"))
(awful.key [modkey] "b" (fn [] (awful.spawn "qblof"))
{:description "launch browser" :group "apps"})
;; rofi
(awful.key [] "Menu" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/launcher.sh"))

View file

@ -174,6 +174,19 @@
}
}
;; floating windows
{
:rule_any {
:class [
"Libre Presenter"
]}
:properties {
:floating true
:raise true
:screen awful.screen.preferred
:height (dpi 850)
:width (dpi 1450)
}
}
{
:rule_any {
:class [
@ -184,7 +197,7 @@
"ffplay"
"Junction"
"junction"
"Church Presenter"
"Libre Presenter"
"pinentry-qt"
]
:name [

View file

@ -765,7 +765,7 @@ c.colors.webpage.darkmode.contrast = 0.5
## `colors.webpage.darkmode.threshold.background` to 205. - "With
## selective inversion of everything": Combines the two variants above.
## Type: Bool
c.colors.webpage.darkmode.enabled = False
c.colors.webpage.darkmode.enabled = True
## Render all colors as grayscale. This only has an effect when
## `colors.webpage.darkmode.algorithm` is set to `lightness-hsl` or