Remove awesome

This commit is contained in:
Simon Bruder 2020-08-23 10:04:11 +02:00
parent 94f0c0660e
commit 0c1f324073
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
47 changed files with 0 additions and 888 deletions

3
.gitmodules vendored
View file

@ -7,9 +7,6 @@
[submodule "mpv-gallery-view"]
path = mpv-gallery-view
url = https://github.com/occivink/mpv-gallery-view
[submodule "home/.config/awesome/lain"]
path = home/.config/awesome/lain
url = https://github.com/lcpz/lain
[submodule "vim-plug"]
path = vim-plug
url = https://github.com/junegunn/vim-plug

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

@ -1 +0,0 @@
Subproject commit e0bffc00566fbc0c05dc01700c569a589a6900eb

View file

@ -1,540 +0,0 @@
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
-- Widget and layout library
local wibox = require("wibox")
-- Theme handling library
local beautiful = require("beautiful")
-- Notification library
local naughty = require("naughty")
local menubar = require("menubar")
local hotkeys_popup = require("awful.hotkeys_popup").widget
-- Enable hotkeys help widget for VIM and other apps
-- when client with a matching name is opened:
require("awful.hotkeys_popup.keys")
local lain = require("lain")
local helpers = require("lain.helpers")
local widgets = require("widgets")
-- {{{ 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)
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
-- Handle runtime errors after startup
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
-- Make sure we don't go into an endless error loop
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
in_error = false
end)
end
-- }}}
-- {{{ Variable definitions
-- Themes define colours, icons, font and wallpapers.
beautiful.init(gears.filesystem.get_configuration_dir() .. "theme.lua")
-- Default shell
awful.util.shell = "/bin/zsh"
-- This is used later as the default terminal and editor to run.
terminal = os.getenv("HOME") .. "/bin/alacritty"
if not(helpers.file_exists(terminal)) then
terminal = "urxvt"
end
editor = os.getenv("EDITOR") or "editor"
editor_cmd = terminal .. " -e " .. editor
-- Default modkey.
-- Usually, Mod4 is the key with a logo between Control and Alt.
-- If you do not like this or do not have such a key,
-- I suggest you to remap Mod4 to another key using xmodmap or other tools.
-- However, you can use another modifier like Mod1, but it may interact with others.
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
awful.layout.layouts = {
awful.layout.suit.tile,
awful.layout.suit.tile.left,
awful.layout.suit.tile.bottom,
awful.layout.suit.tile.top,
awful.layout.suit.fair,
awful.layout.suit.fair.horizontal,
awful.layout.suit.max,
-- awful.layout.suit.spiral,
-- awful.layout.suit.spiral.dwindle,
-- awful.layout.suit.max.fullscreen,
-- awful.layout.suit.magnifier,
-- awful.layout.suit.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
-- awful.layout.suit.floating,
}
-- }}}
-- {{{ Helper functions
local function client_menu_toggle_fn()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = 250 } })
end
end
end
-- }}}
-- {{{ Menu
-- Menubar configuration
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
-- }}}
-- {{{ Wibar
-- Create a textclock widget
mytextclock = wibox.widget.textclock()
-- Create calendar and attach it to textclock
mycal = widgets.cal
mycal.attach(mytextclock)
-- Create a wibox for each screen and add it
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),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
local tasklist_buttons = gears.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, client_menu_toggle_fn()),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
local function set_wallpaper(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", set_wallpaper)
awful.screen.connect_for_each_screen(function(s)
-- Wallpaper
set_wallpaper(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(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),
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, taglist_buttons)
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, tasklist_buttons)
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", screen = s })
-- Add widgets to the wibox
s.mywibox:setup {
layout = wibox.layout.align.horizontal,
{ -- Left widgets
layout = wibox.layout.fixed.horizontal,
s.mytaglist,
s.mypromptbox,
},
s.mytasklist, -- Middle widget
{ -- Right widgets
layout = wibox.layout.fixed.horizontal,
wibox.widget.systray(),
widgets.notifications,
widgets.tearstop,
widgets.redshift,
widgets.bluetooth,
widgets.vpn.icon,
widgets.vpn.widget,
widgets.netdown_icon,
widgets.netdown.widget,
widgets.netup_icon,
widgets.netup.widget,
widgets.mem_icon,
widgets.mem.widget,
widgets.cpu_icon,
widgets.cpu.widget,
widgets.temp_icon,
widgets.temp.widget,
widgets.bat_icon,
widgets.bat.widget,
mytextclock,
s.mylayoutbox,
},
}
end)
-- }}}
-- {{{ Mouse bindings
root.buttons(gears.table.join(
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = gears.table.join(
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ modkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", 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"}),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}),
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"}),
-- Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"}),
-- Lock screen
awful.key({ modkey }, "y", function() awful.util.spawn({ "/usr/local/bin/lock" }) end,
{description = "lock the screen", group = "awesome"})
)
clientkeys = gears.table.join(
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "(un)maximize", group = "client"}),
awful.key({ modkey, "Control" }, "m",
function (c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end ,
{description = "(un)maximize vertically", group = "client"}),
awful.key({ modkey, "Shift" }, "m",
function (c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end ,
{description = "(un)maximize horizontally", group = "client"}),
-- Special „multimedia“ keys
awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn({"xbacklight", "-inc", "10"}) end),
awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn({"xbacklight", "-dec", "10"}) end),
awful.key({}, "XF86AudioMute", function() awful.util.spawn_with_shell("pactl set-sink-mute $(pacmd dump|grep -E '^set-default-sink'|cut -d' ' -f2) toggle") end),
awful.key({}, "XF86AudioMicMute", function() awful.util.spawn_with_shell("pactl set-source-mute $(pacmd dump|grep -E '^set-default-source'|cut -d' ' -f2) toggle") end),
awful.key({}, "XF86Display", function() awful.util.spawn({"autorandr", "-c"}) end)
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it work on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = gears.table.join(globalkeys,
-- View tag only.
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"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. 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"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
end
clientbuttons = gears.table.join(
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
awful.button({ modkey }, 1, awful.mouse.client.move),
awful.button({ modkey }, 3, awful.mouse.client.resize))
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen
}
},
-- Floating clients.
{ rule_any = {
class = {
"pinentry",
},
role = {
"pop-up",
}
}, properties = { floating = true }},
-- Use full space for urxvt
{ rule = { class = "URxvt" },
properties = { size_hints_honor = false } },
-- Default tags
{ properties = { tag = "" }, rule = { class = "Chromium" } },
{ properties = { tag = "" }, rule = { class = "Firefox" } },
{ properties = { tag = "" }, rule = { class = "Claws-mail" } },
{ properties = { tag = "" }, rule = { class = "Mumble" } },
{ properties = { tag = "" }, rule = { class = "Evince" } },
{ properties = { tag = "" }, rule = { class = "Gnome-calendar" } },
{ properties = { tag = "" }, rule = { class = "Gnome-contact" } },
{ properties = { tag = "" }, rule = { class = "Gscan2pdf" } },
{ properties = { tag = "" }, rule = { class = "libreoffice" } },
{ properties = { tag = "" }, rule = { name = "org.pwmt.zathura" } },
{ properties = { tag = "" }, rule = { class = "Audacious" } },
{ properties = { tag = "" }, rule = { class = "Pavucontrol" } },
{ properties = { tag = "" }, rule = { class = "Darktable" } },
{ properties = { tag = "" }, rule = { class = "Gimp" } },
{ properties = { tag = "" }, rule = { class = "Inkscape" } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and
not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
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)
-- }}}
-- autostart
awful.util.spawn({"pulseaudio", "--start"})
awful.util.spawn({"nm-applet"})
--awful.util.spawn({"ibus-daemon", "-r", "--xim"})
awful.util.spawn({"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"})

