-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52351d3
commit c88fa58
Showing
21 changed files
with
311 additions
and
336 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
-- _______ __ __ __ | ||
-- | _ |.--.--.| |_.-----.-----.| |_.---.-.----.| |_ | ||
-- | || | || _| _ |__ --|| _| _ | _|| _| | ||
-- |___|___||_____||____|_____|_____||____|___._|__| |____| | ||
-- -------------------------------------------------------------------------- -- | ||
-- autostart module | ||
-- Libraries and Modules | ||
local awful = require("awful") | ||
local sfx = require("modules.sfx") | ||
-- -------------------------------------------------------------------------- -- | ||
-- Autostart Applications | ||
|
||
local function run_once(cmd) | ||
local findme = cmd | ||
local firstspace = cmd:find(" ") | ||
if firstspace then | ||
findme = cmd:sub(0, firstspace - 1) | ||
end | ||
awful.spawn.easy_async_with_shell( | ||
string.format("pgrep -u $USER -x %s > /dev/null || (%s)", findme, cmd) | ||
) | ||
local findme = cmd | ||
local firstspace = cmd:find(" ") | ||
if firstspace then | ||
findme = cmd:sub(0, firstspace - 1) | ||
end | ||
awful.spawn.with_shell( | ||
string.format("pgrep -u $USER -x %s > /dev/null || (%s)", findme, cmd) | ||
) | ||
end | ||
-- -------------------------------------------------------------------------- -- | ||
-- Add apps to autostart here via terminal commands in subshells (meaning ending with &) | ||
autostart_apps = { | ||
"picom -b --experimental-backends &", -- picom for compositing | ||
' eval "$(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)" &', -- gnome secrets daemon | ||
"xrdb -merge $HOME/.Xresources &", -- xsettings | ||
"xss-lock lock &", -- screen locking | ||
"picom -b --experimental-backends &", -- picom for compositing | ||
' eval "$(gnome-keyring-daemon -s --components=pkcs11,secrets,ssh,gpg)" &', -- gnome secrets daemon | ||
"xrdb -merge $HOME/.Xresources &", -- xsettings | ||
"xss-lock lock &", -- screen locking | ||
} | ||
|
||
-- -------------------------------------------------------------------------- -- | ||
for app = 1, #autostart_apps do | ||
run_once(autostart_apps[app]) | ||
run_once(autostart_apps[app]) | ||
end | ||
|
||
sfx.startup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
-- Import necessary modules | ||
local awful = require("awful") | ||
|
||
-- Define the custom layout | ||
local paper_layout = {} | ||
paper_layout.name = "paper" | ||
|
||
function paper_layout.arrange(p) | ||
-- Check if there are any clients | ||
if #p.clients == 0 then | ||
return | ||
end | ||
|
||
-- Store the number of clients | ||
local num_clients = #p.clients | ||
|
||
-- Check if the workarea width and height are not zero | ||
if p.workarea.width == 0 or p.workarea.height == 0 then | ||
return | ||
end | ||
|
||
-- Iterate over each client | ||
for i, c in ipairs(p.clients) do | ||
-- Calculate the new geometry for the client | ||
local new_geometry = { | ||
x = p.workarea.x + (i - 1) * p.workarea.width / num_clients, | ||
y = p.workarea.y, | ||
width = p.workarea.width / num_clients, | ||
height = p.workarea.height, | ||
} | ||
|
||
-- Apply the new geometry | ||
c:geometry(new_geometry) | ||
end | ||
end | ||
|
||
-- Add the custom layout to the global layouts table | ||
table.insert(awful.layout.layouts, paper_layout) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,14 @@ | ||
-- ______ __ __ | ||
-- | __ \.---.-.| |_| |_.-----.----.--.--. | ||
-- | __ <| _ || _| _| -__| _| | | | ||
-- |______/|___._||____|____|_____|__| |___ | | ||
-- |_____| | ||
-- _______ __ __ | ||
-- | __|__|.-----.-----.---.-.| | | ||
-- |__ | || _ | | _ || | | ||
-- |_______|__||___ |__|__|___._||__| | ||
-- |_____| | ||
-- ------------------------------------------------- -- | ||
-- signal::battery | ||
-- percentage | ||
-- state | ||
local upower_widget = require("modules.battery") | ||
local battery_listener = upower_widget({ | ||
device_path = "/org/freedesktop/UPower/devices/battery_BAT0", | ||
instant_update = true, | ||
device_path = "/org/freedesktop/UPower/devices/battery_BAT0", | ||
instant_update = true, | ||
}) | ||
|
||
battery_listener:connect_signal("upower::update", function(_, device) | ||
if device ~= nil then | ||
awesome.emit_signal("signal::battery", device.percentage, device.state) | ||
collectgarbage("collect") | ||
else | ||
awesome.emit_signal("signal::battery:error") | ||
end | ||
if device ~= nil then | ||
awesome.emit_signal("signal::battery", device.percentage, device.state) | ||
collectgarbage("collect") | ||
else | ||
awesome.emit_signal("signal::battery:error") | ||
end | ||
end) | ||
-- ------------------------------------------------- -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.