Compare commits
4 Commits
ac437b3b0e
...
28e11e675d
| Author | SHA1 | Date | |
|---|---|---|---|
| 28e11e675d | |||
| fda8049989 | |||
| 81395b1f43 | |||
| fc75826dd4 |
@@ -20,9 +20,3 @@ A minimal, stable Linux development environment.
|
||||
* `config/` — Application configuration
|
||||
* `scripts/` — Installation and utility scripts
|
||||
* `install.sh` — Creates symbolic links
|
||||
|
||||
## Versioning
|
||||
|
||||
Releases are tagged.
|
||||
|
||||
The goal is to keep the environment stable. New features should solve real issues rather than my curiosity.
|
||||
|
||||
@@ -1,116 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local colors = require("config.colors")
|
||||
local widgets = require("config.widgets")
|
||||
|
||||
local M = {}
|
||||
|
||||
local taglist_buttons = gears.table.join(
|
||||
awful.button({ }, 1, function(t) t:view_only() end),
|
||||
awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle)
|
||||
)
|
||||
|
||||
local function set_wallpaper(s)
|
||||
if beautiful.wallpaper then
|
||||
local wp = beautiful.wallpaper
|
||||
if type(wp) == "function" then wp = wp(s) end
|
||||
gears.wallpaper.maximized(wp, s, true)
|
||||
end
|
||||
end
|
||||
screen.connect_signal("property::geometry", set_wallpaper)
|
||||
|
||||
function M.setup()
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
set_wallpaper(s)
|
||||
awful.tag({ "1", "2", "3", "4", "5" }, s, awful.layout.layouts[1])
|
||||
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
s.mylayoutbox = awful.widget.layoutbox(s)
|
||||
s.mylayoutbox:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() awful.layout.inc(1) end),
|
||||
awful.button({ }, 3, function() awful.layout.inc(-1) end)
|
||||
))
|
||||
|
||||
s.mytaglist = awful.widget.taglist {
|
||||
screen = s, filter = awful.widget.taglist.filter.all, buttons = taglist_buttons,
|
||||
style = { shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 4) end },
|
||||
layout = { spacing = 4, layout = wibox.layout.fixed.horizontal },
|
||||
widget_template = {
|
||||
{ { id = "text_role", widget = wibox.widget.textbox }, left = 10, right = 10, top = 4, bottom = 4, widget = wibox.container.margin },
|
||||
id = "background_role", widget = wibox.container.background,
|
||||
},
|
||||
}
|
||||
|
||||
-- Per-screen monitor widgets (created here so multi-monitor stays valid)
|
||||
local title = widgets.make_title()
|
||||
local vol = widgets.make_vol()
|
||||
local cpu = widgets.make_cpu()
|
||||
local brightness = widgets.make_brightness()
|
||||
local clock = wibox.widget.textclock("%Y-%m-%d %H:%M")
|
||||
|
||||
local right = wibox.layout.fixed.horizontal()
|
||||
local function push(w) right:add(widgets.padded(w, 4, 4)) end
|
||||
push(wibox.widget.systray()); right:add(widgets.sep())
|
||||
push(vol); right:add(widgets.sep())
|
||||
push(cpu); right:add(widgets.sep())
|
||||
push(clock);
|
||||
push(brightness);
|
||||
push(s.mylayoutbox)
|
||||
|
||||
s.mywibox = awful.wibar {
|
||||
position = "top", screen = s, height = 45, bg = colors.background, fg = colors.white,
|
||||
shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 0) end,
|
||||
}
|
||||
|
||||
s.mywibox:setup {
|
||||
layout = wibox.container.margin, left = 8, right = 8, top = 10, bottom = 10,
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left: workspaces + focused window title
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
widgets.padded(s.mytaglist, 8, 4), s.mypromptbox,
|
||||
{ title, left = 18, widget = wibox.container.margin },
|
||||
},
|
||||
nil, -- empty center
|
||||
widgets.padded(right, 4, 12),
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
-- Overlay for rofi launchers
|
||||
local dim_overlay = wibox({
|
||||
visible = false,
|
||||
ontop = true,
|
||||
type = "splash",
|
||||
bg = "#00000099",
|
||||
})
|
||||
dim_overlay.name = "awesome_dim_overlay"
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
dim_overlay.screen = s -- adjust if you want it per-screen vs spanning all
|
||||
end)
|
||||
|
||||
-- span the primary screen's geometry (or loop over all screens if you use a multi-monitor dim)
|
||||
local function update_dim_geometry()
|
||||
local geo = screen.primary.geometry
|
||||
dim_overlay:geometry(geo)
|
||||
end
|
||||
update_dim_geometry()
|
||||
screen.connect_signal("property::geometry", update_dim_geometry)
|
||||
|
||||
-- expose functions over awesome-client
|
||||
_G.show_dim = function() dim_overlay.visible = true end
|
||||
_G.hide_dim = function() dim_overlay.visible = false end
|
||||
|
||||
-- Prime the window so X/picom register its type before first real use,
|
||||
-- avoiding a one-time grow animation on the very first show_dim() call
|
||||
dim_overlay.visible = true
|
||||
gears.timer.delayed_call(function()
|
||||
dim_overlay.visible = false
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
@@ -1,12 +0,0 @@
|
||||
return {
|
||||
background = "#111111",
|
||||
background_alt = "#1a1a1a",
|
||||
foreground = "#dcd7ba", -- kanagawa foreground
|
||||
accent = "#6a9589", -- black (bright) - muted gray, same role as old #6e6e6e
|
||||
accent_alt = "#7fb4ca", -- blue (normal) - crystalBlue
|
||||
red = "#e82424", -- red (bright) - samuraiRed, vivid
|
||||
green = "#98bb6c", -- green (bright) - springGreen
|
||||
yellow = "#e6c384", -- yellow (bright) - carpYellow
|
||||
disabled = "#6a9589", -- cyan (normal) - muted, low-contrast
|
||||
white = "#ffffff", -- white (normal) - dimmer than foreground
|
||||
}
|
||||
@@ -1,85 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
local menubar = require("menubar")
|
||||
|
||||
local M = {}
|
||||
|
||||
M.globalkeys = gears.table.join(
|
||||
awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
|
||||
|
||||
-- Directional focus (vim keys)
|
||||
awful.key({ modkey }, "h", function() awful.client.focus.bydirection("left") end, { description = "focus left", group = "client" }),
|
||||
awful.key({ modkey }, "j", function() awful.client.focus.bydirection("down") end, { description = "focus down", group = "client" }),
|
||||
awful.key({ modkey }, "k", function() awful.client.focus.bydirection("up") end, { description = "focus up", group = "client" }),
|
||||
awful.key({ modkey }, "l", function() awful.client.focus.bydirection("right") end, { description = "focus right", group = "client" }),
|
||||
|
||||
-- Directional move (swap clients in the tiling layout)
|
||||
awful.key({ modkey, "Control" }, "h", function() awful.client.swap.bydirection("left") end, { description = "move left", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "j", function() awful.client.swap.bydirection("down") end, { description = "move down", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "k", function() awful.client.swap.bydirection("up") end, { description = "move up", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "l", function() awful.client.swap.bydirection("right") end, { description = "move right", group = "client" }),
|
||||
|
||||
-- Resize the master/other split
|
||||
awful.key({ modkey, "Shift" }, "h", function() awful.tag.incmwfact(-0.05) end, { description = "shrink master", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "l", function() awful.tag.incmwfact( 0.05) end, { description = "grow master", group = "layout" }),
|
||||
|
||||
-- Launching / layout
|
||||
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end, { description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ modkey }, "e", function() awful.spawn("thunar") end, { description = "Filemanager", group = "system" }),
|
||||
awful.key({ modkey }, "w", function() awful.layout.inc(1) end, { description = "next layout", group = "layout" }),
|
||||
|
||||
|
||||
-- screenshooter
|
||||
awful.key({ modkey, "Control" }, "p", function() awful.spawn("xfce4-screenshooter") end, { description = "screenshot", group = "system" }),
|
||||
|
||||
-- Alt tab current workspace windows
|
||||
awful.key({ modkey }, "Tab", function() awful.client.focus.byidx(1) end),
|
||||
|
||||
-- Media keys
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" +2%']]) end, { description = "volume up", group = "media" }),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" -2%']]) end, { description = "volume down", group = "media" }),
|
||||
awful.key({ }, "XF86AudioMute", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']]) end, { description = "toggle mute", group = "media" }),
|
||||
|
||||
-- rofi menus
|
||||
awful.key({ modkey }, "space", function() awful.spawn("/home/jason/.local/bin/runrofi") end, { description = "application launcher", group = "launcher" }),
|
||||
awful.key({ modkey }, "`", function() awful.spawn("/home/jason/.local/bin/powermenu") end, { description = "power menu", group = "system" }),
|
||||
awful.key({ modkey }, "a", function() awful.spawn("/home/jason/.local/bin/audioswitch") end, { description = "audio output", group = "system" }),
|
||||
awful.key({ modkey }, "b", function () awful.spawn("/home/jason/.local/bin/bookmarks") end, {description = "bookmarks", group = "internet"}),
|
||||
|
||||
-- Awesome control
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" })
|
||||
)
|
||||
|
||||
-- Workspace keys 1..5: Alt+N view, Alt+Shift+N move client to tag
|
||||
for i = 1, 5 do
|
||||
M.globalkeys = gears.table.join(M.globalkeys,
|
||||
awful.key({ modkey }, "#" .. i + 9, function()
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then tag:view_only() end
|
||||
end, { description = "view tag #" .. i, group = "tag" }),
|
||||
|
||||
awful.key({ modkey, "Control" }, "#" .. i + 9, function()
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then client.focus:move_to_tag(tag) end
|
||||
end
|
||||
end, { description = "move focused client to tag #" .. i, group = "tag" })
|
||||
)
|
||||
end
|
||||
|
||||
M.clientkeys = gears.table.join(
|
||||
awful.key({ modkey }, "q", function(c) c:kill() end, { description = "kill window", group = "client" }),
|
||||
awful.key({ modkey }, "f", function(c) c.fullscreen = not c.fullscreen; c:raise() end, { description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ modkey }, "m", function(c) c:swap(awful.client.getmaster()) end, { description = "make master", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle, { description = "toggle floating", group = "client" })
|
||||
)
|
||||
|
||||
M.clientbuttons = gears.table.join(
|
||||
awful.button({ }, 1, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }) end),
|
||||
awful.button({ modkey }, 1, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }); awful.mouse.client.move(c) end),
|
||||
awful.button({ modkey }, 3, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }); awful.mouse.client.resize(c) end)
|
||||
)
|
||||
|
||||
return M
|
||||
@@ -1,37 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local keys = require("config.keys")
|
||||
|
||||
return {
|
||||
{
|
||||
rule = { },
|
||||
properties = {
|
||||
border_width = beautiful.border_width, border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter, raise = true,
|
||||
keys = keys.clientkeys, buttons = keys.clientbuttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
}
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
instance = { "pinentry" },
|
||||
class = { "Arandr", "Blueman-manager", "Gpick", "Pavucontrol" },
|
||||
name = { "Event Tester" },
|
||||
role = { "AlarmWindow", "pop-up" },
|
||||
},
|
||||
properties = { floating = true }
|
||||
},
|
||||
{
|
||||
rule = { name = "Sublime Terminal", },
|
||||
properties = { floating = false, },
|
||||
callback = function(c)
|
||||
awful.client.setslave(c)
|
||||
|
||||
local t = c.first_tag
|
||||
if t then
|
||||
t.master_width_factor = 0.67
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
client.connect_signal("manage", function(c)
|
||||
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
-- New windows open into the stack (to the right); first window becomes master.
|
||||
if not awesome.startup then awful.client.setslave(c) end
|
||||
-- 0 or ie 13 = corner radius
|
||||
c.shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 0) end
|
||||
end)
|
||||
|
||||
client.connect_signal("property::floating", function(c)
|
||||
if c.floating and c.type ~= "notification" then awful.placement.centered(c, { honor_workarea = true }) end
|
||||
end)
|
||||
|
||||
client.connect_signal("manage", function(c)
|
||||
if c.floating and c.type ~= "notification" then awful.placement.centered(c, { honor_workarea = true }) end
|
||||
end)
|
||||
|
||||
-- Focus follows mouse (i3-like). Comment out for click-to-focus only.
|
||||
client.connect_signal("mouse::enter", function(c) c:emit_signal("request::activate", "mouse_enter", { raise = false }) end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
@@ -1,47 +0,0 @@
|
||||
local gears = require("gears")
|
||||
local beautiful = require("beautiful")
|
||||
local naughty = require("naughty")
|
||||
local colors = require("config.colors")
|
||||
|
||||
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||
|
||||
beautiful.useless_gap = 8
|
||||
beautiful.gap_single_client = true
|
||||
beautiful.font = "JetBrainsMono Nerd Font 11"
|
||||
beautiful.border_width = 4
|
||||
beautiful.border_normal = colors.background_alt
|
||||
beautiful.border_focus = colors.accent
|
||||
|
||||
beautiful.taglist_bg_focus = colors.accent
|
||||
beautiful.taglist_fg_focus = colors.background
|
||||
beautiful.taglist_fg_occupied = colors.accent
|
||||
beautiful.taglist_bg_occupied = colors.background
|
||||
beautiful.taglist_fg_empty = colors.white
|
||||
beautiful.taglist_bg_empty = colors.background
|
||||
beautiful.taglist_bg_urgent = colors.red
|
||||
beautiful.taglist_fg_urgent = colors.background
|
||||
|
||||
beautiful.bg_systray = colors.background
|
||||
beautiful.systray_icon_spacing = 4
|
||||
|
||||
-- Notifications, styled to match the wibar/client theme
|
||||
naughty.config.defaults.position = "top_right"
|
||||
naughty.config.defaults.timeout = 5
|
||||
naughty.config.padding = 12
|
||||
naughty.config.defaults.margin = 12
|
||||
naughty.config.defaults.spacing = 8
|
||||
naughty.config.defaults.icon_size = 48
|
||||
naughty.config.defaults.border_width = 3
|
||||
naughty.config.defaults.font = "JetBrainsMono Nerd Font 12"
|
||||
naughty.config.defaults.shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 13) end
|
||||
|
||||
naughty.config.presets.normal = {
|
||||
bg = colors.background, fg = colors.foreground, border_color = colors.accent,
|
||||
border_width = 3, font = "JetBrainsMono Nerd Font 12", timeout = 5,
|
||||
}
|
||||
naughty.config.presets.low = naughty.config.presets.normal
|
||||
naughty.config.presets.critical = {
|
||||
bg = colors.background, fg = colors.red, border_color = colors.red,
|
||||
border_width = 3, font = "JetBrainsMono Nerd Font 12", timeout = 0, -- stays until dismissed
|
||||
}
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
local colors = require("config.colors")
|
||||
|
||||
local M = {}
|
||||
|
||||
-- "ICON value" with ICON tinted accent, like polybar's *-prefix-foreground.
|
||||
function M.label(icon, val)
|
||||
return string.format("<span foreground='%s'>%s</span> %s", colors.white, icon, val or "")
|
||||
end
|
||||
|
||||
-- A slim separator in the disabled color, like polybar's separator.
|
||||
function M.sep()
|
||||
local w = wibox.widget.textbox()
|
||||
w.markup = string.format("<span foreground='%s00'> </span>", colors.disabled)
|
||||
return w
|
||||
end
|
||||
|
||||
-- Wrap a widget in a small margin so bar modules aren't crammed together.
|
||||
function M.padded(w, left, right)
|
||||
return wibox.container.margin(w, left or 8, right or 8)
|
||||
end
|
||||
|
||||
-- Focused window title (polybar xwindow / %title%)
|
||||
function M.make_title()
|
||||
local t = wibox.widget.textbox()
|
||||
local function update()
|
||||
local c = client.focus
|
||||
t.markup = c and string.format("<span foreground='%s'>%s</span>", colors.white, gears.string.xml_escape(c.name or "")) or ""
|
||||
end
|
||||
client.connect_signal("focus", update)
|
||||
client.connect_signal("unfocus", update)
|
||||
client.connect_signal("property::name", update)
|
||||
return t
|
||||
end
|
||||
|
||||
-- CPU usage % (two top samples so the reading is accurate)
|
||||
function M.make_cpu()
|
||||
return awful.widget.watch(
|
||||
{ "bash", "-c", [[LANG=C top -bn2 -d0.3 | grep -m2 '^%Cpu' | tail -1 | awk '{printf "%.0f", 100 - $8}']] },
|
||||
3, function(w, out) w.markup = M.label("<span font_size='large'> </span>", out:gsub("%s+$", "") .. "%") end)
|
||||
end
|
||||
|
||||
-- Volume: click to mute, scroll to adjust, right-click for the mixer.
|
||||
-- Keeps its own refresh() so button presses update instantly instead of
|
||||
-- waiting on the polling timer.
|
||||
function M.make_vol()
|
||||
local w = wibox.widget.textbox()
|
||||
|
||||
local vol_script = [[
|
||||
sink=$(LANG=C pactl get-default-sink 2>/dev/null)
|
||||
m=$(LANG=C pactl get-sink-mute "$sink" 2>/dev/null | grep -oE 'yes|no')
|
||||
v=$(LANG=C pactl get-sink-volume "$sink" 2>/dev/null | grep -oE '[0-9]+%' | head -n1)
|
||||
echo "$m $v"
|
||||
]]
|
||||
local function shell_quote(s) return "'" .. s:gsub("'", "'\\''") .. "'" end
|
||||
local vol_cmd = "sh -c " .. shell_quote(vol_script)
|
||||
|
||||
local function refresh()
|
||||
awful.spawn.easy_async_with_shell(vol_cmd, function(out)
|
||||
local muted, pct = out:match("(%a+)%s+(%d+)%%")
|
||||
if muted == nil and pct == nil then
|
||||
w.markup = string.format("<span foreground='%s'><span font_size='large'></span> n/a</span>", colors.disabled)
|
||||
return
|
||||
end
|
||||
muted = muted == "yes"
|
||||
pct = pct or "0"
|
||||
w.markup = muted and string.format("<span foreground='%s'>MUTE</span>", colors.yellow) or M.label("<span font_size='large'></span>", pct .. "%")
|
||||
end)
|
||||
end
|
||||
|
||||
w:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() awful.spawn("/home/jason/.local/bin/audioswitch") end),
|
||||
awful.button({ }, 3, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']], function() refresh() end) end),
|
||||
awful.button({ }, 4, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" +2%']], function() refresh() end) end),
|
||||
awful.button({ }, 5, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" -2%']], function() refresh() end) end)
|
||||
))
|
||||
|
||||
gears.timer { timeout = 2, call_now = true, autostart = true, callback = refresh }
|
||||
return w
|
||||
end
|
||||
|
||||
-- Brightness: click to toggle between night (default gamma) and day (boosted).
|
||||
function M.make_brightness()
|
||||
local OUTPUT = "HDMI-A-0"
|
||||
local DAY_CMD = "xrandr --output " .. OUTPUT .. " --set CTM \"1.1,0,0,0,1.1,0,0,0,1.1\" --gamma 1.08:1.08:1.08"
|
||||
local NIGHT_CMD = "xrandr --output " .. OUTPUT .. " --set CTM \"1,0,0,0,1,0,0,0,1\" --gamma 1.0:1.0:1.0"
|
||||
|
||||
local w = wibox.widget.textbox()
|
||||
local is_day = true
|
||||
|
||||
local function render()
|
||||
local icon = is_day and " " or " "
|
||||
|
||||
w.markup = string.format(
|
||||
"<span font_family='JetBrainsMono Nerd Font' foreground='%s' font_size='large'>%s</span>",
|
||||
colors.white, icon
|
||||
)
|
||||
end
|
||||
|
||||
local function apply(day)
|
||||
local cmd = day and DAY_CMD or NIGHT_CMD
|
||||
awful.spawn.easy_async_with_shell(cmd, function()
|
||||
is_day = day
|
||||
render()
|
||||
end)
|
||||
end
|
||||
|
||||
w:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() apply(not is_day) end)
|
||||
))
|
||||
|
||||
apply(true)
|
||||
return w
|
||||
end
|
||||
|
||||
return M
|
||||
+435
-18
@@ -1,13 +1,21 @@
|
||||
pcall(require, "luarocks.loader")
|
||||
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local naughty = require("naughty")
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
local menubar = require("menubar")
|
||||
|
||||
require("awful.autofocus")
|
||||
local naughty = require("naughty")
|
||||
local bling = require("bling")
|
||||
|
||||
-- Pick a random image from the folder on start/reload
|
||||
awful.spawn.with_shell("feh --bg-fill --randomize /home/jason/Pictures/Wallpapers/")
|
||||
|
||||
-- Global config
|
||||
modkey = "Mod4" -- Alt. Use "Mod4" for the Super/Windows key.
|
||||
-- Alt. Use "Mod4" for the Super/Windows key.
|
||||
modkey = "Mod4"
|
||||
terminal = "alacritty"
|
||||
editor = os.getenv("EDITOR") or "nano"
|
||||
|
||||
@@ -36,17 +44,426 @@ do
|
||||
end)
|
||||
end
|
||||
|
||||
-- Modules (order matters: theme before bar, keys before rules)
|
||||
require("config.theme")
|
||||
local keys = require("config.keys")
|
||||
require("config.bar").setup()
|
||||
root.keys(keys.globalkeys)
|
||||
awful.rules.rules = require("config.rules")
|
||||
require("config.signals")
|
||||
|
||||
-- Wallpaper
|
||||
bling.module.wallpaper.setup {
|
||||
wallpaper = { "/home/jason/Pictures/Wallpapers/shop.jpg" },
|
||||
position = "fit",
|
||||
background = "#181818",
|
||||
-- ================================================
|
||||
-- THEME
|
||||
-- ================================================
|
||||
local colors = {
|
||||
background = "#111111",
|
||||
background_alt = "#1a1a1a",
|
||||
foreground = "#dcd7ba", -- kanagawa foreground
|
||||
accent = "#6a9589", -- black (bright) - muted gray, same role as old #6e6e6e
|
||||
accent_alt = "#7fb4ca", -- blue (normal) - crystalBlue
|
||||
red = "#e82424", -- red (bright) - samuraiRed, vivid
|
||||
green = "#98bb6c", -- green (bright) - springGreen
|
||||
yellow = "#e6c384", -- yellow (bright) - carpYellow
|
||||
disabled = "#6a9589", -- cyan (normal) - muted, low-contrast
|
||||
white = "#ffffff", -- white (normal) - dimmer than foreground
|
||||
}
|
||||
|
||||
|
||||
beautiful.wallpaper = nil
|
||||
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||
|
||||
beautiful.useless_gap = 8
|
||||
beautiful.gap_single_client = true
|
||||
beautiful.font = "JetBrainsMono Nerd Font 11"
|
||||
beautiful.border_width = 4
|
||||
beautiful.border_normal = colors.background_alt
|
||||
beautiful.border_focus = colors.accent
|
||||
|
||||
beautiful.taglist_bg_focus = colors.accent
|
||||
beautiful.taglist_fg_focus = colors.background
|
||||
beautiful.taglist_fg_occupied = colors.accent
|
||||
beautiful.taglist_bg_occupied = colors.background
|
||||
beautiful.taglist_fg_empty = colors.white
|
||||
beautiful.taglist_bg_empty = colors.background
|
||||
beautiful.taglist_bg_urgent = colors.red
|
||||
beautiful.taglist_fg_urgent = colors.background
|
||||
|
||||
beautiful.bg_systray = colors.background
|
||||
beautiful.systray_icon_spacing = 4
|
||||
|
||||
-- Notifications, styled to match the wibar/client theme
|
||||
naughty.config.defaults.position = "top_right"
|
||||
naughty.config.defaults.timeout = 5
|
||||
naughty.config.padding = 12
|
||||
naughty.config.defaults.margin = 12
|
||||
naughty.config.defaults.spacing = 8
|
||||
naughty.config.defaults.icon_size = 48
|
||||
naughty.config.defaults.border_width = 3
|
||||
naughty.config.defaults.font = "JetBrainsMono Nerd Font 12"
|
||||
naughty.config.defaults.shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 13) end
|
||||
|
||||
naughty.config.presets.normal = {
|
||||
bg = colors.background, fg = colors.foreground, border_color = colors.accent,
|
||||
border_width = 3, font = "JetBrainsMono Nerd Font 12", timeout = 5,
|
||||
}
|
||||
naughty.config.presets.low = naughty.config.presets.normal
|
||||
naughty.config.presets.critical = {
|
||||
bg = colors.background, fg = colors.red, border_color = colors.red,
|
||||
border_width = 3, font = "JetBrainsMono Nerd Font 12", timeout = 0, -- stays until dismissed
|
||||
}
|
||||
|
||||
-- ================================================
|
||||
-- WIDGETS
|
||||
-- ================================================
|
||||
local widgets = {}
|
||||
|
||||
-- "ICON value" with ICON tinted accent, like polybar's *-prefix-foreground.
|
||||
function widgets.label(icon, val)
|
||||
return string.format("<span foreground='%s'>%s</span> %s", colors.white, icon, val or "")
|
||||
end
|
||||
|
||||
-- A slim separator in the disabled color, like polybar's separator.
|
||||
function widgets.sep()
|
||||
local w = wibox.widget.textbox()
|
||||
w.markup = string.format("<span foreground='%s00'> </span>", colors.disabled)
|
||||
return w
|
||||
end
|
||||
|
||||
-- Wrap a widget in a small margin so bar modules aren't crammed together.
|
||||
function widgets.padded(w, left, right)
|
||||
return wibox.container.margin(w, left or 8, right or 8)
|
||||
end
|
||||
|
||||
-- Focused window title (polybar xwindow / %title%)
|
||||
function widgets.make_title()
|
||||
local t = wibox.widget.textbox()
|
||||
local function update()
|
||||
local c = client.focus
|
||||
t.markup = c and string.format("<span foreground='%s'>%s</span>", colors.white, gears.string.xml_escape(c.name or "")) or ""
|
||||
end
|
||||
client.connect_signal("focus", update)
|
||||
client.connect_signal("unfocus", update)
|
||||
client.connect_signal("property::name", update)
|
||||
return t
|
||||
end
|
||||
|
||||
-- CPU usage % (two top samples so the reading is accurate)
|
||||
function widgets.make_cpu()
|
||||
return awful.widget.watch(
|
||||
{ "bash", "-c", [[LANG=C top -bn2 -d0.3 | grep -m2 '^%Cpu' | tail -1 | awk '{printf "%.0f", 100 - $8}']] },
|
||||
3, function(w, out) w.markup = widgets.label("<span font_size='large'> </span>", out:gsub("%s+$", "") .. "%") end)
|
||||
end
|
||||
|
||||
-- Volume: click to mute, scroll to adjust, right-click for the mixer.
|
||||
-- Keeps its own refresh() so button presses update instantly instead of
|
||||
-- waiting on the polling timer.
|
||||
function widgets.make_vol()
|
||||
local w = wibox.widget.textbox()
|
||||
|
||||
local vol_script = [[
|
||||
sink=$(LANG=C pactl get-default-sink 2>/dev/null)
|
||||
m=$(LANG=C pactl get-sink-mute "$sink" 2>/dev/null | grep -oE 'yes|no')
|
||||
v=$(LANG=C pactl get-sink-volume "$sink" 2>/dev/null | grep -oE '[0-9]+%' | head -n1)
|
||||
echo "$m $v"
|
||||
]]
|
||||
local function shell_quote(s) return "'" .. s:gsub("'", "'\\''") .. "'" end
|
||||
local vol_cmd = "sh -c " .. shell_quote(vol_script)
|
||||
|
||||
local function refresh()
|
||||
awful.spawn.easy_async_with_shell(vol_cmd, function(out)
|
||||
local muted, pct = out:match("(%a+)%s+(%d+)%%")
|
||||
if muted == nil and pct == nil then
|
||||
w.markup = string.format("<span foreground='%s'><span font_size='large'></span> n/a</span>", colors.disabled)
|
||||
return
|
||||
end
|
||||
muted = muted == "yes"
|
||||
pct = pct or "0"
|
||||
w.markup = muted and string.format("<span foreground='%s'>MUTE</span>", colors.yellow) or widgets.label("<span font_size='large'></span>", pct .. "%")
|
||||
end)
|
||||
end
|
||||
|
||||
w:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() awful.spawn("/home/jason/.local/bin/audioswitch") end),
|
||||
awful.button({ }, 3, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']], function() refresh() end) end),
|
||||
awful.button({ }, 4, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" +2%']], function() refresh() end) end),
|
||||
awful.button({ }, 5, function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" -2%']], function() refresh() end) end)
|
||||
))
|
||||
|
||||
gears.timer { timeout = 2, call_now = true, autostart = true, callback = refresh }
|
||||
return w
|
||||
end
|
||||
|
||||
-- Brightness: click to toggle between night (default gamma) and day (boosted).
|
||||
function widgets.make_brightness()
|
||||
local OUTPUT = "HDMI-A-0"
|
||||
local DAY_CMD = "xrandr --output " .. OUTPUT .. " --set CTM \"1.1,0,0,0,1.1,0,0,0,1.1\" --gamma 1.08:1.08:1.08"
|
||||
local NIGHT_CMD = "xrandr --output " .. OUTPUT .. " --set CTM \"1,0,0,0,1,0,0,0,1\" --gamma 1.0:1.0:1.0"
|
||||
|
||||
local w = wibox.widget.textbox()
|
||||
local is_day = true
|
||||
|
||||
local function render()
|
||||
local icon = is_day and " " or " "
|
||||
|
||||
w.markup = string.format(
|
||||
"<span font_family='JetBrainsMono Nerd Font' foreground='%s' font_size='large'>%s</span>",
|
||||
colors.white, icon
|
||||
)
|
||||
end
|
||||
|
||||
local function apply(day)
|
||||
local cmd = day and DAY_CMD or NIGHT_CMD
|
||||
awful.spawn.easy_async_with_shell(cmd, function()
|
||||
is_day = day
|
||||
render()
|
||||
end)
|
||||
end
|
||||
|
||||
w:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() apply(not is_day) end)
|
||||
))
|
||||
|
||||
apply(true)
|
||||
return w
|
||||
end
|
||||
|
||||
-- ================================================
|
||||
-- KEYBINDS
|
||||
-- ================================================
|
||||
local keys = {}
|
||||
|
||||
keys.globalkeys = gears.table.join(
|
||||
awful.key({ modkey }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
|
||||
|
||||
-- Directional focus (vim keys)
|
||||
awful.key({ modkey }, "h", function() awful.client.focus.bydirection("left") end, { description = "focus left", group = "client" }),
|
||||
awful.key({ modkey }, "j", function() awful.client.focus.bydirection("down") end, { description = "focus down", group = "client" }),
|
||||
awful.key({ modkey }, "k", function() awful.client.focus.bydirection("up") end, { description = "focus up", group = "client" }),
|
||||
awful.key({ modkey }, "l", function() awful.client.focus.bydirection("right") end, { description = "focus right", group = "client" }),
|
||||
|
||||
-- Directional move (swap clients in the tiling layout)
|
||||
awful.key({ modkey, "Control" }, "h", function() awful.client.swap.bydirection("left") end, { description = "move left", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "j", function() awful.client.swap.bydirection("down") end, { description = "move down", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "k", function() awful.client.swap.bydirection("up") end, { description = "move up", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "l", function() awful.client.swap.bydirection("right") end, { description = "move right", group = "client" }),
|
||||
|
||||
-- Resize the master/other split
|
||||
awful.key({ modkey, "Shift" }, "h", function() awful.tag.incmwfact(-0.05) end, { description = "shrink master", group = "layout" }),
|
||||
awful.key({ modkey, "Shift" }, "l", function() awful.tag.incmwfact( 0.05) end, { description = "grow master", group = "layout" }),
|
||||
|
||||
-- Launching / layout
|
||||
awful.key({ modkey }, "Return", function() awful.spawn(terminal) end, { description = "open a terminal", group = "launcher" }),
|
||||
awful.key({ modkey }, "e", function() awful.spawn("thunar") end, { description = "Filemanager", group = "system" }),
|
||||
awful.key({ modkey }, "w", function() awful.layout.inc(1) end, { description = "next layout", group = "layout" }),
|
||||
|
||||
|
||||
-- screenshooter
|
||||
awful.key({ modkey, "Control" }, "p", function() awful.spawn("xfce4-screenshooter") end, { description = "screenshot", group = "system" }),
|
||||
|
||||
-- Alt tab current workspace windows
|
||||
awful.key({ modkey }, "Tab", function() awful.client.focus.byidx(1) end),
|
||||
|
||||
-- Media keys
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" +2%']]) end, { description = "volume up", group = "media" }),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-volume "$(pactl get-default-sink)" -2%']]) end, { description = "volume down", group = "media" }),
|
||||
awful.key({ }, "XF86AudioMute", function() awful.spawn.easy_async_with_shell([[sh -c 'pactl set-sink-mute "$(pactl get-default-sink)" toggle']]) end, { description = "toggle mute", group = "media" }),
|
||||
|
||||
-- rofi menus
|
||||
awful.key({ modkey }, "space", function() awful.spawn("/home/jason/.local/bin/runrofi") end, { description = "application launcher", group = "launcher" }),
|
||||
awful.key({ modkey }, "`", function() awful.spawn("/home/jason/.local/bin/powermenu") end, { description = "power menu", group = "system" }),
|
||||
awful.key({ modkey }, "a", function() awful.spawn("/home/jason/.local/bin/audioswitch") end, { description = "audio output", group = "system" }),
|
||||
awful.key({ modkey }, "b", function () awful.spawn("/home/jason/.local/bin/bookmarks") end, {description = "bookmarks", group = "internet"}),
|
||||
|
||||
-- Awesome control
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart, { description = "reload awesome", group = "awesome" })
|
||||
)
|
||||
|
||||
-- Workspace keys 1..5: Alt+N view, Alt+Shift+N move client to tag
|
||||
for i = 1, 5 do
|
||||
keys.globalkeys = gears.table.join(keys.globalkeys,
|
||||
awful.key({ modkey }, "#" .. i + 9, function()
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[i]
|
||||
if tag then tag:view_only() end
|
||||
end, { description = "view tag #" .. i, group = "tag" }),
|
||||
|
||||
awful.key({ modkey, "Control" }, "#" .. i + 9, function()
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[i]
|
||||
if tag then client.focus:move_to_tag(tag) end
|
||||
end
|
||||
end, { description = "move focused client to tag #" .. i, group = "tag" })
|
||||
)
|
||||
end
|
||||
|
||||
keys.clientkeys = gears.table.join(
|
||||
awful.key({ modkey }, "q", function(c) c:kill() end, { description = "kill window", group = "client" }),
|
||||
awful.key({ modkey }, "f", function(c) c.fullscreen = not c.fullscreen; c:raise() end, { description = "toggle fullscreen", group = "client" }),
|
||||
awful.key({ modkey }, "m", function(c) c:swap(awful.client.getmaster()) end, { description = "make master", group = "client" }),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle, { description = "toggle floating", group = "client" })
|
||||
)
|
||||
|
||||
keys.clientbuttons = gears.table.join(
|
||||
awful.button({ }, 1, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }) end),
|
||||
awful.button({ modkey }, 1, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }); awful.mouse.client.move(c) end),
|
||||
awful.button({ modkey }, 3, function(c) c:emit_signal("request::activate", "mouse_click", { raise = true }); awful.mouse.client.resize(c) end)
|
||||
)
|
||||
|
||||
root.keys(keys.globalkeys)
|
||||
|
||||
-- ================================================
|
||||
-- BAR
|
||||
-- ================================================
|
||||
local taglist_buttons = gears.table.join(
|
||||
awful.button({ }, 1, function(t) t:view_only() end),
|
||||
awful.button({ modkey }, 1, function(t) if client.focus then client.focus:move_to_tag(t) end end),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle)
|
||||
)
|
||||
|
||||
local function bar_setup()
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
awful.tag({ "1", "2", "3", "4", "5" }, s, awful.layout.layouts[1])
|
||||
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
s.mylayoutbox = awful.widget.layoutbox(s)
|
||||
s.mylayoutbox:buttons(gears.table.join(
|
||||
awful.button({ }, 1, function() awful.layout.inc(1) end),
|
||||
awful.button({ }, 3, function() awful.layout.inc(-1) end)
|
||||
))
|
||||
|
||||
s.mytaglist = awful.widget.taglist {
|
||||
screen = s, filter = awful.widget.taglist.filter.all, buttons = taglist_buttons,
|
||||
style = { shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 4) end },
|
||||
layout = { spacing = 4, layout = wibox.layout.fixed.horizontal },
|
||||
widget_template = {
|
||||
{ { id = "text_role", widget = wibox.widget.textbox }, left = 10, right = 10, top = 4, bottom = 4, widget = wibox.container.margin },
|
||||
id = "background_role", widget = wibox.container.background,
|
||||
},
|
||||
}
|
||||
|
||||
-- Per-screen monitor widgets (created here so multi-monitor stays valid)
|
||||
local title = widgets.make_title()
|
||||
local vol = widgets.make_vol()
|
||||
local cpu = widgets.make_cpu()
|
||||
local brightness = widgets.make_brightness()
|
||||
local clock = wibox.widget.textclock("%Y-%m-%d %H:%M")
|
||||
|
||||
local right = wibox.layout.fixed.horizontal()
|
||||
local function push(w) right:add(widgets.padded(w, 4, 4)) end
|
||||
push(wibox.widget.systray()); right:add(widgets.sep())
|
||||
push(vol); right:add(widgets.sep())
|
||||
push(cpu); right:add(widgets.sep())
|
||||
push(clock);
|
||||
push(brightness);
|
||||
push(s.mylayoutbox)
|
||||
|
||||
s.mywibox = awful.wibar {
|
||||
position = "top", screen = s, height = 45, bg = colors.background, fg = colors.white,
|
||||
shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, 0) end,
|
||||
}
|
||||
|
||||
s.mywibox:setup {
|
||||
layout = wibox.container.margin, left = 8, right = 8, top = 10, bottom = 10,
|
||||
{
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left: workspaces + focused window title
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
widgets.padded(s.mytaglist, 8, 4), s.mypromptbox,
|
||||
{ title, left = 18, widget = wibox.container.margin },
|
||||
},
|
||||
nil, -- empty center
|
||||
widgets.padded(right, 4, 12),
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
-- Overlay for rofi launchers
|
||||
local dim_overlay = wibox({
|
||||
visible = false,
|
||||
ontop = true,
|
||||
type = "splash",
|
||||
bg = "#00000099",
|
||||
})
|
||||
dim_overlay.name = "awesome_dim_overlay"
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
dim_overlay.screen = s -- adjust if you want it per-screen vs spanning all
|
||||
end)
|
||||
|
||||
-- span the primary screen's geometry (or loop over all screens if you use a multi-monitor dim)
|
||||
local function update_dim_geometry()
|
||||
local geo = screen.primary.geometry
|
||||
dim_overlay:geometry(geo)
|
||||
end
|
||||
update_dim_geometry()
|
||||
screen.connect_signal("property::geometry", update_dim_geometry)
|
||||
|
||||
-- expose functions over awesome-client
|
||||
_G.show_dim = function() dim_overlay.visible = true end
|
||||
_G.hide_dim = function() dim_overlay.visible = false end
|
||||
|
||||
-- Prime the window so X/picom register its type before first real use,
|
||||
-- avoiding a one-time grow animation on the very first show_dim() call
|
||||
dim_overlay.visible = true
|
||||
gears.timer.delayed_call(function()
|
||||
dim_overlay.visible = false
|
||||
end)
|
||||
end
|
||||
|
||||
bar_setup()
|
||||
|
||||
-- ================================================
|
||||
-- WINDOW RULES
|
||||
-- ================================================
|
||||
awful.rules.rules = {
|
||||
{
|
||||
rule = { },
|
||||
properties = {
|
||||
border_width = beautiful.border_width, border_color = beautiful.border_normal,
|
||||
focus = awful.client.focus.filter, raise = true,
|
||||
keys = keys.clientkeys, buttons = keys.clientbuttons,
|
||||
screen = awful.screen.preferred,
|
||||
placement = awful.placement.no_overlap + awful.placement.no_offscreen,
|
||||
}
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
instance = { "pinentry" },
|
||||
class = { "Arandr", "Blueman-manager", "Gpick", "Pavucontrol" },
|
||||
name = { "Event Tester" },
|
||||
role = { "AlarmWindow", "pop-up" },
|
||||
},
|
||||
properties = { floating = true }
|
||||
},
|
||||
{
|
||||
rule = { name = "Sublime Terminal", },
|
||||
properties = { floating = false, },
|
||||
callback = function(c)
|
||||
awful.client.setslave(c)
|
||||
|
||||
local t = c.first_tag
|
||||
if t then
|
||||
t.master_width_factor = 0.67
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- ================================================
|
||||
-- SIGNALS
|
||||
-- ================================================
|
||||
client.connect_signal("manage", function(c)
|
||||
if awesome.startup and not c.size_hints.user_position and not c.size_hints.program_position then
|
||||
awful.placement.no_offscreen(c)
|
||||
end
|
||||
-- New windows open into the stack (to the right); first window becomes master.
|
||||
if not awesome.startup then awful.client.setslave(c) end
|
||||
-- 0 or ie 13 = corner radius
|
||||
c.shape = function(cr, width, height) gears.shape.rounded_rect(cr, width, height, 0) end
|
||||
end)
|
||||
|
||||
client.connect_signal("property::floating", function(c)
|
||||
if c.floating and c.type ~= "notification" then awful.placement.centered(c, { honor_workarea = true }) end
|
||||
end)
|
||||
|
||||
client.connect_signal("manage", function(c)
|
||||
if c.floating and c.type ~= "notification" then awful.placement.centered(c, { honor_workarea = true }) end
|
||||
end)
|
||||
|
||||
-- Focus follows mouse (i3-like). Comment out for click-to-focus only.
|
||||
client.connect_signal("mouse::enter", function(c) c:emit_signal("request::activate", "mouse_enter", { raise = false }) end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
# ==============================================================================
|
||||
# ENVIRONMENT VARIABLES
|
||||
# ==============================================================================
|
||||
|
||||
export XDG_CONFIG_HOME="$HOME/.config"
|
||||
export XDG_DATA_HOME="$HOME/.local/share"
|
||||
export XDG_CACHE_HOME="$HOME/.cache"
|
||||
export XDG_STATE_HOME="$HOME/.local/state"
|
||||
export GOOGLE_API_KEY="no"
|
||||
export GOOGLE_DEFAULT_CLIENT_ID="no"
|
||||
export GOOGLE_DEFAULT_CLIENT_SECRET="no"
|
||||
|
||||
# Core settings
|
||||
export EDITOR="nvim"
|
||||
export VISUAL="nvim"
|
||||
export MANPAGER="nvim +Man!"
|
||||
export BROWSER="firefox"
|
||||
# export TERM=xterm-256color
|
||||
export COLORTERM="truecolor"
|
||||
export LANG="en_US.UTF-8"
|
||||
export LC_ALL="en_US.UTF-8"
|
||||
|
||||
# Development
|
||||
export DEBUG=1
|
||||
export GOPATH="$HOME/.go"
|
||||
export GOCACHE="$HOME/.go/cache"
|
||||
export GOROOT=/usr/local/go
|
||||
export PATH="/usr/local/go/bin:$GOPATH/bin:$PATH"
|
||||
|
||||
# Direnv
|
||||
eval "$(direnv hook bash)"
|
||||
|
||||
# ==============================================================================
|
||||
# FZF configuration
|
||||
# ==============================================================================
|
||||
export FZF_DEFAULT_OPTS="
|
||||
--height 40%
|
||||
--layout=reverse
|
||||
--border
|
||||
--ansi
|
||||
--preview-window=down:30%
|
||||
--bind 'ctrl-d:preview-page-down,ctrl-u:preview-page-up'
|
||||
--color=fg:#ffffff,header:#f38ba8,info:#cba6ac,pointer:#f5e0dc
|
||||
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6ac,hl+:#f38ba8"
|
||||
|
||||
export FZF_DEFAULT_COMMAND='fdfind --exclude={.git,.cache,.xmake,.zig-cache,build,tmp,node_modules,elpa} --type f -H'
|
||||
|
||||
# ==============================================================================
|
||||
# PATH CONFIGURATION
|
||||
# ==============================================================================
|
||||
# bash has no fish_add_path (which dedupes + checks existence), so roll a
|
||||
# small helper that does the same thing.
|
||||
add_to_path() {
|
||||
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then
|
||||
PATH="$1:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
add_to_path /var/lib/flatpak/exports/bin
|
||||
add_to_path /usr/local/bin
|
||||
add_to_path /usr/local/go/bin
|
||||
add_to_path "$GOPATH/bin"
|
||||
add_to_path "$HOME/bin"
|
||||
add_to_path "$HOME/.local/bin"
|
||||
add_to_path "$HOME/.local/share/flatpak/exports/bin"
|
||||
add_to_path "$HOME/.npm-global/bin"
|
||||
add_to_path "$HOME/.odin/"
|
||||
|
||||
export PATH
|
||||
|
||||
# ==============================================================================
|
||||
# ALIASES
|
||||
# ==============================================================================
|
||||
# List commands
|
||||
alias ls='ls -lh --color=auto --group-directories-first'
|
||||
alias ll='ls -lAh --color=auto --group-directories-first'
|
||||
alias la='ls -la --color=auto --group-directories-first'
|
||||
alias l='ls -CF --color=auto'
|
||||
alias tree='tree --dirsfirst -C'
|
||||
|
||||
# Safety aliases
|
||||
alias rm='rm -I --preserve-root'
|
||||
alias mv='mv -i'
|
||||
alias cp='cp -i'
|
||||
alias ln='ln -i'
|
||||
|
||||
# System information
|
||||
alias df='df -h'
|
||||
alias du='du -h'
|
||||
alias free='free -h'
|
||||
alias bat='bat --theme="ansi" --paging=never'
|
||||
|
||||
# Application shortcuts
|
||||
alias vi='nvim'
|
||||
alias :q='exit'
|
||||
alias files='thunar .'
|
||||
alias fetch='pfetch'
|
||||
|
||||
# Custom shortcuts
|
||||
alias reload='source ~/.bashrc'
|
||||
alias dots='cd ~/.dotfiles && nvim'
|
||||
alias doti='bash ~/.dotfiles/install.sh -i'
|
||||
alias dotl='bash ~/.dotfiles/install.sh -l'
|
||||
alias myip='curl ipinfo.io/ip; echo ""'
|
||||
alias query='xbps-query -Rs'
|
||||
alias commits='git log origin/main..HEAD --oneline'
|
||||
|
||||
## Basic project picker using fzf
|
||||
pp() {
|
||||
local project
|
||||
project=$(
|
||||
find ~/Projects -mindepth 1 -maxdepth 1 -type d |
|
||||
awk -F/ '{print $NF "\t" $0}' |
|
||||
fzf --with-nth=1
|
||||
)
|
||||
|
||||
[ -z "$project" ] && return
|
||||
|
||||
project=$(echo "$project" | cut -f2)
|
||||
cd "$project" && clear
|
||||
}
|
||||
|
||||
# ==============================================================================
|
||||
# PROMPT
|
||||
# ==============================================================================
|
||||
# bash has no built-in __fish_git_prompt_* equivalent, so we write a small
|
||||
# git-branch function and build PS1 by hand.
|
||||
|
||||
parse_git_branch() {
|
||||
git branch 2>/dev/null | sed -n '/\* /s///p'
|
||||
}
|
||||
|
||||
git_prompt_info() {
|
||||
local branch
|
||||
branch=$(parse_git_branch)
|
||||
[ -z "$branch" ] && return
|
||||
|
||||
local esc=$'\033'
|
||||
local status marker
|
||||
status=$(git status --porcelain 2>/dev/null)
|
||||
|
||||
if [ -n "$status" ]; then
|
||||
if echo "$status" | grep -q '^[MADRC]'; then
|
||||
marker=" ${esc}[33m●${esc}[0m " # staged - yellow ●
|
||||
elif echo "$status" | grep -q '^??'; then
|
||||
marker="" # untracked - no char
|
||||
else
|
||||
marker=" ${esc}[31m+${esc}[0m " # dirty - red +
|
||||
fi
|
||||
else
|
||||
marker=" ${esc}[1;32m${esc}[0m " # clean - green
|
||||
fi
|
||||
|
||||
echo " ${esc}[1;35m(${branch})${esc}[0m${marker}"
|
||||
}
|
||||
|
||||
PS1='\[\033[32m\]\u\[\033[0m\]@\[\033[34m\]\h\[\033[0m\]:\[\033[36m\]\w\[\033[0m\]$(git_prompt_info)\$ '
|
||||
@@ -1,137 +0,0 @@
|
||||
# ==============================================================================
|
||||
# ENVIRONMENT VARIABLES
|
||||
# ==============================================================================
|
||||
# Disable fish greeting
|
||||
set -g fish_greeting
|
||||
set -g fish_prompt_pwd_dir_length 999
|
||||
|
||||
set -gx XDG_CONFIG_HOME $HOME/.config
|
||||
set -gx XDG_DATA_HOME $HOME/.local/share
|
||||
set -gx XDG_CACHE_HOME $HOME/.cache
|
||||
set -gx XDG_STATE_HOME $HOME/.local/state
|
||||
set -gx GOOGLE_API_KEY "no"
|
||||
set -gx GOOGLE_DEFAULT_CLIENT_ID "no"
|
||||
set -gx GOOGLE_DEFAULT_CLIENT_SECRET "no"
|
||||
|
||||
# Core settings
|
||||
set -gx EDITOR "nvim"
|
||||
set -gx VISUAL "nvim"
|
||||
set -gx MANPAGER "nvim +Man!"
|
||||
set -gx BROWSER firefox
|
||||
# set -gx TERM xterm-256color
|
||||
set -gx COLORTERM truecolor
|
||||
set -gx LANG "en_US.UTF-8"
|
||||
set -gx LC_ALL "en_US.UTF-8"
|
||||
|
||||
# Development
|
||||
set -gx DEBUG 1
|
||||
set -gx GOPATH "$HOME/.go"
|
||||
set -gx GOCACHE "$HOME/.go/cache"
|
||||
set -gx GOROOT /usr/local/go
|
||||
set -gx PATH /usr/local/go/bin $GOPATH/bin $PATH
|
||||
|
||||
# Direnv
|
||||
direnv hook fish | source
|
||||
|
||||
# ==============================================================================
|
||||
# FZF configuration
|
||||
# ==============================================================================
|
||||
set -gx FZF_DEFAULT_OPTS "
|
||||
--height 40%
|
||||
--layout=reverse
|
||||
--border
|
||||
--ansi
|
||||
--preview-window=down:30%
|
||||
--bind 'ctrl-d:preview-page-down,ctrl-u:preview-page-up'
|
||||
--color=fg:#ffffff,header:#f38ba8,info:#cba6ac,pointer:#f5e0dc
|
||||
--color=marker:#f5e0dc,fg+:#cdd6f4,prompt:#cba6ac,hl+:#f38ba8"
|
||||
|
||||
set -gx FZF_DEFAULT_COMMAND 'fdfind --exclude={.git,.cache,.xmake,.zig-cache,build,tmp,node_modules,elpa} --type f -H'
|
||||
|
||||
# ==============================================================================
|
||||
# PATH CONFIGURATION
|
||||
# ==============================================================================
|
||||
# Fish's 'fish_add_path' is smart: it checks if the dir exists and prevents duplicates.
|
||||
fish_add_path /var/lib/flatpak/exports/bin
|
||||
fish_add_path /usr/local/bin
|
||||
fish_add_path /usr/local/go/bin
|
||||
fish_add_path $GOPATH/bin
|
||||
fish_add_path "$HOME/bin"
|
||||
fish_add_path "$HOME/.local/bin"
|
||||
fish_add_path "$HOME/.local/share/flatpak/exports/bin"
|
||||
fish_add_path "$HOME/.npm-global/bin"
|
||||
fish_add_path "$HOME/.odin/"
|
||||
|
||||
# ==============================================================================
|
||||
# ALIASES & ABBREVIATIONS
|
||||
# ==============================================================================
|
||||
# List commands
|
||||
alias ls='ls -lh --color=auto --group-directories-first'
|
||||
alias ll='ls -lAh --color=auto --group-directories-first'
|
||||
alias la='ls -la --color=auto --group-directories-first'
|
||||
alias l='ls -CF --color=auto'
|
||||
alias tree='tree --dirsfirst -C'
|
||||
|
||||
# Safety aliases
|
||||
alias rm='rm -I --preserve-root'
|
||||
alias mv='mv -i'
|
||||
alias cp='cp -i'
|
||||
alias ln='ln -i'
|
||||
|
||||
# System information
|
||||
alias df='df -h'
|
||||
alias du='du -h'
|
||||
alias free='free -h'
|
||||
alias bat='bat --theme="ansi" --paging=never'
|
||||
|
||||
# Application shortcuts
|
||||
alias vi='nvim'
|
||||
alias :q='exit'
|
||||
alias lg='lazygit'
|
||||
alias files='thunar .'
|
||||
alias fetch='pfetch'
|
||||
|
||||
# Custom shortcuts
|
||||
alias reload='source ~/.config/fish/config.fish'
|
||||
alias dots='cd ~/.dotfiles && nvim'
|
||||
alias doti='bash ~/.dotfiles/install.sh -i'
|
||||
alias dotl='bash ~/.dotfiles/install.sh -l'
|
||||
alias myip='curl ipinfo.io/ip; echo ""'
|
||||
alias query='xbps-query -Rs'
|
||||
alias commits='git log origin/main..HEAD --oneline'
|
||||
|
||||
|
||||
## Basic project picker using mini sessions and neovim
|
||||
function pp
|
||||
set project (
|
||||
find ~/Projects -mindepth 1 -maxdepth 1 -type d |
|
||||
awk -F/ '{print $NF "\t" $0}' |
|
||||
fzf --with-nth=1
|
||||
)
|
||||
|
||||
if test -z "$project"
|
||||
return
|
||||
end
|
||||
|
||||
set project (echo $project | cut -f2)
|
||||
cd $project && clear
|
||||
end
|
||||
|
||||
# ==============================================================================
|
||||
# PROMPT COLORS
|
||||
# ==============================================================================
|
||||
set -l user_color (set_color green)
|
||||
set -l host_color (set_color blue)
|
||||
set -l path_color (set_color cyan)
|
||||
|
||||
# Fish's built-in git prompt configuration
|
||||
set -eg ___fish_git_prompt_char_stateseparator
|
||||
set -g __fish_git_prompt_show_informative_status 1
|
||||
set -g __fish_git_prompt_color_branch magenta --bold
|
||||
set -g __fish_git_prompt_color_stagedstate yellow
|
||||
set -g __fish_git_prompt_color_invalidstate red
|
||||
set -g __fish_git_prompt_color_cleanstate green --bold
|
||||
set -g __fish_git_prompt_separator ' '
|
||||
set -g __fish_git_prompt_char_dirtystate '+'
|
||||
set -g __fish_git_prompt_char_stagedstate '●'
|
||||
set -g __fish_git_prompt_char_untrackedfiles ''
|
||||
@@ -50,7 +50,8 @@ entry {
|
||||
}
|
||||
/* -- List/grid toggle icons, top-right (matches screenshot) -- */
|
||||
mode-switcher {
|
||||
enabled: false; /* flip to true if you use rofi's built-in mode tabs */
|
||||
/* flip to true if you use rofis built-in mode tabs */
|
||||
enabled: false;
|
||||
}
|
||||
/* -- Results -- */
|
||||
listview {
|
||||
@@ -59,15 +60,17 @@ listview {
|
||||
spacing: 6px;
|
||||
scrollbar: false;
|
||||
background-color: transparent;
|
||||
fixed-height: true; /* box height stays locked, doesn't shrink/grow with result count */
|
||||
dynamic: false; /* don't resize dynamically as you type either */
|
||||
/* box height stays locked, doesnt shrink/grow with result count */
|
||||
fixed-height: true;
|
||||
/* dont resize dynamically as you type either */
|
||||
dynamic: false;
|
||||
}
|
||||
/*
|
||||
* Rofi tracks row state as a combination of position (normal/alternate,
|
||||
* i.e. even/odd rows for banding) and status (normal/urgent/active/selected).
|
||||
* Each combination needs its own selector or a competing @theme import
|
||||
* (if you have one elsewhere in your rofi config) can still win on states
|
||||
* this file doesn't explicitly cover. Pinning all of them here.
|
||||
* this file doesnt explicitly cover. Pinning all of them here.
|
||||
*/
|
||||
element {
|
||||
padding: 10px 12px;
|
||||
|
||||
+6
-8
@@ -83,8 +83,8 @@ if [ "$DO_LINKS" = true ]; then
|
||||
CREATED=0
|
||||
SKIPPED=0
|
||||
|
||||
link_file "$DOTFILES_DIR/config/bash/bashrc" "$HOME/.bashrc"
|
||||
link_file "$DOTFILES_DIR/config/kanata" "$HOME/.config/kanata"
|
||||
link_file "$DOTFILES_DIR/config/fish" "$HOME/.config/fish"
|
||||
link_file "$DOTFILES_DIR/config/alacritty" "$HOME/.config/alacritty"
|
||||
link_file "$DOTFILES_DIR/config/picom" "$HOME/.config/picom"
|
||||
link_file "$DOTFILES_DIR/config/awesome" "$HOME/.config/awesome"
|
||||
@@ -147,20 +147,18 @@ if [ "$DO_INSTALL" = true ]; then
|
||||
## INSTALL REQUIRED PACKAGES
|
||||
# -----------------------------------------------------------------------------
|
||||
REQUIRED_PACKAGES=(
|
||||
# system
|
||||
pfetch fuse
|
||||
# network & download
|
||||
wget curl ca-certificates gnupg rsync
|
||||
# core utilities
|
||||
git unzip jq fzf tree direnv make
|
||||
# modern cli replacements
|
||||
fd ripgrep bat delta lazygit
|
||||
# shell & terminal
|
||||
fish-shell alacritty
|
||||
# modern shell and cli tools
|
||||
fish-shell alacritty fd ripgrep bat
|
||||
# build & dev tools
|
||||
base-devel valgrind tree-sitter-cli go
|
||||
# system
|
||||
pfetch fuse
|
||||
# window manager & desktop
|
||||
picom xdotool wmctrl polybar rofi kanata
|
||||
picom xdotool wmctrl rofi kanata feh
|
||||
# fonts
|
||||
noto-fonts-ttf noto-fonts-emoji
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user