commit 4cacdd9bd700c5bfaa5ca03a7d3017f526cc3b83 Author: Yessiest Date: Sun Nov 14 14:28:13 2021 +0400 Initial commit diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..9b9e5e0 --- /dev/null +++ b/README.txt @@ -0,0 +1,12 @@ +This folder is the root of awesomewm configuration. +The layout is as follows: +/core - original rc.lua, split into components for convenience. +/core/widgets - self-contained widgets from original awesomewm rc.lua. +/modules - small self-contained plug-ins to be required in rc.lua. +/libs - libraries, for various purposes. +/widgets - custom widgets +/various-scripts - scripts for clearing up desktop files, installing pam, etc. +/docs +/themes - themes compatible with this config or awesomewm in general. + +Each folder contains a readme, describing what it contains and some additional details that one might need. diff --git a/core/README.txt b/core/README.txt new file mode 100644 index 0000000..88ccf8b --- /dev/null +++ b/core/README.txt @@ -0,0 +1,27 @@ +These are the core modules of this desktop. +There are currently the following modules, in the order of loading: +1) error.lua - Error handling +2) vars.lua - Variable definitions +3) style.lua - ``beautiful`` theme and style definitions +4) binds.lua - Binds +5) layout.lua - Wibar layout +6) rules.lua - Rules +7) signals.lua - Signals + +Notice that Error handling and Variable definitions come before beautiful +initialization. That is normal. Those modules don't depend on any of the +above, therefore they are loaded before anything else. + +Additionally, notice that Binds come before Wibar. That is not exactly how it +was in the default rc.lua, but it is important to load them in exactly that +order. Widgets, which are called from layout.lua, override the global bindings +table. If you load binds after the layout is loaded, the bindings are reset to +defaults. + +Everything else is kept in exactly the same order as it was in the default +rc.lua + +Additionally, it should be noted that all widgets in this config are entirely +independent. Simply not loading them will not load any keybindings or break +the config. Therefore, if you want to change any keybindings for the widgets, +you would want to search for them in their respective modules. diff --git a/core/binds.lua b/core/binds.lua new file mode 100644 index 0000000..737e5aa --- /dev/null +++ b/core/binds.lua @@ -0,0 +1,10 @@ +local awful = require("awful") +local gears = require("gears") + +local keys = require("core.binds.globalkeys") +local buttons = require("core.binds.globalbuttons") + +-- Set keys +root.buttons(buttons) +root.keys(keys) +-- }}} diff --git a/core/binds/clientbuttons.lua b/core/binds/clientbuttons.lua new file mode 100644 index 0000000..3cdf298 --- /dev/null +++ b/core/binds/clientbuttons.lua @@ -0,0 +1,17 @@ +local awful = require("awful") +local gears = require("gears") + +local clientbuttons = gears.table.join( + awful.button({ }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + end), + awful.button({ global.modkey }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ global.modkey }, 3, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.resize(c) + end) +) +return clientbuttons diff --git a/core/binds/clientkeys.lua b/core/binds/clientkeys.lua new file mode 100644 index 0000000..0fc947e --- /dev/null +++ b/core/binds/clientkeys.lua @@ -0,0 +1,47 @@ +local awful = require("awful") +local gears = require("gears") + +local clientkeys = gears.table.join( + awful.key({ global.modkey, }, "f", + function (c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = "toggle fullscreen", group = "client"}), + awful.key({ global.modkey, "Shift" }, "c", function (c) c:kill() end, + {description = "close", group = "client"}), + awful.key({ global.modkey, "Control" }, "space", awful.client.floating.toggle , + {description = "toggle floating", group = "client"}), + awful.key({ global.modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, + {description = "move to master", group = "client"}), + awful.key({ global.modkey, }, "o", function (c) c:move_to_screen() end, + {description = "move to screen", group = "client"}), + awful.key({ global.modkey, }, "t", function (c) c.ontop = not c.ontop end, + {description = "toggle keep on top", group = "client"}), + awful.key({ global.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({ global.modkey, }, "m", + function (c) + c.maximized = not c.maximized + c:raise() + end , + {description = "(un)maximize", group = "client"}), + awful.key({ global.modkey, "Control" }, "m", + function (c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end , + {description = "(un)maximize vertically", group = "client"}), + awful.key({ global.modkey, "Shift" }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end , + {description = "(un)maximize horizontally", group = "client"}) +) +return clientkeys diff --git a/core/binds/globalbuttons.lua b/core/binds/globalbuttons.lua new file mode 100644 index 0000000..09c8f8b --- /dev/null +++ b/core/binds/globalbuttons.lua @@ -0,0 +1,8 @@ +local awful = require("awful") +local gears = require("gears") + +return gears.table.join( + awful.button({ }, 3, function () require("core.widgets.menu"):toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +) diff --git a/core/binds/globalkeys.lua b/core/binds/globalkeys.lua new file mode 100644 index 0000000..c5e0bb8 --- /dev/null +++ b/core/binds/globalkeys.lua @@ -0,0 +1,132 @@ +local awful = require("awful") +local gears = require("gears") + +local globalkeys = gears.table.join( + awful.key({ global.modkey, }, "Left", awful.tag.viewprev, + {description = "view previous", group = "tag"}), + awful.key({ global.modkey, }, "Right", awful.tag.viewnext, + {description = "view next", group = "tag"}), + awful.key({ global.modkey, }, "Escape", awful.tag.history.restore, + {description = "go back", group = "tag"}), + + awful.key({ global.modkey, }, "j", + function () + awful.client.focus.byidx( 1) + end, + {description = "focus next by index", group = "client"} + ), + awful.key({ global.modkey, }, "k", + function () + awful.client.focus.byidx(-1) + end, + {description = "focus previous by index", group = "client"} + ), + -- Layout manipulation + awful.key({ global.modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, + {description = "swap with next client by index", group = "client"}), + awful.key({ global.modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, + {description = "swap with previous client by index", group = "client"}), + awful.key({ global.modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, + {description = "focus the next screen", group = "screen"}), + awful.key({ global.modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, + {description = "focus the previous screen", group = "screen"}), + awful.key({ global.modkey, }, "u", awful.client.urgent.jumpto, + {description = "jump to urgent client", group = "client"}), + awful.key({ global.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({ global.modkey, }, "Return", function () awful.spawn(global.terminal) end, + {description = "open a terminal", group = "launcher"}), + awful.key({ global.modkey, "Control" }, "r", awesome.restart, + {description = "reload awesome", group = "awesome"}), + awful.key({ global.modkey, "Shift" }, "q", awesome.quit, + {description = "quit awesome", group = "awesome"}), + + awful.key({ global.modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, + {description = "increase master width factor", group = "layout"}), + awful.key({ global.modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, + {description = "decrease master width factor", group = "layout"}), + awful.key({ global.modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, + {description = "increase the number of master clients", group = "layout"}), + awful.key({ global.modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, + {description = "decrease the number of master clients", group = "layout"}), + awful.key({ global.modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, + {description = "increase the number of columns", group = "layout"}), + awful.key({ global.modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, + {description = "decrease the number of columns", group = "layout"}), + awful.key({ global.modkey, }, "space", function () awful.layout.inc( 1) end, + {description = "select next", group = "layout"}), + awful.key({ global.modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, + {description = "select previous", group = "layout"}), + + awful.key({ global.modkey, "Control" }, "n", + function () + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal( + "request::activate", "key.unminimize", {raise = true} + ) + end + end, + {description = "restore minimized", group = "client"}) +) + +-- 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({ global.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({ global.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({ global.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({ global.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 + +return globalkeys diff --git a/core/binds/titlebar.lua b/core/binds/titlebar.lua new file mode 100644 index 0000000..c85148d --- /dev/null +++ b/core/binds/titlebar.lua @@ -0,0 +1,14 @@ +local awful = require("awful") +local gears = require("gears") + +local buttons = gears.table.join( + awful.button({ }, 1, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.resize(c) + end) +) +return buttons diff --git a/core/client.lua b/core/client.lua new file mode 100644 index 0000000..efa2c04 --- /dev/null +++ b/core/client.lua @@ -0,0 +1,10 @@ +--{{{ Additional client setup +local gears = require("gears") +return function(c) + local shape = function(cr, width, height) + return gears.shape.partially_rounded_rect(cr, width, height, + true,true,false,false,require("beautiful").titlebar_rounding) + end + c.shape = shape +end +--}}} diff --git a/core/error.lua b/core/error.lua new file mode 100644 index 0000000..74d5af4 --- /dev/null +++ b/core/error.lua @@ -0,0 +1,26 @@ +local naughty = require("naughty") + +-- {{{ 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 +-- }}} diff --git a/core/layout.lua b/core/layout.lua new file mode 100644 index 0000000..a82182d --- /dev/null +++ b/core/layout.lua @@ -0,0 +1,114 @@ +local beautiful = require("beautiful") +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +-- {{{ Wibar + +-- Create a wibox for each screen and add it + +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) + +-- {{{ Non-widget modules +-- The following modules are not exactly widgets, however they are part of the ui. + +-- Load the keybindings list +require("core.widgets.hotkeys_popup") + +-- Load the menubar +require("core.widgets.menubar") +-- }}} + +awful.screen.connect_for_each_screen(function(s) + -- Wallpaper + set_wallpaper(s) + + -- Each screen has its own tag table. + awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) + + -- Create a promptbox for each screen + s.mypromptbox = require("core.widgets.prompt")() + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- Create the taglist + s.mytaglist = require("core.widgets.taglist")(s) + -- We need one layoutbox per screen. + s.mylayoutbox = require("core.widgets.layout_box")(s) + -- Create a tasklist widget + s.mytasklist = require("core.widgets.tasklist")(s) + -- Create the wibox + s.mywibox = awful.wibar({ + position = "top", + screen = s, + bg = beautiful.topbar_bg + }) + -- Add screen lock + require("widgets.lock")({screen = s,obscure = false}) + require("widgets.unitybar")(s,{ + top_widgets = { + require("widgets.polytasklist")({ + vertical = true, + stretch = false, + --constraint = 180, + names = false, + margins = 5 + })(s), + }, + bottom_widgets = { + require("widgets.polylauncher")({vertical = true}) + } + }) + -- Add widgets to the wibox + s.mywibox:setup { + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + require("core.widgets.menu_launcher"), + --require("widgets.polylauncher")({vertical = false}), + s.mytaglist, + s.mypromptbox, + }, + -- Middle widget + { + --[[require("widgets.polytasklist")({ + vertical = false, + stretch = false, + constraint = 180, + names = true, + margins = 5 + })(s),]] + layout = wibox.layout.fixed.horizontal + }, + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + awful.widget.keyboardlayout(), + require("widgets.wallpapers")({ + screen = s, + path = os.getenv("HOME").."/Pictures/Wallpapers/" + }), + require("widgets.mailbox")({ + screen = s, + style = { + rounding = 1 + } + }), + wibox.widget.systray(), + require("widgets.volume")({}), + require("widgets.battery")({percentage = true}), + wibox.widget.textclock(), + s.mylayoutbox, + }, + } +end) +-- }}} diff --git a/core/rules.lua b/core/rules.lua new file mode 100644 index 0000000..0b0eddb --- /dev/null +++ b/core/rules.lua @@ -0,0 +1,61 @@ +local awful = require("awful") +local gears = require("gears") +local beautiful = require("beautiful") +-- {{{ 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 = require("core.binds.clientkeys"), + buttons = require("core.binds.clientbuttons"), + screen = awful.screen.preferred, + placement = awful.placement.no_overlap+awful.placement.no_offscreen, + requests_no_titlebar = false +} + }, + + -- Floating clients. + { rule_any = { + instance = { + "DTA", -- Firefox addon DownThemAll. + "copyq", -- Includes session name in class. + "pinentry", + }, + class = { + "Arandr", + "Blueman-manager", + "Gpick", + "Kruler", + "MessageWin", -- kalarm. + "Sxiv", + "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. + "Wpa_gui", + "veromix", + "xtightvncviewer"}, + + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + "Event Tester", -- xev. + }, + role = { + "AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. + } + }, properties = { floating = true }}, + + -- Add titlebars to normal clients and dialogs + { rule_any = {type = { "normal", "dialog" } + }, properties = { titlebars_enabled = true } + }, + + -- Set Firefox to always map on the tag named "2" on screen 1. + -- { rule = { class = "Firefox" }, + -- properties = { screen = 1, tag = "2" } }, +} +-- }}} diff --git a/core/signals.lua b/core/signals.lua new file mode 100644 index 0000000..a29a6c6 --- /dev/null +++ b/core/signals.lua @@ -0,0 +1,35 @@ +local awful = require('awful') +local gears = require('gears') +local beautiful = require("beautiful") +-- {{{ 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 + local s, preprocess = pcall(require,"core.client") + if s then + preprocess(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + require("core.titlebar")(c) +end) + +-- Enable sloppy focus, so that focus follows mouse. +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) +-- }}} diff --git a/core/style.lua b/core/style.lua new file mode 100644 index 0000000..5849b17 --- /dev/null +++ b/core/style.lua @@ -0,0 +1,3 @@ +local beautiful = require("beautiful") +beautiful.init(global.theme) + diff --git a/core/titlebar.lua b/core/titlebar.lua new file mode 100644 index 0000000..987c25b --- /dev/null +++ b/core/titlebar.lua @@ -0,0 +1,109 @@ +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local menu = require("widgets.polymenu") +local move_screentags = {} +local toggle_screentags = {} +awful.screen.connect_for_each_screen(function(s) + local move_tags = {} + local toggle_tags = {} + for _,tag in pairs(s.tags) do + table.insert(move_tags,{ + tag.name, + function() + if client.focus then + client.focus:tags({tag}) + end + end + }) + table.insert(toggle_tags,{ + tag.name, + function() + if client.focus then + local tags = client.focus:tags() + for k,v in pairs(tags) do + if v == tag then + table.remove(tags,k) + client.focus:tags(tags) + return + end + end + table.insert(tags,tag) + client.focus:tags(tags) + end + end + }) + end + table.insert(move_screentags,{ + "Screen "..tostring(s.index), + move_tags + }) + table.insert(toggle_screentags,{ + "Screen "..tostring(s.index), + toggle_tags + }) +end) +return function(c) + local buttons = gears.table.join( + awful.button({ }, 1, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.resize(c) + end) + ) + c.menu = menu({ + before = { + { + awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.stickybutton (c), + awful.titlebar.widget.ontopbutton (c), + forced_width = 72, + forced_height = 24, + layout = wibox.layout.fixed.horizontal, + } + }, + items = { + { "Move to tag" , + move_screentags + }, + { "Toggle on tag", + toggle_screentags + } + }, + vertical = true + }) + c.menu_button = awful.titlebar.widget.iconwidget(c) + c.menu_button:connect_signal("button::press", function() + c.menu.toggle() + c:emit_signal("request::activate", "titlebar", {raise = true}) + end) + c:connect_signal("unfocus",function() + if c.menu.visible then + c.menu.toggle(0,0) + end + end) + return awful.titlebar(c) : setup { + { -- Left + c.menu_button, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.minimizebutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal, + } +end diff --git a/core/vars.lua b/core/vars.lua new file mode 100644 index 0000000..7f2cb9f --- /dev/null +++ b/core/vars.lua @@ -0,0 +1,30 @@ +local awful = require("awful") +local gears = require("gears") +-- {{{ Variable definitions +global = {} +global.awesome_dir = os.getenv("HOME").."/.config/awesome/" +global.config_dir = os.getenv("HOME").."/.awesome/" +global.theme = global.awesome_dir .. "themes/unity2/theme.lua" +global.terminal = "xterm" +global.editor = os.getenv("EDITOR") or "vim" +global.editor_cmd = global.terminal .. " -e ".. global.editor +global.modkey = "Mod4" +awful.layout.layouts = { + awful.layout.suit.floating, + 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.spiral, + awful.layout.suit.spiral.dwindle, + awful.layout.suit.max, + 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, +} +-- }}} diff --git a/core/widgets/hotkeys_popup.lua b/core/widgets/hotkeys_popup.lua new file mode 100644 index 0000000..1534638 --- /dev/null +++ b/core/widgets/hotkeys_popup.lua @@ -0,0 +1,8 @@ +local awful = require("awful") +local gears = require("gears") +local hotkeys_popup = require("awful.hotkeys_popup") +root.keys(gears.table.join( + root.keys(), + awful.key({ global.modkey, }, "s", hotkeys_popup.show_help, + {description="show help", group="awesome"}))) +return hotkeys_popup diff --git a/core/widgets/layout_box.lua b/core/widgets/layout_box.lua new file mode 100644 index 0000000..da779a0 --- /dev/null +++ b/core/widgets/layout_box.lua @@ -0,0 +1,12 @@ +local awful = require("awful") +local gears = require("gears") +-- (Layout list is in vars.lua because it functions without this widget) +return function(s) + local layoutbox = awful.widget.layoutbox(s) + layoutbox: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))) + return layoutbox +end diff --git a/core/widgets/menu.lua b/core/widgets/menu.lua new file mode 100644 index 0000000..cb4b088 --- /dev/null +++ b/core/widgets/menu.lua @@ -0,0 +1,91 @@ +local awful = require('awful') +local gears = require("gears") +local beautiful = require('beautiful') +local polymenu = require("widgets.polymenu") +local wibox = require("wibox") +local awmtk = require("awmtk") +local style = awmtk.style(awmtk.defaults,{},"powercontrol_") +local awesome_menu = { + { "hotkeys", function() require("core.widgets.hotkeys_popup").show_help(nil, awful.screen.focused()) end }, + { "manual", global.terminal .. " -e man awesome" }, + { "edit config", global.editor_cmd .. " " .. awesome.conffile }, + { "restart", awesome.restart }, + { "quit", function() awesome.quit() end }, +} +local before_table = { + { + widget = wibox.widget.textbox, + markup = "AwesomeWM" + } +} +local after_table = {} +awful.screen.connect_for_each_screen(function(s) + table.insert(before_table,{ + { + widget = wibox.widget.textbox, + markup = "Screen "..tostring(s.index) + }, + require("core.widgets.taglist")(s), + layout = wibox.layout.fixed.vertical + }) +end) +table.insert(after_table,{ + style.icon({ + widget = wibox.widget.imagebox, + image = gears.color.recolor_image(style.powercontrol_icon_shutdown,style.powercontrol_button_fg_normal), + resize = true + },{ + bg = style.powercontrol_button_bg_focus, + forced_width = 24, + forced_height = 24 + },{ + function() + awful.spawn("loginctl poweroff") + end + }), + style.icon({ + widget = wibox.widget.imagebox, + image = gears.color.recolor_image(style.powercontrol_icon_suspend,style.powercontrol_button_fg_normal), + resize = true, + },{ + bg = style.powercontrol_button_bg_focus, + forced_width = 24, + forced_height = 24 + },{ + function() + awful.spawn("loginctl suspend") + end + }), + style.icon({ + widget = wibox.widget.imagebox, + image = gears.color.recolor_image(style.powercontrol_icon_lock,style.powercontrol_button_fg_normal), + resize = true, + },{ + bg = style.powercontrol_button_bg_focus, + forced_width = 24, + forced_height = 24 + },{ + function() + awesome.emit_signal("lock_screen") + end + }), + spacing = style.powercontrol_container_spacing_horizontal, + layout = wibox.layout.fixed.horizontal +}) +local items = require("widgets.xdg-menu") { + before = {{ "awesome", awesome_menu, beautiful.awesome_icon }}, + after = {{ "open terminal", global.terminal }}, +} +local menu_template = { + before = before_table, + items = items, + after = after_table, + vertical = true, + inverse = true +} +local menu = polymenu(menu_template) +root.keys(gears.table.join( + root.keys(), + awful.key({ global.modkey, }, "w", function () menu:show() end, + {description = "show main menu", group = "awesome"}))) +return menu diff --git a/core/widgets/menu_launcher.lua b/core/widgets/menu_launcher.lua new file mode 100644 index 0000000..2af1ac9 --- /dev/null +++ b/core/widgets/menu_launcher.lua @@ -0,0 +1,5 @@ +local awful = require('awful') +local beautiful = require('beautiful') +return awful.widget.launcher({ image = beautiful.awesome_icon, + menu = require("core.widgets.menu") }) + diff --git a/core/widgets/menubar.lua b/core/widgets/menubar.lua new file mode 100644 index 0000000..3c2535e --- /dev/null +++ b/core/widgets/menubar.lua @@ -0,0 +1,11 @@ +local awful = require("awful") +local gears = require("gears") +local menubar = require("menubar") +root.keys(gears.table.join( + root.keys(), + -- Menubar + awful.key({ global.modkey }, "p", function() menubar.show() end, + {description = "show the menubar", group = "launcher"}) +)) +menubar.utils.terminal = global.terminal +return menubar diff --git a/core/widgets/prompt.lua b/core/widgets/prompt.lua new file mode 100644 index 0000000..16a670f --- /dev/null +++ b/core/widgets/prompt.lua @@ -0,0 +1,25 @@ +--This widget is now entirely portable. Bindings are loaded and always reference the new object, not an object named "mypromptbox" attached to the screen. +local gears = require("gears") +local awful = require("awful") +return function() + local new_prompt = awful.widget.prompt() + root.keys(gears.table.join( + root.keys(), + -- Prompt + awful.key({ global.modkey }, "r", function () new_prompt:run() end, + {description = "run prompt", group = "launcher"}), + + awful.key({ global.modkey }, "x", + function () + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = new_prompt.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, + {description = "lua execute prompt", group = "awesome"}))) + return new_prompt +end + + diff --git a/core/widgets/taglist.lua b/core/widgets/taglist.lua new file mode 100644 index 0000000..9bdc9d3 --- /dev/null +++ b/core/widgets/taglist.lua @@ -0,0 +1,27 @@ +local awful = require("awful") +local gears = require("gears") +local taglist_buttons = gears.table.join( + awful.button({ }, 1, function(t) t:view_only() end), + awful.button({ global.modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ global.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) + ) + +return function(s) + return awful.widget.taglist { + screen = s, + filter = awful.widget.taglist.filter.all, + buttons = taglist_buttons + } +end + diff --git a/core/widgets/tasklist.lua b/core/widgets/tasklist.lua new file mode 100644 index 0000000..e199240 --- /dev/null +++ b/core/widgets/tasklist.lua @@ -0,0 +1,31 @@ +local awful = require("awful") +local gears = require("gears") +local tasklist_buttons = gears.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + c:emit_signal( + "request::activate", + "tasklist", + {raise = true} + ) + end + 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)) + +return function(s) + return awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons + } +end diff --git a/libs/README.txt b/libs/README.txt new file mode 100644 index 0000000..248c4b9 --- /dev/null +++ b/libs/README.txt @@ -0,0 +1,6 @@ +This folder contains various shared libraries, either in lua or in C. + +If the libraries are written in C, they could be installed using scripts that +could be found in various-scripts/ + +The documentation for each library is provided in docs/libs/libraryname.md diff --git a/libs/awmtk.lua b/libs/awmtk.lua new file mode 100644 index 0000000..4923782 --- /dev/null +++ b/libs/awmtk.lua @@ -0,0 +1,343 @@ +-- AWMTK isn't exactly a toolkit as much as it is +-- an addon on top of awesome's native widget capabilities. +-- What it provides primarily is the ability to sub-theme +-- various parts of the ui. +-- Features: +-- - Many new non-standard beautiful variables, +-- - Hierarchic defaults, +-- - Quick widget generators, +-- - Variable prefix generators (like titlebar_bg_normal, etc), +-- - Nightmares, +-- - Why does this exist, +-- - Please don't use it. +local beautiful = require("beautiful") +local wibox = require("wibox") +local awful = require("awful") +local gears = require("gears") +local awmtk = {} + +--Global class names +local classes = { + "container_", + "button_", + "inputbox_", + "textbox_", + "icon_" +} +-- Utility functions +local get_child_by_id = function(widget,id,limit) + local children = {} + local function _get_child(widget,id) + for k,v in pairs(widget) do + if type(v) == "table" then + if v.id == id then + children[#children+1] = v + end + _get_child(v,id) + end + end + end + _get_child({widget},id) + return children +end +local function key_union(...) + local tables = {...} + local keys_lookup = {} + local keys = {} + for _,v in pairs(tables) do + for k,whocareslol in pairs(v) do + if not keys_lookup[k] then + keys_lookup[k] = k + table.insert(keys,k) + end + end + end + return keys +end +-- Preprocessable boilerplates +local preprocess = {} +preprocess.button = function(style) + return function(widget,args,callbacks) + local args = args or {} + local callbacks = callbacks or {} + local new_widget = style.button_widget(style) + local background = get_child_by_id(new_widget,"widget_background")[1] + for k,v in pairs(args) do + background[k] = v + end + local container = get_child_by_id(new_widget,"widget_container")[1] + container[#container+1] = widget + new_widget = wibox.widget(new_widget) + awmtk.connect_buttons(new_widget,callbacks) + return new_widget + end +end +preprocess.icon = function(style) + return function(widget,args,callbacks) + local args = args or {} + local callbacks = callbacks or {} + local new_widget = style.icon_widget(style) + local background = get_child_by_id(new_widget,"widget_background")[1] + for k,v in pairs(args) do + background[k] = v + end + local container = get_child_by_id(new_widget,"widget_container")[1] + container[#container+1] = widget + new_widget = wibox.widget(new_widget) + awmtk.connect_buttons(new_widget,callbacks) + return new_widget + end +end +preprocess.inputbox = function(style) + return function(ps1,args,prompt_args) + local args = args or {} + local new_widget = style.inputbox_widget(style,ps1) + local background = get_child_by_id(new_widget,"widget_background")[1] + for k,v in pairs(args) do + background[k] = v + end + new_widget = wibox.widget(new_widget) + local textbox = new_widget:get_children_by_id("widget_prompt")[1] + awmtk.connect_buttons(new_widget,{function() + if prompt_args.pre_callback then + prompt_args.pre_callback(textbox) + end + local prompt_options = { + textbox = textbox, + } + for k,v in pairs(prompt_args) do + if k ~= "textbox" then + prompt_options[k] = v + end + end + prompt_options.exe_callback = function(input) + prompt_args.exe_callback(input,textbox) + textbox:set_markup_silently(ps1) + end + awful.prompt.run(prompt_options) + end}) + return new_widget + end +end +preprocess.container = function(style) + return function(widget,args) + local args = args or {} + local new_widget = style.container_widget(style) + local background = get_child_by_id(new_widget,"widget_background")[1] + for k,v in pairs(args) do + background[k] = v + end + local container = get_child_by_id(new_widget,"widget_container")[1] + container[#container+1] = widget + new_widget = wibox.widget(new_widget) + return new_widget + end +end +preprocess.shape = function(style) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, style.rounding) + end +end +preprocess.container_shape = function(style) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, style.container_rounding or style.rounding) + end +end +preprocess.button_shape = function(style) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, style.button_rounding or style.rounding) + end +end +preprocess.icon_shape = function(style) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, style.icon_rounding or style.rounding) + end +end +preprocess.inputbox_shape = function(style) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, style.inputbox_rounding or style.rounding) + end +end +-- AWMTK functions + +awmtk.connect_buttons = function(new_widget,callbacks) + new_widget:buttons ( + awful.util.table.join( + (callbacks[1] and awful.button({},1,callbacks[1],callbacks.release_1)), + (callbacks[2] and awful.button({},2,callbacks[2],callbacks.release_2)), + (callbacks[3] and awful.button({},3,callbacks[3],callbacks.release_3)) + ) + ) + return new_widget +end + +awmtk._create_preprocess_style = function(style,prefix) + -- We use this function to force templates to favor prefix values + new_style = setmetatable({}, { + __index = function(t,k) + if type(k) == "string" and style[prefix..k] then + return style[prefix..k] + end + return style[k] + end + }) + return new_style +end +awmtk.create_prefix = function(style,prefix,index) + -- Create a prefix for new widgets to use + local keys = index + for _,k in pairs(keys) do + style[prefix..k] = style[prefix..k] or style[k] or parent[k] + end + return style +end +awmtk.style = function(parent,delta,prefix) + local new_style = setmetatable({},{ + __index = function(t,k) + return rawget(t,k) or + delta[k] or + parent[k] + end + }) + if prefix then + new_style = awmtk.create_prefix(new_style,prefix,key_union(parent,delta)) + end + local _new_style = awmtk._create_preprocess_style(new_style,prefix) + _new_style.button_shape = preprocess.button_shape(_new_style) + _new_style.icon_shape = preprocess.icon_shape(_new_style) + _new_style.container_shape = preprocess.container_shape(_new_style) + _new_style.inputbox_shape = preprocess.inputbox_shape(_new_style) + new_style.button = preprocess.button(_new_style) + new_style.icon = preprocess.icon(_new_style) + new_style.container = preprocess.container(_new_style) + new_style.inputbox = preprocess.inputbox(_new_style) + return new_style +end + +-- Default variables table +defaults = setmetatable({},{ + __index = beautiful +}) +defaults.bg_normal = defaults.bg_normal +defaults.bg_focus = defaults.bg_focus +defaults.bg_urgent = defaults.bg_urgent +defaults.bg_marked = defaults.bg_marked +defaults.fg_normal = defaults.fg_normal +defaults.fg_focus = defaults.fg_focus +defaults.fg_urgent = defaults.fg_urgent +defaults.fg_marked = defaults.fg_marked +defaults.border_width = defaults.border_width +defaults.border_normal = defaults.border_normal +defaults.border_focus = defaults.border_focus +defaults.border_marked = defaults.border_marked +defaults.shape_border_width = defaults.shape_border_width or 0 +defaults.shape_border_color = defaults.shape_border_color or defaults.bg_normal +-- Extra variables +defaults.inner_margin = defaults.inner_margin or 5 +defaults.rounding = defaults.rounding or 0 +local new_defaults = {} +-- Generate classes variables +for _,class in pairs(classes) do + for parameter,value in pairs(defaults) do + new_defaults[class..parameter] = ( + defaults[class..parameter] or + value + ) + end +end +for parameter,value in pairs(defaults) do + new_defaults[parameter] = value +end +defaults = setmetatable(new_defaults,{ + __index = beautiful +}) +--make icons look less weird +defaults.icon_inner_margin = beautiful.icon_inner_margin or 0 +--add spacing for lists +defaults.container_spacing = defaults.container_spacing or 2 +defaults.container_spacing_vertical = defaults.container_spacing_vertical or defaults.container_spacing +defaults.container_spacing_horizontal = defaults.container_spacing_horizontal or defaults.container_spacing +-- Templates for quick widget generation +defaults.button_widget = defaults.button_widget or function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.button_inner_margin, + }, + bg = style.button_bg_normal, + id = "widget_background", + widget = wibox.container.background, + shape = style.button_shape, + shape_border_width = style.button_shape_border_width, + shape_border_color = style.button_shape_border_color, + fg = style.button_fg_normal + } +end +defaults.icon_widget = defaults.icon_widget or function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.icon_inner_margin, + }, + bg = style.icon_bg_normal, + id = "widget_background", + widget = wibox.container.background, + shape = style.icon_shape, + shape_border_width = style.icon_shape_border_width, + shape_border_color = style.icon_shape_border_color, + fg = style.icon_fg_normal + } +end +defaults.container_widget = defaults.container_widget or function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.container_inner_margin, + }, + bg = style.container_bg_normal, + id = "widget_background", + widget = wibox.container.background, + shape = style.container_shape, + shape_border_width = style.container_shape_border_width, + shape_border_color = style.container_shape_border_color, + fg = style.container_fg_normal + } +end +defaults.inputbox_widget = defaults.inputbox_widget or function(style,prompt) + return { + { + { + id = "widget_prompt", + markup = prompt or "", + widget = wibox.widget.textbox, + fg = style.inputbox_fg_normal + }, + id = "widget_container", + widget = wibox.container.margin, + margins = style.inputbox_inner_margin, + }, + bg = style.inputbox_bg_normal, + id = "widget_background", + widget = wibox.container.background, + shape = style.inputbox_shape, + shape_border_width = style.inputbox_shape_border_width, + shape_border_color = style.inputbox_shape_border_color + } +end +defaults.button_shape = defaults.button_shape or preprocess.button_shape(defaults) +defaults.icon_shape = defaults.icon_shape or preprocess.icon_shape(defaults) +defaults.container_shape = defaults.container_shape or preprocess.container_shape(defaults) +defaults.button = preprocess.button(defaults) +defaults.icon = preprocess.icon(defaults) +defaults.container = preprocess.container(defaults) +defaults.inputbox = preprocess.inputbox(defaults) +awmtk.defaults = defaults +awmtk.preprocess = preprocess +awmtk.utils = { + key_union = key_union, + get_child_by_id = get_child_by_id +} +return awmtk diff --git a/libs/pam.so b/libs/pam.so new file mode 100644 index 0000000..182f05f Binary files /dev/null and b/libs/pam.so differ diff --git a/libs/pam/LICENSE b/libs/pam/LICENSE new file mode 100644 index 0000000..fa2182e --- /dev/null +++ b/libs/pam/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2012 Dennis Schridde + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/libs/pam/README b/libs/pam/README new file mode 100644 index 0000000..0c43fdc --- /dev/null +++ b/libs/pam/README @@ -0,0 +1 @@ +https://github.com/devurandom/lua-pam diff --git a/libs/simplepam.lua b/libs/simplepam.lua new file mode 100644 index 0000000..d5573ea --- /dev/null +++ b/libs/simplepam.lua @@ -0,0 +1,52 @@ +-- If you experience errors on the next line, +-- that means that you did not install lua-pam. +-- Run install_luapam.sh from the various-scripts directory. +local pam = require('pam') +local naughty = require("naughty") + +local function check_password(pw,username) + local function conversation(messages) + local responses = {} + for i, message in ipairs(messages) do + local msg_style, msg = message[1], message[2] + if msg_style == pam.PROMPT_ECHO_OFF then + -- Assume PAM asks us for the password + print("PAM Message: ",msg) + responses[i] = {pw, 0} + elseif msg_style == pam.PROMPT_ECHO_ON then + -- Assume PAM asks us for the username + print("PAM Message: ",msg) + responses[i] = {username or os.getenv("USER"), 0} + elseif msg_style == pam.ERROR_MSG then + print("PAM Error: ",msg) + responses[i] = {"", 0} + elseif msg_style == pam.TEXT_INFO then + print("PAM Info message: ",msg) + responses[i] = {"", 0} + else + print("Unsupported conversation message style for PAM: " .. msg_style) + print("PAM Message: ",msg) + end + end + return responses + end + local handler,err = pam.start("system-auth", nil, {conversation, nil}) + if not handler then + naughty.notify({title="PAM session start error: ",text=err,bg="#AA0000"}) + print("PAM session start error: ",err) + return false + end + local auth,err = pam.authenticate(handler) + if not auth then + print("PAM authentication error: ",err) + return false + end + local s_end,err = pam.endx(handler, pam.SUCCESS) + if not s_end then + naughty.notify({title="PAM session end error: ",text=err,bg="#AA0000"}) + print("PAM session end error: ",err) + return false + end + return true +end +return check_password diff --git a/modules/README.txt b/modules/README.txt new file mode 100644 index 0000000..69cf660 --- /dev/null +++ b/modules/README.txt @@ -0,0 +1,7 @@ +Modules are self-contained plugins that change the behaviour of awesomewm. + +Their config files are usually located either in ~/.awesome, or in the +folder specified by the varioable global.config_dir in core/vars.lua. + +The configuration format is described in docs/modules/modulename.md + diff --git a/modules/awesomerc.lua b/modules/awesomerc.lua new file mode 100644 index 0000000..aa228dc --- /dev/null +++ b/modules/awesomerc.lua @@ -0,0 +1,68 @@ +---AwesomeWM autorun system +-- This module provides a way to start up applications on desktop boot +-- It's like cron's @reboot but with additional awesomewm specific features +local awful = require("awful") +local rcfile = io.open(global.config_dir.."rc.lua") +local execd = {} +-- load persistent file for "o" tag +local execd_file = io.open("/tmp/awesomerc.started","r") +if execd_file then + execd_file:read("*a"):gsub("[^\n]+",function(prg) + execd[prg] = true + end) + execd_file:close() +end +execd_file = io.open("/tmp/awesomerc.started","w") +local function check_pid(prg) + local args = {} + prg:gsub("[^%s ]+",function(name) + args[#args+1] = name + end) + local prgname + for _,prgn in pairs(args) do + if prgn:match("^[^=]+$") then + prgname = prgn:match("[^/]+$"):sub(1,15) + break + end + end + if os.execute("pgrep "..prgname) == 0 then + return true + else + return false + end +end +local function check_once(prg) + if not execd[prg] then + execd[prg] = true + execd_file:write(tostring(prg).."\n") + return true + end +end +local function apply_tags(k,prg) + if k:match("n") and (check_pid(prg)) then + return false + end + if k:match("o") and (not check_once(prg)) then + return false + end + awful.spawn(prg) + return true +end + +if rcfile then + local rc,err = load(rcfile:read("*a")) + rcfile:close() + local rcdata + if not err then + rcdata = rc() + else + require("naughty").notify({ + title = "Error reading rc.lua", + text = err + }) + end + for entry,command in pairs(rcdata or {}) do + apply_tags(entry,command) + end +end +execd_file:close() diff --git a/modules/custom_binds.lua b/modules/custom_binds.lua new file mode 100644 index 0000000..28114d5 --- /dev/null +++ b/modules/custom_binds.lua @@ -0,0 +1,31 @@ +--This module allows loading in custom keybindings that launch programs. +local gears = require("gears") +local awful = require("awful") +local keys = root.keys() +local bindsfile = io.open(global.config_dir.."binds.lua") +if bindsfile then + local binds = {} + local rc,err = load(bindsfile:read("*a")) + bindsfile:close() + if not err then + binds = rc() + else + require("naughty").notify({ + title = "Error reading binds.lua", + text = err + }) + return + end + local keys = root.keys() + for _,bind in pairs(binds) do + keys = gears.table.join(keys,awful.key(bind[1],bind[2], + function() + awful.spawn.with_shell(bind[3]) + end,{ + description = bind.description, + group = bind.group + })) + end + root.keys(keys) +end + diff --git a/modules/powerman.lua b/modules/powerman.lua new file mode 100644 index 0000000..b4ae918 --- /dev/null +++ b/modules/powerman.lua @@ -0,0 +1,125 @@ +--This module is an attempt to add the functionality of automatic suspension to awesome. +--Although it is not supported nor is advised, it should probably work as long as awful.spawn and gears.timer functions don't change +--A known issue: there is a memory leak that is hard to trace +local awful = require("awful") +local gears = require("gears") +local naughty = require("naughty") +local rcfile = io.open(global.config_dir.."powerman.lua") +G_PowerManPIDs = {} +G_PowerManSleepTimer = os.time() +G_PowerManSuspendTimer = os.time() +G_PowerManSleepNotify = os.time() +G_PowerManSuspendNotify = os.time() +G_PowerManTracker = { + MouseCoords = {} +} +local function pgrep(prg) + awful.spawn.easy_async("pgrep "..prg,function(out,err,r,code) + if out ~= "" then + G_PowerManPIDs[prg] = true + else + G_PowerManPIDs[prg] = nil + end + end) +end +if rcfile then + local sleep_activated,suspend_activated = false,false + local sleep_notified,suspend_notified = false,false + --rc file loading + local rc,err = load(rcfile:read("*a")) + rcfile:close() + local rcdata + if not err then + rcdata = rc() + else + require("naughty").notify({ + title = "Error reading rc.lua", + text = err + }) + end + --disable builtin x11 screensaver timer and dpms timer + awful.spawn("xset -dpms s off") + --defaults + rcdata.sleep_rules = rcdata.sleep_rules or {} + rcdata.suspend_rules = rcdata.suspend_rules or {} + rcdata.sleep_time = rcdata.sleep_time or + ((type(rcdata.sleep_time) == "nil") and 900) + rcdata.suspend_time = rcdata.suspend_time or + ((type(rcdata.suspend_time) == "nil") and 1800) + rcdata.sleep = rcdata.sleep or ((type(rcdata.sleep) == "nil") and true) + rcdata.suspend = rcdata.suspend + rcdata.sleep_notify = rcdata.sleep_notify or + ((type(rcdata.sleep_notify) == "nil") and 600) + rcdata.suspend_notify = rcdata.suspend_notify + --main timer + gears.timer { + timeout = 10, + call_now = true, + autostart = true, + callback = function() + if mouse.coords() and + mouse.coords().x ~= G_PowerManTracker.MouseCoords.x or + mouse.coords().y ~= G_PowerManTracker.MouseCoords.y then + G_PowerManSleepTimer = os.time() + G_PowerManSuspendTimer = os.time() + G_PowerManSleepNotify = os.time() + G_PowerManSuspendNotify = os.time() + sleep_activated = false + suspend_activated = false + sleep_notified = false + suspend_notified = false + end + for flags,progname in pairs(rcdata.sleep_rules) do + pgrep(progname) + if G_PowerManPIDs[progname] then + G_PowerManSleepTimer = os.time() + G_PowerManSleepNotify = os.time() + end + end + for flags,progname in pairs(rcdata.suspend_rules) do + pgrep(progname) + if G_PowerManPIDs[progname] then + G_PowerManSuspendTimer = os.time() + G_PowerManSuspendNotify = os.time() + end + end + if rcdata.sleep_notify and (not sleep_notified) and + (rcdata.sleep_notify+10 < rcdata.sleep_time) then + if os.time()-G_PowerManSleepNotify > rcdata.sleep_notify then + sleep_notified = true + naughty.notify({text="screen will turn off in "..tostring( + math.floor((rcdata.sleep_time-rcdata.sleep_notify)/60) + ).." minutes"}) + end + end + if rcdata.suspend_notify and (not suspend_notified) and + (rcdata.suspend_notify+10 < rcdata.suspend_time) then + if os.time()-G_PowerManSuspendNotify>rcdata.suspend_notify then + suspend_notified = true + naughty.notify({text="Computer will suspend in"..tostring( + math.floor((rcdata.suspend_time-rcdata.suspend_notify)/60) + ).."minutes"}) + end + end + if rcdata.sleep and (not sleep_activated) then + if os.time()-G_PowerManSleepTimer > rcdata.sleep_time then + if rcdata.sleep_lock then + rcdata.sleep_lock() + end + sleep_activated = true + awful.spawn("xset s activate dpms suspend") + end + end + if rcdata.suspend and (not suspend_activated) then + if os.time()-G_PowerManSuspendTimer > rcdata.suspend_time then + if rcdata.suspend_lock then + rcdata.suspend_lock() + end + suspend_activated = true + awful.spawn.with_shell("systemctl suspend || loginctl suspend") + end + end + G_PowerManTracker.MouseCoords = mouse.coords() or {} + end + } +end diff --git a/rc.lua b/rc.lua new file mode 100644 index 0000000..3604f35 --- /dev/null +++ b/rc.lua @@ -0,0 +1,44 @@ +-- If LuaRocks is installed, make sure that packages installed through it are +-- found (e.g. lgi). If LuaRocks is not installed, do nothing. +package.path = os.getenv("HOME").."/.config/awesome/libs/?.lua;" + ..os.getenv("HOME").."/.config/awesome/libs/?/init.lua;" + ..os.getenv("HOME").."/.config/awesome/modules/?/init.lua;" + ..os.getenv("HOME").."/.config/awesome/modules/?.lua;" + ..package.path +package.cpath = os.getenv("HOME").."/.config/awesome/libs/?.so;"..package.cpath + +pcall(require, "luarocks.loader") + +-- Standard awesome library +local gears = require("gears") +local awful = require("awful") +require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") +-- Theme handling library +local beautiful = require("beautiful") +-- Notification library +local naughty = require("naughty") +-- Enable hotkeys help widget for VIM and other apps +-- when client with a matching name is opened: +require("awful.hotkeys_popup.keys") + +-- {{{ Default modules +-- WARNING: Order matters. Don't change it unless you know what you're doing. Read ./core/README.txt +require("core.error") +require("core.vars") +require("core.style") +require("core.binds") +require("core.layout") +require("core.rules") +require("core.signals") +-- }}} + +-- This is a questionable decision, considering that lua has automatic garbage collection, however, it might potentially improve memory usage while not using up much cpu or memory either. +require("gears").timer.start_new(60,function() + collectgarbage("collect") +end) + +require("custom_binds") +require("awesomerc") +require("powerman") diff --git a/themes/alt-icons/layouts/cornerne.png b/themes/alt-icons/layouts/cornerne.png new file mode 100644 index 0000000..bb40d04 Binary files /dev/null and b/themes/alt-icons/layouts/cornerne.png differ diff --git a/themes/alt-icons/layouts/cornernw.png b/themes/alt-icons/layouts/cornernw.png new file mode 100644 index 0000000..9c78188 Binary files /dev/null and b/themes/alt-icons/layouts/cornernw.png differ diff --git a/themes/alt-icons/layouts/cornerse.png b/themes/alt-icons/layouts/cornerse.png new file mode 100644 index 0000000..ca9229b Binary files /dev/null and b/themes/alt-icons/layouts/cornerse.png differ diff --git a/themes/alt-icons/layouts/cornersw.png b/themes/alt-icons/layouts/cornersw.png new file mode 100644 index 0000000..f84570f Binary files /dev/null and b/themes/alt-icons/layouts/cornersw.png differ diff --git a/themes/alt-icons/layouts/dwindle.png b/themes/alt-icons/layouts/dwindle.png new file mode 100644 index 0000000..84c1182 Binary files /dev/null and b/themes/alt-icons/layouts/dwindle.png differ diff --git a/themes/alt-icons/layouts/fairh.png b/themes/alt-icons/layouts/fairh.png new file mode 100644 index 0000000..b28e62b Binary files /dev/null and b/themes/alt-icons/layouts/fairh.png differ diff --git a/themes/alt-icons/layouts/fairv.png b/themes/alt-icons/layouts/fairv.png new file mode 100644 index 0000000..255f3d6 Binary files /dev/null and b/themes/alt-icons/layouts/fairv.png differ diff --git a/themes/alt-icons/layouts/floating.png b/themes/alt-icons/layouts/floating.png new file mode 100644 index 0000000..a8b2bba Binary files /dev/null and b/themes/alt-icons/layouts/floating.png differ diff --git a/themes/alt-icons/layouts/fullscreen.png b/themes/alt-icons/layouts/fullscreen.png new file mode 100644 index 0000000..6c93ce2 Binary files /dev/null and b/themes/alt-icons/layouts/fullscreen.png differ diff --git a/themes/alt-icons/layouts/magnifier.png b/themes/alt-icons/layouts/magnifier.png new file mode 100644 index 0000000..f6ac699 Binary files /dev/null and b/themes/alt-icons/layouts/magnifier.png differ diff --git a/themes/alt-icons/layouts/max.png b/themes/alt-icons/layouts/max.png new file mode 100644 index 0000000..d8378e5 Binary files /dev/null and b/themes/alt-icons/layouts/max.png differ diff --git a/themes/alt-icons/layouts/spiral.png b/themes/alt-icons/layouts/spiral.png new file mode 100644 index 0000000..7da4d5b Binary files /dev/null and b/themes/alt-icons/layouts/spiral.png differ diff --git a/themes/alt-icons/layouts/tile.png b/themes/alt-icons/layouts/tile.png new file mode 100644 index 0000000..9ad9da7 Binary files /dev/null and b/themes/alt-icons/layouts/tile.png differ diff --git a/themes/alt-icons/layouts/tilebottom.png b/themes/alt-icons/layouts/tilebottom.png new file mode 100644 index 0000000..21bd6e9 Binary files /dev/null and b/themes/alt-icons/layouts/tilebottom.png differ diff --git a/themes/alt-icons/layouts/tileleft.png b/themes/alt-icons/layouts/tileleft.png new file mode 100644 index 0000000..6b0df38 Binary files /dev/null and b/themes/alt-icons/layouts/tileleft.png differ diff --git a/themes/alt-icons/layouts/tiletop.png b/themes/alt-icons/layouts/tiletop.png new file mode 100644 index 0000000..af1a4ec Binary files /dev/null and b/themes/alt-icons/layouts/tiletop.png differ diff --git a/themes/alt-icons/taglist/squarefz.png b/themes/alt-icons/taglist/squarefz.png new file mode 100644 index 0000000..7b51bcb Binary files /dev/null and b/themes/alt-icons/taglist/squarefz.png differ diff --git a/themes/alt-icons/taglist/squarez.png b/themes/alt-icons/taglist/squarez.png new file mode 100644 index 0000000..b70328f Binary files /dev/null and b/themes/alt-icons/taglist/squarez.png differ diff --git a/themes/alt-icons/titlebar/close_focus.png b/themes/alt-icons/titlebar/close_focus.png new file mode 100644 index 0000000..c7d1c00 Binary files /dev/null and b/themes/alt-icons/titlebar/close_focus.png differ diff --git a/themes/alt-icons/titlebar/close_normal.png b/themes/alt-icons/titlebar/close_normal.png new file mode 100644 index 0000000..dc23f77 Binary files /dev/null and b/themes/alt-icons/titlebar/close_normal.png differ diff --git a/themes/alt-icons/titlebar/floating_focus_active.png b/themes/alt-icons/titlebar/floating_focus_active.png new file mode 100644 index 0000000..691d0ab Binary files /dev/null and b/themes/alt-icons/titlebar/floating_focus_active.png differ diff --git a/themes/alt-icons/titlebar/floating_focus_inactive.png b/themes/alt-icons/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..aea1fb5 Binary files /dev/null and b/themes/alt-icons/titlebar/floating_focus_inactive.png differ diff --git a/themes/alt-icons/titlebar/floating_normal_active.png b/themes/alt-icons/titlebar/floating_normal_active.png new file mode 100644 index 0000000..4ad65a3 Binary files /dev/null and b/themes/alt-icons/titlebar/floating_normal_active.png differ diff --git a/themes/alt-icons/titlebar/floating_normal_inactive.png b/themes/alt-icons/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..699d1db Binary files /dev/null and b/themes/alt-icons/titlebar/floating_normal_inactive.png differ diff --git a/themes/alt-icons/titlebar/maximized_focus_active.png b/themes/alt-icons/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..07540aa Binary files /dev/null and b/themes/alt-icons/titlebar/maximized_focus_active.png differ diff --git a/themes/alt-icons/titlebar/maximized_focus_inactive.png b/themes/alt-icons/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..3445dc5 Binary files /dev/null and b/themes/alt-icons/titlebar/maximized_focus_inactive.png differ diff --git a/themes/alt-icons/titlebar/maximized_normal_active.png b/themes/alt-icons/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..ea6b9a1 Binary files /dev/null and b/themes/alt-icons/titlebar/maximized_normal_active.png differ diff --git a/themes/alt-icons/titlebar/maximized_normal_inactive.png b/themes/alt-icons/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..5f63cf6 Binary files /dev/null and b/themes/alt-icons/titlebar/maximized_normal_inactive.png differ diff --git a/themes/alt-icons/titlebar/ontop_focus_active.png b/themes/alt-icons/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..5e09ff3 Binary files /dev/null and b/themes/alt-icons/titlebar/ontop_focus_active.png differ diff --git a/themes/alt-icons/titlebar/ontop_focus_inactive.png b/themes/alt-icons/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..db80b22 Binary files /dev/null and b/themes/alt-icons/titlebar/ontop_focus_inactive.png differ diff --git a/themes/alt-icons/titlebar/ontop_normal_active.png b/themes/alt-icons/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..0697dc7 Binary files /dev/null and b/themes/alt-icons/titlebar/ontop_normal_active.png differ diff --git a/themes/alt-icons/titlebar/ontop_normal_inactive.png b/themes/alt-icons/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..cce23b2 Binary files /dev/null and b/themes/alt-icons/titlebar/ontop_normal_inactive.png differ diff --git a/themes/alt-icons/titlebar/sticky_focus_active.png b/themes/alt-icons/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..108f3f1 Binary files /dev/null and b/themes/alt-icons/titlebar/sticky_focus_active.png differ diff --git a/themes/alt-icons/titlebar/sticky_focus_inactive.png b/themes/alt-icons/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..7796a59 Binary files /dev/null and b/themes/alt-icons/titlebar/sticky_focus_inactive.png differ diff --git a/themes/alt-icons/titlebar/sticky_normal_active.png b/themes/alt-icons/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..1888573 Binary files /dev/null and b/themes/alt-icons/titlebar/sticky_normal_active.png differ diff --git a/themes/alt-icons/titlebar/sticky_normal_inactive.png b/themes/alt-icons/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..d877fe6 Binary files /dev/null and b/themes/alt-icons/titlebar/sticky_normal_inactive.png differ diff --git a/themes/redmond98/assets/redmond98borders.svg b/themes/redmond98/assets/redmond98borders.svg new file mode 100644 index 0000000..0d8530d --- /dev/null +++ b/themes/redmond98/assets/redmond98borders.svg @@ -0,0 +1,204 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/redmond98/assets/win98bordersv1.svg b/themes/redmond98/assets/win98bordersv1.svg new file mode 100644 index 0000000..57d674b --- /dev/null +++ b/themes/redmond98/assets/win98bordersv1.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + diff --git a/themes/redmond98/assets/win98bordersv1layer2.svg b/themes/redmond98/assets/win98bordersv1layer2.svg new file mode 100644 index 0000000..315b4a1 --- /dev/null +++ b/themes/redmond98/assets/win98bordersv1layer2.svg @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-caution-charging-symbolic.svg b/themes/redmond98/icons/battery-caution-charging-symbolic.svg new file mode 100644 index 0000000..56fe444 --- /dev/null +++ b/themes/redmond98/icons/battery-caution-charging-symbolic.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/themes/redmond98/icons/battery-caution-symbolic.svg b/themes/redmond98/icons/battery-caution-symbolic.svg new file mode 100644 index 0000000..3fb7d4a --- /dev/null +++ b/themes/redmond98/icons/battery-caution-symbolic.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/themes/redmond98/icons/battery-empty-charging-symbolic.svg b/themes/redmond98/icons/battery-empty-charging-symbolic.svg new file mode 100644 index 0000000..e3e8620 --- /dev/null +++ b/themes/redmond98/icons/battery-empty-charging-symbolic.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/themes/redmond98/icons/battery-empty-symbolic.svg b/themes/redmond98/icons/battery-empty-symbolic.svg new file mode 100644 index 0000000..710c02b --- /dev/null +++ b/themes/redmond98/icons/battery-empty-symbolic.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/themes/redmond98/icons/battery-full-charged-symbolic.svg b/themes/redmond98/icons/battery-full-charged-symbolic.svg new file mode 100644 index 0000000..ae88a8c --- /dev/null +++ b/themes/redmond98/icons/battery-full-charged-symbolic.svg @@ -0,0 +1,70 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-full-charging-symbolic.svg b/themes/redmond98/icons/battery-full-charging-symbolic.svg new file mode 100644 index 0000000..2db325e --- /dev/null +++ b/themes/redmond98/icons/battery-full-charging-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-full-symbolic.svg b/themes/redmond98/icons/battery-full-symbolic.svg new file mode 100644 index 0000000..7daa418 --- /dev/null +++ b/themes/redmond98/icons/battery-full-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-good-charging-symbolic.svg b/themes/redmond98/icons/battery-good-charging-symbolic.svg new file mode 100644 index 0000000..0b54f56 --- /dev/null +++ b/themes/redmond98/icons/battery-good-charging-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-good-symbolic.svg b/themes/redmond98/icons/battery-good-symbolic.svg new file mode 100644 index 0000000..b55a8e0 --- /dev/null +++ b/themes/redmond98/icons/battery-good-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-low-charging-symbolic.svg b/themes/redmond98/icons/battery-low-charging-symbolic.svg new file mode 100644 index 0000000..56fb9cc --- /dev/null +++ b/themes/redmond98/icons/battery-low-charging-symbolic.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-low-symbolic.svg b/themes/redmond98/icons/battery-low-symbolic.svg new file mode 100644 index 0000000..ab50fc2 --- /dev/null +++ b/themes/redmond98/icons/battery-low-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/redmond98/icons/battery-missing-symbolic.svg b/themes/redmond98/icons/battery-missing-symbolic.svg new file mode 100644 index 0000000..f96c4b2 --- /dev/null +++ b/themes/redmond98/icons/battery-missing-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/themes/redmond98/icons/lock.svg b/themes/redmond98/icons/lock.svg new file mode 100644 index 0000000..974b65c --- /dev/null +++ b/themes/redmond98/icons/lock.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/themes/redmond98/icons/shutdown.svg b/themes/redmond98/icons/shutdown.svg new file mode 100644 index 0000000..affd2a5 --- /dev/null +++ b/themes/redmond98/icons/shutdown.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/themes/redmond98/icons/suspend.svg b/themes/redmond98/icons/suspend.svg new file mode 100644 index 0000000..d64205d --- /dev/null +++ b/themes/redmond98/icons/suspend.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/themes/redmond98/icons/volume-high.svg b/themes/redmond98/icons/volume-high.svg new file mode 100644 index 0000000..486ec0b --- /dev/null +++ b/themes/redmond98/icons/volume-high.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/themes/redmond98/icons/volume-low.svg b/themes/redmond98/icons/volume-low.svg new file mode 100644 index 0000000..824a3f6 --- /dev/null +++ b/themes/redmond98/icons/volume-low.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/themes/redmond98/icons/volume-medium.svg b/themes/redmond98/icons/volume-medium.svg new file mode 100644 index 0000000..5e6dd1f --- /dev/null +++ b/themes/redmond98/icons/volume-medium.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/themes/redmond98/icons/volume-muted.svg b/themes/redmond98/icons/volume-muted.svg new file mode 100644 index 0000000..bf8f17a --- /dev/null +++ b/themes/redmond98/icons/volume-muted.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/themes/redmond98/layouts/cornerne.png b/themes/redmond98/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/themes/redmond98/layouts/cornerne.png differ diff --git a/themes/redmond98/layouts/cornernew.png b/themes/redmond98/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/themes/redmond98/layouts/cornernew.png differ diff --git a/themes/redmond98/layouts/cornernw.png b/themes/redmond98/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/themes/redmond98/layouts/cornernw.png differ diff --git a/themes/redmond98/layouts/cornernww.png b/themes/redmond98/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/themes/redmond98/layouts/cornernww.png differ diff --git a/themes/redmond98/layouts/cornerse.png b/themes/redmond98/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/themes/redmond98/layouts/cornerse.png differ diff --git a/themes/redmond98/layouts/cornersew.png b/themes/redmond98/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/themes/redmond98/layouts/cornersew.png differ diff --git a/themes/redmond98/layouts/cornersw.png b/themes/redmond98/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/themes/redmond98/layouts/cornersw.png differ diff --git a/themes/redmond98/layouts/cornersww.png b/themes/redmond98/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/themes/redmond98/layouts/cornersww.png differ diff --git a/themes/redmond98/layouts/dwindle.png b/themes/redmond98/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/themes/redmond98/layouts/dwindle.png differ diff --git a/themes/redmond98/layouts/dwindlew.png b/themes/redmond98/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/themes/redmond98/layouts/dwindlew.png differ diff --git a/themes/redmond98/layouts/fairh.png b/themes/redmond98/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/themes/redmond98/layouts/fairh.png differ diff --git a/themes/redmond98/layouts/fairhw.png b/themes/redmond98/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/themes/redmond98/layouts/fairhw.png differ diff --git a/themes/redmond98/layouts/fairv.png b/themes/redmond98/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/themes/redmond98/layouts/fairv.png differ diff --git a/themes/redmond98/layouts/fairvw.png b/themes/redmond98/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/themes/redmond98/layouts/fairvw.png differ diff --git a/themes/redmond98/layouts/floating.png b/themes/redmond98/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/themes/redmond98/layouts/floating.png differ diff --git a/themes/redmond98/layouts/floatingw.png b/themes/redmond98/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/themes/redmond98/layouts/floatingw.png differ diff --git a/themes/redmond98/layouts/fullscreen.png b/themes/redmond98/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/themes/redmond98/layouts/fullscreen.png differ diff --git a/themes/redmond98/layouts/fullscreenw.png b/themes/redmond98/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/themes/redmond98/layouts/fullscreenw.png differ diff --git a/themes/redmond98/layouts/magnifier.png b/themes/redmond98/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/themes/redmond98/layouts/magnifier.png differ diff --git a/themes/redmond98/layouts/magnifierw.png b/themes/redmond98/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/themes/redmond98/layouts/magnifierw.png differ diff --git a/themes/redmond98/layouts/max.png b/themes/redmond98/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/themes/redmond98/layouts/max.png differ diff --git a/themes/redmond98/layouts/maxw.png b/themes/redmond98/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/themes/redmond98/layouts/maxw.png differ diff --git a/themes/redmond98/layouts/spiral.png b/themes/redmond98/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/themes/redmond98/layouts/spiral.png differ diff --git a/themes/redmond98/layouts/spiralw.png b/themes/redmond98/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/themes/redmond98/layouts/spiralw.png differ diff --git a/themes/redmond98/layouts/tile.png b/themes/redmond98/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/themes/redmond98/layouts/tile.png differ diff --git a/themes/redmond98/layouts/tilebottom.png b/themes/redmond98/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/themes/redmond98/layouts/tilebottom.png differ diff --git a/themes/redmond98/layouts/tilebottomw.png b/themes/redmond98/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/themes/redmond98/layouts/tilebottomw.png differ diff --git a/themes/redmond98/layouts/tileleft.png b/themes/redmond98/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/themes/redmond98/layouts/tileleft.png differ diff --git a/themes/redmond98/layouts/tileleftw.png b/themes/redmond98/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/themes/redmond98/layouts/tileleftw.png differ diff --git a/themes/redmond98/layouts/tiletop.png b/themes/redmond98/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/themes/redmond98/layouts/tiletop.png differ diff --git a/themes/redmond98/layouts/tiletopw.png b/themes/redmond98/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/themes/redmond98/layouts/tiletopw.png differ diff --git a/themes/redmond98/layouts/tilew.png b/themes/redmond98/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/themes/redmond98/layouts/tilew.png differ diff --git a/themes/redmond98/submenu.png b/themes/redmond98/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/themes/redmond98/submenu.png differ diff --git a/themes/redmond98/taglist/squarefw.png b/themes/redmond98/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/themes/redmond98/taglist/squarefw.png differ diff --git a/themes/redmond98/taglist/squarew.png b/themes/redmond98/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/themes/redmond98/taglist/squarew.png differ diff --git a/themes/redmond98/theme.lua b/themes/redmond98/theme.lua new file mode 100644 index 0000000..fcbb7d2 --- /dev/null +++ b/themes/redmond98/theme.lua @@ -0,0 +1,264 @@ +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi + +local gears = require("gears") +local wibox = require("wibox") +local gfs = require("gears.filesystem") +local themes_path = os.getenv("HOME").."/.config/awesome/themes/" +local theme_name = "redmond98" + +local theme = {} + +theme.font = "Ubuntu Regular 9" +theme.unitybar_width = dpi(55) + +theme.tasklist_button_shape_border_width = dpi(1) +theme.tasklist_button_shape_border_color = "#262626AA" +theme.launcher_button_shape_border_width = dpi(1) +theme.launcher_button_shape_border_color = "#262626AA" +theme.launcher_button_size = 44 +theme.tasklist_button_size = 44 +theme.macbar_height = 45 +theme.menu_button_inner_margin = 2 +theme.bg_normal = "#c2c3c3" +theme.bg_focus = "#e2e3e3" +theme.bg_urgent = "#e2e3e3" +theme.bg_minimize = "#d2d3d3" +theme.bg_systray = theme.bg_normal + +theme.fg_normal = "#121212" +theme.fg_focus = "#121212" +theme.fg_urgent = "#121212" +theme.fg_minimize = "#121212" + +theme.useless_gap = dpi(10) +theme.border_width = dpi(1) +theme.border_normal = theme.bg_normal +theme.border_focus = theme.bg_focus +theme.border_marked = theme.bg_marked + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] +-- tasklist_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- prompt_[fg|bg|fg_cursor|bg_cursor|font] +-- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] +-- Example: +--theme.taglist_bg_focus = "#ff0000" +theme.hotkeys_border_color = "#262626" +theme.hotkeys_opacity = 0.2 +theme.bgimage = function(context, cr, width, height) + local surface = gears.surface( + themes_path..theme_name.."/assets/redmond98borders.svg" + ) + local bg_width,bg_height = gears.surface.get_size(surface) + cr:scale(width / bg_width, height / bg_height) + cr:set_source_surface(surface) + cr:paint() +end +theme.button_widget = function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.button_inner_margin, + }, + bgimage = theme.bgimage, + id = "widget_background", + widget = wibox.container.background, + shape = style.button_shape, + shape_border_width = style.button_shape_border_width, + shape_border_color = style.button_shape_border_color, + fg = style.button_fg_normal + } +end +theme.icon_widget = function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.icon_inner_margin, + }, + bgimage = theme.bgimage, + id = "widget_background", + widget = wibox.container.background, + shape = style.icon_shape, + shape_border_width = style.icon_shape_border_width, + shape_border_color = style.icon_shape_border_color, + fg = style.icon_fg_normal + } +end +theme.container_widget = function(style) + return { + { + id = "widget_container", + widget = wibox.container.margin, + margins = style.container_inner_margin, + }, + bgimage = theme.bgimage, + id = "widget_background", + widget = wibox.container.background, + shape = style.container_shape, + shape_border_width = style.container_shape_border_width, + shape_border_color = style.container_shape_border_color, + fg = style.container_fg_normal + } +end +theme.inputbox_widget = function(style,prompt) + return { + { + { + id = "widget_prompt", + markup = prompt or "", + widget = wibox.widget.textbox, + fg = style.inputbox_fg_normal + }, + id = "widget_container", + widget = wibox.container.margin, + margins = style.inputbox_inner_margin, + }, + bgimage = theme.bgimage, + id = "widget_background", + widget = wibox.container.background, + shape = style.inputbox_shape, + shape_border_width = style.inputbox_shape_border_width, + shape_border_color = style.inputbox_shape_border_color + } +end +theme.titlebar_bg_focus = { + type = "linear", + from = { 0, 15 }, + to = { 0, 0 }, + stops = { { 0, "#3C3C3C"} , { 1 , "#424242"} } +} + +theme.titlebar_bg_normal = { + type = "linear", + from = { 0, 15 }, + to = { 0, 0 }, + stops = { { 0, "#161617"} , { 1 , "#222223"} } + +} +theme.topbar_bg = theme.titlebar_bg_normal + +-- Generate taglist squares: +local taglist_square_size = dpi(4) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel( + taglist_square_size, theme.fg_normal +) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( + taglist_square_size, theme.fg_normal +) + +-- Variables set for theming notifications: +-- notification_font +-- not1ification_[bg|fg] +-- notification_[width|height|margin] +-- notification_[border_color|border_width|shape|opacity] +theme.notification_width = dpi(250) +theme.notification_height = dpi(80) +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = themes_path..theme_name.."/submenu.png" +theme.menu_height = dpi(18) +theme.menu_width = dpi(140) + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = themes_path..theme_name.."/titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path..theme_name.."/titlebar/close_focus.png" + +theme.titlebar_minimize_button_normal = themes_path..theme_name.."/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path..theme_name.."/titlebar/minimize_focus.png" + +theme.titlebar_ontop_button_normal_inactive = themes_path..theme_name.."/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path..theme_name.."/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path..theme_name.."/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path..theme_name.."/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = themes_path..theme_name.."/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path..theme_name.."/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path..theme_name.."/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path..theme_name.."/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = themes_path..theme_name.."/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path..theme_name.."/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path..theme_name.."/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path..theme_name.."/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = themes_path..theme_name.."/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path..theme_name.."/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path..theme_name.."/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path..theme_name.."/titlebar/maximized_focus_active.png" + +theme.wallpaper = themes_path..theme_name.."/background.png" + +-- You can use your own layout icons like this: +theme.layout_fairh = themes_path..theme_name.."/layouts/fairhw.png" +theme.layout_fairv = themes_path..theme_name.."/layouts/fairvw.png" +theme.layout_floating = themes_path..theme_name.."/layouts/floatingw.png" +theme.layout_magnifier = themes_path..theme_name.."/layouts/magnifierw.png" +theme.layout_max = themes_path..theme_name.."/layouts/maxw.png" +theme.layout_fullscreen = themes_path..theme_name.."/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path..theme_name.."/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path..theme_name.."/layouts/tileleftw.png" +theme.layout_tile = themes_path..theme_name.."/layouts/tilew.png" +theme.layout_tiletop = themes_path..theme_name.."/layouts/tiletopw.png" +theme.layout_spiral = themes_path..theme_name.."/layouts/spiralw.png" +theme.layout_dwindle = themes_path..theme_name.."/layouts/dwindlew.png" +theme.layout_cornernw = themes_path..theme_name.."/layouts/cornernww.png" +theme.layout_cornerne = themes_path..theme_name.."/layouts/cornernew.png" +theme.layout_cornersw = themes_path..theme_name.."/layouts/cornersww.png" +theme.layout_cornerse = themes_path..theme_name.."/layouts/cornersew.png" + +-- Generate Awesome icon: +theme.awesome_icon = theme_assets.awesome_icon( + theme.menu_height, theme.bg_focus, theme.fg_focus +) + +-- Define the icon theme for application icons. If not set then the icons +-- from /usr/share/icons and /usr/share/icons/hicolor will be used. +theme.icon_theme = "Adwaita" + +-- Recolor icons +theme_assets.recolor_titlebar(theme,theme.fg_normal,"normal") +theme_assets.recolor_titlebar(theme,theme.fg_focus,"focus") +theme_assets.recolor_layout(theme,theme.fg_normal) + +-- Powermenu icons +theme.powercontrol_icon_shutdown = themes_path..theme_name.."/icons/shutdown.svg" +theme.powercontrol_icon_suspend = themes_path..theme_name.."/icons/suspend.svg" +theme.powercontrol_icon_lock = themes_path..theme_name.."/icons/lock.svg" + +-- Volume icons +theme.volume_icon_high = themes_path..theme_name.."/icons/volume-high.svg" +theme.volume_icon_medium = themes_path..theme_name.."/icons/volume-medium.svg" +theme.volume_icon_low = themes_path..theme_name.."/icons/volume-low.svg" +theme.volume_icon_muted = themes_path..theme_name.."/icons/volume-muted.svg" + +-- Battery icons +theme.battery_caution_charging_symbolic = themes_path..theme_name.."/icons/battery-caution-charging-symbolic.svg" +theme.battery_caution_symbolic = themes_path..theme_name.."/icons/battery-caution-symbolic.svg" +theme.battery_empty_charging_symbolic = themes_path..theme_name.."/icons/battery-empty-charging-symbolic.svg" +theme.battery_empty_symbolic = themes_path..theme_name.."/icons/battery-empty-symbolic.svg" +theme.battery_full_charged_symbolic = themes_path..theme_name.."/icons/battery-full-charged-symbolic.svg" +theme.battery_full_charging_symbolic = themes_path..theme_name.."/icons/battery-full-charging-symbolic.svg" +theme.battery_full_symbolic = themes_path..theme_name.."/icons/battery-full-symbolic.svg" +theme.battery_good_charging_symbolic = themes_path..theme_name.."/icons/battery-good-charging-symbolic.svg" +theme.battery_good_symbolic = themes_path..theme_name.."/icons/battery-good-symbolic.svg" +theme.battery_low_charging_symbolic = themes_path..theme_name.."/icons/battery-low-charging-symbolic.svg" +theme.battery_low_symbolic = themes_path..theme_name.."/icons/battery-low-symbolic.svg" +theme.battery_missing_symbolic = themes_path..theme_name.."/icons/battery-missing-symbolic.svg" +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/redmond98/titlebar/close_focus.png b/themes/redmond98/titlebar/close_focus.png new file mode 100644 index 0000000..01ef825 Binary files /dev/null and b/themes/redmond98/titlebar/close_focus.png differ diff --git a/themes/redmond98/titlebar/close_normal.png b/themes/redmond98/titlebar/close_normal.png new file mode 100644 index 0000000..5448ed8 Binary files /dev/null and b/themes/redmond98/titlebar/close_normal.png differ diff --git a/themes/redmond98/titlebar/floating_focus_active.png b/themes/redmond98/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/themes/redmond98/titlebar/floating_focus_active.png differ diff --git a/themes/redmond98/titlebar/floating_focus_inactive.png b/themes/redmond98/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/themes/redmond98/titlebar/floating_focus_inactive.png differ diff --git a/themes/redmond98/titlebar/floating_normal_active.png b/themes/redmond98/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/themes/redmond98/titlebar/floating_normal_active.png differ diff --git a/themes/redmond98/titlebar/floating_normal_inactive.png b/themes/redmond98/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/themes/redmond98/titlebar/floating_normal_inactive.png differ diff --git a/themes/redmond98/titlebar/maximized_focus_active.png b/themes/redmond98/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..d7dffd7 Binary files /dev/null and b/themes/redmond98/titlebar/maximized_focus_active.png differ diff --git a/themes/redmond98/titlebar/maximized_focus_inactive.png b/themes/redmond98/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..844389f Binary files /dev/null and b/themes/redmond98/titlebar/maximized_focus_inactive.png differ diff --git a/themes/redmond98/titlebar/maximized_normal_active.png b/themes/redmond98/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..a705f81 Binary files /dev/null and b/themes/redmond98/titlebar/maximized_normal_active.png differ diff --git a/themes/redmond98/titlebar/maximized_normal_inactive.png b/themes/redmond98/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..4c1ab1f Binary files /dev/null and b/themes/redmond98/titlebar/maximized_normal_inactive.png differ diff --git a/themes/redmond98/titlebar/minimize_focus.png b/themes/redmond98/titlebar/minimize_focus.png new file mode 100644 index 0000000..caaceb2 Binary files /dev/null and b/themes/redmond98/titlebar/minimize_focus.png differ diff --git a/themes/redmond98/titlebar/minimize_normal.png b/themes/redmond98/titlebar/minimize_normal.png new file mode 100644 index 0000000..36621d0 Binary files /dev/null and b/themes/redmond98/titlebar/minimize_normal.png differ diff --git a/themes/redmond98/titlebar/ontop_focus_active.png b/themes/redmond98/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/themes/redmond98/titlebar/ontop_focus_active.png differ diff --git a/themes/redmond98/titlebar/ontop_focus_inactive.png b/themes/redmond98/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/themes/redmond98/titlebar/ontop_focus_inactive.png differ diff --git a/themes/redmond98/titlebar/ontop_normal_active.png b/themes/redmond98/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/themes/redmond98/titlebar/ontop_normal_active.png differ diff --git a/themes/redmond98/titlebar/ontop_normal_inactive.png b/themes/redmond98/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/themes/redmond98/titlebar/ontop_normal_inactive.png differ diff --git a/themes/redmond98/titlebar/sticky_focus_active.png b/themes/redmond98/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/themes/redmond98/titlebar/sticky_focus_active.png differ diff --git a/themes/redmond98/titlebar/sticky_focus_inactive.png b/themes/redmond98/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/themes/redmond98/titlebar/sticky_focus_inactive.png differ diff --git a/themes/redmond98/titlebar/sticky_normal_active.png b/themes/redmond98/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/themes/redmond98/titlebar/sticky_normal_active.png differ diff --git a/themes/redmond98/titlebar/sticky_normal_inactive.png b/themes/redmond98/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/themes/redmond98/titlebar/sticky_normal_inactive.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_orange_RGB.svg b/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_orange_RGB.svg new file mode 100644 index 0000000..2ea2468 --- /dev/null +++ b/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_orange_RGB.svg @@ -0,0 +1 @@ +Artboard 1 \ No newline at end of file diff --git a/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_white_RGB.svg b/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_white_RGB.svg new file mode 100644 index 0000000..db242ec --- /dev/null +++ b/themes/unity2/Focal_Fossa_Wallpapers/Focal Fossa_white_RGB.svg @@ -0,0 +1 @@ +Artboard 1 \ No newline at end of file diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/.DS_Store b/themes/unity2/Focal_Fossa_Wallpapers/JPG/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/.DS_Store differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080.jpg new file mode 100644 index 0000000..deebd59 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080_GREY.jpg new file mode 100644 index 0000000..e8128ce Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_1920x1080_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440.jpg new file mode 100644 index 0000000..9e032d5 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440_GREY.jpg new file mode 100644 index 0000000..3c62cd7 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_2560x1440_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304.jpg new file mode 100644 index 0000000..3ca217f Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304_GREY.jpg new file mode 100644 index 0000000..706e90f Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_4096x2304_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608.jpg new file mode 100644 index 0000000..f701374 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608_GREY.jpg new file mode 100644 index 0000000..9e3a012 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_Plain_WP_8192x4608_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080.jpg new file mode 100644 index 0000000..30383ba Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080_GREY.jpg new file mode 100644 index 0000000..46df268 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_1920x1080_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440.jpg new file mode 100644 index 0000000..aede03e Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440_GREY.jpg new file mode 100644 index 0000000..939a027 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_2560x1440_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304.jpg new file mode 100644 index 0000000..e4922df Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304_GREY.jpg new file mode 100644 index 0000000..369d20d Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_4096x2304_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608.jpg new file mode 100644 index 0000000..38f2e00 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608_GREY.jpg b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608_GREY.jpg new file mode 100644 index 0000000..905f8e6 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/JPG/Focal-Fossa_WP_8192x4608_GREY.jpg differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080.png new file mode 100644 index 0000000..2ff7836 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080_GREY.png new file mode 100644 index 0000000..82dcb73 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_1920x1080_GREY.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440.png new file mode 100644 index 0000000..b157e00 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440_GREY.png new file mode 100644 index 0000000..2871a17 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_2560x1440_GREY.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304.png new file mode 100644 index 0000000..ccf8ed9 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304_GREY.png new file mode 100644 index 0000000..cf74c13 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_Plain_WP_4096x2304_GREY.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080.png new file mode 100644 index 0000000..1435237 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080_GREY.png new file mode 100644 index 0000000..9ff06fb Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_1920x1080_GREY.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440.png new file mode 100644 index 0000000..d40c7bf Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440_GREY.png new file mode 100644 index 0000000..ae43bdd Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_2560x1440_GREY.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304.png new file mode 100644 index 0000000..68a0b5d Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304.png differ diff --git a/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304_GREY.png b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304_GREY.png new file mode 100644 index 0000000..66b9505 Binary files /dev/null and b/themes/unity2/Focal_Fossa_Wallpapers/PNG/Focal-Fossa_WP_4096x2304_GREY.png differ diff --git a/themes/unity2/background.png b/themes/unity2/background.png new file mode 100644 index 0000000..2ff7836 Binary files /dev/null and b/themes/unity2/background.png differ diff --git a/themes/unity2/icons/battery-caution-charging-symbolic.svg b/themes/unity2/icons/battery-caution-charging-symbolic.svg new file mode 100644 index 0000000..56fe444 --- /dev/null +++ b/themes/unity2/icons/battery-caution-charging-symbolic.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/themes/unity2/icons/battery-caution-symbolic.svg b/themes/unity2/icons/battery-caution-symbolic.svg new file mode 100644 index 0000000..3fb7d4a --- /dev/null +++ b/themes/unity2/icons/battery-caution-symbolic.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/themes/unity2/icons/battery-empty-charging-symbolic.svg b/themes/unity2/icons/battery-empty-charging-symbolic.svg new file mode 100644 index 0000000..e3e8620 --- /dev/null +++ b/themes/unity2/icons/battery-empty-charging-symbolic.svg @@ -0,0 +1,12 @@ + + + + + diff --git a/themes/unity2/icons/battery-empty-symbolic.svg b/themes/unity2/icons/battery-empty-symbolic.svg new file mode 100644 index 0000000..710c02b --- /dev/null +++ b/themes/unity2/icons/battery-empty-symbolic.svg @@ -0,0 +1,9 @@ + + + + + diff --git a/themes/unity2/icons/battery-full-charged-symbolic.svg b/themes/unity2/icons/battery-full-charged-symbolic.svg new file mode 100644 index 0000000..ae88a8c --- /dev/null +++ b/themes/unity2/icons/battery-full-charged-symbolic.svg @@ -0,0 +1,70 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/unity2/icons/battery-full-charging-symbolic.svg b/themes/unity2/icons/battery-full-charging-symbolic.svg new file mode 100644 index 0000000..2db325e --- /dev/null +++ b/themes/unity2/icons/battery-full-charging-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/unity2/icons/battery-full-symbolic.svg b/themes/unity2/icons/battery-full-symbolic.svg new file mode 100644 index 0000000..7daa418 --- /dev/null +++ b/themes/unity2/icons/battery-full-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/unity2/icons/battery-good-charging-symbolic.svg b/themes/unity2/icons/battery-good-charging-symbolic.svg new file mode 100644 index 0000000..0b54f56 --- /dev/null +++ b/themes/unity2/icons/battery-good-charging-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/unity2/icons/battery-good-symbolic.svg b/themes/unity2/icons/battery-good-symbolic.svg new file mode 100644 index 0000000..b55a8e0 --- /dev/null +++ b/themes/unity2/icons/battery-good-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/unity2/icons/battery-low-charging-symbolic.svg b/themes/unity2/icons/battery-low-charging-symbolic.svg new file mode 100644 index 0000000..56fb9cc --- /dev/null +++ b/themes/unity2/icons/battery-low-charging-symbolic.svg @@ -0,0 +1,71 @@ + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/themes/unity2/icons/battery-low-symbolic.svg b/themes/unity2/icons/battery-low-symbolic.svg new file mode 100644 index 0000000..ab50fc2 --- /dev/null +++ b/themes/unity2/icons/battery-low-symbolic.svg @@ -0,0 +1,62 @@ + + + + + + image/svg+xml + + + + + + + + + + diff --git a/themes/unity2/icons/battery-missing-symbolic.svg b/themes/unity2/icons/battery-missing-symbolic.svg new file mode 100644 index 0000000..f96c4b2 --- /dev/null +++ b/themes/unity2/icons/battery-missing-symbolic.svg @@ -0,0 +1,69 @@ + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/themes/unity2/icons/lock.svg b/themes/unity2/icons/lock.svg new file mode 100644 index 0000000..974b65c --- /dev/null +++ b/themes/unity2/icons/lock.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/themes/unity2/icons/shutdown.svg b/themes/unity2/icons/shutdown.svg new file mode 100644 index 0000000..affd2a5 --- /dev/null +++ b/themes/unity2/icons/shutdown.svg @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/themes/unity2/icons/suspend.svg b/themes/unity2/icons/suspend.svg new file mode 100644 index 0000000..d64205d --- /dev/null +++ b/themes/unity2/icons/suspend.svg @@ -0,0 +1,13 @@ + + + + + + + + + diff --git a/themes/unity2/icons/volume-high.svg b/themes/unity2/icons/volume-high.svg new file mode 100644 index 0000000..486ec0b --- /dev/null +++ b/themes/unity2/icons/volume-high.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/themes/unity2/icons/volume-low.svg b/themes/unity2/icons/volume-low.svg new file mode 100644 index 0000000..824a3f6 --- /dev/null +++ b/themes/unity2/icons/volume-low.svg @@ -0,0 +1,14 @@ + + + + + + + + + + diff --git a/themes/unity2/icons/volume-medium.svg b/themes/unity2/icons/volume-medium.svg new file mode 100644 index 0000000..5e6dd1f --- /dev/null +++ b/themes/unity2/icons/volume-medium.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/themes/unity2/icons/volume-muted.svg b/themes/unity2/icons/volume-muted.svg new file mode 100644 index 0000000..bf8f17a --- /dev/null +++ b/themes/unity2/icons/volume-muted.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + diff --git a/themes/unity2/layouts/cornerne.png b/themes/unity2/layouts/cornerne.png new file mode 100644 index 0000000..c85bd56 Binary files /dev/null and b/themes/unity2/layouts/cornerne.png differ diff --git a/themes/unity2/layouts/cornernew.png b/themes/unity2/layouts/cornernew.png new file mode 100644 index 0000000..c3fd986 Binary files /dev/null and b/themes/unity2/layouts/cornernew.png differ diff --git a/themes/unity2/layouts/cornernw.png b/themes/unity2/layouts/cornernw.png new file mode 100644 index 0000000..dfe78b3 Binary files /dev/null and b/themes/unity2/layouts/cornernw.png differ diff --git a/themes/unity2/layouts/cornernww.png b/themes/unity2/layouts/cornernww.png new file mode 100644 index 0000000..f489010 Binary files /dev/null and b/themes/unity2/layouts/cornernww.png differ diff --git a/themes/unity2/layouts/cornerse.png b/themes/unity2/layouts/cornerse.png new file mode 100644 index 0000000..023ae79 Binary files /dev/null and b/themes/unity2/layouts/cornerse.png differ diff --git a/themes/unity2/layouts/cornersew.png b/themes/unity2/layouts/cornersew.png new file mode 100644 index 0000000..f7cfa1c Binary files /dev/null and b/themes/unity2/layouts/cornersew.png differ diff --git a/themes/unity2/layouts/cornersw.png b/themes/unity2/layouts/cornersw.png new file mode 100644 index 0000000..c1453c9 Binary files /dev/null and b/themes/unity2/layouts/cornersw.png differ diff --git a/themes/unity2/layouts/cornersww.png b/themes/unity2/layouts/cornersww.png new file mode 100644 index 0000000..a65a043 Binary files /dev/null and b/themes/unity2/layouts/cornersww.png differ diff --git a/themes/unity2/layouts/dwindle.png b/themes/unity2/layouts/dwindle.png new file mode 100644 index 0000000..9902d22 Binary files /dev/null and b/themes/unity2/layouts/dwindle.png differ diff --git a/themes/unity2/layouts/dwindlew.png b/themes/unity2/layouts/dwindlew.png new file mode 100644 index 0000000..9199049 Binary files /dev/null and b/themes/unity2/layouts/dwindlew.png differ diff --git a/themes/unity2/layouts/fairh.png b/themes/unity2/layouts/fairh.png new file mode 100644 index 0000000..d41deea Binary files /dev/null and b/themes/unity2/layouts/fairh.png differ diff --git a/themes/unity2/layouts/fairhw.png b/themes/unity2/layouts/fairhw.png new file mode 100644 index 0000000..bb50e3a Binary files /dev/null and b/themes/unity2/layouts/fairhw.png differ diff --git a/themes/unity2/layouts/fairv.png b/themes/unity2/layouts/fairv.png new file mode 100644 index 0000000..f5f0288 Binary files /dev/null and b/themes/unity2/layouts/fairv.png differ diff --git a/themes/unity2/layouts/fairvw.png b/themes/unity2/layouts/fairvw.png new file mode 100644 index 0000000..4f4ed52 Binary files /dev/null and b/themes/unity2/layouts/fairvw.png differ diff --git a/themes/unity2/layouts/floating.png b/themes/unity2/layouts/floating.png new file mode 100644 index 0000000..b8061a0 Binary files /dev/null and b/themes/unity2/layouts/floating.png differ diff --git a/themes/unity2/layouts/floatingw.png b/themes/unity2/layouts/floatingw.png new file mode 100644 index 0000000..4815894 Binary files /dev/null and b/themes/unity2/layouts/floatingw.png differ diff --git a/themes/unity2/layouts/fullscreen.png b/themes/unity2/layouts/fullscreen.png new file mode 100644 index 0000000..d02f6fc Binary files /dev/null and b/themes/unity2/layouts/fullscreen.png differ diff --git a/themes/unity2/layouts/fullscreenw.png b/themes/unity2/layouts/fullscreenw.png new file mode 100644 index 0000000..5c35bfa Binary files /dev/null and b/themes/unity2/layouts/fullscreenw.png differ diff --git a/themes/unity2/layouts/magnifier.png b/themes/unity2/layouts/magnifier.png new file mode 100644 index 0000000..2925414 Binary files /dev/null and b/themes/unity2/layouts/magnifier.png differ diff --git a/themes/unity2/layouts/magnifierw.png b/themes/unity2/layouts/magnifierw.png new file mode 100644 index 0000000..6209556 Binary files /dev/null and b/themes/unity2/layouts/magnifierw.png differ diff --git a/themes/unity2/layouts/max.png b/themes/unity2/layouts/max.png new file mode 100644 index 0000000..8d20844 Binary files /dev/null and b/themes/unity2/layouts/max.png differ diff --git a/themes/unity2/layouts/maxw.png b/themes/unity2/layouts/maxw.png new file mode 100644 index 0000000..85f5ce3 Binary files /dev/null and b/themes/unity2/layouts/maxw.png differ diff --git a/themes/unity2/layouts/spiral.png b/themes/unity2/layouts/spiral.png new file mode 100644 index 0000000..d9434be Binary files /dev/null and b/themes/unity2/layouts/spiral.png differ diff --git a/themes/unity2/layouts/spiralw.png b/themes/unity2/layouts/spiralw.png new file mode 100644 index 0000000..b78dd86 Binary files /dev/null and b/themes/unity2/layouts/spiralw.png differ diff --git a/themes/unity2/layouts/tile.png b/themes/unity2/layouts/tile.png new file mode 100644 index 0000000..3ede21e Binary files /dev/null and b/themes/unity2/layouts/tile.png differ diff --git a/themes/unity2/layouts/tilebottom.png b/themes/unity2/layouts/tilebottom.png new file mode 100644 index 0000000..6f8c257 Binary files /dev/null and b/themes/unity2/layouts/tilebottom.png differ diff --git a/themes/unity2/layouts/tilebottomw.png b/themes/unity2/layouts/tilebottomw.png new file mode 100644 index 0000000..a1de7b2 Binary files /dev/null and b/themes/unity2/layouts/tilebottomw.png differ diff --git a/themes/unity2/layouts/tileleft.png b/themes/unity2/layouts/tileleft.png new file mode 100644 index 0000000..31d6870 Binary files /dev/null and b/themes/unity2/layouts/tileleft.png differ diff --git a/themes/unity2/layouts/tileleftw.png b/themes/unity2/layouts/tileleftw.png new file mode 100644 index 0000000..cf14c25 Binary files /dev/null and b/themes/unity2/layouts/tileleftw.png differ diff --git a/themes/unity2/layouts/tiletop.png b/themes/unity2/layouts/tiletop.png new file mode 100644 index 0000000..98cade2 Binary files /dev/null and b/themes/unity2/layouts/tiletop.png differ diff --git a/themes/unity2/layouts/tiletopw.png b/themes/unity2/layouts/tiletopw.png new file mode 100644 index 0000000..d1d0872 Binary files /dev/null and b/themes/unity2/layouts/tiletopw.png differ diff --git a/themes/unity2/layouts/tilew.png b/themes/unity2/layouts/tilew.png new file mode 100644 index 0000000..fde2ca4 Binary files /dev/null and b/themes/unity2/layouts/tilew.png differ diff --git a/themes/unity2/menu.lua b/themes/unity2/menu.lua new file mode 100644 index 0000000..34071bb --- /dev/null +++ b/themes/unity2/menu.lua @@ -0,0 +1,117 @@ +local temp = io.open(os.getenv("HOME").."/.config/awesome/file.lua","r") +local filehelper = loadstring(temp:read("*a"))() +temp:close() +--get a giant list of xdg data +log = function(...) + local params = {} + for k,v in pairs({...}) do + params[#params+1] = tostring(v) + end + local str = table.concat(params," ") + filehelper.write("./awesome_log",filehelper.read("./awesome_log").."\n"..str) +end +local function parse_xdg() + local output = {} + local temp = io.popen("find /usr/share/applications","r") + local file_table = temp:read("*a") + temp:close() + local temp = io.popen("find "..os.getenv("HOME").."/.local/share/applications","r") + file_table = file_table.."\n"..temp:read("*a") + temp:close() + local lines = {} + file_table:gsub("[^\n]+",function(capt) lines[#lines+1] = capt end) + for k,v in pairs(lines) do + local data = filehelper.read(v,"*a") + --check if its an app, if it has a name, and if it's even readable. + if data and data:match("Type=([^\n]+)") and data:match("Type=([^\n]+)") == "Application" and data:match("Name=([^\n]+)") then + --get the tags + local tags = data:match("Categories=([^\n]+)") + local categories = {} + if tags then + tags:gsub("[^;]+",function(capt) categories[#categories+1] = capt:match("%w+") end) + end + --remove a bunch of useless category extensions + while true do + local occurences = 0 + local whitelist = { + Network = true, + Game = true, + Education = true, + Development = true, + Graphics = true, + Utility = true, + System = true, + AudioVideo = true, + Office = true, + Settings = true, + } + for k,v in pairs(categories) do + if not whitelist[v] then + table.remove(categories,k) + occurences = occurences + 1 + end + end + if occurences == 0 then + break + end + end + --add this to the end so it'll be detected like a path. + categories[#categories+1]=data:match("Name=([^\n]+)") + output[#output+1] = {data:match("Exec=([^\n%%]+)"),categories = categories} + end + end + return output +end + +--fuck +local function sort_by_categories(input) + local output = {} + assert(type(input) == "table") + for k,v in pairs(input) do + local categories = v.categories + local function sort(tab,list,value) + local found = nil + for k,v in pairs(tab) do + if v[1] == list[1] then + found = v + end + end + if not found then + if list[2] then + tab[#tab+1] = {list[1],{}} + found = tab[#tab] + elseif list[1] then + tab[#tab+1] = {list[1],value} + found = tab[#tab] + end + end + if list[2] then + table.remove(list,1) + found[2] = sort(found[2],list,value) + end + return tab + end + output = sort(output,categories,v[1]) + end + return output +end + +local function sort_untagged(input) + local output = input + local other = {} + for k,v in pairs(input) do + log(k,v[1],v[2]) + if type(v[2]) == "string" then + other[#other+1] = {v[1],v[2]} + output[k] = nil + end + end + local new_output = {} + for k,v in pairs(output) do + new_output[#new_output+1] = v + end + new_output[#new_output+1] = {"Other",other} + return new_output +end + +return sort_untagged(sort_by_categories(parse_xdg())) diff --git a/themes/unity2/submenu.png b/themes/unity2/submenu.png new file mode 100644 index 0000000..b2778e2 Binary files /dev/null and b/themes/unity2/submenu.png differ diff --git a/themes/unity2/taglist/squarefw.png b/themes/unity2/taglist/squarefw.png new file mode 100644 index 0000000..2a86430 Binary files /dev/null and b/themes/unity2/taglist/squarefw.png differ diff --git a/themes/unity2/taglist/squarew.png b/themes/unity2/taglist/squarew.png new file mode 100644 index 0000000..913f2ca Binary files /dev/null and b/themes/unity2/taglist/squarew.png differ diff --git a/themes/unity2/theme.lua b/themes/unity2/theme.lua new file mode 100644 index 0000000..cfb63ef --- /dev/null +++ b/themes/unity2/theme.lua @@ -0,0 +1,190 @@ +local theme_assets = require("beautiful.theme_assets") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi + +local gfs = require("gears.filesystem") +local themes_path = os.getenv("HOME").."/.config/awesome/themes/" +local theme_name = "unity2" + +local theme = {} + +theme.font = "Ubuntu Regular 9" +theme.unitybar_width = dpi(55) + +theme.icon_rounding = 5 +theme.tasklist_button_shape_border_width = dpi(1) +theme.tasklist_button_shape_border_color = "#262626AA" +theme.launcher_button_shape_border_width = dpi(1) +theme.launcher_button_shape_border_color = "#262626AA" +theme.launcher_button_size = 44 +theme.tasklist_button_size = 44 +theme.macbar_rounding = 5 +theme.macbar_height = 45 +theme.menu_button_inner_margin = 2 +theme.container_rounding = 4 +theme.button_rounding = 4 +theme.bg_normal = "#181819" +theme.bg_focus = "#3E3E3E" +theme.bg_urgent = "#2E2E2E" +theme.bg_minimize = "#2E2E2E" +theme.bg_systray = theme.bg_normal + +theme.fg_normal = "#e1dec7" +theme.fg_focus = "#e1dec7" +theme.fg_urgent = "#e1dec7" +theme.fg_minimize = "#e1dec7" + +theme.useless_gap = dpi(10) +theme.border_width = dpi(1) +theme.border_normal = theme.bg_normal +theme.border_focus = theme.bg_focus +theme.border_marked = theme.bg_marked + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- taglist_[bg|fg]_[focus|urgent|occupied|empty|volatile] +-- tasklist_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- prompt_[fg|bg|fg_cursor|bg_cursor|font] +-- hotkeys_[bg|fg|border_width|border_color|shape|opacity|modifiers_fg|label_bg|label_fg|group_margin|font|description_font] +-- Example: +--theme.taglist_bg_focus = "#ff0000" +theme.hotkeys_border_color = "#262626" +theme.hotkeys_opacity = 0.2 + +theme.titlebar_bg_focus = { + type = "linear", + from = { 0, 15 }, + to = { 0, 0 }, + stops = { { 0, "#3C3C3C"} , { 1 , "#424242"} } +} + +theme.titlebar_bg_normal = { + type = "linear", + from = { 0, 15 }, + to = { 0, 0 }, + stops = { { 0, "#161617"} , { 1 , "#222223"} } + +} +theme.topbar_bg = theme.titlebar_bg_normal +theme.titlebar_rounding = 6 + +-- Generate taglist squares: +local taglist_square_size = dpi(4) +theme.taglist_squares_sel = theme_assets.taglist_squares_sel( + taglist_square_size, theme.fg_normal +) +theme.taglist_squares_unsel = theme_assets.taglist_squares_unsel( + taglist_square_size, theme.fg_normal +) + +-- Variables set for theming notifications: +-- notification_font +-- not1ification_[bg|fg] +-- notification_[width|height|margin] +-- notification_[border_color|border_width|shape|opacity] +theme.notification_width = dpi(250) +theme.notification_height = dpi(80) +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = themes_path..theme_name.."/submenu.png" +theme.menu_height = dpi(18) +theme.menu_width = dpi(140) + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = themes_path..theme_name.."/titlebar/close_normal.png" +theme.titlebar_close_button_focus = themes_path..theme_name.."/titlebar/close_focus.png" + +theme.titlebar_minimize_button_normal = themes_path..theme_name.."/titlebar/minimize_normal.png" +theme.titlebar_minimize_button_focus = themes_path..theme_name.."/titlebar/minimize_focus.png" + +theme.titlebar_ontop_button_normal_inactive = themes_path..theme_name.."/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = themes_path..theme_name.."/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = themes_path..theme_name.."/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = themes_path..theme_name.."/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = themes_path..theme_name.."/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = themes_path..theme_name.."/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = themes_path..theme_name.."/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = themes_path..theme_name.."/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = themes_path..theme_name.."/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = themes_path..theme_name.."/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = themes_path..theme_name.."/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = themes_path..theme_name.."/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = themes_path..theme_name.."/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = themes_path..theme_name.."/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = themes_path..theme_name.."/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = themes_path..theme_name.."/titlebar/maximized_focus_active.png" + +theme.wallpaper = themes_path..theme_name.."/background.png" + +-- You can use your own layout icons like this: +theme.layout_fairh = themes_path..theme_name.."/layouts/fairhw.png" +theme.layout_fairv = themes_path..theme_name.."/layouts/fairvw.png" +theme.layout_floating = themes_path..theme_name.."/layouts/floatingw.png" +theme.layout_magnifier = themes_path..theme_name.."/layouts/magnifierw.png" +theme.layout_max = themes_path..theme_name.."/layouts/maxw.png" +theme.layout_fullscreen = themes_path..theme_name.."/layouts/fullscreenw.png" +theme.layout_tilebottom = themes_path..theme_name.."/layouts/tilebottomw.png" +theme.layout_tileleft = themes_path..theme_name.."/layouts/tileleftw.png" +theme.layout_tile = themes_path..theme_name.."/layouts/tilew.png" +theme.layout_tiletop = themes_path..theme_name.."/layouts/tiletopw.png" +theme.layout_spiral = themes_path..theme_name.."/layouts/spiralw.png" +theme.layout_dwindle = themes_path..theme_name.."/layouts/dwindlew.png" +theme.layout_cornernw = themes_path..theme_name.."/layouts/cornernww.png" +theme.layout_cornerne = themes_path..theme_name.."/layouts/cornernew.png" +theme.layout_cornersw = themes_path..theme_name.."/layouts/cornersww.png" +theme.layout_cornerse = themes_path..theme_name.."/layouts/cornersew.png" + +-- Generate Awesome icon: +theme.awesome_icon = theme_assets.awesome_icon( + theme.menu_height, theme.bg_focus, theme.fg_focus +) + +-- Define the icon theme for application icons. If not set then the icons +-- from /usr/share/icons and /usr/share/icons/hicolor will be used. +theme.icon_theme = "Adwaita" + +-- Recolor icons +theme_assets.recolor_titlebar(theme,theme.fg_normal,"normal") +theme_assets.recolor_titlebar(theme,theme.fg_focus,"focus") +theme_assets.recolor_layout(theme,theme.fg_normal) + +-- Powermenu icons +theme.powercontrol_icon_shutdown = themes_path..theme_name.."/icons/shutdown.svg" +theme.powercontrol_icon_suspend = themes_path..theme_name.."/icons/suspend.svg" +theme.powercontrol_icon_lock = themes_path..theme_name.."/icons/lock.svg" + +-- Volume icons +theme.volume_icon_high = themes_path..theme_name.."/icons/volume-high.svg" +theme.volume_icon_medium = themes_path..theme_name.."/icons/volume-medium.svg" +theme.volume_icon_low = themes_path..theme_name.."/icons/volume-low.svg" +theme.volume_icon_muted = themes_path..theme_name.."/icons/volume-muted.svg" + +-- Battery icons +theme.battery_caution_charging_symbolic = themes_path..theme_name.."/icons/battery-caution-charging-symbolic.svg" +theme.battery_caution_symbolic = themes_path..theme_name.."/icons/battery-caution-symbolic.svg" +theme.battery_empty_charging_symbolic = themes_path..theme_name.."/icons/battery-empty-charging-symbolic.svg" +theme.battery_empty_symbolic = themes_path..theme_name.."/icons/battery-empty-symbolic.svg" +theme.battery_full_charged_symbolic = themes_path..theme_name.."/icons/battery-full-charged-symbolic.svg" +theme.battery_full_charging_symbolic = themes_path..theme_name.."/icons/battery-full-charging-symbolic.svg" +theme.battery_full_symbolic = themes_path..theme_name.."/icons/battery-full-symbolic.svg" +theme.battery_good_charging_symbolic = themes_path..theme_name.."/icons/battery-good-charging-symbolic.svg" +theme.battery_good_symbolic = themes_path..theme_name.."/icons/battery-good-symbolic.svg" +theme.battery_low_charging_symbolic = themes_path..theme_name.."/icons/battery-low-charging-symbolic.svg" +theme.battery_low_symbolic = themes_path..theme_name.."/icons/battery-low-symbolic.svg" +theme.battery_missing_symbolic = themes_path..theme_name.."/icons/battery-missing-symbolic.svg" +return theme + +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80 diff --git a/themes/unity2/titlebar/close_focus.png b/themes/unity2/titlebar/close_focus.png new file mode 100644 index 0000000..01ef825 Binary files /dev/null and b/themes/unity2/titlebar/close_focus.png differ diff --git a/themes/unity2/titlebar/close_normal.png b/themes/unity2/titlebar/close_normal.png new file mode 100644 index 0000000..5448ed8 Binary files /dev/null and b/themes/unity2/titlebar/close_normal.png differ diff --git a/themes/unity2/titlebar/floating_focus_active.png b/themes/unity2/titlebar/floating_focus_active.png new file mode 100644 index 0000000..82dcc7c Binary files /dev/null and b/themes/unity2/titlebar/floating_focus_active.png differ diff --git a/themes/unity2/titlebar/floating_focus_inactive.png b/themes/unity2/titlebar/floating_focus_inactive.png new file mode 100644 index 0000000..c19ba80 Binary files /dev/null and b/themes/unity2/titlebar/floating_focus_inactive.png differ diff --git a/themes/unity2/titlebar/floating_normal_active.png b/themes/unity2/titlebar/floating_normal_active.png new file mode 100644 index 0000000..62342d1 Binary files /dev/null and b/themes/unity2/titlebar/floating_normal_active.png differ diff --git a/themes/unity2/titlebar/floating_normal_inactive.png b/themes/unity2/titlebar/floating_normal_inactive.png new file mode 100644 index 0000000..e2bbdfa Binary files /dev/null and b/themes/unity2/titlebar/floating_normal_inactive.png differ diff --git a/themes/unity2/titlebar/maximized_focus_active.png b/themes/unity2/titlebar/maximized_focus_active.png new file mode 100644 index 0000000..d7dffd7 Binary files /dev/null and b/themes/unity2/titlebar/maximized_focus_active.png differ diff --git a/themes/unity2/titlebar/maximized_focus_inactive.png b/themes/unity2/titlebar/maximized_focus_inactive.png new file mode 100644 index 0000000..844389f Binary files /dev/null and b/themes/unity2/titlebar/maximized_focus_inactive.png differ diff --git a/themes/unity2/titlebar/maximized_normal_active.png b/themes/unity2/titlebar/maximized_normal_active.png new file mode 100644 index 0000000..a705f81 Binary files /dev/null and b/themes/unity2/titlebar/maximized_normal_active.png differ diff --git a/themes/unity2/titlebar/maximized_normal_inactive.png b/themes/unity2/titlebar/maximized_normal_inactive.png new file mode 100644 index 0000000..4c1ab1f Binary files /dev/null and b/themes/unity2/titlebar/maximized_normal_inactive.png differ diff --git a/themes/unity2/titlebar/minimize_focus.png b/themes/unity2/titlebar/minimize_focus.png new file mode 100644 index 0000000..caaceb2 Binary files /dev/null and b/themes/unity2/titlebar/minimize_focus.png differ diff --git a/themes/unity2/titlebar/minimize_normal.png b/themes/unity2/titlebar/minimize_normal.png new file mode 100644 index 0000000..36621d0 Binary files /dev/null and b/themes/unity2/titlebar/minimize_normal.png differ diff --git a/themes/unity2/titlebar/ontop_focus_active.png b/themes/unity2/titlebar/ontop_focus_active.png new file mode 100644 index 0000000..312c00b Binary files /dev/null and b/themes/unity2/titlebar/ontop_focus_active.png differ diff --git a/themes/unity2/titlebar/ontop_focus_inactive.png b/themes/unity2/titlebar/ontop_focus_inactive.png new file mode 100644 index 0000000..a48e1c5 Binary files /dev/null and b/themes/unity2/titlebar/ontop_focus_inactive.png differ diff --git a/themes/unity2/titlebar/ontop_normal_active.png b/themes/unity2/titlebar/ontop_normal_active.png new file mode 100644 index 0000000..117a203 Binary files /dev/null and b/themes/unity2/titlebar/ontop_normal_active.png differ diff --git a/themes/unity2/titlebar/ontop_normal_inactive.png b/themes/unity2/titlebar/ontop_normal_inactive.png new file mode 100644 index 0000000..d3a10c8 Binary files /dev/null and b/themes/unity2/titlebar/ontop_normal_inactive.png differ diff --git a/themes/unity2/titlebar/sticky_focus_active.png b/themes/unity2/titlebar/sticky_focus_active.png new file mode 100644 index 0000000..814499b Binary files /dev/null and b/themes/unity2/titlebar/sticky_focus_active.png differ diff --git a/themes/unity2/titlebar/sticky_focus_inactive.png b/themes/unity2/titlebar/sticky_focus_inactive.png new file mode 100644 index 0000000..21b000d Binary files /dev/null and b/themes/unity2/titlebar/sticky_focus_inactive.png differ diff --git a/themes/unity2/titlebar/sticky_normal_active.png b/themes/unity2/titlebar/sticky_normal_active.png new file mode 100644 index 0000000..bdb5595 Binary files /dev/null and b/themes/unity2/titlebar/sticky_normal_active.png differ diff --git a/themes/unity2/titlebar/sticky_normal_inactive.png b/themes/unity2/titlebar/sticky_normal_inactive.png new file mode 100644 index 0000000..a96b9b1 Binary files /dev/null and b/themes/unity2/titlebar/sticky_normal_inactive.png differ diff --git a/various_scripts/README b/various_scripts/README new file mode 100644 index 0000000..91993c3 --- /dev/null +++ b/various_scripts/README @@ -0,0 +1 @@ +These are some scripts that manage some stuff in your folders. Requires root. diff --git a/various_scripts/clean_desktop.py b/various_scripts/clean_desktop.py new file mode 100644 index 0000000..75b9256 --- /dev/null +++ b/various_scripts/clean_desktop.py @@ -0,0 +1,98 @@ +import os +import re +from pathlib import Path +#get path +PATHS = os.environ['PATH'].split(":") + +#directories to check +DIRS = [ + os.environ["HOME"]+"/.local/share/applications/", + "/usr/share/applications" +] + +print("Welcome to shitty link cleaner PRO v1.3.3.7 patch 666") + +isroot = (os.environ["USER"] == "root") +engage = [] + +for directory in DIRS: + p = Path(directory) + dfiles = list(p.glob('./*.desktop')) + if (not isroot) and p.owner() != os.environ["USER"]: + print("Unable to engage "+directory+" motherfucker - i'm not root and i refuse to delete anything in another user's dir.") + else: + print("Engage "+directory+" motherfucker ("+str(len(dfiles))+" files)") + answer = input("[y/n?]: ") + while not (answer in ["y","n"]): + print("Bitch please speak clearly, y/n?") + answer = input("[y/n?]: ") + if answer == "y": + print("Added "+directory+" to cleaning list.") + engage = engage + dfiles + else: + print("Skipping "+directory) + +for f in engage: + if f.is_dir(): + print(str(f)+" isn't even a file, skipping...") + continue + execname = re.findall("\nExec=([^\n]+)\n",f.read_text()) + if not execname: + print(str(f)+" doesn't seem to have an Exec field. delet?") + answer = input("[y/n?]: ") + while not (answer in ["y","n"]): + print("Bitch please speak clearly, y/n?") + answer = input("[y/n?]: ") + if answer == "y": + print(str(f)+" delet") + f.unlink(missing_ok=True) + else: + print("Skipping...") + continue + args = execname[0].split(" ") + comm = None + for arg in args: + if arg == "env": + print("Assuming 'env' is not the target binary - skipping...") + continue + if "=" in arg: + print("Assuming '"+arg+"' is an environment variable - skipping...") + continue + comm = arg + break + if not comm: + print("Weirdly enough, "+str(f)+" has an exec, but no target. delet?") + answer = input("[y/n?]: ") + while not (answer in ["y","n"]): + print("Bitch please speak clearly, y/n?") + answer = input("[y/n?]: ") + if answer == "y": + print(str(f)+" delet") + f.unlink(missing_ok=True) + else: + print("skipping") + continue + else: + print("Testing "+comm+" against various PATHs...") + if f.exists(): + print(str(f)+" seems to be fine, skipping...") + continue + found = False + for path in PATHS: + if (path / f).exists(): + print(str(f)+" seems to be fine, skipping...") + found = True + break + if found: + continue + print(comm+" doesn't seem to exist. delet?") + answer = input("[y/n?]: ") + while not (answer in ["y","n"]): + print("Bitch please speak clearly, y/n?") + answer = input("[y/n?]: ") + if answer == "y": + print(str(f)+" delet") + f.unlink(missing_ok=True) + else: + print("skipping") + continue diff --git a/various_scripts/file.lua b/various_scripts/file.lua new file mode 100644 index 0000000..1b7c9b7 --- /dev/null +++ b/various_scripts/file.lua @@ -0,0 +1,71 @@ +--This bot is heavily dependent on file operations, therefore this library exists. +file = {} +file.safe = true +file.read = function(filename,mode) + assert(type(filename) == "string","string expected, got "..type(filename)) + mode = mode or "*a" + local temp_file,err = io.open(filename,r) + if err then + if not file.safe then error(err) else + ret_string = "" + end + else + ret_string = temp_file:read(mode) + temp_file:close() + end + return ret_string,err +end + +file.write = function(filename,write) + assert(type(filename) == "string", "string expected, got "..type(filename)) + assert(type(write) == "string", "string expected for argument #2 "..type(write)) + local temp_file,err = io.open(filename,"w+") + local status = false + if err then + if not file.safe then error(err) else + status = false + end + else + temp_file:write(write) + temp_file:close() + status = true + end + return status,err +end + +file.readJSON = function(filename,default) + assert(type(filename) == "string","string expected, got "..type(filename)) + json = require("custom.dkjson") + json_data,err = file.read(filename) + if err then + if not file.safe then error(err) else + status = err + table_data = default or {} + end + else + table_data,_,err = json.decode(json_data) + if not table_data then + if not file.safe then error(err) else + status = err + table_data = default or {} + end + end + end + return table_data, status +end +file.writeJSON = function(filename,table_data) + assert(type(filename) == "string","string expected, got "..type(filename)) + assert(type(table_data) == "table","table expected, got "..type(table_data)) + local status = false + local status,json_object,_,err = pcall(function() require("custom.dkjson").encode(table_data) end) + if not status then + if not file.safe then error(err) else + status = false + err = json_object + end + else + status,err = file.write(filename,json_object) + end + return status, err +end +return file diff --git a/various_scripts/install_luapam.sh b/various_scripts/install_luapam.sh new file mode 100644 index 0000000..855c398 --- /dev/null +++ b/various_scripts/install_luapam.sh @@ -0,0 +1,27 @@ +#!/bin/bash +#This script builds luapam module for the appropriate lua version +#Lua-pam is needed by the lock screen widget +doasroot() { + nohup which sudo > /dev/null + if [ "$?" != "0" ]; then + doas $@ + else + sudo $@ + fi +} +LUA_VERSION=$(awesome --version | \ + grep -Po "(?<=Compiled against Lua )5\.\d") +if [ "$LUA_VERSION" == "" ]; then + echo "Unable to detect the lua version which awesome uses" + exit 1 +fi +echo "Target version: $LUA_VERSION" +git clone --recursive https://github.com/devurandom/lua-pam ~/.config/awesome/lua-pam +cd ~/.config/awesome/lua-pam +make LUA_VERSION="$LUA_VERSION" +mkdir -p ~/.config/awesome/libs/pam/ +cp LICENSE ~/.config/awesome/libs/pam/ +echo "https://github.com/devurandom/lua-pam" > ~/.config/awesome/libs/pam/README +cp pam.so ~/.config/awesome/libs/ +rm -rf ~/.config/awesome/lua-pam + diff --git a/various_scripts/remove_config.sh b/various_scripts/remove_config.sh new file mode 100644 index 0000000..8475bf5 --- /dev/null +++ b/various_scripts/remove_config.sh @@ -0,0 +1,6 @@ +#!/bin/bash +rm -r ~/.config/awesome/core +rm -r ~/.config/awesome/widgets +rm -r ~/.config/awesome/libs +rm -r ~/.config/awesome/themes +rm ~/.config/awesome/rc.lua diff --git a/widgets/LICENSE b/widgets/LICENSE new file mode 100644 index 0000000..f63b742 --- /dev/null +++ b/widgets/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2020 Yessiest + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/widgets/battery.lua b/widgets/battery.lua new file mode 100644 index 0000000..891e133 --- /dev/null +++ b/widgets/battery.lua @@ -0,0 +1,46 @@ +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk = require("awmtk") + +return function(args) + local style = awmtk.style(awmtk.defaults, args.style or {},"battery_") + local device = args.device or "default" + local power_command = args.command or "upower -d" + local function get_icon(name) + return style[name] + end + local icon = style.icon({ + { + widget = wibox.widget.imagebox, + image = get_icon("battery_missing_symbolic"), + id = "widget_icon", + resize = true + }, + (args.percentage and { + widget = wibox.widget.textbox, + markup = "0%", + id = "widget_text" + }), + layout = wibox.layout.fixed.horizontal, + spacing = style.battery_container_spacing_horizontal + }) + gears.timer { + autostart = true, + timeout = 10, + call_now = true, + callback = function() + awful.spawn.easy_async_with_shell(power_command, function(out) + local icon_name = out:match("icon%-name:%s+'(battery%-[^']+)'") + local value = out:match("percentage:%s+(%d+%%)") + icon:get_children_by_id("widget_icon")[1].image = + gears.color.recolor_image(get_icon(icon_name:gsub("%-","_")), + style.battery_icon_fg_normal) + if args.percentage and value then + icon:get_children_by_id("widget_text")[1].markup = value + end + end) + end + } + return icon +end diff --git a/widgets/lock.lua b/widgets/lock.lua new file mode 100644 index 0000000..e420f58 --- /dev/null +++ b/widgets/lock.lua @@ -0,0 +1,139 @@ +local awful = require("awful") +local wibox = require("wibox") +local gears = require("gears") +local awmtk = require("awmtk") +local beautiful = require("beautiful") +local simplepam = require("simplepam") +local function read(path) + local file = io.open(path,"r") + if file then + local answer = file:read("*a") + file:close() + return answer + end +end +return function(args) + local style = awmtk.style(awmtk.defaults,args.style or {},"lockscreen_") + if not args.screen then + error("Screen not specified") + end + local s = args.screen + if not G_KeyboardLock then + G_KeyboardLock = awful.keygrabber { + mask_modkeys = true, + mask_event_callback = true + } + end + local function gen_password_prompt() + G_KeyboardLock:start() + local inputbox = style.inputbox("Enter password",{},{ + pre_callback = function() + --Just before we activate the prompt, deactivate keygrabber + G_KeyboardLock:stop() + end, + exe_callback = function(input,textbox) + --Activate keygrabber before calling pam interface + --This prevents any input while pam is checking password. + G_KeyboardLock:start() + if simplepam(input) then + s.lockscreen.visible = false + G_KeyboardLock:stop() + end + end, + highlighter = (args.obscure and function(b,a) + --This adds a black fully transparent text tag to password field + return "","" + end), + prompt = "Password: ", + history_max = 0, + history_path = "/tmp/lockfakehist", + done_callback = function() + --Ensure that even if input is cancelled and if the lock screen is still visible, the lock would start. + if (not G_KeyboardLock.is_running) and s.lockscreen.visible then + G_KeyboardLock:start() + end + end + }) + return inputbox + end + s.lockscreen = awful.popup({ + widget = { + { + --Top bar + { + { + { + markup = "AwesomewWM", + widget = wibox.widget.textbox + }, + { + widget = wibox.container.background + }, + { + require("widgets.battery")({percentage = true}), + wibox.widget.textclock(), + widget = wibox.container.background, + layout = wibox.layout.fixed.horizontal + }, + layout = wibox.layout.align.horizontal, + }, + widget = wibox.container.background, + forced_width = s.geometry.width, + forced_height = style.lockscreen_bar_height or 25, + bg = style.lockscreen_bar_bg or style.lockscreen_bg_normal + }, + widget = wibox.container.place, + valign = "top", + halign = "center" + },{ + --Combo box (face, nickname, password entry) + style.container({ + (read("./.face") and style.container { + widget = wibox.widget.imagebox, + image = "./.face", + resize = true, + forced_height = style.lockscreen_image_height or 128, + forced_width = style.lockscreen_image_width or 128 + }), + style.container { + widget = wibox.widget.textbox, + text = "Logged in as "..os.getenv("USER") + }, + gen_password_prompt(), + layout = wibox.layout.fixed.vertical, + spacing = style.lockscreen_container_spacing_vertical + }), + widget = wibox.container.place + }, + widget = wibox.container.background, + layout = wibox.layout.stack, + forced_width = s.geometry.width, + forced_height = s.geometry.height, + }, + hide_on_right_click = false, + bgimage = function(context,cr,width,height) + local surface = gears.surface( + read("./.wallpaper") or beautiful.wallpaper + ) + local bg_width,bg_height = gears.surface.get_size(surface) + local scale = height/bg_height + if width/bg_width > scale then + scale = width/bg_width + end + cr:translate((width - (bg_width*scale))/2,(height - (bg_height*scale))/2) + cr:rectangle(0,0, (bg_width*scale), (bg_height*scale)) + cr:clip() + cr:scale(scale,scale) + cr:set_source_surface(surface) + cr:paint() + end, + visible = false, + ontop = true + }) + awesome.connect_signal("lock_screen",function() + G_KeyboardLock:start() + s.lockscreen.visible = true + end) + G_KeyboardLock:stop() + return s +end diff --git a/widgets/macbar.lua b/widgets/macbar.lua new file mode 100644 index 0000000..13d4dac --- /dev/null +++ b/widgets/macbar.lua @@ -0,0 +1,47 @@ +local awful = require("awful") +local wibox = require("wibox") +local gears = require("gears") +local awmtk = require("awmtk") +function macbar(s,args) + local style = awmtk.style(awmtk.defaults,args.style or {},"macbar_") + s.mymacbar = awful.wibar({ + stretch = false, + position = "bottom", + screen = s, + border_width = style.macbar_border_width or 1, + border_color = style.macbar_border_color or "#262626AA", + bg = style.macbar_bg or ((style.bg_normal:len() < 8) and style.bg_normal.."AA"), + height = style.macbar_height or 50, + width = style.macbar_width or 650, + shape = function(cr,width,height) + return gears.shape.partially_rounded_rect(cr,width,height,true,true,false,false,style.macbar_rounding or 5) + end + + }) + local top_widgets = { + layout = wibox.layout.fixed.horizontal, + } + local bottom_widgets = { + layout = wibox.layout.fixed.horizontal, + } + for _,widget in pairs(args.top_widgets or {}) do + table.insert(top_widgets,widget) + end + for _, widget in pairs(args.bottom_widgets or {}) do + table.insert(bottom_widgets,widget) + end + s.mymacbar:setup { + widget = wibox.container.margin, + margins = style.macbar_inner_margin, + { + layout = wibox.layout.align.horizontal, + top_widgets, + { --Middle spacer + widget = wibox.container.background + }, + bottom_widgets + } + } + return s.mymacbar +end +return macbar diff --git a/widgets/mailbox/Mail.png b/widgets/mailbox/Mail.png new file mode 100644 index 0000000..d5f0ed9 Binary files /dev/null and b/widgets/mailbox/Mail.png differ diff --git a/widgets/mailbox/init.lua b/widgets/mailbox/init.lua new file mode 100644 index 0000000..0ef3bbb --- /dev/null +++ b/widgets/mailbox/init.lua @@ -0,0 +1,118 @@ +local awful = require("awful") +local beautiful = require("beautiful") +local gears = require("gears") +local spawn = require("awful.spawn") +local wibox = require("wibox") +local naughty = require("naughty") +local awmtk_status,awmtk = pcall(require,"awmtk") +local dbus_config = require("naughty.dbus") +local widget = {} +local path_to_icons = os.getenv("HOME").."/.config/awesome/widgets/mailbox/" +local function worker(args) + local style = {} + local args = args or {} + -- Set up style variables + if awmtk_status then + style = awmtk.style(awmtk.defaults,args.style,"mailbox_") + end + style.mailbox_container_width = style.mailbox_container_width or 260 + style.mailbox_button_height = style.mailbox_button_heihgt or 40 + args.mail_limit = args.mail_limit or 8 + -- Create a notifications list + notifications_list = { + spacing = style.mailbox_container_spacing_vertical, + layout = wibox.layout.fixed.vertical, + } + -- Function to regenerate the popup + local gen_popup = function() + return awful.popup(style.container( + { + { + text = "This widget will store your notification", + widget = wibox.widget.textbox + }, + notifications_list, + layout = wibox.layout.fixed.vertical, + forced_width = style.mailbox_container_width + },{ + visible = false, + ontop = true, + } + )) + end + + -- Initialize the popup + local notification_popup = gen_popup() + + -- Create a mailbox button + args.screen.notify_widget = style.icon ( + { + image = gears.color.recolor_image(path_to_icons.."Mail.png", + style.mailbox_icon_fg_normal), + widget = wibox.widget.imagebox + },{},{ + function() + if notification_popup.visible then + --rows = nil + notification_popup.visible = not notification_popup.visible + else + --init_popup() + for s in screen do + s.notify_widget.bg = style.mailbox_button_bg + end + notification_popup:move_next_to(mouse.current_widget_geometry) + end + end + } + ) + local notify_widget = args.screen.notify_widget + local update_notifications = function(update_args) + if notification_popup.visible then notification_popup.visible = false end + table.insert(notifications_list,1,style.button( + { + (update_args.icon and { + image = update_args.icon, + resize = true, + forced_height = style.mailbox_button_height, + widget = wibox.widget.imagebox + }), + { + markup = "".. + (update_args.title or "").. + "\n"..(update_args.text or ""), + widget = wibox.widget.textbox, + forced_height = style.mailbox_button_height + }, + layout = wibox.layout.fixed.horizontal + },{ + bg = style.mailbox_button_bg_focus, + shape = style.mailbox_container_shape, + border_width = style.mailbox_button_border_width + },{ + function() + clip = io.open("/tmp/clip","w") + clip:write(update_args.text) + clip:close() + awful.spawn.with_shell("cat /tmp/clip | xclip -selection clipboard") + notification_popup.visible = false + end + } + )) + if #notifications_list >= args.mail_limit then + table.remove(notifications_list,args.mail_limit) + end + notification_popup = gen_popup() + for s in screen do + s.notify_widget:emit_signal("notification::arrived") + end + return update_args + end + args.screen.notify_widget:connect_signal("notification::arrived",function() + args.screen.notify_widget.bg = style.mailbox_button_bg_focus + end) + naughty.config.notify_callback = update_notifications + widget = notify_widget + return notify_widget +end + +return setmetatable(widget, { __call = function(_, ...) return worker(...) end }) diff --git a/widgets/polylauncher.lua b/widgets/polylauncher.lua new file mode 100644 index 0000000..8f5794f --- /dev/null +++ b/widgets/polylauncher.lua @@ -0,0 +1,79 @@ +local awful = require("awful") +local gears = require("gears") +local menubar_utils = require("menubar.utils") +local wibox = require("wibox") +local beautiful = require("beautiful") +local awmtk = require("awmtk") +--because async ls just... fails. (read the comments below) +local function synchronous_ls(dir) + local filenames = {} + local handler = io.popen("ls -1 "..dir,"r") + handler:read("*a"):gsub("[^\n]+",function(filename) + table.insert(filenames,filename) + end) + return filenames +end +local function loader(options) + local style = awmtk.style(awmtk.defaults,options.style or {},"launcher_") + options = options or {} + local button_bg_on = style.launcher_button_bg_focus + local button_bg_off = style.launcher_button_bg_normal + local userlinks = ( + --list_container function allows generating any kind of widget which supports the + --"add" method to add buttons. + options.list_container and ( + wibox.widget(options.list_container()) + ) + ) or ( + (options.vertical == true) and + wibox.widget { + layout = wibox.layout.fixed.vertical, + spacing = style.launcher_container_spacing or 4, + } + ) or ( + wibox.widget { + layout = wibox.layout.fixed.horizontal, + spacing = style.launcher_container_spacing or 4, + } + ) + --The following process **has** to be done synchronously. + --This causes a (barely noticeable) slowdown while loading, but it prevents a race condition which causes crashes occasional crashes on slow devices. + + --specify a sensible path + local programs_path = (options.links_dir or ((globalopts and globalopts.config_dir) or os.getenv("HOME").."/.awesome").."/links") + --add a slash at the end if one isn't set + local programs_path = programs_path..((not programs_path:match("/$")) and "/") + local programs = synchronous_ls(programs_path) + --remove everything that doesn't end with ".desktop" from file list + for k,v in pairs(programs) do + if not v:match("%.desktop$") then + table.remove(programs,k) + end + end + for k,v in pairs(programs) do + --parse a desktop file + local v = menubar_utils.parse_desktop_file(programs_path..v) + if v then + local temp_widget = style.button( + { + image = menubar_utils.lookup_icon_uncached(v.Icon), + widget = wibox.widget.imagebox + },{},{}) + awmtk.connect_buttons(temp_widget,{ + function() + local comm = v.Exec:gsub("(%s+)%%.(%s*)","%1%2") + awful.spawn(comm) + temp_widget:get_children_by_id("widget_background")[1].bg = button_bg_on + end, + release_1 = function() + temp_widget:get_children_by_id("widget_background")[1].bg = button_bg_off + end + }) + userlinks:add(temp_widget) + end + end + return userlinks + --end of loader function +end + +return loader diff --git a/widgets/polymenu.lua b/widgets/polymenu.lua new file mode 100644 index 0000000..63d4217 --- /dev/null +++ b/widgets/polymenu.lua @@ -0,0 +1,189 @@ +local awful = require("awful") +local gears = require("gears") +local menubar_utils = require("menubar.utils") +local wibox = require("wibox") +local beautiful = require("beautiful") +local awmtk = require("awmtk") +local function cascade_close(path,limit) + for I = #path,limit or 1,-1 do + if path[I] then + path[I].visible = false + end + path[I] = nil + end +end +local function merge_into_widget(widget,args) + for k,v in ipairs(args) do + table.insert(widget,v) + end +end +local function get_button_container() + --This function prevents mouse.current_widget_geometry from picking up textboxes + local output = {} + local geo = mouse.current_widgets + for k,v in pairs(geo) do + if tostring(v):match("^widget_background") then + output = mouse.current_widget_geometries[k] + break + end + end + return output +end +local function loader(options) + local style = awmtk.style(awmtk.defaults,options.style or {},"menu_") + options = options or {} + -- Define styles + local button_bg_on = style.menu_button_bg_focus + local button_bg_off = style.menu_button_bg_normal + local userlinks = wibox.widget { + layout = ( + options.vertical and + wibox.layout.fixed.vertical + ) or wibox.layout.fixed.horizontal, + spacing = style.menu_container_spacing or 4, + } + local button_template = function(v) + return { + layout = ( + options.vertical and + wibox.layout.fixed.horizontal + ) or wibox.layout.fixed.vertical, + (v[3] and { + widget = wibox.widget.imagebox, + resize = true, + image = v[3], + }), + { + markup = v[1] or "", + widget = wibox.widget.textbox, + ellipsize = "end" + }, + spacing = 2 + } + end + local button_style = { + bg = button_bg_off, + forced_height = style.menu_button_height or + style.menu_height or + 24, + forced_width = style.menu_button_width or + style.menu_width or + 140 + } + local menu_template = function(tree_layer) + return { + layout = ( + options.vertical + and wibox.layout.fixed.vertical + ) or wibox.layout.fixed.horizontal, + spacing = ( + options.vertical and + style.menu_container_spacing_vertical + ) or style.menu_container_spacing_horizontal, + tree_layer = tree_layer, + } + end + local menu_popup_template = { + visible = false, + ontop = true, + preferred_positions = (options.vertical and {"right","left"}) or {"top","bottom"}, + preferred_anchors = (options.inverse and {"back","front"}) or {"front","back"}, + } + --Create menu root + local menu = menu_template(1) + local tree_path = {"spacer"} + --Insert widgets above/before the menu + merge_into_widget(menu,options.before or {}) + local function generate_menu(leaf,menu) + --Iterate over a table of widget defining tables + for k,v in ipairs(leaf) do + if type(v) ~= "table" then + --Error if the structure is invalid + error("Invalid leaf type "..type(v).." in menu tree") + else + local tree_layer = menu.tree_layer+1 + --Create a button widget + local new_button = style.button(button_template(v),button_style) + if type(v[2]) == "table" then + --Create a popup template for the new menu leaf + local new_popup = menu_template(tree_layer) + --Add buttons and widgets to the new leaf + merge_into_widget(new_popup,v[2].before or {}) + generate_menu(v[2],new_popup) + merge_into_widget(new_popup,v[2].after or {}) + new_popup = awful.popup(style.container(new_popup,menu_popup_template)) + new_button:connect_signal("mouse::enter",function() + --Hide cascading leaves of a branch when leaf changes + if menu.current_selection and (menu.current_selection ~= new_popup) then + cascade_close(tree_path,tree_layer) + end + --Move the new popup widget closer to mouse and align it precisely to the button + if mouse.current_widget_geometry then + local geo = get_button_container() + tree_path[tree_layer] = new_popup + --Apparently it's a thing that needed fixing. + --I don't question it, and neither should you. + if geo.x and geo.y then + new_popup:move_next_to(geo) + end + --previous method call aligns the popup to the button, + --NOT the buttons within the popup. So we do that ourselves (somewhat). + if new_popup.current_anchor == "front" then + new_popup.y = new_popup.y - style.menu_container_inner_margin + else + new_popup.y = new_popup.y + style.menu_container_inner_margin + end + new_popup.visible = true + menu.current_selection = new_popup + end + end) + elseif type(v[2]) == "function" then + new_button:connect_signal("button::press",v[2]) + elseif type(v[2]) == "string" then + new_button:connect_signal("button::press",function() + awful.spawn(v[2]) + end) + end + new_button:connect_signal("mouse::enter",function() + --Set button bg + if menu.current_button then + menu.current_button.bg = button_bg_off + end + menu.current_button = new_button + menu.current_button.bg = button_bg_on + end) + new_button:connect_signal("button::press",function() + cascade_close(tree_path,1) + end) + table.insert(menu,new_button) + end + end + end + generate_menu(options.items,menu) + --Insert widgets below/after the menu + merge_into_widget(menu,options.after or {}) + menu = awful.popup(style.container(menu,menu_popup_template)) + tree_path[1] = menu + menu.toggle = function(x,y) + if (not x) or (not y) then + x = mouse.coords().x + y = mouse.coords().y + end + menu.x = x + menu.y = y + if menu.x+menu.width > menu.screen.geometry.width then + menu.x = menu.x-menu.width + end + if menu.y+menu.height > menu.screen.geometry.height then + menu.y = menu.y-menu.height + end + if menu.visible then + cascade_close(tree_path,2) + end + tree_path[1] = menu + menu.visible = (not menu.visible) + end + return menu +end + +return loader diff --git a/widgets/polytasklist.lua b/widgets/polytasklist.lua new file mode 100644 index 0000000..eb7a0c7 --- /dev/null +++ b/widgets/polytasklist.lua @@ -0,0 +1,96 @@ +local awful = require("awful") +local wibox = require("wibox") +local gears = require("gears") +local beautiful = require("beautiful") +local awmtk = require("awmtk") +local tasklist_buttons = gears.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + c:emit_signal( + "request::activate", + "tasklist", + {raise = true} + ) + end + 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)) + + +return function(options) + local style = awmtk.style(awmtk.defaults,options.style or {},"tasklist_") + -- Color definitions + local button_bg_on = style.tasklist_button_bg_focus + local button_bg_off = style.tasklist_button_bg_normal + local constraint = options.constraint or style.tasklist_constraint + local _style = awmtk._create_preprocess_style(style,"tasklist_") + _style.button_shape = awmtk.preprocess.button_shape(_style) + local container = style.tasklist_button_widget(_style) + return function(s) + local tasklist = { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons, + style = { + shape = container.shape, + shape_border_width = container.shape_border_width, + shape_border_color = container.shape_border_color + }, + layout = options.container or { + spacing = style.tasklist_container_spacing, + layout = (options.vertical and + wibox.layout.fixed.vertical + ) or ((not options.stretch) and + wibox.layout.flex.horizontal + ) or + wibox.layout.fixed.horizontal + + }, + widget_template = container + } + if constraint then + tasklist.widget_template = { + container, + widget = wibox.container.constraint, + width = (type(constraint) == "number" and constraint) or 180, + strategy = "exact" + } + end + local top = awmtk.utils.get_child_by_id( + tasklist.widget_template,"widget_container" + )[1] + top[1] = { + { + id = 'clienticon', + widget = awful.widget.clienticon, + }, + (options.names and { + id = 'text_role', + widget = wibox.widget.textbox, + ellipsize = "end", + }), + left = style.tasklist_padding or ((not options.vertical) and 6), + right = style.tasklist_padding or ((not options.vertical) and 6), + layout = (options.vertical and wibox.layout.fixed.vertical) or + wibox.layout.fixed.horizontal, + spacing = 3, + } + local top = awmtk.utils.get_child_by_id( + tasklist.widget_template,"widget_background" + )[1] + top.id = "background_role" + tasklist.widget_template.create_callback = function(self, c, index, objects) + self:get_children_by_id('clienticon')[1].client = c + end + return awful.widget.tasklist(tasklist) + end +end diff --git a/widgets/unitybar.lua b/widgets/unitybar.lua new file mode 100644 index 0000000..4b63e92 --- /dev/null +++ b/widgets/unitybar.lua @@ -0,0 +1,41 @@ +local awful = require("awful") +local wibox = require("wibox") +local gears = require("gears") +local awmtk = require("awmtk") +function unitybar(s,args) + local style = awmtk.style(awmtk.defaults,args.style or {},"unitybar_") + s.myunitybar = awful.wibar({ + position = "left", + screen = s, + border_width = style.unitybar_border_width or 1, + border_color = style.unitybar_border_color or "#262626AA", + bg = style.unitybar_bg or ((style.bg_normal:len() < 8) and style.bg_normal.."AA"), + width = style.unitybar_width or 50, + }) + local top_widgets = { + layout = wibox.layout.fixed.vertical, + } + local bottom_widgets = { + layout = wibox.layout.fixed.vertical, + } + for _,widget in pairs(args.top_widgets or {}) do + table.insert(top_widgets,widget) + end + for _, widget in pairs(args.bottom_widgets or {}) do + table.insert(bottom_widgets,widget) + end + s.myunitybar:setup { + widget = wibox.container.margin, + margins = style.unitybar_inner_margin, + { + layout = wibox.layout.align.vertical, + top_widgets, + { --Middle spacer + widget = wibox.container.background + }, + bottom_widgets + } + } + return s.myunitybar +end +return unitybar diff --git a/widgets/volume.lua b/widgets/volume.lua new file mode 100644 index 0000000..b0185a3 --- /dev/null +++ b/widgets/volume.lua @@ -0,0 +1,117 @@ +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local awmtk = require("awmtk") + +return function(args) + local style = awmtk.style(awmtk.defaults, args.style or {},"volume_") + local device = args.device or "default" + local icons = args.icons or { + high = style.volume_icon_high, + medium = style.volume_icon_medium, + low = style.volume_icon_low, + muted = style.volume_icon_muted, + } + local controls = args.controls or { + "Master", + "Headphone" + } + for k,v in pairs(icons) do + icons[k] = gears.color.recolor_image(v, + style.volume_icon_fg_normal) + end + local function get_icon(percent) + if percent >= 66 then + return icons.high + elseif percent >= 33 then + return icons.medium + elseif percent > 0 then + return icons.low + else + return icons.muted + end + end + local commands = args.commands or { + get_master = "amixer -D "..device.." sget Master", + set = "amixer -q -D "..device.." sset ", + get = "amixer -D "..device.." sget " + } + local list = { + layout = wibox.layout.fixed.horizontal + } + for k,v in pairs(controls) do + local widget = wibox.widget({ + { + widget = wibox.widget.textbox, + markup = v, + ellipsize = "end", + font = style.volume_font + }, + { + { + widget = wibox.widget.slider, + id = "widget_slider", + handle_width = style.volume_handle_width or 6, + bar_height = style.volumer_bar_width or 5, + bar_color = style.volume_bar_color or "#55CC60", + bar_shape = style.bar_shape, + handler_shape = style.handle_shape, + value = 100, + }, + widget = wibox.container.rotate, + direction = "east" + }, + layout = wibox.layout.fixed.vertical, + spacing = style.volume_container_spacing_horizontal, + forced_width = style.volume_slider_width or 40, + forced_height = style.volume_slider_height or 120 + }) + local slider = widget:get_children_by_id("widget_slider")[1] + awful.spawn.easy_async_with_shell(commands.get..v,function(out) + local volume_percent = out:match("%[(%d+)%%%]") or "" + volume_percent = tonumber(volume_percent) + if not volume_percent then + return + end + slider.value = volume_percent + end) + slider:connect_signal("widget::redraw_needed",function() + awful.spawn(commands.set..v.." "..slider.value.."%") + end) + table.insert(list,widget) + end + local tweaker_popup = awful.popup(style.container(list,{ + visible = false, + ontop = true + })) + local icon = style.icon({ + widget = wibox.widget.imagebox, + image = icons.muted, + id = "widget_icon" + },{},{ + function() + if mouse.current_widget_geometry and (not tweaker_popup.visible) then + tweaker_popup:move_next_to(mouse.current_widget_geometry) + tweaker_popup.visible = true + else + tweaker_popup.visible = false + end + end + }) + gears.timer { + autostart = true, + timeout = 0.5, + call_now = true, + callback = function() + awful.spawn.easy_async_with_shell(commands.get_master, function(out) + local volume_percent = out:match("%[(%d+)%%%]") or "" + volume_percent = tonumber(volume_percent) + if not volume_percent then + return + end + icon:get_children_by_id("widget_icon")[1].image = get_icon(volume_percent) + end) + end + } + return icon +end diff --git a/widgets/wallpapers/init.lua b/widgets/wallpapers/init.lua new file mode 100644 index 0000000..0dffe5a --- /dev/null +++ b/widgets/wallpapers/init.lua @@ -0,0 +1,106 @@ +local awful = require("awful") +local beautiful = require("beautiful") +local gears = require("gears") +local spawn = require("awful.spawn") +local wibox = require("wibox") +local naughty = require("naughty") +local awmtk = require("awmtk") +local widget = {} +local path_to_icons = os.getenv("HOME").."/.config/awesome/widgets/wallpapers/" +local function ls(path) + local ls_data = io.popen("ls -1 "..path) + local output = {} + if ls_data then + ls_data:read("*a"):gsub("[^\n]+",function(capt) table.insert(output,capt) end) + ls_data:close() + else + error("ls "..path.." failed.") + end + return output +end + +local function worker(args) + local args = args or {} + if not args["screen"] then error("Screen not specified") end + if not args["path"] then error("Path to wallpapers folder not specified") end + args["configdir"] = args["configdir"] or os.getenv("HOME") + --create local style + local style = {} + style = awmtk.style(awmtk.defaults,args.style or {},"wallpapers_") + --set wallpaper + local handler = io.open(args["configdir"].."/.wallpaper","r") + if handler then + local wallpaper_path = handler:read("*a") + gears.wallpaper.maximized(wallpaper_path,args["screen"]) + end + local function update_last_wallpaper(s) + local handler = io.open(args["configdir"].."/.wallpaper","w") + handler:write(s) + handler:close() + end + --read wallpapers from the wallpaper directory + local image_list = ls(args["path"]) + for k,v in pairs(image_list) do + if not (v:match("%.jpg$") or v:match("%.png$")) then + image_list[k] = nil + end + end + --style variables + local button_bg = style.wallpapers_button_bg_focus + local function new_wallpaper_button(image,s) + local new_widget = style.button({ + image = args["path"]..image, + resize = true, + widget = wibox.widget.imagebox + },{ + bg = button_bg, + forced_height = style.wallpapers_button_height or 60, + forced_width = style.wallpapers_button_width or 100 + },{ + function() + gears.wallpaper.maximized(args["path"]..image,s) + update_last_wallpaper(args["path"]..image) + end + }) + return new_widget + end + local copy_list = { + widget = wibox.layout.grid, + forced_num_cols = args.columns or 4, + homogeneous = true, + expand = true, + orientation = "vertical", + spacing = 5 + } + for k,v in pairs(image_list) do + local new_widget = new_wallpaper_button(v,args["screen"]) + table.insert(copy_list,new_widget) + end + local popup = awful.popup(style.container( + copy_list, + { + visible = false, + ontop = true + } + )) + local clip_widget = style.icon({ + image = gears.color.recolor_image(path_to_icons.."wallpaper-icon.png", + style.wallpapers_icon_fg_normal), + resize = true, + widget = wibox.widget.imagebox + },{},{ + function() + if popup.visible then + --rows = nil + popup.visible = not popup.visible + else + --init_popup() + popup:move_next_to(mouse.current_widget_geometry) + end + end + }) + widget = clip_widget + return clip_widget +end + +return setmetatable(widget, { __call = function(_, ...) return worker(...) end }) diff --git a/widgets/wallpapers/wallpaper-icon.png b/widgets/wallpapers/wallpaper-icon.png new file mode 100644 index 0000000..d7c6f9b Binary files /dev/null and b/widgets/wallpapers/wallpaper-icon.png differ diff --git a/widgets/xdg-menu.lua b/widgets/xdg-menu.lua new file mode 100644 index 0000000..bf13eea --- /dev/null +++ b/widgets/xdg-menu.lua @@ -0,0 +1,96 @@ +-- This widget generates menus but synchronously +-- This is done to avoid crashes when generating menus using polymenu +local menu_utils = require("menubar.utils") +local menu_gen = require("menubar.menu_gen") +local beautiful = require("beautiful") +menu_utils.wm_name = "" +local desktop_dirs = { + "/usr/local/share/applications", + "/usr/share/applications", + os.getenv("HOME").."/.local/share/applications" +} + +local app_type_map = { + Other = { + name = "Other", + icon = "applications-other" + }, + Wine = { + name = "Wine", + icon = "wine" + } +} +for k,v in pairs(menu_gen.all_categories) do + app_type_map[v.app_type] = v +end + +local function get_files(dirs,filter) + local files = {} + for _,dir in pairs(dirs) do + local temp = io.popen("find "..tostring(dir),r) + if temp then + temp:read("*a"):gsub("[^\n]+",function(path) + if ((not filter) or filter(path)) then + files[#files+1] = path + end + end) + end + end + return files +end + +return function(args) + local menu = {} + local category_index = {} + for _,entry in ipairs(args.before or {}) do + table.insert(menu,entry) + end + local filter = function(t) + return t:match(".*%.desktop$") + end + for _,file in pairs(get_files(desktop_dirs,filter)) do + local desktop_data = menu_utils.parse_desktop_file(file) + local category + for k,v in pairs(desktop_data.Categories or {"Other"}) do + if app_type_map[v] then + category = v + break + end + end + category = category or "Other" + local exec = (desktop_data.Exec or ""):gsub("(%s+)%%.(%s*)","%1%2") + --Make applications that require a terminal open in terminal + if desktop_data.Terminal then + exec = (args.terminal or global.terminal).." -e "..exec + end + --Special case for wine apps, all thanks to their inconsistency + if exec and exec:find(" wine ") then + category = "Wine" + end + local icon = desktop_data.Icon + local name = desktop_data.Name + local category_name = app_type_map[category].name + --Another speical case just for wine + if category_name:match("^Wine") then + category = "Wine" + end + if not desktop_data.NoDisplay then + if not category_index[category] then + category_index[category] = { + category_name, + {} + } + table.insert(menu,category_index[category]) + end + table.insert(category_index[category][2],{ + name, + exec, + (icon and menu_utils.lookup_icon(icon)) + }) + end + end + for _,entry in ipairs(args.after or {}) do + table.insert(menu,entry) + end + return menu +end