finally have a proper determination of laptop
This commit is contained in:
parent
eabac7dcfa
commit
eebfc39eb9
|
@ -1 +1 @@
|
||||||
Subproject commit 048cf41e0aa5a391948d62e6168d6e54279cf627
|
Subproject commit 0fb85341916b6de1c5cd6ddf3e8472292a93a303
|
5018
awesome/fennel.lua
5018
awesome/fennel.lua
File diff suppressed because it is too large
Load diff
171
awesome/init.fnl
171
awesome/init.fnl
|
@ -81,13 +81,15 @@
|
||||||
(local shift "Shift")
|
(local shift "Shift")
|
||||||
(local ctrl "Control")
|
(local ctrl "Control")
|
||||||
(local alt "Mod1")
|
(local alt "Mod1")
|
||||||
|
(local comp [])
|
||||||
|
|
||||||
;; Set hostname so that we can utilize specific features on different machines
|
;; determine whether using laptop
|
||||||
(awful.spawn.easy_async "cat /etc/hostname" (fn [ stdout stderr reason exit_code ]
|
(local file (io.open "/etc/hostname"))
|
||||||
(if (= "syl\n" stdout)
|
(io.input file)
|
||||||
(global laptop true)
|
(local laptop (if (= (io.read) "syl")
|
||||||
(global laptop false))))
|
true
|
||||||
(local laptop false)
|
false))
|
||||||
|
(io.close file)
|
||||||
|
|
||||||
;; Table of layouts to cover with awful.layout.inc, order matters.
|
;; Table of layouts to cover with awful.layout.inc, order matters.
|
||||||
(set awful.layout.layouts [
|
(set awful.layout.layouts [
|
||||||
|
@ -117,14 +119,14 @@
|
||||||
;; Create a launcher widget and a main menu
|
;; Create a launcher widget and a main menu
|
||||||
(global myawesomemenu [
|
(global myawesomemenu [
|
||||||
[ "hotkeys" (fn [] (hotkeys_popup.show_help nil (awful.screen.focused))) ]
|
[ "hotkeys" (fn [] (hotkeys_popup.show_help nil (awful.screen.focused))) ]
|
||||||
[ "manual" (.. terminal " -e man awesome") ]
|
[ "manual" (.. terminal " -e man awesome") ]
|
||||||
[ "edit config" (.. editor_cmd " " awesome.conffile) ]
|
[ "edit config" (.. editor_cmd " " awesome.conffile) ]
|
||||||
[ "restart" awesome.restart ]
|
[ "restart" awesome.restart ]
|
||||||
[ "quit" (fn [] (awesome.quit)) ]])
|
[ "quit" (fn [] (awesome.quit)) ]])
|
||||||
|
|
||||||
(global mymainmenu (awful.menu {:items [
|
(global mymainmenu (awful.menu {:items [
|
||||||
[ "awesome" myawesomemenu beautiful.awesome_icon ]
|
[ "awesome" myawesomemenu beautiful.awesome_icon ]
|
||||||
[ "open terminal" terminal ]]}))
|
[ "open terminal" terminal ]]}))
|
||||||
|
|
||||||
(global mylauncher (awful.widget.launcher {:image beautiful.awesome_icon
|
(global mylauncher (awful.widget.launcher {:image beautiful.awesome_icon
|
||||||
:menu mymainmenu }))
|
:menu mymainmenu }))
|
||||||
|
@ -615,40 +617,40 @@
|
||||||
|
|
||||||
(client.connect_signal "request::default_keybindings"
|
(client.connect_signal "request::default_keybindings"
|
||||||
(fn []
|
(fn []
|
||||||
(awful.keyboard.append_client_keybindings [
|
(awful.keyboard.append_client_keybindings [
|
||||||
(awful.key [modkey] "c" (fn [c] (: c :kill))
|
(awful.key [modkey] "c" (fn [c] (: c :kill))
|
||||||
{:description "close" :group "client"})
|
{:description "close" :group "client"})
|
||||||
(awful.key [ modkey ] "f" (fn [c] (set c.fullscreen (not c.fullscreen)) (: c :raise))
|
(awful.key [ modkey ] "f" (fn [c] (set c.fullscreen (not c.fullscreen)) (: c :raise))
|
||||||
{:description "toggle fullscreen" :group "client"})
|
{:description "toggle fullscreen" :group "client"})
|
||||||
(awful.key [ modkey ctrl ] "space" awful.client.floating.toggle
|
(awful.key [ modkey ctrl ] "space" awful.client.floating.toggle
|
||||||
{:description "toggle floating" :group "client"})
|
{:description "toggle floating" :group "client"})
|
||||||
(awful.key [ modkey ctrl ] "Return" (fn [c] (: c :swap (awful.client.getmaster)))
|
(awful.key [ modkey ctrl ] "Return" (fn [c] (: c :swap (awful.client.getmaster)))
|
||||||
{:description "move to master" :group "client"})
|
{:description "move to master" :group "client"})
|
||||||
(awful.key [ modkey ] "o" (fn [c] (: c :move_to_screen))
|
(awful.key [ modkey ] "o" (fn [c] (: c :move_to_screen))
|
||||||
{:description "move to screen" :group "client"})
|
{:description "move to screen" :group "client"})
|
||||||
(awful.key [ modkey ] "t" (fn [c] (set c.ontop (not c.ontop)))
|
(awful.key [ modkey ] "t" (fn [c] (set c.ontop (not c.ontop)))
|
||||||
{:description "toggle keep on top" :group "client"})
|
{:description "toggle keep on top" :group "client"})
|
||||||
(awful.key [ modkey ] "n" (fn [c]
|
(awful.key [ modkey ] "n" (fn [c]
|
||||||
;; The client currently has the input focus, so it cannot be
|
;; The client currently has the input focus, so it cannot be
|
||||||
;; minimized, since minimized clients can't have the focus.
|
;; minimized, since minimized clients can't have the focus.
|
||||||
(set c.minimized true))
|
(set c.minimized true))
|
||||||
{:description "minimize" :group "client"})
|
{:description "minimize" :group "client"})
|
||||||
(awful.key [ modkey ] "m" (fn [c] (set c.maximized (not c.maximized)) (: c :raise))
|
(awful.key [ modkey ] "m" (fn [c] (set c.maximized (not c.maximized)) (: c :raise))
|
||||||
{:description "(un)maximize" :group "client"})
|
{:description "(un)maximize" :group "client"})
|
||||||
(awful.key [ modkey ctrl ] "m" (fn [c] (set c.maximized_vertical (not c.maximized_vertical)) (: c :raise))
|
(awful.key [ modkey ctrl ] "m" (fn [c] (set c.maximized_vertical (not c.maximized_vertical)) (: c :raise))
|
||||||
{:description "(un)maximize vertically" :group "client"})
|
{:description "(un)maximize vertically" :group "client"})
|
||||||
(awful.key [modkey shift ] "m" (fn [c] (set c.maximized_horizontal (not c.maximized_horizontal)) (: c :raise))
|
(awful.key [modkey shift ] "m" (fn [c] (set c.maximized_horizontal (not c.maximized_horizontal)) (: c :raise))
|
||||||
{:description "(un)maximize horizontally" :group "client"})]
|
{:description "(un)maximize horizontally" :group "client"})]
|
||||||
|
|
||||||
)))
|
)))
|
||||||
|
|
||||||
(client.connect_signal "request::default_mousebindings"
|
(client.connect_signal "request::default_mousebindings"
|
||||||
(fn []
|
(fn []
|
||||||
(awful.mouse.append_client_mousebindings [
|
(awful.mouse.append_client_mousebindings [
|
||||||
(awful.button [] 1 (fn [c] (: c :activate {:context "mouse_click"})))
|
(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] 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.button [modkey] 3 (fn [c] (: c :activate {:context "mouse_click" :action "mouse_resize"})))
|
||||||
])))
|
])))
|
||||||
|
|
||||||
|
|
||||||
;; Set keys
|
;; Set keys
|
||||||
|
@ -660,7 +662,7 @@
|
||||||
(ruled.notification.connect_signal
|
(ruled.notification.connect_signal
|
||||||
"request::rules"
|
"request::rules"
|
||||||
(fn []
|
(fn []
|
||||||
(ruled.notification.append_rules notifications)))
|
(ruled.notification.append_rules notifications)))
|
||||||
|
|
||||||
;; Signals
|
;; Signals
|
||||||
;; Signal function to execute when a new client appears.
|
;; Signal function to execute when a new client appears.
|
||||||
|
@ -668,61 +670,62 @@
|
||||||
"manage"
|
"manage"
|
||||||
(fn [c]
|
(fn [c]
|
||||||
|
|
||||||
;; Set the windows at the slave,
|
;; Set the windows at the slave,
|
||||||
;; i.e. put it at the end of others instead of setting it master.
|
;; i.e. put it at the end of others instead of setting it master.
|
||||||
(when (not awesome.startup) (awful.client.setslave c))
|
(when (not awesome.startup) (awful.client.setslave c))
|
||||||
|
|
||||||
(when (and awesome.startup
|
(when (and awesome.startup
|
||||||
(not c.size_hints.user_position)
|
(not c.size_hints.user_position)
|
||||||
(not c.size_hints.program_position))
|
(not c.size_hints.program_position))
|
||||||
;; Prevent clients from being unreachable after screen count changes.
|
;; Prevent clients from being unreachable after screen count changes.
|
||||||
(awful.placement.no_offscreen c))
|
(awful.placement.no_offscreen c))
|
||||||
|
|
||||||
;; MPV wasn't centering right
|
;; MPV wasn't centering right
|
||||||
(when (= c.class "mpv") (awful.placement.centered c))
|
(when (= c.class "mpv") (awful.placement.centered c))
|
||||||
(when (= c.class "imv") (awful.placement.centered c))
|
(when (= c.class "imv") (awful.placement.centered c))
|
||||||
(when (= c.class "Sxiv") (awful.placement.centered c))
|
(when (= c.class "Sxiv") (awful.placement.centered c))
|
||||||
(when (= c.name "Display Window") (set c.fullscreen true))
|
(when (= c.class "Libre Presenter") (awful.placement.centered c))
|
||||||
(awful.client.focus.byidx 1)
|
(when (= c.name "Display Window") (set c.fullscreen true))
|
||||||
|
(awful.client.focus.byidx 1)
|
||||||
|
|
||||||
;; Rounded windows done right
|
;; Rounded windows done right
|
||||||
(when (and (not c.fullscreen) (not (= c.name "Display Window")))
|
(when (and (not c.fullscreen) (not (= c.name "Display Window")))
|
||||||
(set c.shape (fn [cr w h]
|
(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)))))
|
||||||
|
|
||||||
(: c :activate [])))
|
(: c :activate [])))
|
||||||
|
|
||||||
;; make fullscreen clients no longer rounded and back afterwards
|
;; make fullscreen clients no longer rounded and back afterwards
|
||||||
(client.connect_signal "property::fullscreen"
|
(client.connect_signal "property::fullscreen"
|
||||||
(fn [c]
|
(fn [c]
|
||||||
(if c.fullscreen
|
(if c.fullscreen
|
||||||
(set c.shape (fn [cr w h]
|
|
||||||
(gears.shape.rectangle cr w h)))
|
|
||||||
(set c.shape (fn [cr w h]
|
(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"
|
(client.connect_signal "property::maximized"
|
||||||
(fn [c]
|
(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]
|
(set c.shape (fn [cr w h]
|
||||||
(gears.shape.rectangle cr w h)))
|
(gears.shape.rounded_rect cr w h (dpi 15)))))))
|
||||||
|
|
||||||
;; (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)))))))
|
|
||||||
|
|
||||||
(client.connect_signal "focus" (fn [c] (set c.border_color beautiful.border_focus)))
|
(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)))
|
(client.connect_signal "unfocus" (fn [c] (set c.border_color beautiful.border_normal)))
|
||||||
|
|
|
@ -172,7 +172,7 @@
|
||||||
{:description "select pass" :group "apps" })
|
{:description "select pass" :group "apps" })
|
||||||
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
|
(awful.key [ modkey shift ] "w" (fn [] (awful.spawn "libreoffice --writer"))
|
||||||
{:description "Open Writer" :group "apps" })
|
{: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"})
|
{:description "launch browser" :group "apps"})
|
||||||
;; rofi
|
;; rofi
|
||||||
(awful.key [] "Menu" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/launcher.sh"))
|
(awful.key [] "Menu" (fn [] (awful.spawn "/home/chris/.config/rofi/launchers-git/launcher.sh"))
|
||||||
|
|
|
@ -174,6 +174,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
;; floating windows
|
;; floating windows
|
||||||
|
{
|
||||||
|
:rule_any {
|
||||||
|
:class [
|
||||||
|
"Libre Presenter"
|
||||||
|
]}
|
||||||
|
:properties {
|
||||||
|
:floating true
|
||||||
|
:raise true
|
||||||
|
:screen awful.screen.preferred
|
||||||
|
:height (dpi 850)
|
||||||
|
:width (dpi 1450)
|
||||||
|
}
|
||||||
|
}
|
||||||
{
|
{
|
||||||
:rule_any {
|
:rule_any {
|
||||||
:class [
|
:class [
|
||||||
|
@ -184,7 +197,7 @@
|
||||||
"ffplay"
|
"ffplay"
|
||||||
"Junction"
|
"Junction"
|
||||||
"junction"
|
"junction"
|
||||||
"Church Presenter"
|
"Libre Presenter"
|
||||||
"pinentry-qt"
|
"pinentry-qt"
|
||||||
]
|
]
|
||||||
:name [
|
:name [
|
||||||
|
|
|
@ -765,7 +765,7 @@ c.colors.webpage.darkmode.contrast = 0.5
|
||||||
## `colors.webpage.darkmode.threshold.background` to 205. - "With
|
## `colors.webpage.darkmode.threshold.background` to 205. - "With
|
||||||
## selective inversion of everything": Combines the two variants above.
|
## selective inversion of everything": Combines the two variants above.
|
||||||
## Type: Bool
|
## 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
|
## Render all colors as grayscale. This only has an effect when
|
||||||
## `colors.webpage.darkmode.algorithm` is set to `lightness-hsl` or
|
## `colors.webpage.darkmode.algorithm` is set to `lightness-hsl` or
|
||||||
|
|
Loading…
Reference in a new issue