ww
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
|
||||
run() {
|
||||
if ! pgrep -f "$1" ;
|
||||
then
|
||||
"$@"&
|
||||
fi
|
||||
}
|
||||
|
||||
run "picom"
|
||||
run "unclutter"
|
||||
run "firefox"
|
||||
run "copyq"
|
||||
run "/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1"
|
||||
run "nm-applet"
|
||||
run "batsignal"
|
||||
run "redshift"
|
||||
run "sunshine"
|
||||
|
||||
killall -q polybar
|
||||
polybar left &
|
||||
polybar right &
|
||||
polybar middle &
|
||||
polybar tray &
|
||||
polybar xwindow &
|
||||
|
||||
pkill xidlehook
|
||||
xidlehook --detect-sleep --not-when-audio --timer 300 'cool-retro-term --fullscreen -e sh ~/cmatrix.sh' '' --timer 600 'pkill cool-retro-term && systemctl suspend' ''
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
-------------------------------------------------
|
||||
-- Calendar Widget for Awesome Window Manager
|
||||
-- Shows the current month and supports scroll up/down to switch month
|
||||
-- More details could be found here:
|
||||
-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/calendar-widget
|
||||
|
||||
-- @author Pavel Makhov
|
||||
-- @copyright 2019 Pavel Makhov
|
||||
-------------------------------------------------
|
||||
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local wibox = require("wibox")
|
||||
local gears = require("gears")
|
||||
local naughty = require("naughty")
|
||||
|
||||
local calendar_widget = {}
|
||||
|
||||
local function worker(user_args)
|
||||
|
||||
local calendar_themes = {
|
||||
nord = {
|
||||
bg = '#2E3440',
|
||||
fg = '#D8DEE9',
|
||||
focus_date_bg = '#88C0D0',
|
||||
focus_date_fg = '#000000',
|
||||
weekend_day_bg = '#3B4252',
|
||||
weekday_fg = '#88C0D0',
|
||||
header_fg = '#E5E9F0',
|
||||
border = '#4C566A'
|
||||
},
|
||||
outrun = {
|
||||
bg = '#0d0221',
|
||||
fg = '#D8DEE9',
|
||||
focus_date_bg = '#650d89',
|
||||
focus_date_fg = '#2de6e2',
|
||||
weekend_day_bg = '#261447',
|
||||
weekday_fg = '#2de6e2',
|
||||
header_fg = '#f6019d',
|
||||
border = '#261447'
|
||||
},
|
||||
dark = {
|
||||
bg = '#000000',
|
||||
fg = '#ffffff',
|
||||
focus_date_bg = '#ffffff',
|
||||
focus_date_fg = '#000000',
|
||||
weekend_day_bg = '#444444',
|
||||
weekday_fg = '#ffffff',
|
||||
header_fg = '#ffffff',
|
||||
border = '#333333'
|
||||
},
|
||||
light = {
|
||||
bg = '#ffffff',
|
||||
fg = '#000000',
|
||||
focus_date_bg = '#000000',
|
||||
focus_date_fg = '#ffffff',
|
||||
weekend_day_bg = '#AAAAAA',
|
||||
weekday_fg = '#000000',
|
||||
header_fg = '#000000',
|
||||
border = '#CCCCCC'
|
||||
},
|
||||
monokai = {
|
||||
bg = '#272822',
|
||||
fg = '#F8F8F2',
|
||||
focus_date_bg = '#AE81FF',
|
||||
focus_date_fg = '#ffffff',
|
||||
weekend_day_bg = '#75715E',
|
||||
weekday_fg = '#FD971F',
|
||||
header_fg = '#F92672',
|
||||
border = '#75715E'
|
||||
},
|
||||
catppuccin = {
|
||||
bg = '#181825',
|
||||
fg = '#F8F8F2',
|
||||
focus_date_bg = '#b4befe',
|
||||
focus_date_fg = '#ffffff',
|
||||
weekend_day_bg = '#1e1e2e',
|
||||
weekday_fg = '#f2cdcd',
|
||||
header_fg = '#cba6f7',
|
||||
border = '#181825'
|
||||
},
|
||||
naughty = {
|
||||
bg = beautiful.notification_bg or beautiful.bg,
|
||||
fg = beautiful.notification_fg or beautiful.fg,
|
||||
focus_date_bg = beautiful.notification_fg or beautiful.fg,
|
||||
focus_date_fg = beautiful.notification_bg or beautiful.bg,
|
||||
weekend_day_bg = beautiful.bg_focus,
|
||||
weekday_fg = beautiful.fg,
|
||||
header_fg = beautiful.fg,
|
||||
border = beautiful.border_normal
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
local args = user_args or {}
|
||||
|
||||
if args.theme ~= nil and calendar_themes[args.theme] == nil then
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = 'Calendar Widget',
|
||||
text = 'Theme "' .. args.theme .. '" not found, fallback to default'})
|
||||
args.theme = 'naughty'
|
||||
end
|
||||
|
||||
local theme = args.theme or 'naughty'
|
||||
local placement = args.placement or 'top'
|
||||
local radius = args.radius or 8
|
||||
local next_month_button = args.next_month_button or 4
|
||||
local previous_month_button = args.previous_month_button or 5
|
||||
local start_sunday = args.start_sunday or false
|
||||
|
||||
local styles = {}
|
||||
local function rounded_shape(size)
|
||||
return function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, size)
|
||||
end
|
||||
end
|
||||
|
||||
styles.month = {
|
||||
padding = 4,
|
||||
bg_color = calendar_themes[theme].bg,
|
||||
border_width = 0,
|
||||
}
|
||||
|
||||
styles.normal = {
|
||||
markup = function(t) return t end,
|
||||
shape = rounded_shape(4)
|
||||
}
|
||||
|
||||
styles.focus = {
|
||||
fg_color = calendar_themes[theme].focus_date_fg,
|
||||
bg_color = calendar_themes[theme].focus_date_bg,
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
shape = rounded_shape(4)
|
||||
}
|
||||
|
||||
styles.header = {
|
||||
fg_color = calendar_themes[theme].header_fg,
|
||||
bg_color = calendar_themes[theme].bg,
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end
|
||||
}
|
||||
|
||||
styles.weekday = {
|
||||
fg_color = calendar_themes[theme].weekday_fg,
|
||||
bg_color = calendar_themes[theme].bg,
|
||||
markup = function(t) return '<b>' .. t .. '</b>' end,
|
||||
}
|
||||
|
||||
local function decorate_cell(widget, flag, date)
|
||||
if flag == 'monthheader' and not styles.monthheader then
|
||||
flag = 'header'
|
||||
end
|
||||
|
||||
-- highlight only today's day
|
||||
if flag == 'focus' then
|
||||
local today = os.date('*t')
|
||||
if not (today.month == date.month and today.year == date.year) then
|
||||
flag = 'normal'
|
||||
end
|
||||
end
|
||||
|
||||
local props = styles[flag] or {}
|
||||
if props.markup and widget.get_text and widget.set_markup then
|
||||
widget:set_markup(props.markup(widget:get_text()))
|
||||
end
|
||||
-- Change bg color for weekends
|
||||
local d = { year = date.year, month = (date.month or 1), day = (date.day or 1) }
|
||||
local weekday = tonumber(os.date('%w', os.time(d)))
|
||||
local default_bg = (weekday == 0 or weekday == 6)
|
||||
and calendar_themes[theme].weekend_day_bg
|
||||
or calendar_themes[theme].bg
|
||||
local ret = wibox.widget {
|
||||
{
|
||||
{
|
||||
widget,
|
||||
halign = 'center',
|
||||
widget = wibox.container.place
|
||||
},
|
||||
margins = (props.padding or 2) + (props.border_width or 0),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
shape = props.shape,
|
||||
shape_border_color = props.border_color or '#000000',
|
||||
shape_border_width = props.border_width or 0,
|
||||
fg = props.fg_color or calendar_themes[theme].fg,
|
||||
bg = props.bg_color or default_bg,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
return ret
|
||||
end
|
||||
|
||||
local cal = wibox.widget {
|
||||
date = os.date('*t'),
|
||||
font = beautiful.get_font(),
|
||||
fn_embed = decorate_cell,
|
||||
long_weekdays = true,
|
||||
start_sunday = start_sunday,
|
||||
widget = wibox.widget.calendar.month
|
||||
}
|
||||
|
||||
local popup = awful.popup {
|
||||
ontop = true,
|
||||
visible = false,
|
||||
shape = rounded_shape(radius),
|
||||
offset = { y = 5 },
|
||||
border_width = 1,
|
||||
border_color = calendar_themes[theme].border,
|
||||
widget = cal
|
||||
}
|
||||
|
||||
popup:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({}, next_month_button, function()
|
||||
local a = cal:get_date()
|
||||
a.month = a.month + 1
|
||||
cal:set_date(nil)
|
||||
cal:set_date(a)
|
||||
popup:set_widget(cal)
|
||||
end),
|
||||
awful.button({}, previous_month_button, function()
|
||||
local a = cal:get_date()
|
||||
a.month = a.month - 1
|
||||
cal:set_date(nil)
|
||||
cal:set_date(a)
|
||||
popup:set_widget(cal)
|
||||
end)
|
||||
)
|
||||
)
|
||||
|
||||
function calendar_widget.toggle()
|
||||
|
||||
if popup.visible then
|
||||
-- to faster render the calendar refresh it and just hide
|
||||
cal:set_date(nil) -- the new date is not set without removing the old one
|
||||
cal:set_date(os.date('*t'))
|
||||
popup:set_widget(nil) -- just in case
|
||||
popup:set_widget(cal)
|
||||
popup.visible = not popup.visible
|
||||
else
|
||||
if placement == 'top' then
|
||||
awful.placement.top(popup, { margins = { top = 50 }, parent = awful.screen.focused() })
|
||||
elseif placement == 'top_right' then
|
||||
awful.placement.top_right(popup, { margins = { top = 30, right = 10}, parent = awful.screen.focused() })
|
||||
elseif placement == 'top_left' then
|
||||
awful.placement.top_left(popup, { margins = { top = 30, left = 10}, parent = awful.screen.focused() })
|
||||
elseif placement == 'bottom_right' then
|
||||
awful.placement.bottom_right(popup, { margins = { bottom = 30, right = 10},
|
||||
parent = awful.screen.focused() })
|
||||
elseif placement == 'bottom_left' then
|
||||
awful.placement.bottom_left(popup, { margins = { bottom = 30, left = 10},
|
||||
parent = awful.screen.focused() })
|
||||
else
|
||||
awful.placement.top(popup, { margins = { top = 50 }, parent = awful.screen.focused() })
|
||||
end
|
||||
|
||||
popup.visible = true
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
return calendar_widget
|
||||
|
||||
end
|
||||
|
||||
return setmetatable(calendar_widget, { __call = function(_, ...)
|
||||
return worker(...)
|
||||
end })
|
||||
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
killall -q polybar
|
||||
@@ -0,0 +1,688 @@
|
||||
-- awesome_mode: api-level=4:screen=on
|
||||
-- If LuaRocks is installed, make sure that packages installed through it are
|
||||
-- found (e.g. lgi). If LuaRocks is not installed, do nothing.
|
||||
pcall(require, "luarocks.loader")
|
||||
|
||||
-- Standard awesome library
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
require("awful.autofocus")
|
||||
-- Widget and layout library
|
||||
local wibox = require("wibox")
|
||||
-- Theme handling library
|
||||
local beautiful = require("beautiful")
|
||||
-- Notification library
|
||||
local naughty = require("naughty")
|
||||
-- Declarative object management
|
||||
local ruled = require("ruled")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
-- Enable hotkeys help widget for VIM and other apps
|
||||
-- when client with a matching name is opened:
|
||||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
-- {{{ Error handling
|
||||
-- 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)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Variable definitions
|
||||
-- Themes define colours, icons, font and wallpapers.
|
||||
beautiful.init("~/.config/awesome/theme-def.lua")
|
||||
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
terminal = "wezterm"
|
||||
editor = os.getenv("EDITOR") or "nvim"
|
||||
editor_cmd = terminal .. " -e " .. editor
|
||||
|
||||
-- Default modkey.
|
||||
-- Usually, Mod4 is the key with a logo between Control and Alt.
|
||||
-- If you do not like this or do not have such a key,
|
||||
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
|
||||
-- However, you can use another modifier like Mod1, but it may interact with others.
|
||||
modkey = "Mod4"
|
||||
-- }}}
|
||||
|
||||
-- {{{ Menu
|
||||
|
||||
polybar = {
|
||||
{
|
||||
"Kill bar",
|
||||
function()
|
||||
awful.spawn.with_shell("sh ~/.config/awesome/kpolybar.sh")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Spawn bar",
|
||||
function()
|
||||
awful.spawn.with_shell("sh ~/.config/awesome/spolybar.sh")
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
mymainmenu = awful.menu({
|
||||
items = {
|
||||
{
|
||||
"Apps",
|
||||
function()
|
||||
awful.spawn.with_shell("sleep 0.5s && sh ~/.config/rofi/launchers/type-6/launcher.sh")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Nemo",
|
||||
function()
|
||||
awful.spawn.with_shell("nemo")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"Scrshot",
|
||||
function()
|
||||
awful.spawn.with_shell("sleep 0.5s && flameshot full")
|
||||
end,
|
||||
},
|
||||
{ "Terminal", terminal },
|
||||
{ "Polybar", polybar, beautiful.menu_submenu_icon },
|
||||
{
|
||||
"Xkill",
|
||||
function()
|
||||
awful.spawn.with_shell("sleep 0.5s && xkill")
|
||||
end,
|
||||
},
|
||||
{ "Restart", awesome.restart },
|
||||
{
|
||||
"Quit",
|
||||
function()
|
||||
awesome.quit()
|
||||
end,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- {{{ Tag layout
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
tag.connect_signal("request::default_layouts", function()
|
||||
awful.layout.append_default_layouts({
|
||||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.floating,
|
||||
})
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Wallpaper
|
||||
screen.connect_signal("request::wallpaper", function(s)
|
||||
awful.wallpaper({
|
||||
screen = s,
|
||||
widget = {
|
||||
{
|
||||
image = beautiful.wallpaper,
|
||||
upscale = true,
|
||||
downscale = true,
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
valign = "center",
|
||||
halign = "center",
|
||||
tiled = false,
|
||||
widget = wibox.container.tile,
|
||||
},
|
||||
})
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Tags
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
-- Each screen has its own tag table.
|
||||
local names = { "1", "2", "3", "4", "5" }
|
||||
local l = awful.layout.suit
|
||||
local layouts = { l.spiral.dwindle, l.spiral.dwindle, l.spiral.dwindle, l.spiral.dwindle, l.floating }
|
||||
awful.tag(names, s, layouts)
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Mouse bindings
|
||||
awful.mouse.append_global_mousebindings({
|
||||
awful.button({}, 3, function()
|
||||
mymainmenu:toggle()
|
||||
end),
|
||||
awful.button({}, 4, awful.tag.viewprev),
|
||||
awful.button({}, 5, awful.tag.viewnext),
|
||||
})
|
||||
-- }}}
|
||||
|
||||
-- {{{ Calendar widget
|
||||
local calendar_widget = require("calendar")
|
||||
local cw = calendar_widget({
|
||||
theme = "catppuccin",
|
||||
placement = "top center",
|
||||
start_sunday = false,
|
||||
radius = 8,
|
||||
})
|
||||
-- }}}
|
||||
|
||||
-- {{{ Key bindings
|
||||
|
||||
-- General Awesome keys
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
|
||||
awful.key({ modkey, "Shift" }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
|
||||
awful.key({ modkey }, "Return", function()
|
||||
awful.spawn(terminal)
|
||||
end, { description = "open a terminal", group = "launcher" }),
|
||||
|
||||
awful.key({}, "XF86AudioRaiseVolume", function()
|
||||
awful.spawn.with_shell("pactl set-sink-volume @DEFAULT_SINK@ +5%")
|
||||
end),
|
||||
|
||||
awful.key({}, "XF86AudioMute", function()
|
||||
awful.spawn.with_shell("pactl set-sink-mute @DEFAULT_SINK@ toggle")
|
||||
end),
|
||||
|
||||
awful.key({}, "F6", function()
|
||||
awful.util.spawn("playerctl play-pause", false)
|
||||
end),
|
||||
|
||||
awful.key({}, "F8", function()
|
||||
awful.util.spawn("playerctl next", false)
|
||||
end),
|
||||
|
||||
awful.key({}, "F7", function()
|
||||
awful.util.spawn("playerctl previous", false)
|
||||
end),
|
||||
|
||||
awful.key({}, "XF86AudioLowerVolume", function()
|
||||
awful.spawn.with_shell("pactl set-sink-volume @DEFAULT_SINK@ -5%")
|
||||
end),
|
||||
|
||||
awful.key({}, "XF86MonBrightnessDown", function()
|
||||
awful.util.spawn("brightnessctl s 10%-")
|
||||
end),
|
||||
|
||||
awful.key({}, "XF86MonBrightnessUp", function()
|
||||
awful.util.spawn("brightnessctl s +10%")
|
||||
end),
|
||||
})
|
||||
|
||||
-- Tags related keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
|
||||
awful.key({ modkey }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
|
||||
awful.key({ modkey }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
|
||||
})
|
||||
|
||||
-- Focus related keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ "Mod1" }, "Tab", function()
|
||||
awful.client.focus.byidx(1)
|
||||
end, { description = "focus next by index", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "j", function()
|
||||
awful.screen.focus_relative(1)
|
||||
end, { description = "focus the next screen", group = "screen" }),
|
||||
awful.key({ modkey, "Control" }, "k", function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end, { description = "focus the previous screen", group = "screen" }),
|
||||
awful.key({ modkey, "Control" }, "n", function()
|
||||
local c = awful.client.restore()
|
||||
-- Focus restored client
|
||||
if c then
|
||||
c:activate({ raise = true, context = "key.unminimize" })
|
||||
end
|
||||
end, { description = "restore minimized", group = "client" }),
|
||||
})
|
||||
|
||||
-- Layout related keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, "Shift" }, "j", function()
|
||||
awful.client.swap.byidx(1)
|
||||
end, { description = "swap with next client by index", group = "client" }),
|
||||
awful.key({ modkey, "Shift" }, "k", function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end, { description = "swap with previous client by index", group = "client" }),
|
||||
awful.key({ modkey }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
|
||||
awful.key({ modkey }, "l", function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end, { description = "increase master width factor", group = "layout" }),
|
||||
awful.key({ modkey }, "h", function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end, { description = "decrease master width factor", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "h", function()
|
||||
awful.tag.incnmaster(1, nil, true)
|
||||
end, { description = "increase the number of master clients", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "l", function()
|
||||
awful.tag.incnmaster(-1, nil, true)
|
||||
end, { description = "decrease the number of master clients", group = "layout" }),
|
||||
awful.key({ modkey, "Control" }, "h", function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end, { description = "increase the number of columns", group = "layout" }),
|
||||
awful.key({ modkey, "Control" }, "l", function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end, { description = "decrease the number of columns", group = "layout" }),
|
||||
awful.key({ modkey, "Control" }, "space", function()
|
||||
awful.layout.inc(1)
|
||||
end, { description = "select next", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "space", function()
|
||||
awful.layout.inc(-1)
|
||||
end, { description = "select previous", group = "layout" }),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey }, "a", function()
|
||||
awful.spawn.with_shell("sh ~/.config/rofi/launchers/type-6/launcher.sh")
|
||||
end, { description = "run rofi apps", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "r", function()
|
||||
awful.spawn.with_shell("sh ~/.config/rofi/launchers/type-6/launcher2.sh")
|
||||
end, { description = "run rofi programs", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "w", function()
|
||||
awful.spawn.with_shell("sh ~/.config/rofi/launchers/type-6/launcher1.sh")
|
||||
end, { description = "run rofi windows", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "e", function()
|
||||
awful.spawn.with_shell("nemo")
|
||||
end, { description = "run nemo", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "`", function()
|
||||
awful.spawn.with_shell("sh ~/.config/rofi/powermenu/type-6/powermenu.sh")
|
||||
end, { description = "power options", group = "awesome" }),
|
||||
|
||||
awful.key({ modkey }, "c", function()
|
||||
cw.toggle()
|
||||
end, { description = "calendar popup", group = "launcher" }),
|
||||
|
||||
awful.key({}, "F4", function()
|
||||
awful.spawn.with_shell("flameshot gui")
|
||||
end, { description = "run flameshot", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "p", function()
|
||||
awful.spawn.with_shell("scrcpy -S --power-off-on-close --window-x 10")
|
||||
end, { description = "run scrcpy", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "z", function()
|
||||
awful.spawn.with_shell("sh ~/.config/awesome/kpolybar.sh")
|
||||
end, { description = "kill polybar", group = "launcher" }),
|
||||
|
||||
awful.key({ modkey }, "x", function()
|
||||
awful.spawn.with_shell("sh ~/.config/awesome/spolybar.sh")
|
||||
end, { description = "run polybar", group = "launcher" }),
|
||||
})
|
||||
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({
|
||||
modifiers = { modkey },
|
||||
keygroup = "numrow",
|
||||
description = "only view tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
tag:view_only()
|
||||
end
|
||||
end,
|
||||
}),
|
||||
awful.key({
|
||||
modifiers = { modkey, "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "move focused client to tag",
|
||||
group = "tag",
|
||||
on_press = function(index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:move_to_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
}),
|
||||
})
|
||||
|
||||
client.connect_signal("request::default_mousebindings", function()
|
||||
awful.mouse.append_client_mousebindings({
|
||||
awful.button({}, 1, function(c)
|
||||
c:activate({ context = "mouse_click" })
|
||||
end),
|
||||
awful.button({ modkey }, 1, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_move" })
|
||||
end),
|
||||
awful.button({ modkey }, 3, function(c)
|
||||
c:activate({ context = "mouse_click", action = "mouse_resize" })
|
||||
end),
|
||||
})
|
||||
end)
|
||||
|
||||
client.connect_signal("request::default_keybindings", function()
|
||||
awful.keyboard.append_client_keybindings({
|
||||
awful.key({ modkey }, "f", function(c)
|
||||
c.fullscreen = not c.fullscreen
|
||||
c:raise()
|
||||
end, { description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ modkey }, "q", function(c)
|
||||
c:kill()
|
||||
end, { description = "close", group = "client" }),
|
||||
awful.key({ modkey }, "space", function(c)
|
||||
awful.client.floating.toggle(c)
|
||||
c.width = 1000
|
||||
c.height = 550
|
||||
awful.placement.centered(c)
|
||||
end, { description = "toggle floating", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "Return", function(c)
|
||||
c:swap(awful.client.getmaster())
|
||||
end, { description = "move to master", group = "client" }),
|
||||
awful.key({ modkey }, "o", function(c)
|
||||
c:move_to_screen()
|
||||
end, { description = "move to screen", group = "client" }),
|
||||
awful.key({ modkey }, "t", function(c)
|
||||
c.ontop = not c.ontop
|
||||
end, { description = "toggle keep on top", group = "client" }),
|
||||
awful.key({ modkey }, "n", function(c)
|
||||
-- The client currently has the input focus, so it cannot be
|
||||
-- minimized, since minimized clients can't have the focus.
|
||||
c.minimized = true
|
||||
end, { description = "minimize", group = "client" }),
|
||||
awful.key({ modkey }, "m", function(c)
|
||||
c.maximized = not c.maximized
|
||||
c:raise()
|
||||
end, { description = "(un)maximize", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "m", function(c)
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
c:raise()
|
||||
end, { description = "(un)maximize vertically", group = "client" }),
|
||||
awful.key({ modkey, "Shift" }, "m", function(c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c:raise()
|
||||
end, { description = "(un)maximize horizontally", group = "client" }),
|
||||
})
|
||||
end)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- {{{ Rules
|
||||
-- Rules to apply to new clients.
|
||||
ruled.client.connect_signal("request::rules", function()
|
||||
-- All clients will match this rule.
|
||||
ruled.client.append_rule({
|
||||
id = "global",
|
||||
rule = {},
|
||||
properties = {
|
||||
focus = awful.client.focus.filter,
|
||||
raise = true,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
},
|
||||
})
|
||||
|
||||
-- Floating clients.
|
||||
ruled.client.append_rule({
|
||||
id = "floating",
|
||||
rule_any = {
|
||||
instance = { "copyq", "pinentry" },
|
||||
class = {
|
||||
"Arandr",
|
||||
"Blueman-manager",
|
||||
"Gpick",
|
||||
"Kruler",
|
||||
"Sxiv",
|
||||
"Tor Browser",
|
||||
"Wpa_gui",
|
||||
"veromix",
|
||||
"xtightvncviewer",
|
||||
},
|
||||
-- Note that the name property shown in xprop might be set slightly after creation of the client
|
||||
-- and the name shown there might not match defined rules here.
|
||||
name = {
|
||||
"Event Tester", -- xev.
|
||||
},
|
||||
role = {
|
||||
"AlarmWindow", -- Thunderbird's calendar.
|
||||
"ConfigManager", -- Thunderbird's about:config.
|
||||
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
|
||||
},
|
||||
},
|
||||
properties = { floating = true },
|
||||
})
|
||||
|
||||
-- Add titlebars to normal clients and dialogs
|
||||
ruled.client.append_rule({
|
||||
id = "titlebars",
|
||||
rule_any = { type = { "normal", "dialog" } },
|
||||
properties = { titlebars_enabled = false },
|
||||
})
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
class = { "firefox" },
|
||||
},
|
||||
properties = { screen = 1 },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "chromium" },
|
||||
properties = { screen = 1, tag = "4", floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "Steam" },
|
||||
properties = { screen = 1, tag = "4", floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "discord" },
|
||||
properties = { screen = 1, tag = "2" },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "discord-screenaudio" },
|
||||
properties = { screen = 1, tag = "2" },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
instance = { "youtube music" },
|
||||
},
|
||||
properties = { screen = 1, tag = "3" },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule_any = {
|
||||
class = { "thunderbird" },
|
||||
},
|
||||
properties = { screen = 1, tag = "3" },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "vscodium" },
|
||||
properties = { screen = 1, tag = "4" },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "dolphin-emu" },
|
||||
properties = { floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "Windscribe" },
|
||||
properties = { floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "feh" },
|
||||
properties = { floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "nm-connection-editor" },
|
||||
properties = { floating = true },
|
||||
})
|
||||
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "scrcpy" },
|
||||
properties = { floating = true },
|
||||
})
|
||||
ruled.client.append_rule({
|
||||
rule = { instance = "polybar" },
|
||||
properties = { border_width = 0 },
|
||||
})
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Notifications
|
||||
|
||||
naughty.config.defaults.ontop = true
|
||||
naughty.config.defaults.screen = awful.screen.focused()
|
||||
naughty.config.defaults.timeout = 4
|
||||
naughty.config.defaults.title = "Notification"
|
||||
naughty.config.defaults.position = "top_right"
|
||||
naughty.config.defaults.border_width = 0
|
||||
beautiful.notification_spacing = 16
|
||||
|
||||
local function create_notif(n)
|
||||
local icon_visibility
|
||||
|
||||
if n.icon == nil then
|
||||
icon_visibility = false
|
||||
else
|
||||
icon_visibility = true
|
||||
end
|
||||
|
||||
-- Action widget
|
||||
local action_widget = {
|
||||
{
|
||||
{
|
||||
id = "text_role",
|
||||
align = "center",
|
||||
font = "Product Sans 10",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
margins = { left = dpi(3), right = dpi(3) },
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
|
||||
-- Apply action widget ^
|
||||
local actions = wibox.widget({
|
||||
notification = n,
|
||||
base_layout = wibox.widget({
|
||||
spacing = dpi(20),
|
||||
layout = wibox.layout.flex.horizontal,
|
||||
}),
|
||||
widget_template = action_widget,
|
||||
widget = naughty.list.actions,
|
||||
})
|
||||
|
||||
local function space_h(length, circumstances)
|
||||
return wibox.widget({
|
||||
forced_width = length,
|
||||
visible = circumstances,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
})
|
||||
end
|
||||
|
||||
-- Make other widgets
|
||||
local title = wibox.widget.textbox()
|
||||
title.font = "Product Sans Bold 12"
|
||||
title.align = "center"
|
||||
title.markup = n.title
|
||||
|
||||
local message = wibox.widget.textbox()
|
||||
message.font = "Product Sans 12"
|
||||
message.align = "left"
|
||||
message.markup = n.message
|
||||
|
||||
local icon = wibox.widget({
|
||||
nil,
|
||||
{
|
||||
{
|
||||
image = n.icon,
|
||||
visible = icon_visibility,
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
strategy = "max",
|
||||
width = dpi(115),
|
||||
height = dpi(115),
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
expand = "none",
|
||||
layout = wibox.layout.align.vertical,
|
||||
})
|
||||
|
||||
local container = wibox.widget({
|
||||
{
|
||||
title,
|
||||
{
|
||||
icon,
|
||||
space_h(dpi(25), icon_visibility),
|
||||
message,
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
},
|
||||
actions,
|
||||
spacing = dpi(20),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
margins = dpi(15),
|
||||
widget = wibox.container.margin,
|
||||
})
|
||||
|
||||
naughty.layout.box({
|
||||
notification = n,
|
||||
type = "notification",
|
||||
bg = beautiful.bg,
|
||||
border_width = 0,
|
||||
shape = function(cr, w, h)
|
||||
gears.shape.rounded_rect(cr, w, h, 5)
|
||||
end,
|
||||
widget_template = {
|
||||
{
|
||||
{
|
||||
{
|
||||
widget = container,
|
||||
},
|
||||
strategy = "max",
|
||||
width = dpi(300),
|
||||
height = dpi(200),
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
strategy = "min",
|
||||
width = dpi(300),
|
||||
height = dpi(130),
|
||||
widget = wibox.container.constraint,
|
||||
},
|
||||
bg = beautiful.bg,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
})
|
||||
end
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
create_notif(n)
|
||||
end)
|
||||
|
||||
ruled.notification.connect_signal("request::rules", function()
|
||||
ruled.notification.append_rule({
|
||||
rule = {},
|
||||
properties = {
|
||||
screen = awful.screen.focused(),
|
||||
implicit_timeout = 4,
|
||||
},
|
||||
})
|
||||
end)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- Autostart
|
||||
|
||||
awful.spawn.with_shell("sh ~/.config/awesome/autorun.sh")
|
||||
awful.spawn.with_shell("pkill http-server")
|
||||
awful.spawn.with_shell("http-server ~/.config/chevron/dist")
|
||||
awful.spawn.with_shell("sleep 20s && conky -c ~/.config/conky/mocha.conf")
|
||||
awful.spawn.with_shell("kdeconnect-indicator")
|
||||
awful.spawn.with_shell("feh --no-fehbg --bg-fill ~/Downloads/alena-aenami-stardust-1k.jpg")
|
||||
|
||||
-- Garbage collection
|
||||
|
||||
collectgarbage("setpause", 110)
|
||||
collectgarbage("setstepmul", 1000)
|
||||
gears.timer({
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function()
|
||||
collectgarbage("collect")
|
||||
end,
|
||||
})
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
polybar left &
|
||||
polybar right &
|
||||
polybar middle &
|
||||
polybar tray &
|
||||
polybar xwindow &
|
||||
@@ -0,0 +1,56 @@
|
||||
---------------------------
|
||||
-- Default awesome theme --
|
||||
---------------------------
|
||||
|
||||
local theme_assets = require("beautiful.theme_assets")
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
|
||||
local gfs = require("gears.filesystem")
|
||||
local themes_path = gfs.get_themes_dir()
|
||||
|
||||
local theme = {}
|
||||
|
||||
theme.font = "Product Sans 11"
|
||||
|
||||
theme.bg_normal = "#181825"
|
||||
theme.bg_focus = "#1e1e2e"
|
||||
theme.bg_urgent = "#eba0ac"
|
||||
theme.bg_minimize = "#313244"
|
||||
theme.bg_systray = theme.bg_normal
|
||||
|
||||
theme.fg_normal = "#cdd6f4"
|
||||
theme.fg_focus = "#737994"
|
||||
theme.fg_urgent = "#ea999c"
|
||||
theme.fg_minimize = "#99d1db"
|
||||
|
||||
theme.useless_gap = dpi(5)
|
||||
theme.border_normal = "#1e1e2e"
|
||||
theme.border_focus = "#1e1e2e"
|
||||
theme.border_marked = "#1e1e2e"
|
||||
theme.border_radius = dpi(8)
|
||||
theme.border_width = dpi(0)
|
||||
|
||||
theme.menu_height = 30
|
||||
theme.menu_width = 120
|
||||
|
||||
-- Generate taglist squares:
|
||||
local taglist_square_size = dpi(4)
|
||||
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
|
||||
taglist_square_size, theme.fg_normal
|
||||
)
|
||||
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
|
||||
taglist_square_size, theme.fg_normal
|
||||
)
|
||||
|
||||
--Signals
|
||||
client.connect_signal("focus", function(c)
|
||||
c.border_color = theme.border_focus end)
|
||||
client.connect_signal("unfocus", function(c)
|
||||
c.border_color = theme.border_normal end)
|
||||
|
||||
theme.icon_theme = nil
|
||||
|
||||
return theme
|
||||
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
Reference in New Issue
Block a user