View file

@ -1,93 +0,0 @@
local theme_assets = require("beautiful.theme_assets")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local gfs = require("gears.filesystem")
local layout_icons_path = gfs.get_configuration_dir() .. "icons/layouts/"
local spawn = require("awful.spawn")
local utils = require("utils")
local helpers = require("lain.helpers")
local theme = {}
theme.font = "Terminus (TTF) 9"
theme.wibar_height = 18
theme.colors = {}
theme.colors.base03 = "#002b36"
theme.colors.base02 = "#073642"
theme.colors.base01 = "#586e75"
theme.colors.base00 = "#657b83"
theme.colors.base0 = "#839496"
theme.colors.base1 = "#93a1a1"
theme.colors.base2 = "#eee8d5"
theme.colors.base3 = "#fdf6e3"
theme.colors.yellow = "#b58900"
theme.colors.orange = "#cb4b16"
theme.colors.red = "#dc322f"
theme.colors.magenta = "#d33682"
theme.colors.violet = "#6c71c4"
theme.colors.blue = "#268bd2"
theme.colors.cyan = "#2aa198"
theme.colors.green = "#859900"
theme.bg_normal = theme.colors.base03
theme.bg_focus = theme.colors.base02
theme.bg_urgent = theme.colors.red
theme.bg_minimize = "#303030"
theme.bg_systray = theme.bg_normal
theme.fg_normal = theme.colors.base0
theme.fg_focus = theme.colors.base1
theme.fg_urgent = theme.fg_focus
theme.fg_minimize = theme.colors.fg_normal
theme.taglist_font = "IPAGothic 10"
theme.taglist_bg_focus = theme.colors.base3
theme.taglist_fg_focus = theme.colors.base00
theme.useless_gap = dpi(0)
theme.border_width = 1
theme.border_normal = theme.colors.base03
theme.border_focus = theme.colors.base02
theme.tasklist_disable_icon = true
theme.hotkeys_font = "Iosevka Bold 10"
theme.hotkeys_description_font = "Iosevka 10"
theme.hotkeys_modifiers_fg = theme.fg_normal
theme.wallpaper = function(s)
if helpers.file_exists(utils.home() .. ".fehbg") then
spawn.spawn(utils.home() .. ".fehbg")
end
end
local taglist_square_size = dpi(4)
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
taglist_square_size, theme.fg_normal
)
theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel(
taglist_square_size, theme.fg_normal
)
theme.layout_fairh = layout_icons_path .. "fairh.png"
theme.layout_fairv = layout_icons_path .. "fairv.png"
theme.layout_floating = layout_icons_path .. "floating.png"
theme.layout_magnifier = layout_icons_path .. "magnifier.png"
theme.layout_max = layout_icons_path .. "max.png"
theme.layout_fullscreen = layout_icons_path .. "fullscreen.png"
theme.layout_tilebottom = layout_icons_path .. "tilebottom.png"
theme.layout_tileleft = layout_icons_path .. "tileleft.png"
theme.layout_tile = layout_icons_path .. "tile.png"
theme.layout_tiletop = layout_icons_path .. "tiletop.png"
theme.layout_spiral = layout_icons_path .. "spiral.png"
theme.layout_dwindle = layout_icons_path .. "dwindle.png"
theme.layout_cornernw = layout_icons_path .. "cornernw.png"
theme.layout_cornerne = layout_icons_path .. "cornerne.png"
theme.layout_cornersw = layout_icons_path .. "cornersw.png"
theme.layout_cornerse = layout_icons_path .. "cornerse.png"
return theme

