refactor: dotfiles

This commit is contained in:
rxyhn 2022-02-27 18:50:51 +07:00
parent d357756532
commit 924929a2c7
6 changed files with 116 additions and 116 deletions

View file

@ -3,6 +3,8 @@ local wibox = require("wibox")
local beautiful = require("beautiful")
local bling = require("module.bling")
bling.module.flash_focus.enable()
-- Set Wallpaper
bling.module.tiled_wallpaper("", s, {
fg = beautiful.lighter_bg,

View file

@ -0,0 +1,25 @@
-- Standard awesome library
local awful = require("awful")
require("awful.autofocus")
local naughty = require("naughty")
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
naughty.connect_signal("request::display_error", function(message, startup)
naughty.notification {
urgency = "critical",
title = "Oops, an error happened" ..
(startup and " during startup!" or "!"),
message = message
}
end)
-- Screen Padding and Tags
screen.connect_signal("request::desktop_decoration", function(s)
-- Screen padding
screen[s].padding = {left = 0, right = 0, top = 0, bottom = 0}
-- Each screen has its own tag table.
awful.tag({"1", "2", "3", "4", "5"}, s, awful.layout.layouts[1])
end)

View file

@ -1,48 +1,6 @@
-- Standard Awesome Library
local awful = require("awful")
local beautiful = require("beautiful")
local gears = require("gears")
-- Bling
local bling = require("module.bling")
bling.module.flash_focus.enable()
-- Autostart
awful.spawn.with_shell("~/.config/awesome/configuration/autorun.sh")
-- Default Applications
terminal = "alacritty"
browser = "firefox"
filemanager = "nautilus"
vscode = "code"
editor = os.getenv("EDITOR") or "nvim"
editor_cmd = terminal .. " -e " .. editor
discord = "discord"
launcher = "rofi -show drun"
-- Weather API
openweathermap_key = "" -- API Key
openweathermap_city_id = "" -- City ID
weather_units = "metric" -- Unit
-- Global Vars
screen_width = awful.screen.focused().geometry.width
screen_height = awful.screen.focused().geometry.height
-- Default modkey.
modkey = "Mod4"
altkey = "Mod1"
shift = "Shift"
ctrl = "Control"
-- Get Bling Config
require("configuration.bling")
-- Get Keybinds
require("configuration.keys")
-- Get Rules
require("configuration.ruled")
-- Layouts and Window Stuff
require("configuration.window")
require("configuration.desktop")
require("configuration.menu")

View file

@ -1,19 +1,36 @@
-- keys.lua
-- Contains Global Keys
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
local hotkeys_popup = require("awful.hotkeys_popup")
local helpers = require("helpers")
-- Custom modules
local machi = require("module.layout-machi")
local bling = require("module.bling")
-- Theme handling library
local beautiful = require("beautiful")
-- Theme library
local beautiful = require("beautiful")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
-- Notifications library
local naughty = require("naughty")
-- Bling
local bling = require("module.bling")
-- Machi
local machi = require("module.layout-machi")
-- Helpers
local helpers = require("helpers")
local keys = {}
-- Default modkey.
modkey = "Mod4"
altkey = "Mod1"
ctrl = "Control"
shift = "Shift"
-- Mouse Bindings
awful.mouse.append_global_mousebindings({
awful.button({}, 4, awful.tag.viewprev),

View file

@ -0,0 +1,42 @@
-- Standard Awesome Library
local awful = require("awful")
local hotkeys_popup = require("awful.hotkeys_popup")
local beautiful = require("beautiful")
-- Create a launcher widget and a main menu
local awesomemenu = {
{
"Hotkeys",
function() hotkeys_popup.show_help(nil, awful.screen.focused()) end
},
{"Restart", awesome.restart},
{"Quit", function() awesome.quit() end}
}
local powermenu = {
{"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end},
{"Reboot", function() awful.spawn.with_shell("systemctl reboot") end},
{"Suspend", function()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end},
{"Lock Screen", function() lock_screen_show() end}
}
local appmenu = {
{"Terminal", terminal},
{"Editor", vscode},
{"File Manager", filemanager},
{"Browser", browser},
{"Discord", discord}
}
local mymainmenu = awful.menu({
items = {
{"AwesomeWM", awesomemenu, beautiful.awesome_logo}, {"Apps", appmenu}, {"Powermenu", powermenu}
}
})
awful.mouse.append_global_mousebindings({
awful.button({}, 3, function() mymainmenu:toggle() end)
})

View file

@ -11,84 +11,40 @@ pcall(require, "luarocks.loader")
-- Standard awesome library
local gfs = require("gears.filesystem")
local awful = require("awful")
require("awful.autofocus")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local hotkeys_popup = require("awful.hotkeys_popup")
require("awful.hotkeys_popup.keys")
-- Check if awesome encountered an error during startup and fell back to
-- another config (This code will only ever execute for the fallback config)
naughty.connect_signal("request::display_error", function(message, startup)
naughty.notification {
urgency = "critical",
title = "Oops, an error happened" ..
(startup and " during startup!" or "!"),
message = message
}
end)
-- Initialize Theme
beautiful.init(gfs.get_configuration_dir() .. "theme/theme.lua")
-- Default Applications
terminal = "alacritty"
browser = "firefox"
filemanager = "nautilus"
vscode = "code"
editor = os.getenv("EDITOR") or "nvim"
editor_cmd = terminal .. " -e " .. editor
discord = "discord"
launcher = "rofi -show drun"
-- Weather API
openweathermap_key = "" -- API Key
openweathermap_city_id = "" -- City ID
weather_units = "metric" -- Unit
-- Global Vars
screen_width = awful.screen.focused().geometry.width
screen_height = awful.screen.focused().geometry.height
-- Autostart
awful.spawn.with_shell("~/.config/awesome/configuration/autorun.sh")
-- Import Configuration
require("configuration")
-- Screen Padding and Tags
screen.connect_signal("request::desktop_decoration", function(s)
-- Screen padding
screen[s].padding = {left = 0, right = 0, top = 0, bottom = 0}
-- Each screen has its own tag table.
awful.tag({"1", "2", "3", "4", "5"}, s, awful.layout.layouts[1])
end)
-- Import Daemons and Widgets
require("signal")
require("ui")
-- Create a launcher widget and a main menu
local awesomemenu = {
{
"Hotkeys",
function() hotkeys_popup.show_help(nil, awful.screen.focused()) end
},
{"Restart", awesome.restart},
{"Quit", function() awesome.quit() end}
}
local powermenu = {
{"Power OFF", function() awful.spawn.with_shell("systemctl poweroff") end},
{"Reboot", function() awful.spawn.with_shell("systemctl reboot") end},
{"Suspend", function()
lock_screen_show()
awful.spawn.with_shell("systemctl suspend")
end},
{"Lock Screen", function() lock_screen_show() end}
}
local appmenu = {
{"Terminal", terminal},
{"Editor", vscode},
{"File Manager", filemanager},
{"Browser", browser},
{"Discord", discord}
}
local mymainmenu = awful.menu({
items = {
{"AwesomeWM", awesomemenu, beautiful.awesome_logo}, {"Apps", appmenu}, {"Powermenu", powermenu}
}
})
awful.mouse.append_global_mousebindings({
awful.button({}, 3, function() mymainmenu:toggle() end)
})
-- Garbage Collector Settings
collectgarbage("setpause", 110)
collectgarbage("setstepmul", 1000)