diff --git a/bindings/keys.lua b/bindings/keys.lua index 827025a..2ef4636 100644 --- a/bindings/keys.lua +++ b/bindings/keys.lua @@ -1,6 +1,7 @@ local awful = require('awful') local hotkeys_popup = require("awful.hotkeys_popup") local menubar = require("menubar") +local revelation = require("revelation") require("awful.hotkeys_popup.keys") @@ -30,6 +31,8 @@ awful.keyboard.append_global_keybindings({ {description = "lua execute prompt", group = "awesome"}), awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, "Shift" }, "Return", function () awful.spawn(terminal .. " --class=floating_terminal") end, + {description = "open a terminal floating", group = "launcher"}), awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, {description = "run prompt", group = "launcher"}), awful.key({ modkey }, "p", function() @@ -45,6 +48,8 @@ awful.keyboard.append_global_keybindings({ {description = "view previous", group = "tag"}), awful.key({ modkey, }, "Right", awful.tag.viewnext, {description = "view next", group = "tag"}), + awful.key({ modkey, }, "e", revelation, + {description = "view exposé", group = "tag"}), awful.key({ modkey, }, "Escape", awful.tag.history.restore, {description = "go back", group = "tag"}), }) @@ -218,7 +223,7 @@ end) client.connect_signal("request::default_keybindings", function() awful.keyboard.append_client_keybindings({ - awful.key({ modkey, }, "f", + awful.key({ modkey, "Shift" }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() @@ -226,11 +231,11 @@ client.connect_signal("request::default_keybindings", function() {description = "toggle fullscreen", group = "client"}), awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, {description = "close", group = "client"}), - awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , + awful.key({ modkey, }, "f", awful.client.floating.toggle , {description = "toggle floating", group = "client"}), awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, {description = "move to master", group = "client"}), - awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, + awful.key({ modkey, "Control", "Shift" }, "j", function (c) c:move_to_screen() end, {description = "move to screen", group = "client"}), awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, {description = "toggle keep on top", group = "client"}), diff --git a/helpers.lua b/helpers.lua new file mode 100644 index 0000000..776972d --- /dev/null +++ b/helpers.lua @@ -0,0 +1,447 @@ + +-- Functions that you use more than once and in different files would +-- be nice to define here. + +local awful = require("awful") +local gears = require("gears") +local beautiful = require("beautiful") +local xresources = require("beautiful.xresources") +local dpi = xresources.apply_dpi +local wibox = require("wibox") +local icons = require("icons") +local notifications = require("notifications") +local naughty = require("naughty") + +local helpers = {} + +-- Create rounded rectangle shape (in one line) +helpers.rrect = function(radius) + return function(cr, width, height) + gears.shape.rounded_rect(cr, width, height, radius) + end +end + +helpers.prrect = function(radius, tl, tr, br, bl) + return function(cr, width, height) + gears.shape.partially_rounded_rect(cr, width, height, tl, tr, br, bl, radius) + end +end + +helpers.squircle = function(rate, delta) + return function(cr, width, height) + gears.shape.squircle(cr, width, height, rate, delta) + end +end +helpers.psquircle = function(rate, delta, tl, tr, br, bl) + return function(cr, width, height) + gears.shape.partial_squircle(cr, width, height, tl, tr, br, bl, rate, delta) + end +end + +helpers.colorize_text = function(text, color) + return ""..text.."" +end + +function helpers.client_menu_toggle() + local instance = nil + + return function () + if instance and instance.wibox.visible then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ theme = { width = dpi(250) } }) + end + end +end + +-- Escapes a string so that it can be displayed inside pango markup +-- tags. Modified from: +-- https://github.com/kernelsauce/turbo/blob/master/turbo/escape.lua +function helpers.pango_escape(s) + return (string.gsub(s, "[&<>]", { + ["&"] = "&", + ["<"] = "<", + [">"] = ">" + })) +end + +function helpers.vertical_pad(height) + return wibox.widget{ + forced_height = height, + layout = wibox.layout.fixed.vertical + } +end + +function helpers.horizontal_pad(width) + return wibox.widget{ + forced_width = width, + layout = wibox.layout.fixed.horizontal + } +end + +local direction_translate = { + ['up'] = 'top', + ['down'] = 'bottom', + ['left'] = 'left', + ['right'] = 'right' +} +function helpers.move_to_edge(c, direction) + local old = c:geometry() + local new = awful.placement[direction_translate[direction]](c, {honor_padding = true, honor_workarea = true, margins = beautiful.useless_gap * 2, pretend = true}) + if direction == "up" or direction == "down" then + c:geometry({ x = old.x, y = new.y }) + else + c:geometry({ x = new.x, y = old.y }) + end +end + +local double_tap_timer = nil +function helpers.single_double_tap(single_tap_function, double_tap_function) + if double_tap_timer then + double_tap_timer:stop() + double_tap_timer = nil + double_tap_function() + -- naughty.notify({text = "We got a double tap"}) + return + end + + double_tap_timer = + gears.timer.start_new(0.20, function() + double_tap_timer = nil + -- naughty.notify({text = "We got a single tap"}) + if single_tap_function then + single_tap_function() + end + return false + end) +end + + +-- Used as a custom command in rofi to move a window into the current tag +-- instead of following it. +-- Rofi has access to the X window id of the client. +function helpers.rofi_move_client_here(window) + local win = function (c) + return awful.rules.match(c, {window = window}) + end + + for c in awful.client.iterate(win) do + c.minimized = false + c:move_to_tag(mouse.screen.selected_tag) + client.focus = c + end +end + +-- Add a hover cursor to a widget by changing the cursor on +-- mouse::enter and mouse::leave +-- You can find the names of the available cursors by opening any +-- cursor theme and looking in the "cursors folder" +-- For example: "hand1" is the cursor that appears when hovering over +-- links +function helpers.add_hover_cursor(w, hover_cursor) + local original_cursor = "left_ptr" + + w:connect_signal("mouse::enter", function () + local w = _G.mouse.current_wibox + if w then + w.cursor = hover_cursor + end + end) + + w:connect_signal("mouse::leave", function () + local w = _G.mouse.current_wibox + if w then + w.cursor = original_cursor + end + end) +end + +-- Tag back and forth: +-- If you try to focus the tag you are already at, go back to the previous tag. +-- Useful for quick switching after for example checking an incoming chat +-- message at tag 2 and coming back to your work at tag 1 with the same +-- keypress. +function helpers.tag_back_and_forth(tag_index) + local s = mouse.screen + local tag = s.tags[tag_index] + if tag then + if tag == s.selected_tag then + awful.tag.history.restore() + else + tag:view_only() + end + end +end + +-- Resize DWIM (Do What I Mean) +-- Resize client or factor +-- Constants -- +local floating_resize_amount = dpi(20) +local tiling_resize_factor= 0.05 +--------------- +function helpers.resize_dwim(c, direction) + if c and c.floating then + if direction == "up" then + c:relative_move( 0, 0, 0, -floating_resize_amount) + elseif direction == "down" then + c:relative_move( 0, 0, 0, floating_resize_amount) + elseif direction == "left" then + c:relative_move( 0, 0, -floating_resize_amount, 0) + elseif direction == "right" then + c:relative_move( 0, 0, floating_resize_amount, 0) + end + elseif awful.layout.get(mouse.screen) ~= awful.layout.suit.floating then + if direction == "up" then + awful.client.incwfact(-tiling_resize_factor) + elseif direction == "down" then + awful.client.incwfact( tiling_resize_factor) + elseif direction == "left" then + awful.tag.incmwfact(-tiling_resize_factor) + elseif direction == "right" then + awful.tag.incmwfact( tiling_resize_factor) + end + end +end + +-- Move client DWIM (Do What I Mean) +-- Move to edge if the client / layout is floating +-- Swap by index if maximized +-- Else swap client by direction +function helpers.move_client_dwim(c, direction) + if c.floating or (awful.layout.get(mouse.screen) == awful.layout.suit.floating) then + helpers.move_to_edge(c, direction) + elseif awful.layout.get(mouse.screen) == awful.layout.suit.max then + if direction == "up" or direction == "left" then + awful.client.swap.byidx(-1, c) + elseif direction == "down" or direction == "right" then + awful.client.swap.byidx(1, c) + end + else + awful.client.swap.bydirection(direction, c, nil) + end +end + +-- Make client floating and snap to the desired edge +local axis_translate = { + ['up'] = 'horizontally', + ['down'] = 'horizontally', + ['left'] = 'vertically', + ['right'] = 'vertically' +} +function helpers.float_and_edge_snap(c, direction) + c.maximized = false + c.maximized_vertical = false + c.maximized_horizontal = false + c.floating = true + local f = awful.placement.scale + + awful.placement[direction_translate[direction]] + + awful.placement['maximize_'..axis_translate[direction]] + f(c, {honor_padding = true, honor_workarea=true, to_percent = 0.5, margins = beautiful.useless_gap * 2 }) +end + +-- Rounds a number to any number of decimals +function helpers.round(number, decimals) + local power = 10 ^ decimals + return math.floor(number * power) / power +end + +function helpers.volume_control(step) + local cmd + if step == 0 then + cmd = "pactl set-sink-mute @DEFAULT_SINK@ toggle" + else + sign = step > 0 and "+" or "" + cmd = "pactl set-sink-mute @DEFAULT_SINK@ 0 && pactl set-sink-volume @DEFAULT_SINK@ "..sign..tostring(step).."%" + end + awful.spawn.with_shell(cmd) +end + +function helpers.send_key(c, key) + awful.spawn.with_shell("xdotool key --window "..tostring(c.window).." "..key) +end + +function helpers.send_key_sequence(c, seq) + awful.spawn.with_shell("xdotool type --delay 5 --window "..tostring(c.window).." "..seq) +end + +function helpers.fake_escape() + root.fake_input('key_press', "Escape") + root.fake_input('key_release', "Escape") +end + +local prompt_font = beautiful.prompt_font or "sans bold 8" +function helpers.prompt(action, textbox, prompt, callback) + if action == "run" then + awful.prompt.run { + prompt = prompt, + -- prompt = "Run: ", + textbox = textbox, + font = prompt_font, + done_callback = callback, + exe_callback = awful.spawn, + completion_callback = awful.completion.shell, + history_path = awful.util.get_cache_dir() .. "/history" + } + elseif action == "web_search" then + awful.prompt.run { + prompt = prompt, + -- prompt = 'Web search: ', + textbox = textbox, + font = prompt_font, + history_path = awful.util.get_cache_dir() .. "/history_web", + done_callback = callback, + exe_callback = function(input) + if not input or #input == 0 then return end + awful.spawn.with_shell("noglob "..user.web_search_cmd.."'"..input.."'") + naughty.notify { title = "Searching the web for", text = input, icon = icons.image.firefox, urgency = "low" } + end + } + end +end + +-- Given a `match` condition, returns an array with clients that match it, or +-- just the first found client if `first_only` is true +function helpers.find_clients(match, first_only) + local matcher = function (c) + return awful.rules.match(c, match) + end + + if first_only then + for c in awful.client.iterate(matcher) do + return c + end + else + local clients = {} + for c in awful.client.iterate(matcher) do + table.insert(clients, c) + end + return clients + end + return nil +end + +-- Given a `match` condition, calls the specified function `f_do` on all the +-- clients that match it +function helpers.find_clients_and_do(match, f_do) + local matcher = function (c) + return awful.rules.match(c, match) + end + + for c in awful.client.iterate(matcher) do + f_do(c) + end +end + +function helpers.run_or_raise(match, move, spawn_cmd, spawn_args) + local matcher = function (c) + return awful.rules.match(c, match) + end + + -- Find and raise + local found = false + for c in awful.client.iterate(matcher) do + found = true + c.minimized = false + if move then + c:move_to_tag(mouse.screen.selected_tag) + client.focus = c + else + c:jump_to() + end + break + end + + -- Spawn if not found + if not found then + awful.spawn(spawn_cmd, spawn_args) + end +end + +-- Run raise or minimize a client (scratchpad style) +-- Depends on helpers.run_or_raise +-- If it not running, spawn it +-- If it is running, focus it +-- If it is focused, minimize it +function helpers.scratchpad(match, spawn_cmd, spawn_args) + local cf = client.focus + if cf and awful.rules.match(cf, match) then + cf.minimized = true + else + helpers.run_or_raise(match, true, spawn_cmd, spawn_args) + end +end + +function helpers.float_and_resize(c, width, height) + c.maximized = false + c.width = width + c.height = height + awful.placement.centered(c,{honor_workarea=true, honor_padding = true}) + awful.client.property.set(c, 'floating_geometry', c:geometry()) + c.floating = true + c:raise() +end + +-- Adds a maximized mask to a screen +function helpers.screen_mask(s, bg) + local mask = wibox({visible = false, ontop = true, type = "splash", screen = s}) + awful.placement.maximize(mask) + mask.bg = bg + return mask +end + +-- Useful for periodically checking the output of a command that +-- requires internet access. +-- Ensures that `command` will be run EXACTLY once during the desired +-- `interval`, even if awesome restarts multiple times during this time. +-- Saves output in `output_file` and checks its last modification +-- time to determine whether to run the command again or not. +-- Passes the output of `command` to `callback` function. +function helpers.remote_watch(command, interval, output_file, callback) + local run_the_thing = function() + -- Pass output to callback AND write it to file + awful.spawn.easy_async_with_shell(command.." | tee "..output_file, function(out) callback(out) end) + end + + local timer + timer = gears.timer { + timeout = interval, + call_now = true, + autostart = true, + single_shot = false, + callback = function() + awful.spawn.easy_async_with_shell("date -r "..output_file.." +%s", function(last_update, _, __, exitcode) + -- Probably the file does not exist yet (first time + -- running after reboot) + if exitcode == 1 then + run_the_thing() + return + end + + local diff = os.time() - tonumber(last_update) + if diff >= interval then + run_the_thing() + else + -- Pass the date saved in the file since it is fresh enough + awful.spawn.easy_async_with_shell("cat "..output_file, function(out) callback(out) end) + + -- Schedule an update for when the remaining time to complete the interval passes + timer:stop() + gears.timer.start_new(interval - diff, function() + run_the_thing() + timer:again() + end) + end + end) + end + } +end + +-- The directory of the currently executed lua script +-- Requires the `debug` library to be available in the build of Lua that is running +function helpers.this_dir() + local str = debug.getinfo(2, "S").source:sub(2) + return str:match("(.*/)") +end + +return helpers diff --git a/lain b/lain new file mode 160000 index 0000000..10076e1 --- /dev/null +++ b/lain @@ -0,0 +1 @@ +Subproject commit 10076e1d69cabd9ac45b3576f06feafe1190d5e0 diff --git a/modules/.sidepanel.lua.swp b/modules/.sidepanel.lua.swp deleted file mode 100644 index 4002e57..0000000 Binary files a/modules/.sidepanel.lua.swp and /dev/null differ diff --git a/modules/appdrawer.lua b/modules/appdrawer.lua index b33d8d1..912dca7 100644 --- a/modules/appdrawer.lua +++ b/modules/appdrawer.lua @@ -1,25 +1,208 @@ -local awful = require('awful') -local wibox = require('wibox') -local gears = require('gears') -local timer = require("gears.timer") -local beautiful = require('beautiful') -local dpi = beautiful.xresources.apply_dpi - -screen.connect_signal("appdrawer::open", function(s) - - local drawer = wibox({ - position = "left", - ontop = true, - stretch = false, - width = dpi(64), - height = s.workarea.height, - visible = true, - y = 48 - }) - - drawer:setup { - expand = "none", - layout = wibox.layout.align.vertical, - } - -end) +local awful = require("awful") +local gears = require("gears") +local wibox = require("wibox") +local beautiful = require("beautiful") +local apps = require("apps") +-- local naughty = require("naughty") + +local helpers = require("helpers") + +-- Appearance +local button_size = beautiful.app_drawer_icon_size or dpi(100) +-- +local keybinds = {} + +-- Helper function that creates buttons given a text symbol, color, hover_color +-- and the command to run on click. +local function create_button(symbol, color, hover_color, cmd, key) + local icon = wibox.widget { + markup = helpers.colorize_text(symbol, color), + align = "center", + valign = "center", + font = "icomoon 50", + forced_width = dpi(180), + forced_height = dpi(200), + widget = wibox.widget.textbox + } + + -- Press "animation" + icon:connect_signal("button::press", function(_, _, __, button) + if button == 3 then + icon.markup = helpers.colorize_text(symbol, hover_color.."55") + end + end) + icon:connect_signal("button::release", function () + icon.markup = helpers.colorize_text(symbol, hover_color) + end) + + -- Hover "animation" + icon:connect_signal("mouse::enter", function () + icon.markup = helpers.colorize_text(symbol, hover_color) + end) + icon:connect_signal("mouse::leave", function () + icon.markup = helpers.colorize_text(symbol, color) + end) + + -- Change cursor on hover + helpers.add_hover_cursor(icon, "hand1") + + -- Adds mousebinds if cmd is provided + if cmd then + icon:buttons(gears.table.join( + awful.button({ }, 1, function () + cmd() + end), + awful.button({ }, 3, function () + cmd() + end) + )) + end + + -- Add keybind to dict, if given + if key then + keybinds[key] = cmd + end + + return icon +end + +-- Create app buttons +local browser = create_button("", x.color3, x.color11, apps.browser, "w") +local discord = create_button("", x.color5, x.color13, apps.discord, "d") +local telegram = create_button("", x.color4, x.color12, apps.telegram, "t") +local mail = create_button("", x.color6, x.color14, apps.mail, "m") +local files = create_button("", x.color3, x.color11, apps.file_manager, "f") +local gimp = create_button("", x.color5, x.color13, apps.gimp, "g") +local youtube = create_button("", x.color1, x.color9, apps.youtube, "y") +local networks = create_button("", x.color3, x.color11, apps.networks, "n") +local passwords = create_button("", x.color1, x.color9, apps.passwords, "p") +local night_mode = create_button("", x.color1, x.color9, apps.night_mode, "x") +local record = create_button("", x.color4, x.color12, apps.record, "r") +local lutris = create_button("", x.color6, x.color14, apps.lutris, "l") +local steam = create_button("", x.color2, x.color10, apps.steam, "s") +local org = create_button("", x.color2, x.color10, apps.org, "o") +local compositor = create_button("", x.color5, x.color13, apps.compositor, "z") + +local restart_awesome = create_button("", x.color4, x.color12) +restart_awesome:buttons(gears.table.join( + awful.button({ }, 1, awesome.restart) +)) + +-- Create the widget +app_drawer = wibox({visible = false, ontop = true, type = "dock"}) +awful.placement.maximize(app_drawer) + +app_drawer.bg = "#00000000" +-- app_drawer.bg = beautiful.app_drawer_bg or x.background or "#111111" +app_drawer.fg = beautiful.app_drawer_fg or x.foreground or "#FEFEFE" + +-- Add app drawer or mask to each screen +for s in screen do + if s == screen.primary then + s.app_drawer = app_drawer + else + s.app_drawer = helpers.screen_mask(s, beautiful.lock_screen_bg or beautiful.exit_screen_bg or x.background) + end +end + +local function set_visibility(v) + for s in screen do + s.app_drawer.visible = v + end +end + +local app_drawer_grabber +function app_drawer_hide() + awful.keygrabber.stop(app_drawer_grabber) + set_visibility(false) +end + +function app_drawer_show() + -- naughty.notify({text = "starting the keygrabber"}) + app_drawer_grabber = awful.keygrabber.run(function(_, key, event) + local invalid_key = false + + -- Debug + -- naughty.notify({ title = event, text = key }) + -- if event == "press" and key == "Alt_L" or key == "Alt_R" then + -- naughty.notify({ title = "you pressed alt" }) + -- end + -- if event == "release" and key == "Alt_L" or key == "Alt_R" then + -- naughty.notify({ title = "you released alt" }) + -- end + + if event == "release" then return end + + if keybinds[key] then + keybinds[key]() + else + invalid_key = true + end + + if not invalid_key or key == 'Escape' then + app_drawer_hide() + end + end) + + set_visibility(true) +end + +app_drawer:buttons(gears.table.join( + -- Left click - Hide app_drawer + awful.button({ }, 1, function () + app_drawer_hide() + end), + -- Right click - Hide app_drawer + awful.button({ }, 2, function () + app_drawer_hide() + end), + -- Middle click - Hide app_drawer + awful.button({ }, 2, function () + app_drawer_hide() + end) +)) + +local function create_stripe(widgets, bg) + local buttons = wibox.widget { + -- spacing = dpi(20), + layout = wibox.layout.fixed.horizontal + } + + for _, widget in ipairs(widgets) do + buttons:add(widget) + end + + local stripe = wibox.widget { + { + nil, + { + nil, + buttons, + expand = "none", + layout = wibox.layout.align.horizontal + }, + expand = "none", + layout = wibox.layout.align.vertical + }, + bg = bg, + widget = wibox.container.background + } + + return stripe +end + +app_drawer:setup { + -- Background + { + -- Stripes + create_stripe({browser, youtube, discord, telegram}, "#00000000"), + create_stripe({mail, org, files, passwords}, x.color8.."20"), + create_stripe({gimp, record, lutris, steam}, x.color8.."40"), + create_stripe({networks, night_mode, compositor, restart_awesome}, x.color8.."60"), + layout = wibox.layout.flex.vertical + }, + bg = x.background, + -- bg = x.background.."AA", + -- bg = "#00000000", + widget = wibox.container.background +} diff --git a/modules/dock.lua b/modules/dock.lua index dd66eec..b038079 100644 --- a/modules/dock.lua +++ b/modules/dock.lua @@ -16,26 +16,26 @@ local box = require("modules.dock.dockbox") return wibox.widget { { - nil, + nil, { - nil, + nil, { - browser, - fileexplorer, - terminal, - intellij, + browser, + fileexplorer, + terminal, + intellij, gimp, spotify, spacing = dpi(8), layout = wibox.layout.fixed.vertical - }, + }, nil, expand = "none", layout = wibox.layout.align.vertical }, - nil, - expand = "none", + nil, + expand = "none", layout = wibox.layout.align.horizontal - }, - widget = wibox.container.background, + }, + widget = wibox.container.background, } diff --git a/modules/notifications.lua b/modules/notifications.lua new file mode 100644 index 0000000..3e5925e --- /dev/null +++ b/modules/notifications.lua @@ -0,0 +1,102 @@ +local awful = require('awful') +local wibox = require('wibox') +local gears = require('gears') +local beautiful = require('beautiful') +local naughty = require('naughty') +local dpi = beautiful.xresources.apply_dpi + +screen.connect_signal("request::desktop_decoration", function(s) + + local panel_width = dpi(300) + local notify_center = wibox({ + ontop = true, + stretch = false, + width = panel_width, + height = s.workarea.height, + visible = false, + y = beautiful.panel_height, + x = s.workarea.width - panel_width + }) + + notify_center:setup { + -- Add a button to dismiss all notifications, because why not. + { + { + text = 'Dismiss all', + align = 'center', + valign = 'center', + widget = wibox.widget.textbox + }, + buttons = gears.table.join( + awful.button({ }, 1, function() naughty.destroy_all_notifications() end) + ), + forced_width = 75, + shape = gears.shape.rounded_bar, + shape_border_width = 1, + shape_border_color = beautiful.bg_highlight, + widget = wibox.container.background + }, + { + base_layout = wibox.widget { + spacing_widget = wibox.widget { + orientation = 'vertical', + span_ratio = 0.5, + widget = wibox.widget.separator, + }, + forced_height = 30, + spacing = 3, + layout = wibox.layout.fixed.vertical + }, + widget_template = { + { + naughty.widget.icon, + { + naughty.widget.title, + naughty.widget.message, + { + layout = wibox.widget { + -- Adding the wibox.widget allows to share a + -- single instance for all spacers. + spacing_widget = wibox.widget { + orientation = 'horizontal', + span_ratio = 0.9, + widget = wibox.widget.separator, + }, + spacing = 3, + layout = wibox.layout.flex.horizontal + }, + widget = naughty.list.widgets, + }, + layout = wibox.layout.align.vertical + }, + spacing = 10, + fill_space = true, + layout = wibox.layout.fixed.horizontal + }, + margins = 5, + widget = wibox.container.margin + }, + widget = naughty.list.notifications, + }, + layout = wibox.layout.align.vertical + } + + + local notify_center_trigger = awful.wibar({ + position = "right", + width = 1, + bg = "#00000000", + opacity = 0, + ontop = true, + visible = true + }) + + local notify_center_hide_timer = gears.timer({ timeout = 1}) + + notify_center_trigger:geometry({ width = 5, height = s.workarea.height }) + notify_center_hide_timer:connect_signal("timeout", function() notify_center.visible = false; notify_center_hide_timer:stop() end ) + notify_center_trigger:connect_signal("mouse::enter", function() notify_center.visible = true end) + notify_center:connect_signal("mouse::enter", function() if notify_center_hide_timer.started then notify_center_hide_timer:stop() end end) + notify_center:connect_signal("mouse::leave", function() notify_center_hide_timer:again() end) + +end) diff --git a/modules/panel.lua b/modules/panel.lua index 34d2479..f9345df 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -1,99 +1,113 @@ -local awful = require('awful') -local wibox = require('wibox') -local gears = require('gears') +local awful = require('awful') +local wibox = require('wibox') +local gears = require('gears') +local beautiful = require('beautiful') +local lain = require('../lain') -local vicious = require("../vicious") -local battery = require('../widgets/battery') ---local volume = require('../widgets/volume') -local date = require('../widgets/date') +local bat = lain.widget.bat { + settings = function() + widget:set_markup("BAT " .. bat_now.perc .. "% ") + end +} +local sysload = lain.widget.sysload { + settings = function() + widget:set_markup("LOAD " .. load_1 .. ", " .. load_5 .. ", " .. load_15 .. " ") + end +} -require("../modules.widget") +local cpu = lain.widget.cpu { + settings = function() + widget:set_markup("CPU " .. cpu_now.usage .. "% ") + end +} +local mem = lain.widget.mem { + settings = function() + widget:set_markup("MEM " .. mem_now.perc .. "% ") + end +} -modkey = "Mod4" +local net = lain.widget.net { + settings = function() + widget:set_markup("NET " .. net_now.sent .. "B/" .. net_now.received .. "B ") + end +} --- Keyboard map indicator and switcher -mykeyboardlayout = awful.widget.keyboardlayout() +modkey = "Mod4" screen.connect_signal("request::desktop_decoration", function(s) - -- Each screen has its own tag table. - awful.tag({ "main", "term", "dev", "browse", "social", "misc" }, s, awful.layout.layouts[1]) - -- Create a promptbox for each screen - s.mypromptbox = awful.widget.prompt() + -- Create the wibox + s.mywibox = awful.wibar({ position = "top" ,height = beautiful.panel_height, screen = s }) - -- Create an imagebox widget which will contain an icon indicating which layout we're using. - -- We need one layoutbox per screen. - s.mylayoutbox = awful.widget.layoutbox { - screen = s, - buttons = { - awful.button({ }, 1, function () awful.layout.inc( 1) end), - awful.button({ }, 3, function () awful.layout.inc(-1) end), - awful.button({ }, 4, function () awful.layout.inc( 1) end), - awful.button({ }, 5, function () awful.layout.inc(-1) end), - } - } + -- Each screen has its own tag table. + awful.tag({ "main", "term", "dev", "browse", "social", "misc" }, s, awful.layout.layouts[1]) - -- Create a taglist widget - s.mytaglist = awful.widget.taglist { - screen = s, - filter = awful.widget.taglist.filter.all, - widget_template = { - { - { - { - id = 'text_role', - widget = wibox.widget.textbox, - }, - layout = wibox.layout.fixed.horizontal, - }, - left = 18, - right = 18, - widget = wibox.container.margin - }, - id = 'background_role', - widget = wibox.container.background, + -- Create a taglist widget + s.mytaglist = awful.widget.taglist { + screen = s, + filter = awful.widget.taglist.filter.all, + widget_template = { + { + { + { + id = 'text_role', + widget = wibox.widget.textbox, + }, + layout = wibox.layout.fixed.horizontal, }, - buttons = { - awful.button({ }, 1, function(t) t:view_only() end), - awful.button({ modkey }, 1, function(t) - if client.focus then - client.focus:move_to_tag(t) - end - end), - awful.button({ }, 3, awful.tag.viewtoggle), - awful.button({ modkey }, 3, function(t) - if client.focus then - client.focus:toggle_tag(t) - end - end), - awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), - awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end), - } + left = 18, + right = 18, + widget = wibox.container.margin + }, + id = 'background_role', + widget = wibox.container.background, + }, + buttons = { + awful.button({ }, 1, function(t) t:view_only() end), + awful.button({ modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), + awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end), } + } - -- Create the wibox - s.mywibox = awful.wibar({ position = "top", height = 48, screen = s }) - - -- Add widgets to the wibox - s.mywibox.widget = { - layout = wibox.layout.align.horizontal, - { -- Left widgets - layout = wibox.layout.fixed.horizontal, - mylauncher, - s.mytaglist, - s.mypromptbox - }, - nil, - -- s.mytasklist, -- Middle widget - { -- Right widgets - layout = wibox.layout.fixed.horizontal, - s.mylayoutbox, - -- mykeyboardlayout, - -- wibox.widget.systray(), - battery, - date, - }, - } + -- Add widgets to the wibox + s.mywibox.widget = { + layout = wibox.layout.stack, + { + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + s.mytaglist, + }, + nil, + { + layout = wibox.layout.fixed.horizontal, + cpu, + mem, + -- net, + bat, + -- sysload, + -- wibox.widget.systray(), + } + }, + { -- Right widgets + layout = wibox.container.place, + valign = "center", + halign = "center", + wibox.widget.textclock + }, + } end) + diff --git a/modules/sidepanel.lua b/modules/sidepanel.lua index a4d3899..4932465 100644 --- a/modules/sidepanel.lua +++ b/modules/sidepanel.lua @@ -5,8 +5,6 @@ local timer = require("gears.timer") local beautiful = require('beautiful') local dpi = beautiful.xresources.apply_dpi -local thumbnail = require('modules.thumbnail') - screen.connect_signal("request::desktop_decoration", function(s) local entries = { @@ -35,7 +33,7 @@ screen.connect_signal("request::desktop_decoration", function(s) width = dpi(64), height = s.workarea.height, visible = false, - y = 48 + y = beautiful.panel_height }) @@ -173,7 +171,7 @@ dock:setup { } } -local dock_trigger = awful.wibox({ +local dock_trigger = awful.wibar({ position = "left", width = 1, bg = "#00000000", @@ -182,11 +180,12 @@ local dock_trigger = awful.wibox({ visible = true }) -local dock_hide_timer = timer({ timeout = 1}) +local dock_hide_timer = gears.timer({ timeout = 1}) dock_trigger:geometry({ width = 5, height = s.workarea.height }) dock_hide_timer:connect_signal("timeout", function() dock.visible = false; dock_hide_timer:stop() end ) dock_trigger:connect_signal("mouse::enter", function() dock.visible = true end) dock:connect_signal("mouse::enter", function() if dock_hide_timer.started then dock_hide_timer:stop() end end) dock:connect_signal("mouse::leave", function() dock_hide_timer:again() end) - end) + +end) diff --git a/modules/thumbnail.lua b/modules/thumbnail.lua deleted file mode 100644 index 35379d3..0000000 --- a/modules/thumbnail.lua +++ /dev/null @@ -1,43 +0,0 @@ -local wibox = require("wibox") -local surface = require("gears.surface") -local shape = require("gears.shape") - -local module = {} - -local function fit(self, context, width, height) - local size = math.min(width, height) - return size, size -end - -local function set_client(self, c) - ret._private.client[1] = c - self:emit_signal("widget::redraw_needed") -end - -local function draw(self, content, cr, width, height) - local c = self._private.client[1] - local s, geo = surface(c.content), c:geometry() - local scale = math.min(width/geo.width, height/geo.height) - local w, h = geo.width*scale, geo.height*scale - local dx, dy = (width-w)/2, (height-h)/2 - cr:translate(dx, dy) - shape.rounded_rect(cr, w, h) - cr:clip() - cr:scale(scale, scale) - cr:set_source_surface(s) - cr:paint() -end - -local function new(c) - local ret = wibox.widget.base.make_widget(nil, nil, { - enable_properties = true, - }) - - rawset(ret, "fit" , fit ) - rawset(ret, "draw" , draw ) - rawset(ret, "set_client", set_client) - ret._private.client = setmetatable({c}, {__mode="v"}) - return ret -end - -return setmetatable(module, {__call=function(_,...) return new(...) end}) diff --git a/preferences/layouts.lua b/preferences/layouts.lua index 957d96c..ca23456 100644 --- a/preferences/layouts.lua +++ b/preferences/layouts.lua @@ -1,9 +1,12 @@ local awful = require('awful') +local lain = require('../lain') tag.connect_signal("request::default_layouts", function() awful.layout.append_default_layouts({ awful.layout.suit.tile, - -- awful.layout.suit.floating, + awful.layout.suit.floating, + lain.layout.termfair, + lain.layout.centerwork, -- awful.layout.suit.tile.left, -- awful.layout.suit.tile.bottom, -- awful.layout.suit.tile.top, @@ -16,4 +19,4 @@ tag.connect_signal("request::default_layouts", function() awful.layout.suit.magnifier, awful.layout.suit.corner.nw, }) -end) \ No newline at end of file +end) diff --git a/preferences/rules.lua b/preferences/rules.lua new file mode 100644 index 0000000..d66253e --- /dev/null +++ b/preferences/rules.lua @@ -0,0 +1,82 @@ +local awful = require("awful") +local ruled = require("ruled") + +ruled.client.connect_signal("request::rules", function() + -- All clients will match this rule. + ruled.client.append_rule { + id = "global", + rule = { }, + properties = { + focus = awful.client.focus.filter, + raise = true, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap+awful.placement.no_offscreen + } + } + + -- Floating terminal. + ruled.client.append_rule { + id = "floating_terminal", + rule_any = { + instance = { "floating_terminal" }, + }, + properties = { + floating = true, + height = 960, + width = 1280, + placement = awful.placement.centered + } + } + + -- Floating clients. + ruled.client.append_rule { + id = "floating", + rule_any = { + instance = { "copyq", "pinentry" }, + class = { + "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv", + "Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer" + }, + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + "Event Tester", "Qalculate!" -- xev. + }, + role = { + "AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. + } + }, + properties = { + floating = true, + placement = awful.placement.centered + } + } + + -- Add titlebars to normal clients and dialogs + ruled.client.append_rule { + id = "titlebars", + rule_any = { type = { "normal", "dialog" } }, + properties = { titlebars_enabled = true } + } + ruled.client.append_rule { + rule = { class = "Plank" }, + properties = { + border_width = 0, + floating = true, + sticky = true, + ontop = true, + focusable = false, + below = true + } + } + + -- Set Firefox to always map on the tag named "2" on screen 1. + -- ruled.client.append_rule { + -- rule = { class = "Firefox" }, + -- properties = { screen = 1, tag = "2" } + -- } +end) + +-- }}} diff --git a/rc.lua b/rc.lua index ada3d4b..3539720 100644 --- a/rc.lua +++ b/rc.lua @@ -3,19 +3,24 @@ pcall(require, "luarocks.loader") local gears = require('gears') local awful = require('awful') local beautiful = require('beautiful') +local revelation = require('revelation') +awful.screen.set_auto_dpi_enabled(true) beautiful.init(require('theme')) +revelation.init() require('awful.autofocus') require('preferences.apps') require('preferences.layouts') +require('preferences.rules') require('modules.client') require('modules.titlebar') require('modules.panel') -require('modules.sidepanel') ---require('modules.dock') +-- require('modules.sidepanel') +-- require('modules.notifications') +-- require('modules.dock') -- require('modules.appdrawer') require('bindings.keys') @@ -111,70 +116,6 @@ awful.mouse.append_global_mousebindings({ --- {{{ Rules --- Rules to apply to new clients. -ruled.client.connect_signal("request::rules", function() - -- All clients will match this rule. - ruled.client.append_rule { - id = "global", - rule = { }, - properties = { - focus = awful.client.focus.filter, - raise = true, - screen = awful.screen.preferred, - placement = awful.placement.no_overlap+awful.placement.no_offscreen - } - } - - -- Floating clients. - ruled.client.append_rule { - id = "floating", - rule_any = { - instance = { "copyq", "pinentry" }, - class = { - "Arandr", "Blueman-manager", "Gpick", "Kruler", "Sxiv", - "Tor Browser", "Wpa_gui", "veromix", "xtightvncviewer" - }, - -- Note that the name property shown in xprop might be set slightly after creation of the client - -- and the name shown there might not match defined rules here. - name = { - "Event Tester", -- xev. - }, - role = { - "AlarmWindow", -- Thunderbird's calendar. - "ConfigManager", -- Thunderbird's about:config. - "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. - } - }, - properties = { floating = true } - } - - -- Add titlebars to normal clients and dialogs - ruled.client.append_rule { - id = "titlebars", - rule_any = { type = { "normal", "dialog" } }, - properties = { titlebars_enabled = true } - } - ruled.client.append_rule { - rule = { class = "Plank" }, - properties = { - border_width = 0, - floating = true, - sticky = true, - ontop = true, - focusable = false, - below = true - } - } - - -- Set Firefox to always map on the tag named "2" on screen 1. - -- ruled.client.append_rule { - -- rule = { class = "Firefox" }, - -- properties = { screen = 1, tag = "2" } - -- } -end) - --- }}} -- {{{ Notifications diff --git a/revelation b/revelation new file mode 160000 index 0000000..d8b58e3 --- /dev/null +++ b/revelation @@ -0,0 +1 @@ +Subproject commit d8b58e3776ec0ace45b5bc1160e322b69fa16d6f diff --git a/themes/pixelos/assets.bck/mockup.svg b/themes/pixelos/assets.bck/mockup.svg new file mode 100644 index 0000000..eee1a39 --- /dev/null +++ b/themes/pixelos/assets.bck/mockup.svg @@ -0,0 +1,3273 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active.png b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active.png new file mode 100644 index 0000000..68cb3f5 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active_hover.png b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active_hover.png new file mode 100644 index 0000000..adda96c Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_active_hover.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive.png b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive.png new file mode 100644 index 0000000..b1e40d6 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive_hover.png b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive_hover.png new file mode 100644 index 0000000..be379c0 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_blue_inactive_hover.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_red.png b/themes/pixelos/assets.bck/titlebar/buttons/button_red.png new file mode 100644 index 0000000..36c0815 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_red.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_red_hover.png b/themes/pixelos/assets.bck/titlebar/buttons/button_red_hover.png new file mode 100644 index 0000000..3c68460 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_red_hover.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_yellow.png b/themes/pixelos/assets.bck/titlebar/buttons/button_yellow.png new file mode 100644 index 0000000..70389b0 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_yellow.png differ diff --git a/themes/pixelos/assets.bck/titlebar/buttons/button_yellow_hover.png b/themes/pixelos/assets.bck/titlebar/buttons/button_yellow_hover.png new file mode 100644 index 0000000..ad47318 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/buttons/button_yellow_hover.png differ diff --git a/themes/pixelos/assets.bck/titlebar/titlebar_bottom.png b/themes/pixelos/assets.bck/titlebar/titlebar_bottom.png new file mode 100644 index 0000000..7141578 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/titlebar_bottom.png differ diff --git a/themes/pixelos/assets.bck/titlebar/titlebar_middle.png b/themes/pixelos/assets.bck/titlebar/titlebar_middle.png new file mode 100644 index 0000000..d7c3ea0 Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/titlebar_middle.png differ diff --git a/themes/pixelos/assets.bck/titlebar/titlebar_top.png b/themes/pixelos/assets.bck/titlebar/titlebar_top.png new file mode 100644 index 0000000..b9fb7fe Binary files /dev/null and b/themes/pixelos/assets.bck/titlebar/titlebar_top.png differ diff --git a/themes/pixelos/assets.bck/wallpaper/wallpaper1.png b/themes/pixelos/assets.bck/wallpaper/wallpaper1.png new file mode 100644 index 0000000..b3514cb Binary files /dev/null and b/themes/pixelos/assets.bck/wallpaper/wallpaper1.png differ diff --git a/themes/pixelos/assets.bck/wallpaper/wallpaper2.jpg b/themes/pixelos/assets.bck/wallpaper/wallpaper2.jpg new file mode 100644 index 0000000..67a9d38 Binary files /dev/null and b/themes/pixelos/assets.bck/wallpaper/wallpaper2.jpg differ diff --git a/themes/pixelos/assets.bck/wallpaper/wallpaper3.jpg b/themes/pixelos/assets.bck/wallpaper/wallpaper3.jpg new file mode 100644 index 0000000..a5ca0eb Binary files /dev/null and b/themes/pixelos/assets.bck/wallpaper/wallpaper3.jpg differ diff --git a/themes/pixelos/assets.bck/wallpaper/wallpaper4.jpg b/themes/pixelos/assets.bck/wallpaper/wallpaper4.jpg new file mode 100644 index 0000000..e4a416d Binary files /dev/null and b/themes/pixelos/assets.bck/wallpaper/wallpaper4.jpg differ diff --git a/themes/pixelos/assets.bck/widget/widget_pill_bottom_left.png b/themes/pixelos/assets.bck/widget/widget_pill_bottom_left.png new file mode 100644 index 0000000..ac64112 Binary files /dev/null and b/themes/pixelos/assets.bck/widget/widget_pill_bottom_left.png differ diff --git a/themes/pixelos/assets.bck/widget/widget_pill_bottom_right.png b/themes/pixelos/assets.bck/widget/widget_pill_bottom_right.png new file mode 100644 index 0000000..10e7800 Binary files /dev/null and b/themes/pixelos/assets.bck/widget/widget_pill_bottom_right.png differ diff --git a/themes/pixelos/assets.bck/widget/widget_pill_top_left.png b/themes/pixelos/assets.bck/widget/widget_pill_top_left.png new file mode 100644 index 0000000..320ce12 Binary files /dev/null and b/themes/pixelos/assets.bck/widget/widget_pill_top_left.png differ diff --git a/themes/pixelos/assets.bck/widget/widget_pill_top_right.png b/themes/pixelos/assets.bck/widget/widget_pill_top_right.png new file mode 100644 index 0000000..f299745 Binary files /dev/null and b/themes/pixelos/assets.bck/widget/widget_pill_top_right.png differ diff --git a/themes/pixelos/assets/titlebar/Readme.md b/themes/pixelos/assets/titlebar/Readme.md new file mode 100644 index 0000000..ba92e09 --- /dev/null +++ b/themes/pixelos/assets/titlebar/Readme.md @@ -0,0 +1 @@ +convert *.png -scale 75% -set filename:f '%t' '%[filename:f].png' diff --git a/themes/pixelos/assets/titlebar/titlebar_bottom.png b/themes/pixelos/assets/titlebar/titlebar_bottom.png index 7141578..1723305 100644 Binary files a/themes/pixelos/assets/titlebar/titlebar_bottom.png and b/themes/pixelos/assets/titlebar/titlebar_bottom.png differ diff --git a/themes/pixelos/assets/titlebar/titlebar_middle.png b/themes/pixelos/assets/titlebar/titlebar_middle.png index d7c3ea0..f92d3bb 100644 Binary files a/themes/pixelos/assets/titlebar/titlebar_middle.png and b/themes/pixelos/assets/titlebar/titlebar_middle.png differ diff --git a/themes/pixelos/assets/titlebar/titlebar_top.png b/themes/pixelos/assets/titlebar/titlebar_top.png index b9fb7fe..77dc766 100644 Binary files a/themes/pixelos/assets/titlebar/titlebar_top.png and b/themes/pixelos/assets/titlebar/titlebar_top.png differ diff --git a/themes/pixelos/assets/wallpaper/wallpaper5.jpg b/themes/pixelos/assets/wallpaper/wallpaper5.jpg new file mode 100644 index 0000000..ad8f563 Binary files /dev/null and b/themes/pixelos/assets/wallpaper/wallpaper5.jpg differ diff --git a/themes/pixelos/init.lua b/themes/pixelos/init.lua index 6024f6a..a83cd7a 100644 --- a/themes/pixelos/init.lua +++ b/themes/pixelos/init.lua @@ -12,12 +12,12 @@ theme.icon_theme = 'Papirus-Dark' -- Font -- theme.font = 'ProggyCleanTTCE Nerd Font Mono 12' -theme.font = 'VictorMono Nerd Font Mono 10' --- theme.font = 'Iosevka Nerd Font Mono 10' +-- theme.font = 'VictorMono Nerd Font Mono 10' +theme.font = 'Iosevka Nerd Font Mono 10' -- Misc -- -- Wallpaper Image -theme.wallpaper = assets .. 'wallpaper/wallpaper4.jpg' +theme.wallpaper = assets .. 'wallpaper/wallpaper5.jpg' -- -- Solid Color gears.wallpaper.set("#20BEC6") @@ -46,6 +46,9 @@ theme.notification_border_width = 0 theme.notification_border_color = "#FFFFFFFF" theme.notification_shape = gears.shape.rounded_rect +-- Panel +theme.panel_height = 38 + -- Menu theme.menu_height = 40 theme.menu_bg_focus = theme.background @@ -53,9 +56,9 @@ theme.menu_bg_normal = theme.background -- Taglist theme.taglist_bg_empty = theme.background .. '00' -theme.taglist_bg_occupied = '#2a2a2a' .. 'ff' +theme.taglist_bg_occupied = '#ffffff' .. '11' theme.taglist_bg_urgent = '#E91E63' .. '99' -theme.taglist_bg_focus = '#3a3a3a' +theme.taglist_bg_focus = '#ffffff' .. '22' theme.taglist_spacing = dpi(0) theme.apps_slack = assets .. 'titlebar/buttons/button_red.png' @@ -91,11 +94,11 @@ theme.titlebar_image_bottom = assets .. 'titlebar/titlebar_bottom.png' theme.titlebar_bgimage_normal = theme.titlebar_middle -- Titlebar Buttons +theme.titlebar_button_spacing = dpi(2.5) theme.titlebar_button_margin_left = dpi(2.5) theme.titlebar_button_margin_right = dpi(3) theme.titlebar_button_margin_top = dpi(3) theme.titlebar_button_margin_bottom = dpi(3) -theme.titlebar_button_spacing = dpi(2.5) theme.titlebar_button_close = assets .. 'titlebar/buttons/button_red.png' theme.titlebar_button_close_hover = assets .. 'titlebar/buttons/button_red_hover.png' diff --git a/vicious b/vicious deleted file mode 160000 index eada066..0000000 --- a/vicious +++ /dev/null @@ -1 +0,0 @@ -Subproject commit eada06667d78f58209f50cc5aa3bdd4dde32f0d9 diff --git a/widgets/battery.lua b/widgets/battery.lua index a854b80..81a6e6b 100644 --- a/widgets/battery.lua +++ b/widgets/battery.lua @@ -1,4 +1,3 @@ -local vicious = require("../vicious") local wibox = require("wibox") local gears = require("gears") require("../modules.widget") @@ -31,4 +30,4 @@ vicious.register(textbox, vicious.widgets.bat, "$2%", 61, "BAT0") -return battery \ No newline at end of file +return battery diff --git a/widgets/clickable_container.lua b/widgets/clickable_container.lua new file mode 100644 index 0000000..6b57aa2 --- /dev/null +++ b/widgets/clickable_container.lua @@ -0,0 +1,59 @@ +local wibox = require('wibox') +local beautiful = require('beautiful') + +local create_click_events = function(widget) + + local container = wibox.widget { + widget, + widget = wibox.container.background + } + + -- Old and new widget + local old_cursor, old_wibox + + -- Mouse hovers on the widget + container:connect_signal( + 'mouse::enter', + function() + container.bg = beautiful.groups_bg + -- Hm, no idea how to get the wibox from this signal's arguments... + local w = mouse.current_wibox + if w then + old_cursor, old_wibox = w.cursor, w + w.cursor = 'hand1' + end + end + ) + + -- Mouse leaves the widget + container:connect_signal( + 'mouse::leave', + function() + container.bg = beautiful.leave_event + if old_wibox then + old_wibox.cursor = old_cursor + old_wibox = nil + end + end + ) + + -- Mouse pressed the widget + container:connect_signal( + 'button::press', + function() + container.bg = beautiful.press_event + end + ) + + -- Mouse releases the widget + container:connect_signal( + 'button::release', + function() + container.bg = beautiful.release_event + end + ) + + return container +end + +return create_click_events diff --git a/widgets/date.lua b/widgets/date.lua index d103afe..bb9c6dc 100644 --- a/widgets/date.lua +++ b/widgets/date.lua @@ -8,4 +8,4 @@ date = pill(textbox, "#2D2D2D") vicious.register(textbox, vicious.widgets.date, "%b %d, %R") -return date \ No newline at end of file +return date diff --git a/widgets/net.lua b/widgets/net.lua new file mode 100644 index 0000000..d103afe --- /dev/null +++ b/widgets/net.lua @@ -0,0 +1,11 @@ +local wibox = require('wibox') +local vicious = require('../vicious') +require("../modules.widget") + +textbox = wibox.widget.textbox() + +date = pill(textbox, "#2D2D2D") + +vicious.register(textbox, vicious.widgets.date, "%b %d, %R") + +return date \ No newline at end of file