View file

@ -1,21 +0,0 @@
local helpers = require("lain.helpers")
local markup = require("lain.util.markup")
local utils = {}
function utils.home()
return os.getenv("HOME") .. "/"
end
function utils.handle_pid(command, callback)
helpers.async_with_shell(string.format("ps x -o pid=,command=|grep -E '^\\s*[0-9]* %s$'|sed 's/\\s*\\([0-9]*\\) .*/\\1/'", command), callback)
end
function utils.ansi2markup(ansi, colors)
return ansi
:gsub("\x1b%[1m([^\x1b]*)", markup.bold("%1"))
:gsub("\x1b%[7m([^\x1b]*)", markup.color(colors.base1, colors.base02, "%1"))
:gsub("\x1b%[0m([^\x1b]*)", "%1")
end
return utils

View file

@ -1,230 +0,0 @@
local awful = require("awful")
local gtable = require("gears.table")
local naughty = require("naughty")
local wibox = require("wibox")
local lain = require("lain")
local helpers = require("lain.helpers")
local markup = lain.util.markup
local theme = require("theme")
local utils = require("utils")
local gfs = require("gears.filesystem")
local iconsdir = gfs.get_configuration_dir() .. "icons/"
local network_interfaces = {"enp0s25", "wlp3s0"}
local widgets = {}
widgets.netdown_icon = wibox.widget.imagebox(iconsdir .. "down.png")
widgets.netdown = lain.widget.net({
units = 1024^2,
iface = network_interfaces,
notify = "off",
settings = function()
widget:set_markup(markup.fontfg(theme.font, theme.colors.green, net_now.received .. "MiB/s "))
end
})
widgets.netup_icon = wibox.widget.imagebox(iconsdir .. "up.png")
widgets.netup = lain.widget.net({
units = 1024^2,
iface = network_interfaces,
notify = "off",
settings = function()
widget:set_markup(markup.fontfg(theme.font, theme.colors.red, net_now.sent .. "MiB/s "))
end
})
widgets.mem_icon = wibox.widget.imagebox(iconsdir .. "mem.png")
widgets.mem = lain.widget.mem({
settings = function()
widget:set_markup(markup.fontfg(theme.font, theme.colors.yellow, mem_now.perc .. "% "))
end
})
widgets.cpu_icon = wibox.widget.imagebox(iconsdir .. "cpu.png")
widgets.cpu = lain.widget.cpu({
settings = function()
widget:set_markup(markup.fontfg(theme.font, theme.colors.cyan, string.format("%02d", cpu_now.usage) .. "% "))
end
})
widgets.temp_icon = wibox.widget.imagebox(iconsdir .. "temp.png")
widgets.temp = lain.widget.temp({
settings = function()
widget:set_markup(markup.fontfg(theme.font, theme.colors.magenta, math.floor(coretemp_now) .. "°C "))
end
})
widgets.bat_icon = wibox.widget.imagebox(iconsdir .. "bat.png")
widgets.bat = lain.widget.bat({
notify = "off",
settings = function()
state = bat_now.ac_status == 0 and "D" or "C"
widget:set_markup(markup.fontfg(theme.font, theme.fg_normal, state .. bat_now.perc))
end
})
widgets.vpn = {}
widgets.vpn.icon = wibox.widget.imagebox(iconsdir .. "vpn.png")
widgets.vpn.widget = wibox.widget.textbox()
widgets.vpn.update = function()
helpers.async({ "/bin/ip", "link" }, function(output)
connected = false
for line in output:gmatch("[^\r\n]+") do
vpn_server = string.match(line, "^%d+: mullvad%-(%g+):")
if vpn_server then
widgets.vpn.widget:set_markup(markup.fontfg(theme.font, theme.colors.blue, vpn_server .. " "))
connected = true
end
end
if connected then
widgets.vpn.icon.visible = true
else
widgets.vpn.widget:set_markup(markup.fontfg(theme.font, theme.colors.blue, ""))
widgets.vpn.icon.visible = false
end
end)
end
helpers.newtimer("vpn", 5, widgets.vpn.update)
widgets.bluetooth = wibox.widget.imagebox(iconsdir .. "bluetooth-on.png")
widgets.bluetooth.pass_state = function(callback)
helpers.async_with_shell("/sbin/rfkill -n -o SOFT list bluetooth|uniq", function(state)
callback(state:gsub("^%s*(.-)%s*$", "%1"))
end)
end
widgets.bluetooth.update = function()
widgets.bluetooth.pass_state(function(state)
if state == "blocked" then
widgets.bluetooth:set_image(iconsdir .. "bluetooth-off.png")
else
helpers.async_with_shell("for device in $(bluetoothctl devices|cut -d' ' -f 2);do bluetoothctl info $device|grep 'Connected: yes';done|wc -l", function(connected_devices)
if tonumber(connected_devices) > 0 then
widgets.bluetooth:set_image(iconsdir .. "bluetooth-active.png")
else
widgets.bluetooth:set_image(iconsdir .. "bluetooth-on.png")
end
end)
end
end)
end
widgets.bluetooth.toggle = function()
widgets.bluetooth.pass_state(function(state)
if state == "blocked" then
awful.spawn.spawn({ "/sbin/rfkill", "unblock", "bluetooth" })
else
awful.spawn.spawn({ "/sbin/rfkill", "block", "bluetooth" })
end
widgets.bluetooth.update()
end)
end
widgets.bluetooth:buttons(
gtable.join(
awful.button({ }, 1, widgets.bluetooth.toggle),
awful.button({ }, 3, function()
awful.spawn.with_shell("blueman-manager; pkill blueman-applet")
end)
)
)
helpers.newtimer("bluetooth", 10, widgets.bluetooth.update)
widgets.redshift = wibox.widget.imagebox(iconsdir .. "redshift-on.png")
widgets.redshift.pid = nil
utils.handle_pid("redshift", function(pid)
if pid and #pid > 0 then
widgets.redshift.pid = tonumber(pid)
else
widgets.redshift.pid = awful.spawn.spawn({ "redshift" })
end
end)
widgets.redshift.active = true
widgets.redshift.toggle = function()
awful.spawn.spawn({ "kill", "-SIGUSR1", tostring(widgets.redshift.pid) })
widgets.redshift.active = not widgets.redshift.active
if widgets.redshift.active == true then
widgets.redshift:set_image(iconsdir .. "redshift-on.png")
else
widgets.redshift:set_image(iconsdir .. "redshift-off.png")
end
end
widgets.redshift:buttons(
gtable.join(
awful.button({ }, 1, widgets.redshift.toggle)
)
)
widgets.tearstop = wibox.widget.imagebox(iconsdir .. "tearstop-off.png")
utils.handle_pid("compton --backend=glx", function(pid)
if pid and #pid > 0 then
widgets.tearstop.pid = tonumber(pid)
widgets.tearstop:set_image(iconsdir .. "tearstop-on.png")
end
end)
widgets.tearstop.pid = nil
widgets.tearstop:buttons(
gtable.join(
awful.button({ }, 1, function()
if widgets.tearstop.pid == nil then
widgets.tearstop.pid = awful.spawn.spawn({ "compton", "--backend=glx" })
widgets.tearstop:set_image(iconsdir .. "tearstop-on.png")
else
awful.spawn.spawn({ "kill", tostring(widgets.tearstop.pid) })
widgets.tearstop.pid = nil
widgets.tearstop:set_image(iconsdir .. "tearstop-off.png")
end
end)
)
)
widgets.notifications = wibox.widget.imagebox(iconsdir .. "notifications-on.png")
widgets.notifications:buttons(
gtable.join(
awful.button({ }, 1, function()
if naughty.is_suspended() then
naughty.resume()
widgets.notifications:set_image(iconsdir .. "notifications-on.png")
else
naughty.suspend()
widgets.notifications:set_image(iconsdir .. "notifications-off.png")
end
end)
)
)
widgets.cal = {}
widgets.cal.toggle = function()
if widgets.cal.notification ~= nil then
naughty.destroy(widgets.cal.notification)
widgets.cal.notification = nil
else
helpers.async({ "khal", "--color", "calendar" }, function(output)
widgets.cal.notification = naughty.notify{
screen = awful.screen.focused(),
text = utils.ansi2markup(output:gsub("\n$", ""), theme.colors),
timeout = 0,
}
end)
end
end
widgets.cal.attach = function(parent)
parent:buttons(awful.util.table.join(
awful.button({}, 1, widgets.cal.toggle)
))
end
return widgets