channel: Move operating-system and home-environment configurations to codeberg.org/anemofilia/zero
|
@ -1,4 +1,3 @@
|
|||
(channel
|
||||
(version 0)
|
||||
(directory "modules")
|
||||
(url "https://codeberg.org/anemofilia/radix.git"))
|
||||
|
|
25
README.md
|
@ -1,29 +1,6 @@
|
|||
# GNU/Radix
|
||||
<a href="https://www.gnu.org/software/guile/">
|
||||
<img src="https://luis-felipe.gitlab.io/media/badges/gnu-guile-made.svg" alt="" />
|
||||
<br></br>
|
||||
|
||||
This repository features my [GNU Guix](https://guix.gnu.org/) configuration and custom channel.
|
||||
![awesome-1](./screenshots/awesome-1.jpg)
|
||||
![awesome-2](./screenshots/awesome-2.jpg)
|
||||
|
||||
## Here you can find (at the moment)
|
||||
### my personal configurations of
|
||||
- awesome
|
||||
- doas
|
||||
- fish
|
||||
- git
|
||||
- GNU Bash
|
||||
- GNU Emacs
|
||||
- GNU Info
|
||||
- kakoune
|
||||
- lf
|
||||
- mpv
|
||||
- newsraft
|
||||
- thinkfan
|
||||
- zathura
|
||||
|
||||
### and some (not too impressive) [guile modules](https://codeberg.org/anemofilia/radix/src/branch/main/modules/radix)
|
||||
This repository features my [GNU Guix](https://guix.gnu.org/) channel. (Most packages and services here are, at least intended, to be upstreamed.)
|
||||
|
||||
## Usage
|
||||
To update Radix along with Guix via guix pull, write the following definition to ~/.config/guix/channels.scm,
|
||||
|
|
|
@ -1,900 +0,0 @@
|
|||
-- 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")
|
||||
|
||||
-- @DOC_REQUIRE_SECTION@
|
||||
-- Standard awesome library
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
require("awful.autofocus")
|
||||
require("collision")()
|
||||
|
||||
-- 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 menubar = require("menubar")
|
||||
local hotkeys_popup = require("awful.hotkeys_popup")
|
||||
|
||||
-- Freedesktop
|
||||
local freedesktop = require("freedesktop")
|
||||
|
||||
-- Lain utils
|
||||
local lain = require("lain")
|
||||
|
||||
-- DPI
|
||||
local dpi = require("beautiful.xresources").apply_dpi
|
||||
|
||||
-- Table
|
||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||
|
||||
-- Enable hotkeys help widget for VIM and other apps
|
||||
-- when client with a matching name is opened:
|
||||
-- require("awful.hotkeys_popup.keys")
|
||||
|
||||
-- {{{ 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)
|
||||
-- @DOC_ERROR_HANDLING@
|
||||
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
|
||||
-- @DOC_LOAD_THEME@
|
||||
-- Themes define colours, icons, font and wallpapers.
|
||||
beautiful.init(gears.filesystem.get_dir("config").."/themes/current.lua")
|
||||
local theme = beautiful.get()
|
||||
|
||||
-- @DOC_DEFAULT_APPLICATIONS@
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
terminal = os.getenv("TERMINAL")
|
||||
editor = os.getenv("EDITOR")
|
||||
browser = os.getenv("BROWSER")
|
||||
editor_cmd = terminal.." -e "..editor
|
||||
file_manager = terminal.." -g 137x31-320+16 -c Lf -e /home/radio/.local/bin/lf/lfrun"
|
||||
irc_client = terminal.." -g 137x31-320+16 -c Weechat -e weechat"
|
||||
rss_reader = terminal.." -g 137x31-320+16 -e newsraft"
|
||||
music_player = terminal.." -g 137x31-320+16 -e ncmpcpp"
|
||||
link_handler = "dmenu_link"
|
||||
|
||||
-- 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"
|
||||
altkey = "Mod1"
|
||||
-- }}}
|
||||
|
||||
-- {{{ Menu
|
||||
-- @DOC_MENU@
|
||||
-- Create a launcher widget and a main menu
|
||||
myawesomemenu = {
|
||||
{ "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end },
|
||||
{ "manual", terminal .. " -e man awesome" },
|
||||
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||
{ "restart", awesome.restart },
|
||||
{ "quit", function() awesome.quit() end },
|
||||
}
|
||||
|
||||
mymainmenu = freedesktop.menu.build {
|
||||
before = {
|
||||
{ "awesome", myawesomemenu },
|
||||
-- other triads can be put here
|
||||
},
|
||||
after = {
|
||||
{ "open terminal", terminal },
|
||||
-- other triads can be put here
|
||||
}
|
||||
}
|
||||
|
||||
mylauncher = awful.widget.launcher({
|
||||
image = beautiful.awesome_icon,
|
||||
menu = mymainmenu
|
||||
})
|
||||
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = terminal
|
||||
-- }}}
|
||||
|
||||
-- {{{ Tag layout
|
||||
-- @DOC_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.tile,
|
||||
awful.layout.suit.tile.bottom,
|
||||
awful.layout.suit.max,
|
||||
})
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Wallpaper
|
||||
-- @DOC_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)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Wibar
|
||||
local markup = lain.util.markup
|
||||
local separators = lain.util.separators
|
||||
|
||||
-- Keyboard map indicator and switcher
|
||||
mykeyboardlayout = awful.widget.keyboardlayout()
|
||||
|
||||
-- Create a textclock widget
|
||||
mytextclock = wibox.widget.textclock()
|
||||
|
||||
local clock = awful.widget.watch(
|
||||
"date +'%a %d %b %R'", 60,
|
||||
function(widget, stdout)
|
||||
widget:set_markup(" " .. markup.font(beautiful.font, stdout))
|
||||
end
|
||||
)
|
||||
|
||||
-- Calendar
|
||||
beautiful.cal = lain.widget.cal({
|
||||
icons = "",
|
||||
attach_to = { clock },
|
||||
notification_preset = {
|
||||
font = beautiful.font,
|
||||
fg = beautiful.fg_normal,
|
||||
bg = beautiful.bg_normal
|
||||
}
|
||||
})
|
||||
|
||||
-- MPD
|
||||
local musicplr = terminal .. " -title Music -g 137x31-320+16 -e ncmpcpp"
|
||||
local mpdicon = wibox.widget.imagebox(beautiful.widget_music)
|
||||
mpdicon:buttons(my_table.join(
|
||||
awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end),
|
||||
awful.button({ }, 1, function ()
|
||||
os.execute("mpc prev")
|
||||
beautiful.mpd.update()
|
||||
end),
|
||||
awful.button({ }, 2, function ()
|
||||
os.execute("mpc toggle")
|
||||
beautiful.mpd.update()
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
os.execute("mpc next")
|
||||
beautiful.mpd.update()
|
||||
end)))
|
||||
beautiful.mpd = lain.widget.mpd({
|
||||
settings = function()
|
||||
if mpd_now.state == "play" then
|
||||
artist = mpd_now.artist .. " "
|
||||
title = mpd_now.title .. " "
|
||||
mpdicon:set_image(beautiful.widget_music_on)
|
||||
elseif mpd_now.state == "pause" then
|
||||
artist = "mpd "
|
||||
title = "paused "
|
||||
else
|
||||
artist = ""
|
||||
title = ""
|
||||
mpdicon:set_image(beautiful.widget_music)
|
||||
end
|
||||
|
||||
widget:set_markup(markup.font(beautiful.font, markup("#8581E0", artist) .. title))
|
||||
end
|
||||
})
|
||||
|
||||
-- MEM
|
||||
local memicon = wibox.widget.imagebox(beautiful.widget_mem)
|
||||
local mem = lain.widget.mem({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(beautiful.font, mem_now.used .. "MB "))
|
||||
end
|
||||
})
|
||||
|
||||
-- CPU
|
||||
local cpuicon = wibox.widget.imagebox(beautiful.widget_cpu)
|
||||
local cpu = lain.widget.cpu({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(beautiful.font, cpu_now.usage .. "% "))
|
||||
end
|
||||
})
|
||||
|
||||
-- Coretemp
|
||||
local tempicon = wibox.widget.imagebox(beautiful.widget_temp)
|
||||
local temp = lain.widget.temp({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(beautiful.font, math.ceil(coretemp_now) .. "°C "))
|
||||
end
|
||||
})
|
||||
|
||||
-- Battery
|
||||
local baticon = wibox.widget.imagebox(beautiful.widget_battery)
|
||||
local bat = lain.widget.bat({
|
||||
settings = function()
|
||||
if bat_now.status and bat_now.status ~= "N/A" then
|
||||
if bat_now.ac_status == 1 then
|
||||
baticon:set_image(beautiful.widget_ac)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 25 then
|
||||
baticon:set_image(beautiful.widget_battery_20)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 45 then
|
||||
baticon:set_image(beautiful.widget_battery_40)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 65 then
|
||||
baticon:set_image(beautiful.widget_battery_60)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 85 then
|
||||
baticon:set_image(beautiful.widget_battery_80)
|
||||
else
|
||||
baticon:set_image(beautiful.widget_battery_100)
|
||||
end
|
||||
widget:set_markup(markup.font(beautiful.font, bat_now.perc .. "% "))
|
||||
else
|
||||
widget:set_markup(markup.font(beautiful.font, "AC "))
|
||||
baticon:set_image(beautiful.widget_ac)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- ALSA volume
|
||||
local volicon = wibox.widget.imagebox(beautiful.widget_vol)
|
||||
beautiful.volume = lain.widget.alsa({
|
||||
settings = function()
|
||||
if volume_now.status == "off" then
|
||||
volicon:set_image(beautiful.widget_vol_mute)
|
||||
elseif volume_now.level then
|
||||
if tonumber(volume_now.level) == 0 then
|
||||
volicon:set_image(beautiful.widget_vol_no)
|
||||
elseif tonumber(volume_now.level) <= 50 then
|
||||
volicon:set_image(beautiful.widget_vol_low)
|
||||
else
|
||||
volicon:set_image(beautiful.widget_vol)
|
||||
end
|
||||
end
|
||||
|
||||
widget:set_markup(markup.font(beautiful.font, volume_now.level .. "% "))
|
||||
end
|
||||
})
|
||||
beautiful.volume.widget:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({}, 4, function ()
|
||||
awful.util.spawn("amixer set Master 1%+")
|
||||
beautiful.volume.update()
|
||||
end),
|
||||
awful.button({}, 5, function ()
|
||||
awful.util.spawn("amixer set Master 1%-")
|
||||
beautiful.volume.update()
|
||||
end)
|
||||
))
|
||||
|
||||
-- Net
|
||||
local netdownicon = wibox.widget.imagebox(beautiful.widget_netdown)
|
||||
local netdowninfo = wibox.widget.textbox()
|
||||
local netupicon = wibox.widget.imagebox(beautiful.widget_netup)
|
||||
local netupinfo = lain.widget.net({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(beautiful.font, net_now.sent .. " "))
|
||||
netdowninfo:set_markup(markup.font(beautiful.font, net_now.received .. " "))
|
||||
end
|
||||
})
|
||||
|
||||
-- Separators
|
||||
local spr = wibox.widget.textbox(' ')
|
||||
local arrl_dl = separators.arrow_left(beautiful.bg_focus, "alpha")
|
||||
local arrl_ld = separators.arrow_left("alpha", beautiful.bg_focus)
|
||||
|
||||
-- @DOC_FOR_EACH_SCREEN@
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
-- Each screen has its own tag table.
|
||||
awful.tag({ "α", "β", "γ", "δ", "ε", "ζ", "η" }, s, awful.layout.layouts[1])
|
||||
|
||||
-- Create a promptbox for each screen
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
|
||||
-- Create an imagebox widget which will contain an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
s.mylayoutbox = awful.widget.layoutbox {
|
||||
screen = s,
|
||||
buttons = {
|
||||
awful.button({ }, 1, function () awful.layout.inc( 1) end),
|
||||
awful.button({ }, 3, function () awful.layout.inc(-1) end),
|
||||
awful.button({ }, 4, function () awful.layout.inc(-1) end),
|
||||
awful.button({ }, 5, function () awful.layout.inc( 1) end),
|
||||
}
|
||||
}
|
||||
|
||||
-- Create a taglist widget
|
||||
s.mytaglist = awful.widget.taglist {
|
||||
screen = s,
|
||||
filter = awful.widget.taglist.filter.all,
|
||||
buttons = {
|
||||
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),
|
||||
awful.button({ modkey }, 3, function(t)
|
||||
if client.focus then
|
||||
client.focus:toggle_tag(t)
|
||||
end
|
||||
end),
|
||||
}
|
||||
}
|
||||
|
||||
-- @TASKLIST_BUTTON@
|
||||
-- Create a tasklist widget
|
||||
s.mytasklist = awful.widget.tasklist {
|
||||
screen = s,
|
||||
filter = awful.widget.tasklist.filter.currenttags,
|
||||
buttons = {
|
||||
awful.button({ }, 1, function (c)
|
||||
c:activate { context = "tasklist", action = "toggle_minimization" }
|
||||
end),
|
||||
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
|
||||
awful.button({ }, 4, function() awful.client.focus.byidx(-1) end),
|
||||
awful.button({ }, 5, function() awful.client.focus.byidx( 1) end),
|
||||
}
|
||||
}
|
||||
|
||||
-- @DOC_WIBAR@
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar {
|
||||
height = dpi(19),
|
||||
position = "top",
|
||||
screen = s,
|
||||
-- @DOC_SETUP_WIDGETS@
|
||||
widget = {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
--mylauncher,
|
||||
s.mytaglist,
|
||||
s.mypromptbox,
|
||||
},
|
||||
-- Middle widget
|
||||
s.mytasklist,
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
--mykeyboardlayout,
|
||||
--wibox.widget.systray(),
|
||||
spr,
|
||||
arrl_ld,
|
||||
wibox.container.background(netdownicon, beautiful.bg_focus),
|
||||
wibox.container.background(netdowninfo, beautiful.bg_focus),
|
||||
wibox.container.background(netupicon, beautiful.bg_focus),
|
||||
wibox.container.background(netupinfo.widget, beautiful.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(memicon, beautiful.bg_normal),
|
||||
wibox.container.background(mem.widget, beautiful.bg_normal),
|
||||
arrl_ld,
|
||||
wibox.container.background(cpuicon, beautiful.bg_focus),
|
||||
wibox.container.background(cpu.widget, beautiful.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(tempicon, beautiful.bg_normal),
|
||||
wibox.container.background(temp.widget, beautiful.bg_normal),
|
||||
arrl_ld,
|
||||
wibox.container.background(volicon, beautiful.bg_focus),
|
||||
wibox.container.background(beautiful.volume.widget, beautiful.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(baticon, beautiful.bg_normal),
|
||||
wibox.container.background(bat.widget, beautiful.bg_normal),
|
||||
arrl_ld,
|
||||
wibox.container.background(clock, beautiful.bg_focus),
|
||||
wibox.container.background(spr, beautiful.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(s.mylayoutbox, beautiful.bg_normal),
|
||||
},
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- {{{ Mouse bindings
|
||||
-- @DOC_ROOT_BUTTONS@
|
||||
awful.mouse.append_global_mousebindings({
|
||||
awful.button({ }, 2, function () mymainmenu:toggle() end),
|
||||
--awful.button({ }, 4, awful.tag.viewprev),
|
||||
--awful.button({ }, 5, awful.tag.viewnext),
|
||||
})
|
||||
-- }}}
|
||||
|
||||
-- {{{ Key bindings
|
||||
-- @DOC_GLOBAL_KEYBINDINGS@
|
||||
|
||||
-- General Awesome keys
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, }, "s",
|
||||
function () hotkeys_popup.widget.new(
|
||||
{ width = 909,
|
||||
height = 0.525*awful.screen.focused().workarea.height,
|
||||
font = "Meslo LG M DZ 8",
|
||||
description_font = "Meslo LG M DZ 8"}):show_help() end,
|
||||
{description="show help", group="awesome"}),
|
||||
awful.key({ modkey, "Control" }, "r", awesome.restart,
|
||||
{description = "reload awesome", group = "awesome"}),
|
||||
awful.key({ modkey, "Control" }, "q", awesome.quit,
|
||||
{description = "quit awesome", group = "awesome"}),
|
||||
awful.key({ altkey, }, "Print", function ()
|
||||
os.execute("screenshot activewindow") end,
|
||||
{description = "print focused window", group = "launcher"}),
|
||||
awful.key({ }, "Print", function ()
|
||||
os.execute("screenshot selectregion") end,
|
||||
{description = "print selected region", group = "launcher"}),
|
||||
awful.key({ }, "XF86WebCam", function ()
|
||||
os.execute("cam") end,
|
||||
{description = "run cam", group = "launcher"}),
|
||||
awful.key({ modkey, }, "c", function ()
|
||||
awful.spawn("keepassxc") end,
|
||||
{description = "run keepassxc", group = "launcher"}),
|
||||
awful.key({ modkey, }, "a", function ()
|
||||
awful.spawn("telegram-desktop") end,
|
||||
{description = "run telegram-desktop", group = "launcher"}),
|
||||
awful.key({ modkey, }, "r", function ()
|
||||
awful.spawn.with_shell("notify-send $(rem)") end,
|
||||
{description = "run telegram-desktop", group = "launcher"}),
|
||||
awful.key({ modkey, }, "w", function ()
|
||||
awful.spawn.raise_or_spawn(irc_client) end,
|
||||
{description = "run irc client", group = "launcher"}),
|
||||
awful.key({ modkey, }, "e", function ()
|
||||
awful.spawn(editor_cmd) end,
|
||||
{description = "run editor", group = "launcher"}),
|
||||
awful.key({ modkey, }, "Down", function ()
|
||||
awful.spawn(music_player) end,
|
||||
{description = "run music player", group = "launcher"}),
|
||||
awful.key({ modkey, }, "b", function ()
|
||||
awful.spawn(browser) end,
|
||||
{description = "run browser", group = "launcher"}),
|
||||
awful.key({ modkey, }, "d", function ()
|
||||
awful.spawn(file_manager) end,
|
||||
{description = "run file manager", group = "launcher"}),
|
||||
awful.key({ }, "XF86Launch1", function ()
|
||||
awful.spawn.raise_or_spawn(rss_reader) end,
|
||||
{description = "run newsraft", group = "launcher"}),
|
||||
awful.key({"Mod4" }, "x", function ()
|
||||
os.execute("xkill") end,
|
||||
{description = "launch xkill", group = "launcher"}),
|
||||
awful.key({"Mod4" }, "z", function ()
|
||||
os.execute("anna") end,
|
||||
{description = "loot some ships", group = "launcher"}),
|
||||
awful.key({"Mod4" }, "g", function ()
|
||||
awful.spawn(terminal.." -e guix repl") end,
|
||||
{description = "run link handler", group = "launcher"}),
|
||||
awful.key({ modkey, }, "Return", function ()
|
||||
awful.spawn(terminal) end,
|
||||
{description = "run terminal", group = "launcher",}),
|
||||
awful.key({ modkey, }, ":", function ()
|
||||
awful.screen.focused().mypromptbox:run() end,
|
||||
{description = "run prompt", group = "launcher"}),
|
||||
})
|
||||
|
||||
-- Tags related keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey, }, "h", awful.tag.viewprev,
|
||||
{description = "focus previous tag", group = "tag"}),
|
||||
awful.key({ modkey, }, "l", awful.tag.viewnext,
|
||||
{description = "focus next tag", 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({ modkey, }, "j", function ()
|
||||
awful.client.focus.byidx( 1) end,
|
||||
{description = "focus previous by index", group = "client"}
|
||||
),
|
||||
awful.key({ modkey, }, "k", function ()
|
||||
awful.client.focus.byidx(-1) end,
|
||||
{description = "focus next by index", group = "client"}
|
||||
),
|
||||
awful.key({ modkey, }, "Tab", function ()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end,
|
||||
{description = "go back", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "h", function ()
|
||||
awful.screen.focus_relative( 1) end,
|
||||
{description = "focus the next screen", group = "screen"}),
|
||||
awful.key({ modkey, "Control" }, "l", function ()
|
||||
awful.screen.focus_relative(-1) end,
|
||||
{description = "focus the previous screen", group = "screen"}),
|
||||
awful.key({ modkey, "Control" }, ".", 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, }, "u", awful.client.urgent.jumpto,
|
||||
{description = "jump to urgent client", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "h", function ()
|
||||
awful.tag.incnmaster( 1, nil, true) end,
|
||||
{description = "increase the number of master clients", group = "layout"}),
|
||||
awful.key({ modkey, "Control" }, "l", function ()
|
||||
awful.tag.incnmaster(-1, nil, true) end,
|
||||
{description = "decrease the number of master clients", group = "layout"}),
|
||||
awful.key({ modkey, }, "space", function ()
|
||||
awful.layout.inc( 1) end,
|
||||
{description = "select next", group = "layout"}),
|
||||
awful.key({ modkey, "Control" }, "space", function ()
|
||||
awful.layout.inc(-1) end,
|
||||
{description = "select previous", group = "layout"}),
|
||||
})
|
||||
|
||||
-- @DOC_NUMBER_KEYBINDINGS@
|
||||
|
||||
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, "Control" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
local screen = awful.screen.focused()
|
||||
local tag = screen.tags[index]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
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,
|
||||
},
|
||||
awful.key {
|
||||
modifiers = { modkey, "Control", "Shift" },
|
||||
keygroup = "numrow",
|
||||
description = "toggle focused client on tag",
|
||||
group = "tag",
|
||||
on_press = function (index)
|
||||
if client.focus then
|
||||
local tag = client.focus.screen.tags[index]
|
||||
if tag then
|
||||
client.focus:toggle_tag(tag)
|
||||
end
|
||||
end
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Audio related keybindings
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function ()
|
||||
awful.util.spawn("amixer -q set Master 1%+", false) end,
|
||||
{description = "volume up", group = "hotkeys"}),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function ()
|
||||
awful.util.spawn("amixer -q set Master 1%-", false) end,
|
||||
{description = "volume down", group = "hotkeys"}),
|
||||
awful.key({ }, "XF86AudioMute", function ()
|
||||
awful.util.spawn("amixer -D set Master 1+ toggle", false) end,
|
||||
{description = "toggle mute", group = "hotkeys"}),
|
||||
})
|
||||
|
||||
-- MPD related keybinds
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ }, "XF86AudioPlay", function ()
|
||||
os.execute("mpc toggle")
|
||||
end,
|
||||
{description = "mpc toggle", group = "widgets"}),
|
||||
awful.key({ }, "XF86AudioStop", function ()
|
||||
os.execute("mpc stop")
|
||||
end,
|
||||
{description = "mpc stop", group = "widgets"}),
|
||||
awful.key({ }, "XF86AudioPrev", function ()
|
||||
os.execute("mpc prev")
|
||||
end,
|
||||
{description = "mpc prev", group = "widgets"}),
|
||||
awful.key({ }, "XF86AudioNext", function ()
|
||||
os.execute("mpc next")
|
||||
end,
|
||||
{description = "mpc next", group = "widgets"}),
|
||||
})
|
||||
|
||||
-- Generic hotkeys
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ "Control", }, "space", function()
|
||||
naughty.destroy_all_notifications() end,
|
||||
{description = "destroy notifications", group = "hotkeys"}),
|
||||
awful.key({ }, "XF86Sleep", function ()
|
||||
os.execute("doas zzz") end,
|
||||
{description = "Sleep", group = "hotkeys"}),
|
||||
awful.key({ }, "XF86Battery", function ()
|
||||
os.execute("i3lock -u -i /home/radio/Pictures/guix-artwork/backgrounds/guix-silver-checkered-16-9.svg") end,
|
||||
{description = "lock screen", group = "hotkeys"}),
|
||||
})
|
||||
|
||||
-- Show/hide wibox
|
||||
awful.keyboard.append_global_keybindings({
|
||||
awful.key({ modkey }, "Up", function ()
|
||||
for s in screen do
|
||||
s.mywibox.visible = not s.mywibox.visible
|
||||
end
|
||||
end,
|
||||
{description = "toggle wibox", group = "awesome"}),
|
||||
})
|
||||
|
||||
-- @DOC_CLIENT_BUTTONS@
|
||||
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)
|
||||
|
||||
-- @DOC_CLIENT_KEYBINDINGS@
|
||||
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, "Shift" }, "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, }, ".", function (c)
|
||||
c.minimized = true end ,
|
||||
{description = "minimize", group = "client"}),
|
||||
awful.key({ modkey, }, "m", lain.util.magnify_client,
|
||||
{description = "toggle magnify", group = "client"})})
|
||||
end)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- {{{ Rules
|
||||
-- Rules to apply to new clients.
|
||||
-- @DOC_RULES@
|
||||
ruled.client.connect_signal("request::rules", function()
|
||||
-- @DOC_GLOBAL_RULE@
|
||||
-- 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
|
||||
}
|
||||
}
|
||||
|
||||
-- @DOC_FLOATING_RULE@
|
||||
-- Floating clients.
|
||||
ruled.client.append_rule {
|
||||
id = "floating",
|
||||
rule_any = {
|
||||
instance = {
|
||||
"copyq",
|
||||
"pinentry"
|
||||
},
|
||||
class = {
|
||||
"Arandr",
|
||||
"TelegramDesktop",
|
||||
"KeePassXC",
|
||||
"Gpick",
|
||||
"Keepassxc",
|
||||
"Tor Browser",
|
||||
"Weechat",
|
||||
"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. Browser's (detached) Developer Tools.
|
||||
}
|
||||
},
|
||||
properties = { floating = true }
|
||||
}
|
||||
|
||||
-- Please st, respect my size hints :(
|
||||
ruled.client.append_rule {
|
||||
id = "respeitador de size hints",
|
||||
rule_any = {
|
||||
class = {"Emacs", "st-256color"},
|
||||
},
|
||||
properties = { size_hints_honor = false }
|
||||
}
|
||||
|
||||
-- @DOC_ONTOP_RULE@
|
||||
-- Ontop clients.
|
||||
ruled.client.append_rule {
|
||||
id = "ontop",
|
||||
rule_any = {
|
||||
name = { "Media viewer" },
|
||||
class = { "mpv" },
|
||||
},
|
||||
properties = { ontop = true },
|
||||
}
|
||||
|
||||
-- Establish a default size and position for telegram
|
||||
ruled.client.append_rule {
|
||||
id = "TelegramDesktop",
|
||||
rule_any = {
|
||||
class = { "TelegramDesktop" },
|
||||
},
|
||||
except_any = {
|
||||
name = { "Choose Files", "Media viewer" }
|
||||
},
|
||||
properties = {
|
||||
above = true,
|
||||
placement = awful.placement.centered,
|
||||
width = 380,
|
||||
height = awful.screen.focused().workarea.height - 4 * beautiful.useless_gap - 2
|
||||
}
|
||||
}
|
||||
|
||||
-- @DOC_DIALOG_RULE@
|
||||
-- Add titlebars to normal clients and dialogs
|
||||
ruled.client.append_rule {
|
||||
-- @DOC_CSD_TITLEBARS@
|
||||
id = "titlebars",
|
||||
rule_any = { type = { "normal", "dialog" } },
|
||||
properties = { titlebars_enabled = false }
|
||||
}
|
||||
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
-- {{{ Titlebars
|
||||
-- @DOC_TITLEBARS@
|
||||
-- Add a titlebar if titlebars_enabled is set to true in the rules.
|
||||
client.connect_signal("request::titlebars", function(c)
|
||||
-- buttons for the titlebar
|
||||
local buttons = {
|
||||
awful.button({ }, 1, function()
|
||||
c:activate { context = "titlebar", action = "mouse_move" }
|
||||
end),
|
||||
awful.button({ }, 3, function()
|
||||
c:activate { context = "titlebar", action = "mouse_resize"}
|
||||
end),
|
||||
}
|
||||
|
||||
awful.titlebar(c).widget = {
|
||||
{ -- Left
|
||||
awful.titlebar.widget.iconwidget(c),
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
},
|
||||
{ -- Middle
|
||||
{ -- Title
|
||||
halign = "center",
|
||||
widget = awful.titlebar.widget.titlewidget(c)
|
||||
},
|
||||
buttons = buttons,
|
||||
layout = wibox.layout.flex.horizontal
|
||||
},
|
||||
{ -- Right
|
||||
awful.titlebar.widget.floatingbutton (c),
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
awful.titlebar.widget.stickybutton (c),
|
||||
awful.titlebar.widget.ontopbutton (c),
|
||||
awful.titlebar.widget.closebutton (c),
|
||||
layout = wibox.layout.fixed.horizontal()
|
||||
},
|
||||
layout = wibox.layout.align.horizontal
|
||||
}
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
--{{{ Autorun programs
|
||||
autorun = true
|
||||
autorunApps = {
|
||||
"xrdb -load /home/radio/.config/x11/xresources",
|
||||
"keepassxc",
|
||||
"/home/radio/.profile",
|
||||
"setxkbmap -layout 'us,br' -option 'grp:menu_switch,parens:swap_brackets,caps:swapescape'",
|
||||
"xmodmap /home/radio/.config/x11/xmodmap",
|
||||
"xset r rate 160 35",
|
||||
"xset b off",
|
||||
"xbanish",
|
||||
"oneko -tofocus -speed 20 -fg '#101010' -bg '#606060'",
|
||||
"oneko -tofocus -speed 22 -position 0x0+25+0",
|
||||
}
|
||||
if autorun then
|
||||
for app = 1, #autorunApps do
|
||||
awful.util.spawn(autorunApps[app])
|
||||
end
|
||||
end
|
||||
---}}}
|
||||
|
||||
|
||||
-- {{{ Notifications
|
||||
|
||||
ruled.notification.connect_signal('request::rules', function()
|
||||
-- All notifications will match this rule.
|
||||
ruled.notification.append_rule {
|
||||
rule = { },
|
||||
properties = {
|
||||
screen = awful.screen.preferred,
|
||||
implicit_timeout = 5,
|
||||
}
|
||||
}
|
||||
end)
|
||||
|
||||
naughty.connect_signal("request::display", function(n)
|
||||
naughty.layout.box { notification = n }
|
||||
end)
|
||||
|
||||
-- }}}
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:activate { context = "mouse_enter", raise = false }
|
||||
end)
|
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 550 B |
Before Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 559 B |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 561 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 195 B |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 208 B |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 253 B |
Before Width: | Height: | Size: 617 B |
Before Width: | Height: | Size: 228 B |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 193 B |
Before Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 348 B |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 350 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 130 B |
Before Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 142 B |
Before Width: | Height: | Size: 189 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 187 B |
Before Width: | Height: | Size: 254 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 154 B |
Before Width: | Height: | Size: 217 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 264 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 244 B |
Before Width: | Height: | Size: 174 B |
Before Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 161 B |
Before Width: | Height: | Size: 224 B |
Before Width: | Height: | Size: 171 B |
Before Width: | Height: | Size: 184 B |
Before Width: | Height: | Size: 155 B |
Before Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 165 B |
Before Width: | Height: | Size: 548 B |
Before Width: | Height: | Size: 552 B |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 1.2 KiB |
|
@ -1,380 +0,0 @@
|
|||
--[[
|
||||
_ __ _ _ _ _ _
|
||||
/ \ _ __ ___ _ __ ___ ___ / _(_| (_) __ _ | |_| |__ ___ _ __ ___ ___
|
||||
/ _ \ | '_ \ / _ | '_ ` _ \ / _ \| |_| | | |/ _` | | __| '_ \ / _ | '_ ` _ \ / _ \
|
||||
/ ___ \| | | | __| | | | | | (_) | _| | | | (_| | | |_| | | | __| | | | | | __/
|
||||
/_/ \_|_| |_|\___|_| |_| |_|\___/|_| |_|_|_|\__,_| \__|_| |_|\___|_| |_| |_|\___|
|
||||
|
||||
|
||||
--]]
|
||||
local gears = require("gears")
|
||||
local lain = require("lain")
|
||||
local awful = require("awful")
|
||||
local wibox = require("wibox")
|
||||
local dpi = require("beautiful.xresources").apply_dpi
|
||||
|
||||
local os = os
|
||||
local my_table = awful.util.table or gears.table -- 4.{0,1} compatibility
|
||||
|
||||
local theme = {}
|
||||
theme.dir = os.getenv("HOME") .. "/.config/awesome/themes/anemofilia"
|
||||
theme.wallpaper = os.getenv("HOME") .. "Pictures/Wallpapers/\wall" --theme.dir .. "/wall.png"
|
||||
theme.font = "Meslo LG M DZ 9"
|
||||
theme.fg_normal = "#DDDDDD"
|
||||
theme.fg_focus = "#8581E0"--"#EA6F81"
|
||||
theme.fg_urgent = "#DCE081"--"#CC9393"
|
||||
theme.bg_normal = "#1A1A1A"
|
||||
theme.bg_focus = "#313131"
|
||||
theme.bg_urgent = "#1A1A1A"
|
||||
theme.border_width = dpi(1)
|
||||
theme.border_normal = "#3F3F3F"
|
||||
theme.border_focus = "#8581E0"--"#7F7F7F"
|
||||
theme.border_marked = "#CC9393"
|
||||
theme.tasklist_bg_focus = "#1A1A1A"
|
||||
theme.titlebar_bg_focus = theme.bg_focus
|
||||
theme.titlebar_bg_normal = theme.bg_normal
|
||||
theme.titlebar_fg_focus = theme.fg_focus
|
||||
theme.menu_height = dpi(20)
|
||||
theme.menu_width = dpi(140)
|
||||
theme.menu_submenu_icon = theme.dir .. "/icons/submenu.png"
|
||||
theme.taglist_squares_sel = theme.dir .. "/icons/square_sel.png"
|
||||
theme.taglist_squares_unsel = theme.dir .. "/icons/square_unsel.png"
|
||||
theme.layout_tile = theme.dir .. "/icons/tile1.png"
|
||||
theme.layout_tileleft = theme.dir .. "/icons/tileleft1.png"
|
||||
theme.layout_tilebottom = theme.dir .. "/icons/tilebottom1.png"
|
||||
theme.layout_tiletop = theme.dir .. "/icons/tiletop1.png"
|
||||
theme.layout_fairv = theme.dir .. "/icons/fairv.png"
|
||||
theme.layout_fairh = theme.dir .. "/icons/fairh.png"
|
||||
theme.layout_spiral = theme.dir .. "/icons/spiral.png"
|
||||
theme.layout_dwindle = theme.dir .. "/icons/dwindle.png"
|
||||
theme.layout_max = theme.dir .. "/icons/max.png"
|
||||
theme.layout_fullscreen = theme.dir .. "/icons/fullscreen.png"
|
||||
theme.layout_magnifier = theme.dir .. "/icons/magnifier.png"
|
||||
theme.layout_floating = theme.dir .. "/icons/floating1.png"
|
||||
theme.widget_ac = theme.dir .. "/icons/ac.png"
|
||||
theme.widget_battery_100 = theme.dir .. "/icons/battery_100.png"
|
||||
theme.widget_battery_80 = theme.dir .. "/icons/battery_80.png"
|
||||
theme.widget_battery_60 = theme.dir .. "/icons/battery_60.png"
|
||||
theme.widget_battery_40 = theme.dir .. "/icons/battery_40.png"
|
||||
theme.widget_battery_20 = theme.dir .. "/icons/battery_20.png"
|
||||
theme.widget_mem = theme.dir .. "/icons/mem.png"
|
||||
theme.widget_cpu = theme.dir .. "/icons/cpu.png"
|
||||
theme.widget_temp = theme.dir .. "/icons/temp.png"
|
||||
theme.widget_netdown = theme.dir .. "/icons/net_down.png"
|
||||
theme.widget_netup = theme.dir .. "/icons/net_up.png"
|
||||
theme.widget_hdd = theme.dir .. "/icons/hdd.png"
|
||||
theme.widget_music = theme.dir .. "/icons/note.png"
|
||||
theme.widget_music_on = theme.dir .. "/icons/note_on.png"
|
||||
theme.widget_vol = theme.dir .. "/icons/vol.png"
|
||||
theme.widget_vol_low = theme.dir .. "/icons/vol_low.png"
|
||||
theme.widget_vol_no = theme.dir .. "/icons/vol_no.png"
|
||||
theme.widget_vol_mute = theme.dir .. "/icons/vol_mute.png"
|
||||
theme.widget_mail = theme.dir .. "/icons/mail.png"
|
||||
theme.widget_mail_on = theme.dir .. "/icons/mail_on.png"
|
||||
theme.tasklist_plain_task_name = false
|
||||
theme.tasklist_disable_icon = true
|
||||
theme.gap_single_client = true
|
||||
theme.useless_gap = dpi(4)
|
||||
theme.titlebar_close_button_focus = theme.dir .. "/icons/titlebar/close_focus.png"
|
||||
theme.titlebar_close_button_normal = theme.dir .. "/icons/titlebar/close_normal.png"
|
||||
theme.titlebar_ontop_button_focus_active = theme.dir .. "/icons/titlebar/ontop_focus_active.png"
|
||||
theme.titlebar_ontop_button_normal_active = theme.dir .. "/icons/titlebar/ontop_normal_active.png"
|
||||
theme.titlebar_ontop_button_focus_inactive = theme.dir .. "/icons/titlebar/ontop_focus_inactive.png"
|
||||
theme.titlebar_ontop_button_normal_inactive = theme.dir .. "/icons/titlebar/ontop_normal_inactive.png"
|
||||
theme.titlebar_sticky_button_focus_active = theme.dir .. "/icons/titlebar/sticky_focus_active.png"
|
||||
theme.titlebar_sticky_button_normal_active = theme.dir .. "/icons/titlebar/sticky_normal_active.png"
|
||||
theme.titlebar_sticky_button_focus_inactive = theme.dir .. "/icons/titlebar/sticky_focus_inactive.png"
|
||||
theme.titlebar_sticky_button_normal_inactive = theme.dir .. "/icons/titlebar/sticky_normal_inactive.png"
|
||||
theme.titlebar_floating_button_focus_active = theme.dir .. "/icons/titlebar/floating_focus_active.png"
|
||||
theme.titlebar_floating_button_normal_active = theme.dir .. "/icons/titlebar/floating_normal_active.png"
|
||||
theme.titlebar_floating_button_focus_inactive = theme.dir .. "/icons/titlebar/floating_focus_inactive.png"
|
||||
theme.titlebar_floating_button_normal_inactive = theme.dir .. "/icons/titlebar/floating_normal_inactive.png"
|
||||
theme.titlebar_maximized_button_focus_active = theme.dir .. "/icons/titlebar/maximized_focus_active.png"
|
||||
theme.titlebar_maximized_button_normal_active = theme.dir .. "/icons/titlebar/maximized_normal_active.png"
|
||||
theme.titlebar_maximized_button_focus_inactive = theme.dir .. "/icons/titlebar/maximized_focus_inactive.png"
|
||||
theme.titlebar_maximized_button_normal_inactive = theme.dir .. "/icons/titlebar/maximized_normal_inactive.png"
|
||||
|
||||
local markup = lain.util.markup
|
||||
local separators = lain.util.separators
|
||||
|
||||
local mykeyboardlayout = awful.widget.keyboardlayout:new()
|
||||
|
||||
-- Textclock
|
||||
local clockicon = wibox.widget.imagebox(theme.widget_clock)
|
||||
local clock = awful.widget.watch(
|
||||
"date +'%a %d %b %R'", 60,
|
||||
function(widget, stdout)
|
||||
widget:set_markup(" " .. markup.font(theme.font, stdout))
|
||||
end
|
||||
)
|
||||
|
||||
-- Calendar
|
||||
theme.cal = lain.widget.cal({
|
||||
icons = "",
|
||||
attach_to = { clock },
|
||||
notification_preset = {
|
||||
font = theme.font,
|
||||
fg = theme.fg_normal,
|
||||
bg = theme.bg_normal
|
||||
}
|
||||
})
|
||||
--]]--
|
||||
|
||||
-- Mail IMAP check
|
||||
local mailicon = wibox.widget.imagebox(theme.widget_mail)
|
||||
--[[ commented because it needs to be set before use
|
||||
mailicon:buttons(my_table.join(awful.button({ }, 1, function () awful.spawn(mail) end)))
|
||||
theme.mail = lain.widget.imap({
|
||||
timeout = 180,
|
||||
server = "server",
|
||||
mail = "luisguilhermecoelho@usp.br",
|
||||
password = "ZeugmaTau-6,283Anemofilia",
|
||||
settings = function()
|
||||
if mailcount > 0 then
|
||||
widget:set_markup(markup.font(theme.font, " " .. mailcount .. " "))
|
||||
mailicon:set_image(theme.widget_mail_on)
|
||||
else
|
||||
widget:set_text("")
|
||||
mailicon:set_image(theme.widget_mail)
|
||||
end
|
||||
end
|
||||
})
|
||||
--]]
|
||||
|
||||
-- MPD
|
||||
local musicplr = awful.util.terminal .. " -title Music -g 130x34-320+16 -e ncmpcpp"
|
||||
local mpdicon = wibox.widget.imagebox(theme.widget_music)
|
||||
mpdicon:buttons(my_table.join(
|
||||
awful.button({ modkey }, 1, function () awful.spawn.with_shell(musicplr) end),
|
||||
awful.button({ }, 1, function ()
|
||||
os.execute("mpc prev")
|
||||
theme.mpd.update()
|
||||
end),
|
||||
awful.button({ }, 2, function ()
|
||||
os.execute("mpc toggle")
|
||||
theme.mpd.update()
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
os.execute("mpc next")
|
||||
theme.mpd.update()
|
||||
end)))
|
||||
theme.mpd = lain.widget.mpd({
|
||||
settings = function()
|
||||
if mpd_now.state == "play" then
|
||||
artist = mpd_now.artist .. " "
|
||||
title = mpd_now.title .. " "
|
||||
mpdicon:set_image(theme.widget_music_on)
|
||||
elseif mpd_now.state == "pause" then
|
||||
artist = "mpd "
|
||||
title = "paused "
|
||||
else
|
||||
artist = ""
|
||||
title = ""
|
||||
mpdicon:set_image(theme.widget_music)
|
||||
end
|
||||
|
||||
widget:set_markup(markup.font(theme.font, markup("#EA6F81", artist) .. title))
|
||||
end
|
||||
})
|
||||
|
||||
-- MEM
|
||||
local memicon = wibox.widget.imagebox(theme.widget_mem)
|
||||
local mem = lain.widget.mem({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(theme.font, mem_now.used .. "MB "))
|
||||
end
|
||||
})
|
||||
|
||||
-- CPU
|
||||
local cpuicon = wibox.widget.imagebox(theme.widget_cpu)
|
||||
local cpu = lain.widget.cpu({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(theme.font, cpu_now.usage .. "% "))
|
||||
end
|
||||
})
|
||||
|
||||
-- Coretemp
|
||||
local tempicon = wibox.widget.imagebox(theme.widget_temp)
|
||||
local temp = lain.widget.temp({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(theme.font, math.ceil(coretemp_now) .. "°C "))
|
||||
end
|
||||
})
|
||||
|
||||
-- / fs
|
||||
local fsicon = wibox.widget.imagebox(theme.widget_hdd)
|
||||
--[[ commented because it needs Gio/Glib >= 2.54
|
||||
theme.fs = lain.widget.fs({
|
||||
notification_preset = { fg = theme.fg_normal, bg = theme.bg_normal, font = "Terminus 10" },
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(theme.font, " " .. fs_now["/"].percentage .. "% "))
|
||||
end
|
||||
})
|
||||
--]]
|
||||
|
||||
-- Battery
|
||||
local baticon = wibox.widget.imagebox(theme.widget_battery)
|
||||
local bat = lain.widget.bat({
|
||||
settings = function()
|
||||
if bat_now.status and bat_now.status ~= "N/A" then
|
||||
if bat_now.ac_status == 1 then
|
||||
baticon:set_image(theme.widget_ac)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 25 then
|
||||
baticon:set_image(theme.widget_battery_20)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 45 then
|
||||
baticon:set_image(theme.widget_battery_40)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 65 then
|
||||
baticon:set_image(theme.widget_battery_60)
|
||||
elseif bat_now.perc and tonumber(bat_now.perc) < 85 then
|
||||
baticon:set_image(theme.widget_battery_80)
|
||||
else
|
||||
baticon:set_image(theme.widget_battery_100)
|
||||
end
|
||||
widget:set_markup(markup.font(theme.font, bat_now.perc .. "% "))
|
||||
else
|
||||
widget:set_markup(markup.font(theme.font, "AC "))
|
||||
baticon:set_image(theme.widget_ac)
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- ALSA volume
|
||||
local volicon = wibox.widget.imagebox(theme.widget_vol)
|
||||
theme.volume = lain.widget.alsa({
|
||||
settings = function()
|
||||
if volume_now.status == "off" then
|
||||
volicon:set_image(theme.widget_vol_mute)
|
||||
elseif tonumber(volume_now.level) == 0 then
|
||||
volicon:set_image(theme.widget_vol_no)
|
||||
elseif tonumber(volume_now.level) <= 50 then
|
||||
volicon:set_image(theme.widget_vol_low)
|
||||
else
|
||||
volicon:set_image(theme.widget_vol)
|
||||
end
|
||||
|
||||
widget:set_markup(markup.font(theme.font, volume_now.level .. "% "))
|
||||
end
|
||||
})
|
||||
theme.volume.widget:buttons(awful.util.table.join(
|
||||
awful.button({}, 4, function ()
|
||||
awful.util.spawn("amixer set Master 1%+")
|
||||
theme.volume.update()
|
||||
end),
|
||||
awful.button({}, 5, function ()
|
||||
awful.util.spawn("amixer set Master 1%-")
|
||||
theme.volume.update()
|
||||
end)
|
||||
))
|
||||
|
||||
-- Net
|
||||
local netdownicon = wibox.widget.imagebox(theme.widget_netdown)
|
||||
local netdowninfo = wibox.widget.textbox()
|
||||
local netupicon = wibox.widget.imagebox(theme.widget_netup)
|
||||
local netupinfo = lain.widget.net({
|
||||
settings = function()
|
||||
widget:set_markup(markup.font(theme.font, net_now.sent .. " "))
|
||||
netdowninfo:set_markup(markup.font(theme.font, net_now.received .. " "))
|
||||
end
|
||||
})
|
||||
|
||||
-- System tray
|
||||
local systray = wibox.widget.systray()
|
||||
systray:set_base_size(20)
|
||||
systray:set_reverse(true)
|
||||
|
||||
-- Separators
|
||||
local spr = wibox.widget.textbox(' ')
|
||||
local arrl_dl = separators.arrow_left(theme.bg_focus, "alpha")
|
||||
local arrl_ld = separators.arrow_left("alpha", theme.bg_focus)
|
||||
|
||||
function theme.at_screen_connect(s)
|
||||
-- Quake application
|
||||
s.quake = lain.util.quake({ app = awful.util.terminal })
|
||||
|
||||
-- If wallpaper is a function, call it with the screen
|
||||
local wallpaper = theme.wallpaper
|
||||
if type(wallpaper) == "function" then
|
||||
wallpaper = wallpaper(s)
|
||||
end
|
||||
gears.wallpaper.maximized(wallpaper, s, true)
|
||||
|
||||
-- Tags
|
||||
awful.tag(awful.util.tagnames, s, awful.layout.layouts)
|
||||
|
||||
-- Create a promptbox for each screen
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
s.mylayoutbox = awful.widget.layoutbox(s)
|
||||
s.mylayoutbox:buttons(my_table.join(
|
||||
awful.button({}, 1, function () awful.layout.inc( 1) end),
|
||||
awful.button({}, 2, function () awful.layout.set( awful.layout.layouts[1] ) end),
|
||||
awful.button({}, 3, function () awful.layout.inc(-1) end),
|
||||
awful.button({}, 4, function () awful.layout.inc( 1) end),
|
||||
awful.button({}, 5, function () awful.layout.inc(-1) end)))
|
||||
-- Create a taglist widget
|
||||
s.mytaglist = awful.widget.taglist(s, awful.widget.taglist.filter.all, awful.util.taglist_buttons)
|
||||
|
||||
-- Create a tasklist widget
|
||||
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, awful.util.tasklist_buttons)
|
||||
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar({ position = "top", screen = s, height = dpi(19), bg = theme.bg_normal, fg = theme.fg_normal })
|
||||
|
||||
-- Add widgets to the wibox
|
||||
s.mywibox:setup {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
--spr,
|
||||
s.mytaglist,
|
||||
s.mypromptbox,
|
||||
spr,
|
||||
},
|
||||
s.mytasklist, -- Middle widget
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
--systray,
|
||||
spr,
|
||||
--arrl_dl,
|
||||
--wibox.container.background(mpdicon, theme.bg_focus),
|
||||
--wibox.container.background(theme.mpd.widget, theme.bg_focus),
|
||||
arrl_ld,
|
||||
--wibox.container.background(mailicon, theme.bg_focus),
|
||||
--wibox.container.background(theme.mail.widget, theme.bg_focus),
|
||||
wibox.container.background(netdownicon, theme.bg_focus),
|
||||
wibox.container.background(netdowninfo, theme.bg_focus),
|
||||
wibox.container.background(netupicon, theme.bg_focus),
|
||||
wibox.container.background(netupinfo.widget, theme.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(memicon, theme.bg_normal),
|
||||
wibox.container.background(mem.widget, theme.bg_normal),
|
||||
arrl_ld,
|
||||
wibox.container.background(cpuicon, theme.bg_focus),
|
||||
wibox.container.background(cpu.widget, theme.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(tempicon, theme.bg_normal),
|
||||
wibox.container.background(temp.widget, theme.bg_normal),
|
||||
arrl_ld,
|
||||
--wibox.container.background(fsicon, theme.bg_focus),
|
||||
--wibox.container.background(theme.fs.widget, theme.bg_focus),
|
||||
--arrl_dl,
|
||||
wibox.container.background(volicon, theme.bg_focus),
|
||||
wibox.container.background(theme.volume.widget, theme.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(baticon, theme.bg_normal),
|
||||
wibox.container.background(bat.widget, theme.bg_normal),
|
||||
arrl_ld,
|
||||
--wibox.container.background(neticon, theme.bg_focus),
|
||||
--wibox.container.background(net.widget, theme.bg_focus),
|
||||
--arrl_dl,
|
||||
wibox.container.background(clock, theme.bg_focus),
|
||||
wibox.container.background(spr, theme.bg_focus),
|
||||
arrl_dl,
|
||||
wibox.container.background(s.mylayoutbox, theme.bg_normal),
|
||||
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return theme
|
Before Width: | Height: | Size: 79 KiB |
Before Width: | Height: | Size: 6.0 MiB |
Before Width: | Height: | Size: 177 B |
Before Width: | Height: | Size: 530 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 550 B |
Before Width: | Height: | Size: 557 B |
Before Width: | Height: | Size: 559 B |
Before Width: | Height: | Size: 554 B |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 576 B |
Before Width: | Height: | Size: 578 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 536 B |
Before Width: | Height: | Size: 532 B |
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 589 B |
Before Width: | Height: | Size: 540 B |
Before Width: | Height: | Size: 541 B |
Before Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 563 B |
Before Width: | Height: | Size: 607 B |
Before Width: | Height: | Size: 553 B |