Compare commits

...
Sign in to create a new pull request.

2 commits
main ... siklos

Author SHA1 Message Date
Hydroxycarbamide
8d0abe603d Fix tag preview closing + Update autorun, default layouts, tag-preview theme 2023-03-20 13:43:31 +01:00
Hydroxycarbamide
2401cfcee2 Add revelation
Update and add bling task_preview, tag_preview and window_switcher
Add catppuccin-macchiato
Use my weather key
Update keybindings
Update autorun
Fix sliders
2023-03-20 09:51:48 +01:00
57 changed files with 2053 additions and 863 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "home/.config/awesome/libs/revelation"]
path = home/.config/awesome/libs/revelation
url = https://github.com/thiru/awesome-revelation

View file

@ -21,7 +21,8 @@ xset r rate 300 50 &
clipmenud & clipmenud &
# Wallpaper : # Wallpaper :
nitrogen --restore & # nitrogen --restore &
$HOME/.fehbg
# conky # conky
#conky -c ~/.config/conky/otis-forest.conkyrc\ & #conky -c ~/.config/conky/otis-forest.conkyrc\ &
@ -35,6 +36,13 @@ nitrogen --restore &
# pidof -s "$program" || setsid -f "$program" # pidof -s "$program" || setsid -f "$program"
#done >/dev/null 2>&1 #done >/dev/null 2>&1
setxkbmap -option compose:ralt
setxkbmap -option caps:escape
# Updates : # Updates :
#notify-send -t 8000 "You have $(checkupdates | wc -l) update 📦" & #notify-send -t 8000 "You have $(checkupdates | wc -l) update 📦" &
killall -9 kdeconnect-indicator
picom -b --dbus
gwe --hide-window &
kdeconnect-indicator &
nvidia-settings

View file

@ -5,41 +5,44 @@
-- ~~~~~~~~~~~~~~ -- ~~~~~~~~~~~~~~
local awful = require("awful") local awful = require("awful")
local hotkeys_popup = require("awful.hotkeys_popup") local hotkeys_popup = require("awful.hotkeys_popup")
local revelation = require("libs.revelation")
local switcher = require("libs.awesome_switcher")
local gfs = require "gears".filesystem.get_configuration_dir()
-- vars -- vars
-- ~~~~~~~~~ -- ~~~~~~~~~
-- modkey -- modkey
local modkey = "Mod4" local modkey = "Mod4"
-- modifer keys -- modifer keys
local shift = "Shift" local shift = "Shift"
local ctrl = "Control" local ctrl = "Control"
local alt = "Mod1" local alt = "Mod1"
-- Default Applications : -- Default Applications :
--terminal = "alacritty" --terminal = "alacritty"
terminal = "kitty" terminal = "kitty"
web_browser = "brave" web_browser = "librewolf"
editor = os.getenv("EDITOR") or "nano" editor = os.getenv("EDITOR") or "nano"
editor_cmd = terminal .. " -e " .. editor editor_cmd = terminal .. " -e " .. editor
-- Configurations -- Configurations
-- ~~~~~~~~~~~~~~ -- ~~~~~~~~~~~~~~
-- # Mouse bindings : -- # Mouse bindings :
awful.mouse.append_global_mousebindings({ awful.mouse.append_global_mousebindings({
awful.button({ }, 3, function () mymainmenu:toggle() end) awful.button({}, 3, function() mymainmenu:toggle() end)
}) })
client.connect_signal("request::default_mousebindings", function() client.connect_signal("request::default_mousebindings", function()
awful.mouse.append_client_mousebindings({ awful.button({ }, 1, function (c) awful.mouse.append_client_mousebindings({ awful.button({}, 1, function(c)
c:activate { context = "mouse_click" } c:activate { context = "mouse_click" }
end),
awful.button({ modkey }, 1, function(c)
c:activate { context = "mouse_click", action = "mouse_move" }
end), end),
awful.button({ modkey }, 1, function (c) awful.button({ modkey }, 3, function(c)
c:activate { context = "mouse_click", action = "mouse_move" } c:activate { context = "mouse_click", action = "mouse_resize" }
end),
awful.button({ modkey }, 3, function (c)
c:activate { context = "mouse_click", action = "mouse_resize"}
end), end),
}) })
end) end)
@ -52,81 +55,88 @@ end)
-- # Key bindings : -- # Key bindings :
-- General Awesome keys -- General Awesome keys
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "s", hotkeys_popup.show_help, {description="show help", group="awesome"}), awful.key({ modkey, }, "s", hotkeys_popup.show_help, { description = "show help", group = "awesome" }),
--awful.key({ modkey, }, "w", function() mymainmenu:show() end, { description = "show main menu", group = "awesome" }),
awful.key({ modkey, }, "w", function () mymainmenu:show() end, {description = "show main menu", group = "awesome"}), awful.key({ modkey, shift }, "r", awesome.restart, { description = "reload awesome", group = "awesome" }),
awful.key({ modkey, shift }, "q", awesome.quit, { description = "quit awesome", group = "awesome" }),
awful.key({ modkey, ctrl }, "r", awesome.restart, {description = "reload awesome", group = "awesome"}), awful.key({ modkey, }, "Return", function() awful.spawn(terminal) end, { description = "open a terminal", group = "launcher" }),
awful.key({ modkey, }, "b", function() awful.spawn(web_browser) end, { description = "Open Web Browser", group = "launcher" }),
awful.key({ modkey, shift }, "q", awesome.quit, {description = "quit awesome", group = "awesome"}), awful.key({ modkey, shift }, "Return", function() awful.spawn("xterm") end, { description = "open a terminal", group = "launcher" }),
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, {description = "open a terminal", group = "launcher"}),
awful.key({ modkey, }, "b", function () awful.spawn(web_browser) end, {description = "Open Web Browser", group = "launcher"}),
awful.key({ modkey, shift }, "Return", function () awful.spawn("xterm") end, {description = "open a terminal", group = "launcher"}),
-- awful.key({ modkey }, "p", function() menubar.show() end, -- awful.key({ modkey }, "p", function() menubar.show() end,
-- {description = "show the menubar", group = "launcher"}), -- {description = "show the menubar", group = "launcher"}),
}) })
-- Tags related keybindings -- Tags related keybindings
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "Left", awful.tag.viewprev, {description = "view previous", group = "tag"}), awful.key({ modkey, }, "Left", awful.tag.viewprev, { description = "view previous", group = "tag" }),
awful.key({ modkey, }, "Right", awful.tag.viewnext, { description = "view next", group = "tag" }),
awful.key({ modkey, }, "Right", awful.tag.viewnext, {description = "view next", group = "tag"}), -- awful.key({ modkey, }, "Escape", awful.tag.history.restore, { description = "go back", group = "tag" }),
awful.key({ modkey, }, "Escape", awful.tag.history.restore, {description = "go back", group = "tag"}),
}) })
-- Focus related keybindings -- Focus related keybindings
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ modkey, }, "j", function () awful.client.focus.byidx(1) end, {description = "focus next by index", group = "client"}), awful.key({ modkey, }, "j", function() awful.client.focus.byidx(1) end, { description = "focus next by index", group = "client" }),
awful.key({ modkey, }, "k", function() awful.client.focus.byidx( -1) end, { description = "focus previous by index", group = "client" }),
awful.key({ modkey, }, "k", function () awful.client.focus.byidx(-1) end, {description = "focus previous by index", group = "client"}), awful.key({ alt, }, "Tab", function()
awesome.emit_signal("bling::window_switcher::turn_on")
awful.key({ modkey, }, "Tab", function () awful.client.focus.history.previous() end, { description = "Switch tab", group = "client" }),
if client.focus then --awful.key({ alt, }, "Tab", function()
client.focus:raise() -- awful.client.focus.history.previous()
end -- if client.focus then
end, {description = "go back", group = "client"}), -- client.focus:raise()
-- end
awful.key({ modkey, ctrl }, "j", function () awful.screen.focus_relative( 1) end, {description = "focus the next screen", group = "screen"}), --end, { description = "go back", group = "client" }),
--awful.key(
awful.key({ modkey, ctrl }, "k", function () awful.screen.focus_relative(-1) end, {description = "focus the previous screen", group = "screen"}), -- { alt },
-- 'Tab',
-- function()
-- switcher.switch(1, "Mod1", "Alt_L", "Shift", "Tab")
-- end
--),
awful.key(
{ alt, shift },
'Tab',
function()
switcher.switch(1, "Mod1", "Alt_L", "Shift", "Tab")
end
),
awful.key({ modkey, ctrl }, "j", function() awful.screen.focus_relative(1) end, { description = "focus the next screen", group = "screen" }),
awful.key({ modkey, ctrl }, "k", function() awful.screen.focus_relative( -1) end, { description = "focus the previous screen", group = "screen" }),
awful.key({ modkey, ctrl }, "n", awful.key({ modkey, ctrl }, "n",
function () function()
local c = awful.client.restore() local c = awful.client.restore()
-- Focus restored client -- Focus restored client
if c then if c then
c:activate { raise = true, context = "key.unminimize" } c:activate { raise = true, context = "key.unminimize" }
end end
end, {description = "restore minimized", group = "client"}), end, { description = "restore minimized", group = "client" }),
awful.key(
{ modkey, "Control" },
"Tab",
awful.client.movetoscreen,
{ description = "Move focused client to other screen", group = "client" }
),
}) })
-- Layout related keybindings -- Layout related keybindings
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ modkey, shift }, "j", function () awful.client.swap.byidx( 1) end, {description = "swap with next client by index", group = "client"}), awful.key({ modkey, shift }, "j", function() awful.client.swap.byidx(1) end, { description = "swap with next client by index", group = "client" }),
awful.key({ modkey, shift }, "k", function() awful.client.swap.byidx( -1) end, { description = "swap with previous client by index", group = "client" }),
awful.key({ modkey, shift }, "k", function () awful.client.swap.byidx( -1) end, {description = "swap with previous client by index", group = "client"}), awful.key({ modkey, }, "u", awful.client.urgent.jumpto, { description = "jump to urgent client", group = "client" }),
awful.key({ modkey, }, "l", function() awful.tag.incmwfact(0.05) end, { description = "increase master width factor", group = "layout" }),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto, {description = "jump to urgent client", group = "client"}), awful.key({ modkey, }, "h", function() awful.tag.incmwfact( -0.05) end, { description = "decrease master width factor", group = "layout" }),
awful.key({ modkey, shift }, "h", function() awful.tag.incnmaster(1, nil, true) end, { description = "increase the number of master clients", group = "layout" }),
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, {description = "increase master width factor", group = "layout"}), awful.key({ modkey, shift }, "l", function() awful.tag.incnmaster( -1, nil, true) end, { description = "decrease the number of master clients", group = "layout" }),
awful.key({ modkey, ctrl }, "h", function() awful.tag.incncol(1, nil, true) end, { description = "increase the number of columns", group = "layout" }),
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, {description = "decrease master width factor", group = "layout"}), awful.key({ modkey, ctrl }, "l", function() awful.tag.incncol( -1, nil, true) end, { description = "decrease the number of columns", group = "layout" }),
awful.key({ modkey, }, "Tab", function() awful.layout.inc(1) end, { description = "select next", group = "layout" }),
awful.key({ modkey, shift }, "h", function () awful.tag.incnmaster( 1, nil, true) end, {description = "increase the number of master clients", group = "layout"}), awful.key(
{ modkey, 'Shift' },
awful.key({ modkey, shift }, "l", function () awful.tag.incnmaster(-1, nil, true) end, {description = "decrease the number of master clients", group = "layout"}), 'w',
revelation,
awful.key({ modkey, ctrl }, "h", function () awful.tag.incncol( 1, nil, true) end, {description = "increase the number of columns", group = "layout"}), { description = "Overview", group = "layout" }
),
awful.key({ modkey, ctrl }, "l", function () awful.tag.incncol(-1, nil, true) end, {description = "decrease the number of columns", group = "layout"}), awful.key({ modkey, shift }, "Tab", function() awful.layout.inc( -1) end, { description = "select previous", group = "layout" }),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, {description = "select next", group = "layout"}),
awful.key({ modkey, shift }, "space", function () awful.layout.inc(-1) end, {description = "select previous", group = "layout"}),
}) })
-- Tags related keybindings -- Tags related keybindings
@ -136,7 +146,7 @@ awful.keyboard.append_global_keybindings({
keygroup = "numrow", keygroup = "numrow",
description = "only view tag", description = "only view tag",
group = "tag", group = "tag",
on_press = function (index) on_press = function(index)
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[index] local tag = screen.tags[index]
if tag then if tag then
@ -149,7 +159,7 @@ awful.keyboard.append_global_keybindings({
keygroup = "numrow", keygroup = "numrow",
description = "toggle tag", description = "toggle tag",
group = "tag", group = "tag",
on_press = function (index) on_press = function(index)
local screen = awful.screen.focused() local screen = awful.screen.focused()
local tag = screen.tags[index] local tag = screen.tags[index]
if tag then if tag then
@ -158,11 +168,11 @@ awful.keyboard.append_global_keybindings({
end, end,
}, },
awful.key { awful.key {
modifiers = { modkey, shift }, modifiers = { modkey, shift },
keygroup = "numrow", keygroup = "numrow",
description = "move focused client to tag", description = "move focused client to tag",
group = "tag", group = "tag",
on_press = function (index) on_press = function(index)
if client.focus then if client.focus then
local tag = client.focus.screen.tags[index] local tag = client.focus.screen.tags[index]
if tag then if tag then
@ -176,7 +186,7 @@ awful.keyboard.append_global_keybindings({
keygroup = "numrow", keygroup = "numrow",
description = "toggle focused client on tag", description = "toggle focused client on tag",
group = "tag", group = "tag",
on_press = function (index) on_press = function(index)
if client.focus then if client.focus then
local tag = client.focus.screen.tags[index] local tag = client.focus.screen.tags[index]
if tag then if tag then
@ -190,7 +200,7 @@ awful.keyboard.append_global_keybindings({
keygroup = "numpad", keygroup = "numpad",
description = "select layout directly", description = "select layout directly",
group = "layout", group = "layout",
on_press = function (index) on_press = function(index)
local t = awful.screen.focused().selected_tag local t = awful.screen.focused().selected_tag
if t then if t then
t.layout = t.layouts[index] or t.layout t.layout = t.layouts[index] or t.layout
@ -201,47 +211,46 @@ awful.keyboard.append_global_keybindings({
-- Media Control : -- Media Control :
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
-- Volume Keys : -- Volume Keys :
awful.key({}, "XF86AudioLowerVolume", function () awful.spawn("amixer -q -D pulse sset Master 5%-", false) end), awful.key({}, "XF86AudioLowerVolume", function() awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ -2%", false) end),
awful.key({}, "XF86AudioRaiseVolume", function() awful.spawn("pactl set-sink-volume @DEFAULT_SINK@ +2%", false) end),
awful.key({}, "XF86AudioRaiseVolume", function () awful.spawn("amixer -q -D pulse sset Master 5%+", false) end), awful.key({}, "XF86AudioMute", function() awful.spawn("pactl set-sink-mute @DEFAULT_SINK@ toggle", false) end),
awful.key({}, "XF86AudioMute", function () awful.spawn("amixer -D pulse set Master 1+ toggle", false) end), -- Media Keys :
awful.key({}, "XF86AudioPlay", function() awful.spawn("playerctl play-pause", false) end),
-- Media Keys : awful.key({}, "XF86AudioNext", function() awful.spawn("playerctl next", false) end),
awful.key({}, "XF86AudioPlay", function() awful.spawn("playerctl play-pause", false) end), awful.key({}, "XF86AudioPrev", function() awful.spawn("playerctl previous", false) end),
awful.key({}, "XF86AudioNext", function() awful.spawn("playerctl next", false) end), -- Brightness Keys :
awful.key({}, "XF86MonBrightnessUp", function() awful.spawn("brightnessctl set 5%+", false) end),
awful.key({}, "XF86AudioPrev", function() awful.spawn("playerctl previous", false) end), awful.key({}, "XF86MonBrightnessDown", function() awful.spawn("brightnessctl set 5%-", false) end),
-- Brightness Keys :
awful.key({}, "XF86MonBrightnessUp", function() awful.spawn("brightnessctl set 5%+", false) end),
awful.key({}, "XF86MonBrightnessDown", function() awful.spawn("brightnessctl set 5%-", false) end),
}) })
-- Standard program : -- Standard program :
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
-- File Manager : -- File Manager :
awful.key({ ctrl, shift }, "f", function () awful.spawn(string.format("pcmanfm")) end, {description = "pcmanfm", group = "file manager"}), awful.key({ modkey }, "e", function() awful.spawn(string.format("xdg-open .")) end, { description = "file manager", group = "file manager" }),
-- Screenshots Keys : -- Screenshots Keys :
awful.key({ }, "Print", function () awful.spawn("screenshot")end, {description = "Maim", group = "screenshot"}), awful.key({}, "Print", function() awful.spawn("screenshot") end, { description = "Maim", group = "screenshot" }),
awful.key({ modkey }, "Print", function () awful.spawn("screenshot-select")end, {description = "Maim", group = "screenshot"}), awful.key({ modkey }, "Print", function() awful.spawn("screenshot-select") end, { description = "Maim", group = "screenshot" }),
-- Rofi : -- Rofi :
awful.key({ modkey }, "p", function () awful.spawn("rofi -show drun -show-icons &>> /tmp/rofi.log") end, {description = "rofi launcher", group = "launcher"}), --awful.key({ modkey }, "d", function() awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi") end, { description = "rofi launcher", group = "launcher" }),
--awful.key({ modkey }, "w", function() awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi") end, { description = "rofi launcher", group = "launcher" }),
awful.key({ modkey }, "d", function() awful.spawn("rofi -show drun -theme " .. gfs .. "/libs/misc/rofi/config.rasi") end, { description = "rofi launcher", group = "launcher" }),
awful.key({ modkey }, "w", function() awful.spawn("rofi -show window -theme " .. gfs .. "/libs/misc/rofi/config.rasi") end, { description = "rofi launcher", group = "launcher" }),
-- Main Menu : -- Main Menu :
-- awful.key({ modkey }, "r", function () awful.spawn("rofi -show drun -show-icons -theme ~/.config/awesome/libs/misc/rofi/config.rasi &>> /tmp/rofi.log") end, {description = "rofi launcher", group = "launcher"}), -- awful.key({ modkey }, "r", function () awful.spawn("rofi -show drun -show-icons -theme ~/.config/awesome/libs/misc/rofi/config.rasi &>> /tmp/rofi.log") end, {description = "rofi launcher", group = "launcher"}),
-- ClipMenu : -- ClipMenu :
awful.key({ modkey}, "Insert", function () awful.spawn("clipmenu") end,{description = "clipboard history by rofi/clipmenud", group = "awesome"}), awful.key({ modkey }, "Insert", function() awful.spawn("clipmenu") end, { description = "clipboard history by rofi/clipmenud", group = "awesome" }),
-- Center Window : -- Center Window :
awful.key({ modkey }, "y", awful.placement.centered) awful.key({ modkey }, "y", awful.placement.centered),
awful.key({ modkey }, "l", function() awful.spawn("betterlockscreen -l") end, { description = "lockscreen", group = "lockscreen" }),
}) })
-- Systray : -- Systray :
@ -251,42 +260,50 @@ awful.keyboard.append_global_keybindings({
-- Bar : -- Bar :
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ modkey }, "=", function () awful.key({ modkey }, "=", function()
for s in screen do for s in screen do
s.mywibar.visible = not s.mywibar.visible s.mywibar.visible = not s.mywibar.visible
end end
end, end,
{description = "toggle wibox", group = "awesome"}), { description = "toggle wibox", group = "awesome" }),
}) })
awful.keyboard.append_global_keybindings({ awful.keyboard.append_global_keybindings({
awful.key({ alt }, "Tab", function() awesome.emit_signal("sidebar::toggle") end), -- Sidebar awful.key({ modkey }, "Escape", function() awesome.emit_signal("sidebar::toggle") end), -- Sidebar
awful.key({ alt }, "t", function() awful.titlebar.toggle(client.focus) end), awful.key({ modkey }, "t", function() awesome.emit_signal("notifications_list::toggle") end), -- Sidebar
awful.key({ alt }, "t", function() awful.titlebar.toggle(client.focus) end),
}) })
-- Client : -- Client :
client.connect_signal("request::default_keybindings", function() client.connect_signal("request::default_keybindings", function()
awful.keyboard.append_client_keybindings({ awful.keyboard.append_client_keybindings({
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen c:raise() end, {description = "toggle fullscreen", group = "client"}), awful.key({ modkey, }, "f", function(c)
c.fullscreen = not c.fullscreen
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,{description = "close", group = "client"}), c:raise()
end, { description = "toggle fullscreen", group = "client" }),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,{description = "toggle floating", group = "client"}), awful.key({ modkey, shift }, "f", function(c)
c.maximized = not c.maximized
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, {description = "move to master", group = "client"}), c:raise()
end, { description = "toggle maximized", group = "client" }),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, {description = "move to screen", group = "client"}), awful.key({ modkey }, "c", function(c) c:kill() end, { description = "close", group = "client" }),
awful.key({ modkey }, "space", awful.client.floating.toggle, { description = "toggle floating", group = "client" }),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, {description = "toggle keep on top", group = "client"}), awful.key({ modkey, "Control" }, "Return", function(c) c:swap(awful.client.getmaster()) end, { description = "move to master", group = "client" }),
-- The client currently has the input focus, so it cannot be awful.key({ modkey, }, "o", function(c) c:move_to_screen() end, { description = "move to screen", group = "client" }),
-- minimized, since minimized clients can't have the focus. awful.key({ modkey, }, "t", function(c) c.ontop = not c.ontop end, { description = "toggle keep on top", group = "client" }),
awful.key({ modkey, }, "n", function (c) c.minimized = true end , {description = "minimize", group = "client"}), -- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
awful.key({ modkey, }, "m", function (c)c.maximized = not c.maximized c:raise() end , {description = "(un)maximize", group = "client"}), awful.key({ modkey, }, "n", function(c) c.minimized = true end, { description = "minimize", group = "client" }),
awful.key({ modkey, }, "m", function(c)
awful.key({ modkey, "Control" }, "m", function (c) c.maximized_vertical = not c.maximized_vertical c:raise() end , {description = "(un)maximize vertically", group = "client"}), c.maximized = not c.maximized
c:raise()
awful.key({ modkey, "Shift" }, "m", function (c) c.maximized_horizontal = not c.maximized_horizontal c:raise() end , {description = "(un)maximize horizontally", group = "client"}), end, { description = "(un)maximize", group = "client" }),
awful.key({ modkey, "Control" }, "m", function(c)
c.maximized_vertical = not c.maximized_vertical
c:raise()
end, { description = "(un)maximize vertically", group = "client" }),
awful.key({ modkey, shift }, "m", function(c)
c.maximized_horizontal = not c.maximized_horizontal
c:raise()
end, { description = "(un)maximize horizontally", group = "client" }),
}) })
end) end)

View file

@ -31,9 +31,9 @@ tag.connect_signal("request::default_layouts", function()
--awful.layout.suit.fair.horizontal, --awful.layout.suit.fair.horizontal,
--awful.layout.suit.spiral, --awful.layout.suit.spiral,
awful.layout.suit.spiral.dwindle, awful.layout.suit.spiral.dwindle,
--awful.layout.suit.max, awful.layout.suit.max,
awful.layout.suit.max.fullscreen, awful.layout.suit.max.fullscreen,
--awful.layout.suit.magnifier, awful.layout.suit.magnifier,
--awful.layout.suit.corner.nw, --awful.layout.suit.corner.nw,
centered, centered,
equal, equal,

View file

@ -19,61 +19,62 @@ ruled.client.connect_signal("request::rules", function()
-- All clients will match this rule. -- All clients will match this rule.
ruled.client.append_rule { ruled.client.append_rule {
id = "global", id = "global",
rule = { }, rule = {},
properties = { properties = {
focus = awful.client.focus.filter, focus = awful.client.focus.filter,
raise = true, raise = true,
screen = awful.screen.preferred, screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen+awful.placement.centered placement = awful.placement.no_overlap + awful.placement.no_offscreen + awful.placement.centered
} }
} }
-- Floating clients. -- Floating clients.
ruled.client.append_rule { ruled.client.append_rule {
id = "floating", id = "floating",
rule_any = { rule_any = {
instance = { "copyq", "pinentry" }, instance = { "copyq", "pinentry" },
class = { class = {
"Arandr", "Arandr",
"Steam", "Steam",
"XTerm", "XTerm",
"Virt-manager", "Virt-manager",
"VirtualBox Manager", "VirtualBox Manager",
"Nm-connection-editor", "Nm-connection-editor",
"Xfce4-power-manager-settings", "Xfce4-power-manager-settings",
"Pavucontrol", "Pavucontrol",
"Qalculate-gtk", "Qalculate-gtk",
"Engrampa", "Engrampa",
"Lxappearance", "Lxappearance",
"Gnome-disks", "Gnome-disks",
"Nitrogen", "Nitrogen",
"Viewnior", "Viewnior",
"Audacious", "Audacious",
"qt5ct", "qt5ct",
"qt6ct", "qt6ct",
"Kvantum Manager", "Kvantum Manager",
"Blueman-manager", "Blueman-manager",
"Gpick", "Gpick",
"Kruler", "Kruler",
"MessageWin", -- kalarm. "MessageWin", -- kalarm.
"Sxiv", "Sxiv",
"Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size.
"Wpa_gui", "Wpa_gui",
"veromix", "veromix",
"alsamixer", "alsamixer",
"xtightvncviewer", "xtightvncviewer",
"Gufw Firewall", "Gufw Firewall",
"VPN4Test" "VPN4Test",
}, "xdg-desktop-portal-gnome"
},
-- Note that the name property shown in xprop might be set slightly after creation of the client -- 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. -- and the name shown there might not match defined rules here.
name = { name = {
"Event Tester", -- xev. "Event Tester", -- xev.
}, },
role = { role = {
"AlarmWindow", -- Thunderbird's calendar. "AlarmWindow", -- Thunderbird's calendar.
"ConfigManager", -- Thunderbird's about:config. "ConfigManager", -- Thunderbird's about:config.
"pop-up", -- e.g. Google Chrome's (detached) Developer Tools. "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
} }
}, },
properties = { floating = true } properties = { floating = true }
@ -83,19 +84,19 @@ ruled.client.connect_signal("request::rules", function()
ruled.client.append_rule { ruled.client.append_rule {
id = "center_placement", id = "center_placement",
rule_any = { rule_any = {
type = {"dialog"}, type = { "dialog" },
class = {"Steam", "discord", "markdown_input", "nemo", "thunar", "pcmanfm" }, class = { "Steam", "discord", "markdown_input", "nemo", "thunar", "pcmanfm" },
instance = {"markdown_input",}, instance = { "markdown_input", },
role = {"GtkFileChooserDialog"} role = { "GtkFileChooserDialog" }
}, },
properties = {placement = awful.placement.center} properties = { placement = awful.placement.center }
} }
-- Add titlebars to normal clients and dialogs -- Add titlebars to normal clients and dialogs
ruled.client.append_rule { ruled.client.append_rule {
id = "titlebars", id = "titlebars",
rule_any = { type = { "normal", "dialog" } }, rule_any = { type = { "normal", "dialog" } },
properties = { titlebars_enabled = false } properties = { titlebars_enabled = false }
} }
-- Set Firefox to always map on the tag named "2" on screen 1. -- Set Firefox to always map on the tag named "2" on screen 1.
@ -103,16 +104,29 @@ ruled.client.connect_signal("request::rules", function()
-- rule = { class = "Firefox" }, -- rule = { class = "Firefox" },
-- properties = { screen = 1, tag = "2" } -- properties = { screen = 1, tag = "2" }
-- } -- }
ruled.client.append_rule {
id = 'sandbox',
rule_any = {
class = {
'nvidia-settings',
'Nvidia-settings'
}
},
properties = {
tag = '8'
}
}
end) end)
ruled.notification.connect_signal('request::rules', function() ruled.notification.connect_signal('request::rules', function()
-- All notifications will match this rule. -- All notifications will match this rule.
ruled.notification.append_rule { ruled.notification.append_rule {
rule = { }, rule = {},
properties = { properties = {
screen = awful.screen.preferred, screen = awful.screen.preferred,
implicit_timeout = 5, implicit_timeout = 5,
position = "top_right", position = "bottom_right",
} }
} }
end) end)
@ -130,12 +144,12 @@ end)
-- Window opacity -- Window opacity
client.connect_signal("focus", function(c) client.connect_signal("focus", function(c)
c.border_color = beautiful.border_focus c.border_color = beautiful.border_focus
c.opacity = 1 c.opacity = 1
end) end)
client.connect_signal("unfocus", function(c) client.connect_signal("unfocus", function(c)
c.border_color = beautiful.border_normal c.border_color = beautiful.border_normal
c.opacity = 0.9 c.opacity = 1
end) end)
client.connect_signal("property::fullscreen", function(c) client.connect_signal("property::fullscreen", function(c)
@ -147,7 +161,7 @@ client.connect_signal("property::fullscreen", function(c)
end) end)
end end
end) end)
-- # Round Corners : -- # Round Corners :
--local function enable_rounding() --local function enable_rounding()
-- client.connect_signal("manage", function (c) -- client.connect_signal("manage", function (c)

View file

@ -0,0 +1,532 @@
local cairo = require("lgi").cairo
local mouse = mouse
local screen = screen
local wibox = require('wibox')
local table = table
local keygrabber = keygrabber
local math = require('math')
local awful = require('awful')
local gears = require("gears")
local timer = gears.timer
local client = client
awful.client = require('awful.client')
local naughty = require("naughty")
local string = string
local tostring = tostring
local tonumber = tonumber
local debug = debug
local pairs = pairs
local unpack = unpack or table.unpack
local surface = cairo.ImageSurface(cairo.Format.RGB24,20,20)
local cr = cairo.Context(surface)
local _M = {}
-- settings
_M.settings = {
preview_box = true,
preview_box_bg = "#18192611",
preview_box_border = "#18192611",
preview_box_fps = 30,
preview_box_delay = 100,
preview_box_title_font = {"Ubuntu","italic","normal"},
preview_box_title_font_size_factor = 0.8,
preview_box_title_color = {202,211,245,1},
client_opacity = true,
client_opacity_value_selected = 1,
client_opacity_value_in_focus = 0.5,
client_opacity_value = 0.5,
cycle_raise_client = true,
}
-- Create a wibox to contain all the client-widgets
_M.preview_wbox = wibox({ width = screen[mouse.screen].geometry.width })
_M.preview_wbox.border_width = 3
_M.preview_wbox.ontop = true
_M.preview_wbox.visible = false
_M.preview_live_timer = timer({ timeout = 1/_M.settings.preview_box_fps })
_M.preview_widgets = {}
_M.altTabTable = {}
_M.altTabIndex = 1
_M.source = string.sub(debug.getinfo(1,'S').source, 2)
_M.path = string.sub(_M.source, 1, string.find(_M.source, "/[^/]*$"))
_M.noicon = _M.path .. "noicon.png"
-- simple function for counting the size of a table
function _M.tableLength(T)
local count = 0
for _ in pairs(T) do count = count + 1 end
return count
end
-- this function returns the list of clients to be shown.
function _M.getClients()
local clients = {}
-- Get focus history for current tag
local s = mouse.screen;
local idx = 0
local c = awful.client.focus.history.get(s, idx)
while c do
table.insert(clients, c)
idx = idx + 1
c = awful.client.focus.history.get(s, idx)
end
-- Minimized clients will not appear in the focus history
-- Find them by cycling through all clients, and adding them to the list
-- if not already there.
-- This will preserve the history AND enable you to focus on minimized clients
local t = s.selected_tag
local all = client.get(s)
for i = 1, #all do
local c = all[i]
local ctags = c:tags();
-- check if the client is on the current tag
local isCurrentTag = false
for j = 1, #ctags do
if t == ctags[j] then
isCurrentTag = true
break
end
end
if isCurrentTag then
-- check if client is already in the history
-- if not, add it
local addToTable = true
for k = 1, #clients do
if clients[k] == c then
addToTable = false
break
end
end
if addToTable then
table.insert(clients, c)
end
end
end
return clients
end
-- here we populate altTabTable using the list of clients taken from
-- _M.getClients(). In case we have altTabTable with some value, the list of the
-- old known clients is restored.
function _M.populateAltTabTable()
local clients = _M.getClients()
if _M.tableLength(_M.altTabTable) then
for ci = 1, #clients do
for ti = 1, #_M.altTabTable do
if _M.altTabTable[ti].client == clients[ci] then
_M.altTabTable[ti].client.opacity = _M.altTabTable[ti].opacity
_M.altTabTable[ti].client.minimized = _M.altTabTable[ti].minimized
break
end
end
end
end
_M.altTabTable = {}
for i = 1, #clients do
table.insert(_M.altTabTable, {
client = clients[i],
minimized = clients[i].minimized,
opacity = clients[i].opacity
})
end
end
-- If the length of list of clients is not equal to the length of altTabTable,
-- we need to repopulate the array and update the UI. This function does this
-- check.
function _M.clientsHaveChanged()
local clients = _M.getClients()
return _M.tableLength(clients) ~= _M.tableLength(_M.altTabTable)
end
function _M.createPreviewText(client)
if client.class then
return " " .. client.class
else
return " " .. client.name
end
end
-- Preview is created here.
function _M.clientOpacity()
if not _M.settings.client_opacity then return end
local opacity = _M.settings.client_opacity_value
if opacity > 1 then opacity = 1 end
for i,data in pairs(_M.altTabTable) do
data.client.opacity = opacity
end
if client.focus == _M.altTabTable[_M.altTabIndex].client then
-- Let's normalize the value up to 1.
local opacityFocusSelected = _M.settings.client_opacity_value_selected + _M.settings.client_opacity_value_in_focus
if opacityFocusSelected > 1 then opacityFocusSelected = 1 end
client.focus.opacity = opacityFocusSelected
else
-- Let's normalize the value up to 1.
local opacityFocus = _M.settings.client_opacity_value_in_focus
if opacityFocus > 1 then opacityFocus = 1 end
local opacitySelected = _M.settings.client_opacity_value_selected
if opacitySelected > 1 then opacitySelected = 1 end
client.focus.opacity = opacityFocus
_M.altTabTable[_M.altTabIndex].client.opacity = opacitySelected
end
end
-- This is called any _M.settings.preview_box_fps milliseconds. In case the list
-- of clients is changed, we need to redraw the whole preview box. Otherwise, a
-- simple widget::updated signal is enough
function _M.updatePreview()
if _M.clientsHaveChanged() then
_M.populateAltTabTable()
_M.preview()
end
for i = 1, #_M.preview_widgets do
_M.preview_widgets[i]:emit_signal("widget::updated")
end
end
function _M.cycle(dir)
-- Switch to next client
_M.altTabIndex = _M.altTabIndex + dir
if _M.altTabIndex > #_M.altTabTable then
_M.altTabIndex = 1 -- wrap around
elseif _M.altTabIndex < 1 then
_M.altTabIndex = #_M.altTabTable -- wrap around
end
_M.updatePreview()
_M.altTabTable[_M.altTabIndex].client.minimized = false
if not _M.settings.preview_box and not _M.settings.client_opacity then
client.focus = _M.altTabTable[_M.altTabIndex].client
end
if _M.settings.client_opacity and _M.preview_wbox.visible then
_M.clientOpacity()
end
if _M.settings.cycle_raise_client == true then
_M.altTabTable[_M.altTabIndex].client:raise()
end
end
function _M.preview()
if not _M.settings.preview_box then return end
-- Apply settings
_M.preview_wbox:set_bg(_M.settings.preview_box_bg)
_M.preview_wbox.border_color = _M.settings.preview_box_border
-- Make the wibox the right size, based on the number of clients
local n = math.max(7, #_M.altTabTable)
local W = screen[mouse.screen].geometry.width -- + 2 * _M.preview_wbox.border_width
local w = W / n -- widget width
local h = w * 0.75 -- widget height
local textboxHeight = w * 0.125
local x = screen[mouse.screen].geometry.x - _M.preview_wbox.border_width
local y = screen[mouse.screen].geometry.y + (screen[mouse.screen].geometry.height - h - textboxHeight) / 2
_M.preview_wbox:geometry({x = x, y = y, width = W, height = h + textboxHeight})
-- create a list that holds the clients to preview, from left to right
local leftRightTab = {}
local leftRightTabToAltTabIndex = {} -- save mapping from leftRightTab to altTabTable as well
local nLeft
local nRight
if #_M.altTabTable == 2 then
nLeft = 0
nRight = 2
else
nLeft = math.floor(#_M.altTabTable / 2)
nRight = math.ceil(#_M.altTabTable / 2)
end
for i = 1, nLeft do
table.insert(leftRightTab, _M.altTabTable[#_M.altTabTable - nLeft + i].client)
table.insert(leftRightTabToAltTabIndex, #_M.altTabTable - nLeft + i)
end
for i = 1, nRight do
table.insert(leftRightTab, _M.altTabTable[i].client)
table.insert(leftRightTabToAltTabIndex, i)
end
-- determine fontsize -> find maximum classname-length
local text, textWidth, textHeight, maxText
local maxTextWidth = 0
local maxTextHeight = 0
local bigFont = textboxHeight / 2
cr:set_font_size(fontSize)
for i = 1, #leftRightTab do
text = _M.createPreviewText(leftRightTab[i])
textWidth = cr:text_extents(text).width
textHeight = cr:text_extents(text).height
if textWidth > maxTextWidth or textHeight > maxTextHeight then
maxTextHeight = textHeight
maxTextWidth = textWidth
maxText = text
end
end
while true do
cr:set_font_size(bigFont)
textWidth = cr:text_extents(maxText).width
textHeight = cr:text_extents(maxText).height
if textWidth < w - textboxHeight and textHeight < textboxHeight then
break
end
bigFont = bigFont - 1
end
local smallFont = bigFont * _M.settings.preview_box_title_font_size_factor
_M.preview_widgets = {}
-- create all the widgets
for i = 1, #leftRightTab do
_M.preview_widgets[i] = wibox.widget.base.make_widget()
_M.preview_widgets[i].fit = function(preview_widget, width, height)
return w, h
end
local c = leftRightTab[i]
_M.preview_widgets[i].draw = function(preview_widget, preview_wbox, cr, width, height)
if width ~= 0 and height ~= 0 then
local a = 0.8
local overlay = 0.6
local fontSize = smallFont
if c == _M.altTabTable[_M.altTabIndex].client then
a = 0.9
overlay = 0
fontSize = bigFont
end
local sx, sy, tx, ty
-- Icons
local icon
if c.icon == nil then
icon = gears.surface(gears.surface.load(_M.noicon))
else
icon = gears.surface(c.icon)
end
local iconboxWidth = 0.9 * textboxHeight
local iconboxHeight = iconboxWidth
-- Titles
cr:select_font_face(unpack(_M.settings.preview_box_title_font))
cr:set_font_face(cr:get_font_face())
cr:set_font_size(fontSize)
text = _M.createPreviewText(c)
textWidth = cr:text_extents(text).width
textHeight = cr:text_extents(text).height
local titleboxWidth = textWidth + iconboxWidth
local titleboxHeight = textboxHeight
-- Draw icons
tx = (w - titleboxWidth) / 2
ty = h
sx = iconboxWidth / icon.width
sy = iconboxHeight / icon.height
cr:translate(tx, ty)
cr:scale(sx, sy)
cr:set_source_surface(icon, 0, 0)
cr:paint()
cr:scale(1/sx, 1/sy)
cr:translate(-tx, -ty)
-- Draw titles
tx = tx + iconboxWidth
ty = h + (textboxHeight + textHeight) / 2
cr:set_source_rgba(unpack(_M.settings.preview_box_title_color))
cr:move_to(tx, ty)
cr:show_text(text)
cr:stroke()
-- Draw previews
local cg = c:geometry()
if cg.width > cg.height then
sx = a * w / cg.width
sy = math.min(sx, a * h / cg.height)
else
sy = a * h / cg.height
sx = math.min(sy, a * h / cg.width)
end
tx = (w - sx * cg.width) / 2
ty = (h - sy * cg.height) / 2
local tmp = gears.surface(c.content)
cr:translate(tx, ty)
cr:scale(sx, sy)
cr:set_source_surface(tmp, 0, 0)
cr:paint()
tmp:finish()
-- Overlays
cr:scale(1/sx, 1/sy)
cr:translate(-tx, -ty)
cr:set_source_rgba(0,0,0,overlay)
cr:rectangle(tx, ty, sx * cg.width, sy * cg.height)
cr:fill()
end
end
-- Add mouse handler
_M.preview_widgets[i]:connect_signal("mouse::enter", function()
_M.cycle(leftRightTabToAltTabIndex[i] - _M.altTabIndex)
end)
end
-- Spacers left and right
local spacer = wibox.widget.base.make_widget()
spacer.fit = function(leftSpacer, width, height)
return (W - w * #_M.altTabTable) / 2, _M.preview_wbox.height
end
spacer.draw = function(preview_widget, preview_wbox, cr, width, height) end
--layout
preview_layout = wibox.layout.fixed.horizontal()
preview_layout:add(spacer)
for i = 1, #leftRightTab do
preview_layout:add(_M.preview_widgets[i])
end
preview_layout:add(spacer)
_M.preview_wbox:set_widget(preview_layout)
end
-- This starts the timer for updating and it shows the preview UI.
function _M.showPreview()
_M.preview_live_timer.timeout = 1 / _M.settings.preview_box_fps
_M.preview_live_timer:connect_signal("timeout", _M.updatePreview)
_M.preview_live_timer:start()
_M.preview()
_M.preview_wbox.visible = true
_M.clientOpacity()
end
function _M.switch(dir, mod_key1, release_key, mod_key2, key_switch)
_M.populateAltTabTable()
if #_M.altTabTable == 0 then
return
elseif #_M.altTabTable == 1 then
_M.altTabTable[1].client.minimized = false
_M.altTabTable[1].client:raise()
return
end
-- reset index
_M.altTabIndex = 1
-- preview delay timer
local previewDelay = _M.settings.preview_box_delay / 1000
_M.previewDelayTimer = timer({timeout = previewDelay})
_M.previewDelayTimer:connect_signal("timeout", function()
_M.previewDelayTimer:stop()
_M.showPreview()
end)
_M.previewDelayTimer:start()
-- Now that we have collected all windows, we should run a keygrabber
-- as long as the user is alt-tabbing:
keygrabber.run(
function (mod, key, event)
-- Stop alt-tabbing when the alt-key is released
if gears.table.hasitem(mod, mod_key1) then
if (key == release_key or key == "Escape") and event == "release" then
if _M.preview_wbox.visible == true then
_M.preview_wbox.visible = false
_M.preview_live_timer:stop()
else
_M.previewDelayTimer:stop()
end
if key == "Escape" then
for i = 1, #_M.altTabTable do
_M.altTabTable[i].client.opacity = _M.altTabTable[i].opacity
_M.altTabTable[i].client.minimized = _M.altTabTable[i].minimized
end
else
-- Raise clients in order to restore history
local c
for i = 1, _M.altTabIndex - 1 do
c = _M.altTabTable[_M.altTabIndex - i].client
if not _M.altTabTable[i].minimized then
c:raise()
client.focus = c
end
end
-- raise chosen client on top of all
c = _M.altTabTable[_M.altTabIndex].client
c:raise()
client.focus = c
-- restore minimized clients
for i = 1, #_M.altTabTable do
if i ~= _M.altTabIndex and _M.altTabTable[i].minimized then
_M.altTabTable[i].client.minimized = true
end
_M.altTabTable[i].client.opacity = _M.altTabTable[i].opacity
end
end
keygrabber.stop()
elseif key == key_switch and event == "press" then
if gears.table.hasitem(mod, mod_key2) then
-- Move to previous client on Shift-Tab
_M.cycle(-1)
else
-- Move to next client on each Tab-press
_M.cycle( 1)
end
end
end
end
)
-- switch to next client
_M.cycle(dir)
end -- function altTab
return {switch = _M.switch, settings = _M.settings}

View file

@ -14,6 +14,7 @@
- [Playerctl](signals/pctl.md) - [Playerctl](signals/pctl.md)
- Widgets - Widgets
- [App Launcher](widgets/app_launcher.md)
- [Tag Preview](widgets/tag_preview.md) - [Tag Preview](widgets/tag_preview.md)
- [Task Preview](widgets/task_preview.md) - [Task Preview](widgets/task_preview.md)
- [Tabbed Misc](widgets/tabbed_misc.md) - [Tabbed Misc](widgets/tabbed_misc.md)

View file

@ -4,14 +4,14 @@
[AwesomeWM](https://awesomewm.org/) is literally what it stands for, an awesome window manager. [AwesomeWM](https://awesomewm.org/) is literally what it stands for, an awesome window manager.
Its unique selling point has always been the widget system, which allows for fancy buttons, sliders, bars, dashboards and anything you can imagine. But that feature can be a curse. Most modules focus on the widget side of things which leave the actual window managing part of AwesomeWM underdeveloped compared to, for example, [xmonad](https://xmonad.org/) even though it's probably just as powerfull in that area. Its unique selling point has always been the widget system, which allows for fancy buttons, sliders, bars, dashboards, and anything you can imagine. But that feature can be a curse. Most modules focus on the widget side of things, which leaves the actual window managing part of AwesomeWM underdeveloped compared to, for example, [xmonad](https://xmonad.org/), even though it's probably just as powerful in that area.
This project focuses on that problem - adding new layouts and modules that make use of the widget system, but primarily focus on the new window managing features. This project aims to fix that problem, adding new layouts and modules that make use of the widget system but primarily focusing on window managing features.
## Installation ## Installation
- clone this repo into your `~/.config/awesome` folder - Clone this repo into your `~/.config/awesome` folder
- `git clone https://github.com/BlingCorp/bling.git ~/.config/awesome/bling` - `git clone https://github.com/BlingCorp/bling.git ~/.config/awesome/bling`
- require the module in your `rc.lua`, and make sure it's under the beautiful module initialization - Require the `bling` module in your `rc.lua`, making sure it's under the `beautiful` module initialization
```lua ```lua
-- other imports -- other imports

View file

@ -2,7 +2,7 @@
Choose layouts from the list below and add them to to your `awful.layouts` list in your `rc.lua`. Choose layouts from the list below and add them to to your `awful.layouts` list in your `rc.lua`.
Everyone of them supports multiple master clients and master width factor making them easy to use. Each layout supports multiple master clients and master width factors, making them easy to use.
The mstab layout uses the tab theme from the tabbed module. The mstab layout uses the tab theme from the tabbed module.

View file

@ -1,6 +1,6 @@
## 🔦 Flash Focus <!-- {docsify-ignore} --> ## 🔦 Flash Focus <!-- {docsify-ignore} -->
Flash focus does an opacity animation effect on a client when it is focused. Flash focus creates an opacity flash animation when a client is focused.
### Usage ### Usage
@ -9,7 +9,7 @@ There are two ways in which you can use this module. You can enable it by callin
```lua ```lua
bling.module.flash_focus.enable() bling.module.flash_focus.enable()
``` ```
This connects to the focus signal of a client, which means that the flash focus will activate however you focus the client. This connects to the focus signal of a client, which means that the flash focus will activate with whatever method you use to focus the client.
The other way is to call the function itself like this: `bling.module.flash_focus.flashfocus(someclient)`. This allows you to activate on certain keybinds like so: The other way is to call the function itself like this: `bling.module.flash_focus.flashfocus(someclient)`. This allows you to activate on certain keybinds like so:
```lua ```lua

View file

@ -61,7 +61,7 @@ term_scratch:turn_on() -- turns the scratchpads visibility on
term_scratch:turn_off() -- turns the scratchpads visibility off term_scratch:turn_off() -- turns the scratchpads visibility off
``` ```
You can also connect to signals as you are used to for further customization. For example like that: You can also connect to signals for further customization. For example:
```lua ```lua
term_scratch:connect_signal("turn_on", function(c) naughty.notify({title = "Turned on!"}) end) term_scratch:connect_signal("turn_on", function(c) naughty.notify({title = "Turned on!"}) end)
@ -69,7 +69,7 @@ term_scratch:connect_signal("turn_on", function(c) naughty.notify({title = "Turn
The following signals are currently available. `turn_on`, `turn_off` and `inital_apply` pass the client on which they operated as an argument: The following signals are currently available. `turn_on`, `turn_off` and `inital_apply` pass the client on which they operated as an argument:
- `turn_on` fires when the scratchpad is turned on on a tag that it wasn't present on before - `turn_on` fires when the scratchpad is turned on on a tag that it wasn't present on before.
- `turn_off` fires when the scratchpad is turned off on a tag - `turn_off` fires when the scratchpad is turned off on a tag.
- `spawn` fires when the scratchpad is launched with the given command - `spawn` fires when the scratchpad is launched with the given command.
- `inital_apply` fires after `spawn`, when a corresponding client has been found and the properties have been applied - `inital_apply` fires after `spawn`, when a corresponding client has been found and the properties have been applied.

View file

@ -4,7 +4,7 @@ Can your window manager swallow? It probably can...
### Usage ### Usage
To activate and deactivate window swallowing here are the following functions. If you want to activate it, just call the `start` function once in your `rc.lua`. To activate and deactivate window swallowing use the following functions. If you only want to activate it, call the `start` function once in your `rc.lua`.
```lua ```lua
bling.module.window_swallowing.start() -- activates window swallowing bling.module.window_swallowing.start() -- activates window swallowing
bling.module.window_swallowing.stop() -- deactivates window swallowing bling.module.window_swallowing.stop() -- deactivates window swallowing

View file

@ -1,6 +1,6 @@
## 📑 Tabbed <!-- {docsify-ignore} --> ## 📑 Tabbed <!-- {docsify-ignore} -->
Tabbed implements a tab container. There are also different themes for the tabs. Tabbed implements a tab container. There are several different themes for the tabs as well.
### Usage ### Usage
@ -8,7 +8,7 @@ You should bind these functions to keys in order to use the tabbed module effect
```lua ```lua
bling.module.tabbed.pick() -- picks a client with your cursor to add to the tabbing group bling.module.tabbed.pick() -- picks a client with your cursor to add to the tabbing group
bling.module.tabbed.pop() -- removes the focused client from the tabbing group bling.module.tabbed.pop() -- removes the focused client from the tabbing group
bling.module.tabbed.iter() -- iterates through the currently focused tabbing group bling.module.tabbed.iter() -- iterates through the currently focused tabbing group
bling.module.tabbed.pick_with_dmenu() -- picks a client with a dmenu application (defaults to rofi, other options can be set with a string parameter like "dmenu") bling.module.tabbed.pick_with_dmenu() -- picks a client with a dmenu application (defaults to rofi, other options can be set with a string parameter like "dmenu")
bling.module.tabbed.pick_by_direction(dir) -- picks a client based on direction ("up", "down", "left" or "right") bling.module.tabbed.pick_by_direction(dir) -- picks a client based on direction ("up", "down", "left" or "right")
``` ```
@ -51,7 +51,7 @@ Modern theme:
*screenshot by [JavaCafe01](https://github.com/JavaCafe01)* *screenshot by [JavaCafe01](https://github.com/JavaCafe01)*
### Signals ### Signals
The tabbed module emits a few signals for the purpose of integration, The tabbed module emits a few signals for the purpose of integration:
```lua ```lua
-- bling::tabbed::update -- triggered whenever a tabbed object is updated -- bling::tabbed::update -- triggered whenever a tabbed object is updated
-- tabobj -- the object that caused the update -- tabobj -- the object that caused the update

View file

@ -2,7 +2,7 @@
### Usage ### Usage
The function to set an automatically created tiled wallpaper can be called the following way (you don't need to set every option in the table): The function to set a tiled wallpaper can be called by the following (not every option is necessary):
```lua ```lua
awful.screen.connect_for_each_screen(function(s) -- that way the wallpaper is applied to every screen awful.screen.connect_for_each_screen(function(s) -- that way the wallpaper is applied to every screen
bling.module.tiled_wallpaper("x", s, { -- call the actual function ("x" is the string that will be tiled) bling.module.tiled_wallpaper("x", s, { -- call the actual function ("x" is the string that will be tiled)
@ -20,7 +20,7 @@ end)
### Preview ### Preview
![](https://media.discordapp.net/attachments/702548913999314964/773887721294135296/tiled-wallpapers.png?width=1920&height=1080) ![](https://user-images.githubusercontent.com/70270606/213927382-bdb1b402-0e14-4a00-bfd1-5a1591c71d96.png)
*screenshots by [Nooo37](https://github.com/Nooo37)* *screenshots by [Nooo37](https://github.com/Nooo37)*

View file

@ -62,9 +62,9 @@ bling.module.wallpaper.setup {
The setup function will do 2 things: call the set-function when awesome requests a wallpaper, and manage a timer to call `set_function` periodically. The setup function will do 2 things: call the set-function when awesome requests a wallpaper, and manage a timer to call `set_function` periodically.
Its argument is a args table that is passed to ohter functions (setters and wallpaper functions), so you define everything with setup. Its argument is an args table that is passed to other functions (setters and wallpaper functions), so you define everything with setup.
The `set_function` is a function called every times a wallpaper is needed. The `set_function` is a function called every time a wallpaper is needed.
The module provides some setters: The module provides some setters:
@ -83,8 +83,8 @@ A wallpaper is one of the following elements:
* a list containing any of the elements above * a list containing any of the elements above
To set up for multiple screens, two possible methods are: To set up for multiple screens, two possible methods are:
* Call the `setup` function for each screen, passing the appropriate configuration and `screen` arg * Call the `setup` function for each screen, passing the appropriate configuration and `screen` arg.
* Call the `setup` function once, passing a table of screens as the `screen` arg. This applies the same configuration to all screens in the table * Call the `setup` function once, passing a table of screens as the `screen` arg. This applies the same configuration to all screens in the table.
_Note_: Multiple screen setup only works for the `simple` and `random` setters _Note_: Multiple screen setup only works for the `simple` and `random` setters
```lua ```lua
@ -105,8 +105,8 @@ bling.module.wallpaper.setup {
``` ```
The provided setters `simple` and `random` will use 2 internal functions that you can use to write your own setter: The provided setters `simple` and `random` will use 2 internal functions that you can use to write your own setter:
* `bling.module.wallpaper.prepare_list`: return a list of wallpapers directly usable by `apply` (for now, it just explores folders) * `bling.module.wallpaper.prepare_list`: return a list of wallpapers directly usable by `apply` (for now, it just explores folders).
* `bling.module.wallpaper.apply`: a wrapper for gears.wallpaper functions, using the args table of setup * `bling.module.wallpaper.apply`: a wrapper for gears.wallpaper functions, using the args table of setup.
Here are the defaults: Here are the defaults:

View file

@ -9,7 +9,7 @@ This is a signal module in which you can connect to certain bling signals to gra
- Song length - Song length
- If there are no players on - If there are no players on
This module relies on `playerctl` and `curl`. If you have this module disabled, you won't need those programs. With this module, you can create a widget like below without worrying about the backend. This module relies on `playerctl` and `curl`. If you have this module disabled, you won't need those programs. With this module, you can create a widget like the one below without worrying about the backend.
![](https://user-images.githubusercontent.com/33443763/107377569-fa807900-6a9f-11eb-93c1-174c58eb7bf1.png) ![](https://user-images.githubusercontent.com/33443763/107377569-fa807900-6a9f-11eb-93c1-174c58eb7bf1.png)
@ -157,7 +157,7 @@ end)
Thats all! You don't even have to worry about updating the widgets, the signals will handle that for you. Thats all! You don't even have to worry about updating the widgets, the signals will handle that for you.
Here's another example in which you get a notification with the album art, title, and artist whenever the song changes. Here's another example in which you get a notification with the album art, title, and artist whenever the song changes:
```lua ```lua
local naughty = require("naughty") local naughty = require("naughty")
@ -184,7 +184,7 @@ button:buttons(gears.table.join(
### Theme Variables and Configuration ### Theme Variables and Configuration
By default, this module will output signals from the most recently active player. If you wish to customize the behavior furthur, the following configuration options are available depending on the selected backend. Here is a summary of the two backends and which configuration options they support. By default, this module will output signals from the most recently active player. If you wish to customize the behavior furthur, the following configuration options are available depending on the selected backend. Here is a summary of the two backends and which configuration options they support:
| Option | playerctl_cli | playerctl_lib | | Option | playerctl_cli | playerctl_lib |
| ------------------- | ------------------ | ------------------ | | ------------------- | ------------------ | ------------------ |

View file

@ -0,0 +1,129 @@
## 🎨 App Launcher <!-- {docsify-ignore} -->
A popup application launcher similar to Rofi.
![](https://user-images.githubusercontent.com/33443763/140196352-07e444fe-cccd-45ad-93fa-5705f09e516b.png)
_image by [JavaCafe01](https://github.com/JavaCafe01)_
### Usage
To enable:
```lua
local app_launcher = bling.widget.app_launcher()
```
To run the app launcher, call `:toggle()` on the launcher:
```lua
app_launcher:toggle()
```
### Example Implementation:
```lua
local args = {
apps_per_column = 1,
sort_alphabetically = false,
reverse_sort_alphabetically = true,
}
local app_launcher = bling.widget.app_launcher(args)
```
### Available Options:
```lua
local args = {
terminal = "alacritty" -- Set default terminal
favorites = { "firefox", "wezterm" } -- Favorites are given priority and are bubbled to top of the list
search_commands = true -- Search by app name AND commandline command
skip_names = { "Discord" } -- List of apps to omit from launcher
skip_commands = { "thunar" } -- List of commandline commands to omit from launcher
skip_empty_icons = true -- Skip applications without icons
sort_alphabetically = true -- Sorts applications alphabetically
reverse_sort_alphabetically = false -- Sort in reverse alphabetical order (NOTE: must set `sort_alphabetically = false` to take effect)
select_before_spawn = true -- When selecting by mouse, click once to select app, click once more to open the app.
hide_on_left_clicked_outside = true -- Hide launcher on left click outside the launcher popup
hide_on_right_clicked_outside = true -- Hide launcher on right click outside the launcher popup
hide_on_launch = true -- Hide launcher when spawning application
try_to_keep_index_after_searching = false -- After a search, reselect the previously selected app
reset_on_hide = true -- When you hide the launcher, reset search query
save_history = true -- Save search history
wrap_page_scrolling = true -- Allow scrolling to wrap back to beginning/end of launcher list
wrap_app_scrolling = true -- Set app scrolling
default_app_icon_name = "standard.svg" -- Sets default app icon name for apps without icon names
default_app_icon_path = "~/icons/" -- Sets default app icon path for apps without icon paths
icon_theme = "application" -- Set icon theme
icon_size = 24 -- Set icon size
type = "dock" -- awful.popup type ("dock", "desktop", "normal"...). See awesomewm docs for more detail
show_on_focused_screen = true -- Should app launcher show on currently focused screen
screen = awful.screen -- Screen you want the launcher to launch to
placement = awful.placement.top_left -- Where launcher should be placed ("awful.placement.centered").
rubato = { x = rubato_animation_x, y = rubato_animation_y } -- Rubato animation to apply to launcher
shrink_width = true -- Automatically shrink width of launcher to fit varying numbers of apps in list (works on apps_per_column)
shrink_height = true -- Automatically shrink height of launcher to fit varying numbers of apps in list (works on apps_per_row)
background = "#FFFFFF" -- Set bg color
border_width = dpi(0) -- Set border width of popup
border_color = "#FFFFFF" -- Set border color of popup
shape = function(cr, width, height)
gears.shape.rectangle(cr, width, height)
end -- Set shape for launcher
prompt_height = dpi(50) -- Prompt height
prompt_margins = dpi(30) -- Prompt margins
prompt_paddings = dpi(15) -- Prompt padding
shape = function(cr, width, height)
gears.shape.rectangle(cr, width, height)
end -- Set shape for prompt
prompt_color = "#000000" -- Prompt background color
prompt_border_width = dpi(0) -- Prompt border width
prompt_border_color = "#000000" -- Prompt border color
prompt_text_halign = "center" -- Prompt text horizontal alignment
prompt_text_valign = "center" -- Prompt text vertical alignment
prompt_icon_text_spacing = dpi(10) -- Prompt icon text spacing
prompt_show_icon = true -- Should prompt show icon (?)
prompt_icon_font = "Comic Sans" -- Prompt icon font
prompt_icon_color = "#000000" -- Prompt icon color
prompt_icon = "" -- Prompt icon
prompt_icon_markup = string.format(
"<span size='xx-large' foreground='%s'>%s</span>",
args.prompt_icon_color, args.prompt_icon
) -- Prompt icon markup
prompt_text = "<b>Search</b>:" -- Prompt text
prompt_start_text = "manager" -- Set string for prompt to start with
prompt_font = "Comic Sans" -- Prompt font
prompt_text_color = "#FFFFFF" -- Prompt text color
prompt_cursor_color = "#000000" -- Prompt cursor color
apps_per_row = 3 -- Set how many apps should appear in each row
apps_per_column = 3 -- Set how many apps should appear in each column
apps_margin = {left = dpi(40), right = dpi(40), bottom = dpi(30)} -- Margin between apps
apps_spacing = dpi(10) -- Spacing between apps
expand_apps = true -- Should apps expand to fill width of launcher
app_width = dpi(400) -- Width of each app
app_height = dpi(40) -- Height of each app
app_shape = function(cr, width, height)
gears.shape.rectangle(cr, width, height)
end -- Shape of each app
app_normal_color = "#000000" -- App normal color
app_normal_hover_color = "#111111" -- App normal hover color
app_selected_color = "#FFFFFF" -- App selected color
app_selected_hover_color = "#EEEEEE" -- App selected hover color
app_content_padding = dpi(10) -- App content padding
app_content_spacing = dpi(10) -- App content spacing
app_show_icon = true -- Should show icon?
app_icon_halign = "center" -- App icon horizontal alignment
app_icon_width = dpi(70) -- App icon wigth
app_icon_height = dpi(70) -- App icon height
app_show_name = true -- Should show app name?
app_name_generic_name_spacing = dpi(0) -- Generic name spacing (If show_generic_name)
app_name_halign = "center" -- App name horizontal alignment
app_name_font = "Comic Sans" -- App name font
app_name_normal_color = "#FFFFFF" -- App name normal color
app_name_selected_color = "#000000" -- App name selected color
app_show_generic_name = true -- Should show generic app name?
}
```

View file

@ -28,7 +28,7 @@ bling.widget.tabbed_misc.titlebar_indicator(client, {
}) })
``` ```
a widget_template option is also available: A `widget_template` option is also available:
```lua ```lua
bling.widget.tabbed_misc.titlebar_indicator(client, { bling.widget.tabbed_misc.titlebar_indicator(client, {
widget_template = { widget_template = {
@ -50,7 +50,7 @@ bling.widget.tabbed_misc.titlebar_indicator(client, {
### Example Implementation ### Example Implementation
You normally embed the widget in your titlebar... The widget is typically embedded in a titlebar:
```lua ```lua
awful.titlebar(c).widget = { awful.titlebar(c).widget = {
{ -- Left { -- Left
@ -75,7 +75,7 @@ awful.titlebar(c).widget = {
``` ```
## Tasklist ## Tasklist
The module exports a function that can be added to your tasklist as a `update_callback` This module exports a function that can be added to your tasklist as an `update_callback`.
### Usage ### Usage
```lua ```lua
@ -108,7 +108,7 @@ awful.widget.tasklist({
}) })
``` ```
If you need to do something else, it can be used like so If you need to do something else, it can be used like so:
```lua ```lua
update_callback = function(self, client, index, clients) update_callback = function(self, client, index, clients)
require("bling.widget.tabbed_misc").custom_tasklist(self, client, index, clients) require("bling.widget.tabbed_misc").custom_tasklist(self, client, index, clients)

View file

@ -49,7 +49,7 @@ By default, the widget is not visible. You must implement when it will update an
### Example Implementation ### Example Implementation
We can trigger the widget to show the specific tag when hovering over it in the taglist. The code shown below is the example taglist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.taglist.html). Basically, we are going to update the widget and toggle it through the taglist's `create_callback`. (The bling addons are commented) We can trigger the widget to show the specific tag when hovering over it in the taglist. The code shown below is the example taglist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.taglist.html). We are going to update the widget and toggle it through the taglist's `create_callback` (bling addons are commented).
```lua ```lua
s.mytaglist = awful.widget.taglist { s.mytaglist = awful.widget.taglist {
screen = s, screen = s,

View file

@ -1,6 +1,6 @@
## 🔍 Task Preview <!-- {docsify-ignore} --> ## 🔍 Task Preview <!-- {docsify-ignore} -->
This is a popup widget that will show a preview of the specified client. It is supposed to mimic the small popup that Windows has when hovering over the application icon. This is a popup widget that will show a preview of the specified client. It intends to mimic the small popup when hovering over an application icon on Windows.
![](https://user-images.githubusercontent.com/33443763/124705653-d7b98b80-deaa-11eb-8091-42bbe62365be.png) ![](https://user-images.githubusercontent.com/33443763/124705653-d7b98b80-deaa-11eb-8091-42bbe62365be.png)
@ -26,7 +26,7 @@ bling.widget.task_preview.enable {
} }
``` ```
To allow for more customization, there is also a `widget_structure` property (as seen in some default awesome widgets) which is optional. An example is as follows - To allow for more customization, there is also a `widget_structure` property (as seen in some default awesome widgets) which is optional. An example is as follows:
```lua ```lua
bling.widget.task_preview.enable { bling.widget.task_preview.enable {
x = 20, -- The x-coord of the popup x = 20, -- The x-coord of the popup
@ -82,7 +82,7 @@ By default, the widget is not visible. You must implement when it will update an
### Example Implementation ### Example Implementation
We can trigger the widget to show the specific client when hovering over it in the tasklist. The code shown below is the example icon only tasklist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.tasklist.html). Basically, we are going to toggle the widget through the tasklist's `create_callback`. (The bling addons are commented) We can trigger the widget to show the specific client when hovering over it in the tasklist. The code shown below is the example icon only tasklist from the [AwesomeWM docs](https://awesomewm.org/doc/api/classes/awful.widget.tasklist.html). We are going to toggle the widget through the tasklist's `create_callback` (bling addons are commented).
```lua ```lua
s.mytasklist = awful.widget.tasklist { s.mytasklist = awful.widget.tasklist {
screen = s, screen = s,

View file

@ -30,7 +30,7 @@ bling.widget.window_switcher.enable {
} }
``` ```
To run the window swicher you have to emit this signal from within your configuration (usually using a keybind). To run the window swicher, emit this signal (usually with a keybind):
```lua ```lua
awesome.emit_signal("bling::window_switcher::turn_on") awesome.emit_signal("bling::window_switcher::turn_on")

View file

@ -16,9 +16,9 @@ function mylayout.arrange(p)
local slave_width = 0.5 * (area.width - master_area_width) local slave_width = 0.5 * (area.width - master_area_width)
local master_area_x = area.x + slave_width local master_area_x = area.x + slave_width
-- Special case: few slaves -> make masters take more space - unless requested otherwise! -- Special case: few slaves -> make masters take more space - unless requested otherwise!
if nslaves < 2 and t.master_fill_policy ~= "master_width_factor" then if nslaves < 2 and t.master_fill_policy ~= "master_width_factor" and
t.centered_layout_master_fill_policy ~= "master_width_factor" then
master_area_x = area.x master_area_x = area.x
if nslaves == 1 then if nslaves == 1 then

View file

@ -170,8 +170,8 @@ function playerctl:get_active_player()
end end
function playerctl:get_player_of_name(name) function playerctl:get_player_of_name(name)
for _, player in ipairs(self._private.manager.players[1]) do for _, player in ipairs(self._private.manager.players) do
if player.name == name then if player.player_name == name then
return player return player
end end
end end
@ -521,8 +521,11 @@ local function new(args)
-- Grab settings from beautiful variables if not set explicitly -- Grab settings from beautiful variables if not set explicitly
args.ignore = args.ignore or beautiful.playerctl_ignore args.ignore = args.ignore or beautiful.playerctl_ignore
args.player = args.player or beautiful.playerctl_player args.player = args.player or beautiful.playerctl_player
ret.update_on_activity = args.update_on_activity or if args.update_on_activity ~= nil then
beautiful.playerctl_update_on_activity or true ret.update_on_activity = args.update_on_activity
else
ret.update_on_activity = beautiful.playerctl_update_on_activity ~= false
end
ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1 ret.interval = args.interval or beautiful.playerctl_position_update_interval or 1
ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35 ret.debounce_delay = args.debounce_delay or beautiful.playerctl_debounce_delay or 0.35
parse_args(ret, args) parse_args(ret, args)

View file

@ -143,7 +143,7 @@ local function create_app_widget(self, entry)
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
id = "name", id = "name",
font = self.app_name_font, font = self.app_name_font,
markup = entry.name markup = string.format("<span foreground='%s'>%s</span>", self.app_name_normal_color, entry.name)
} or nil } or nil
local generic_name = entry.generic_name ~= nil and self.app_show_generic_name == true and local generic_name = entry.generic_name ~= nil and self.app_show_generic_name == true and
@ -770,16 +770,18 @@ local function new(args)
args.default_app_icon_name = args.default_app_icon_name or nil args.default_app_icon_name = args.default_app_icon_name or nil
args.default_app_icon_path = args.default_app_icon_path or nil args.default_app_icon_path = args.default_app_icon_path or nil
args.icon_theme = args.icon_theme or nil args.icon_theme = args.icon_theme or nil
args.icons_size = args.icons_size or nil args.icon_size = args.icon_size or nil
args.type = args.type or "dock" args.type = args.type or "dock"
args.show_on_focused_screen = args.show_on_focused_screen == nil and true or args.show_on_focused_screen args.show_on_focused_screen = args.show_on_focused_screen == nil and true or args.show_on_focused_screen
args.screen = args.screen or capi.screen.primary args.screen = args.screen or capi.screen.primary
args.placement = args.placement or awful.placement.centered args.placement = args.placement or awful.placement.centered
args.rubato = args.rubato or nil args.rubato = args.rubato or nil
args.shirnk_width = args.shirnk_width ~= nil and args.shirnk_width or false args.shrink_width = args.shrink_width ~= nil and args.shrink_width or false
args.shrink_height = args.shrink_height ~= nil and args.shrink_height or false args.shrink_height = args.shrink_height ~= nil and args.shrink_height or false
args.background = args.background or "#000000" args.background = args.background or "#000000"
args.border_width = args.border_width or beautiful.border_width or dpi(0)
args.border_color = args.border_color or beautiful.border_color or "#FFFFFF"
args.shape = args.shape or nil args.shape = args.shape or nil
args.prompt_height = args.prompt_height or dpi(100) args.prompt_height = args.prompt_height or dpi(100)
@ -842,7 +844,7 @@ local function new(args)
gtable.crush(ret, args) gtable.crush(ret, args)
-- Calculate the grid width and height -- Calculate the grid width and height
local grid_width = ret.shirnk_width == false local grid_width = ret.shrink_width == false
and dpi((ret.app_width * ret.apps_per_column) + ((ret.apps_per_column - 1) * ret.apps_spacing)) and dpi((ret.app_width * ret.apps_per_column) + ((ret.apps_per_column - 1) * ret.apps_spacing))
or nil or nil
local grid_height = ret.shrink_height == false local grid_height = ret.shrink_height == false
@ -923,6 +925,8 @@ local function new(args)
visible = false, visible = false,
ontop = true, ontop = true,
placement = ret.placement, placement = ret.placement,
border_width = ret.border_width,
border_color = ret.border_color,
shape = ret.shape, shape = ret.shape,
bg = ret.background, bg = ret.background,
widget = widget =

View file

@ -18,6 +18,7 @@ local position = beautiful.tabbar_position or "top"
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
local flexlist = wibox.layout.flex.horizontal() local flexlist = wibox.layout.flex.horizontal()
local title_temp = c.name or c.class or "-" local title_temp = c.name or c.class or "-"
title_temp = gears.string.xml_escape(title_temp)
local bg_temp = inactive_bool and bg_normal_inactive or bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = inactive_bool and fg_normal_inactive or fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then

View file

@ -73,6 +73,7 @@ end
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
-- local flexlist = wibox.layout.flex.horizontal() -- local flexlist = wibox.layout.flex.horizontal()
local title_temp = c.name or c.class or "-" local title_temp = c.name or c.class or "-"
title_temp = gears.string.xml_escape(title_temp)
local bg_temp = inactive_bool and bg_normal_inactive or bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = inactive_bool and fg_normal_inactive or fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then

View file

@ -10,25 +10,6 @@ local window_switcher_first_client -- The client that was focused when the windo
local window_switcher_minimized_clients = {} -- The clients that were minimized when the window switcher was activated local window_switcher_minimized_clients = {} -- The clients that were minimized when the window switcher was activated
local window_switcher_grabber local window_switcher_grabber
local get_num_clients = function()
local minimized_clients_in_tag = 0
local matcher = function(c)
return awful.rules.match(
c,
{
minimized = true,
skip_taskbar = false,
hidden = false,
first_tag = awful.screen.focused().selected_tag,
}
)
end
for c in awful.client.iterate(matcher) do
minimized_clients_in_tag = minimized_clients_in_tag + 1
end
return minimized_clients_in_tag + #awful.screen.focused().clients
end
local window_switcher_hide = function(window_switcher_box) local window_switcher_hide = function(window_switcher_box)
-- Add currently focused client to history -- Add currently focused client to history
if client.focus then if client.focus then
@ -367,20 +348,19 @@ local enable = function(opts)
} }
window_switcher_box:connect_signal("property::width", function() window_switcher_box:connect_signal("property::width", function()
if window_switcher_box.visible and get_num_clients() == 0 then if window_switcher_box.visible and #awful.screen.focused().selected_tag:clients() == 0 then
window_switcher_hide(window_switcher_box) window_switcher_hide(window_switcher_box)
end end
end) end)
window_switcher_box:connect_signal("property::height", function() window_switcher_box:connect_signal("property::height", function()
if window_switcher_box.visible and get_num_clients() == 0 then if window_switcher_box.visible and #awful.screen.focused().selected_tag:clients() == 0 then
window_switcher_hide(window_switcher_box) window_switcher_hide(window_switcher_box)
end end
end) end)
awesome.connect_signal("bling::window_switcher::turn_on", function() awesome.connect_signal("bling::window_switcher::turn_on", function()
local number_of_clients = get_num_clients() if #awful.screen.focused().selected_tag:clients() == 0 then
if number_of_clients == 0 then
return return
end end

View file

@ -0,0 +1,15 @@
/*
* AUTHOR: Luca
*/
* {
background: #1e2030;
background-alt: #24273a;
brdr: #181926;
foreground: #cad3f5;
foresel: #67AFC1;
selected: #f4dbd6;
urgent: #ed8796;
on: #a6da95;
off: #ee99a0;
}

View file

@ -24,15 +24,15 @@ configuration{
} }
* { * {
background: #262626; background: #1e2030;
background-alt: #333333; background-alt: #24273a;
brdr: #191F21; brdr: #181926;
foreground: #D8D8D8; foreground: #cad3f5;
foresel: #67AFC1; foresel: #67AFC1;
selected: #458588; selected: #f4dbd6;
urgent: #E06C75; urgent: #ed8796;
on: #87A181; on: #a6da95;
off: #D88B9F; off: #ee99a0;
} }
@ -48,11 +48,11 @@ window {
border-color: @background-alt; border-color: @background-alt;
width: 400px; width: 400px;
height: 500px; height: 500px;
location: south west; location: south west;
anchor: south west; anchor: south west;
orientation: horizontal; orientation: horizontal;
x-offset: 11px; x-offset: 11px;
y-offset: -52px; y-offset: -52px;
} }
prompt { prompt {
@ -147,12 +147,16 @@ element selected.normal {
border-color: @selected; border-color: @selected;
} }
element selected.urgent { element selected.urgent {
background-color: @background; background-color: @off;
text-color: @off; border: 0px;
border-radius: 8px;
text-color: @background;
} }
element selected.active { element selected.active {
background-color: @background; background-color: @on;
text-color: @on; border: 0px;
border-radius: 8px;
text-color: @background;
} }
element alternate.normal { element alternate.normal {
background-color: @background; background-color: @background;
@ -160,11 +164,11 @@ element alternate.normal {
} }
element alternate.urgent { element alternate.urgent {
background-color: @background; background-color: @background;
text-color: @foreground; text-color: @off;
} }
element alternate.active { element alternate.active {
background-color: @background; background-color: @background;
text-color: @foreground; text-color: @on;
} }
sidebar { sidebar {
@ -179,7 +183,7 @@ button {
vertical-align: 0.5; vertical-align: 0.5;
padding: 8px; padding: 8px;
background-color: @background-alt; background-color: @background-alt;
text-color: @background; text-color: @foreground;
border: 0px; border: 0px;
border-radius: 8px; border-radius: 8px;
border-color: @selected; border-color: @selected;
@ -187,7 +191,7 @@ button {
button selected { button selected {
background-color: @selected; background-color: @selected;
text-color: @foreground; text-color: @background;
border: 0px; border: 0px;
border-radius: 8px; border-radius: 8px;
border-color: @selected; border-color: @selected;

@ -0,0 +1 @@
Subproject commit 852f95f38247aedb3e4b0ca8167380bb0016c57e

View file

@ -5,11 +5,14 @@ local awful = require("awful")
-- Theme handling library -- Theme handling library
local beautiful = require("beautiful") local beautiful = require("beautiful")
-- # Themes : -- # Themes :
local theme = require("themes") local theme = require("themes")
beautiful.init(theme) beautiful.init(theme)
-- ### Configurations ### -- local revelation = require("libs.revelation")
revelation.init()
-- ### Configurations ### --
-- # Keybindings : -- # Keybindings :
require("configurations.keybindings") require("configurations.keybindings")
@ -21,7 +24,7 @@ require("configurations.layouts")
require("configurations.rules") require("configurations.rules")
-- ### UI ### -- -- ### UI ### --
-- # Notifications : -- # Notifications :
require("ui.notifications") require("ui.notifications")
@ -37,10 +40,14 @@ require("signals")
-- # Sidebar : -- # Sidebar :
require("ui.sidebar") require("ui.sidebar")
require("ui.notifications-list")
-- # Bar : -- # Bar :
require("ui.bar") require("ui.bar")
require("ui.widgets.window-switcher")
require("ui.widgets.task-preview")
require("ui.widgets.tag-preview")
-- Autorun at startup -- Autorun at startup
awful.spawn.with_shell("bash ~/.config/awesome/configurations/autorun") awful.spawn.with_shell("bash ~/.config/awesome/configurations/autorun")

View file

@ -19,15 +19,15 @@ local net_cmd = [[
]] ]]
awful.widget.watch(net_cmd, update_interval, function(_, stdout) awful.widget.watch(net_cmd, update_interval, function(_, stdout)
local net_ssid = stdout local net_ssid = stdout
net_ssid = string.gsub(net_ssid, '^%s*(.-)%s*$', '%1') net_ssid = string.gsub(net_ssid, '^%s*(.-)%s*$', '%1')
local net_status = true local net_status = true
-- update networks status -- update networks status
if net_ssid == "disabled" then if net_ssid == "disabled" then
net_status = false net_status = false
end end
-- emit (true or false) -- emit (true or false)
awesome.emit_signal("signal::airplane", net_status) awesome.emit_signal("signal::airplane", net_status)
end) end)

View file

@ -29,7 +29,7 @@ local emit_brightness_info = function()
stdout = function(value) stdout = function(value)
awful.spawn.with_line_callback(brightness_max, { awful.spawn.with_line_callback(brightness_max, {
stdout = function(max) stdout = function(max)
percentage = tonumber(value)/tonumber(max) * 100 local percentage = tonumber(value)/tonumber(max) * 100
percentage = tonumber(percentage) or 0 percentage = tonumber(percentage) or 0
awesome.emit_signal("signal::brightness", percentage) awesome.emit_signal("signal::brightness", percentage)
end}) end})

View file

@ -6,7 +6,7 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears") local gears = require("gears")
local which_disk = "/dev/sda2" local which_disk = "/dev/nvme0n1p5"
local function get_disk() local function get_disk()
local script = [[ local script = [[

View file

@ -11,5 +11,5 @@ req = {
} }
for _, x in pairs(req) do for _, x in pairs(req) do
require("signals."..x) require("signals." .. x)
end end

View file

@ -6,25 +6,25 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears") local gears = require("gears")
local city = "" -- Ex. London or Salt+Lake+City local city = "Toulouse" -- Ex. London or Salt+Lake+City
local get_weather = function() --local get_weather = function()
local script = [[ -- local script = [[
bash -c "$HOME/.config/awesome/signals/weather_script.sh ]] .. city.. [[" -- bash -c "$HOME/.config/awesome/signals/weather_script.sh ]] .. city .. [["
]] -- ]]
awful.spawn.easy_async_with_shell(script, function(stdout) -- awful.spawn.easy_async_with_shell(script, function(stdout)
local weather = stdout:match("(.+):") -- local weather = stdout:match("(.+):")
local feels_like = stdout:match(".+[:](.+)") -- local feels_like = stdout:match(".+[:](.+)")
awesome.emit_signal('signal::weather', weather, feels_like) -- awesome.emit_signal('signal::weather', weather, feels_like)
end) -- end)
end --end
gears.timer { --gears.timer {
timeout = 1200, -- timeout = 1200,
call_now = true, -- call_now = true,
autostart = true, -- autostart = true,
callback = function() -- callback = function()
get_weather() -- get_weather()
end -- end
} --}

View file

@ -14,207 +14,248 @@ local dpi = xresources.apply_dpi
-- Theme Dir : -- Theme Dir :
local themes_path = os.getenv("HOME") .. "/.config/awesome/themes/" local themes_path = os.getenv("HOME") .. "/.config/awesome/themes/"
-- Titlebar Dir : -- Titlebar Dir :
local titlebar_theme = "mac" local titlebar_theme = "mac"
local titlebar_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/titlebar/" .. titlebar_theme .. "/" local titlebar_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/titlebar/" .. titlebar_theme .. "/"
local tip = titlebar_icon_path local tip = titlebar_icon_path
-- Layout Dir : -- Layout Dir :
local layout_icons = "base" local layout_icons = "base"
local layout_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/layouts/" .. layout_icons .. "/" local layout_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/layouts/" .. layout_icons .. "/"
local lip = layout_icon_path local lip = layout_icon_path
-- others Icons : -- others Icons :
local other_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/other/" local other_icon_path = os.getenv("HOME") .. "/.config/awesome/themes/icons/other/"
local oip = other_icon_path local oip = other_icon_path
local otis_forest = require ("themes.schemes.otis-forest") local otis_forest = require("themes.schemes.otis-forest")
local doom = require ("themes.schemes.doom-one") local doom = require("themes.schemes.doom-one")
local gruvbox = require ("themes.schemes.gruvbox-dark") local gruvbox = require("themes.schemes.gruvbox-dark")
local berry = require ("themes.schemes.berry") local berry = require("themes.schemes.berry")
local matcha_sea = require ("themes.schemes.matcha-sea") local matcha_sea = require("themes.schemes.matcha-sea")
local matcha_azul = require ("themes.schemes.matcha-azul") local matcha_azul = require("themes.schemes.matcha-azul")
local matcha_aliz = require ("themes.schemes.matcha-aliz") local matcha_aliz = require("themes.schemes.matcha-aliz")
local catppuccin_macchiato = require("themes.schemes.catppuccin-macchiato")
-- ## Don''t change the line number 😊 -- ## Don''t change the line number 😊
colors = gruvbox colors = catppuccin_macchiato
-- ############# -- #############
theme = {} theme = {}
-- # Fonts : -- # Fonts :
--theme.font = "iosevka Extended Bold 11" --theme.font = "iosevka Extended Bold 11"
--theme.font = "JetBrains Mono Bold 10" --theme.font = "JetBrains Mono Bold 10"
--theme.font = "JetBrainsMono Nerd Font Bold 10" --theme.font = "JetBrainsMono Nerd Font Bold 10"
--theme.font = "RobotoMono Nerd Font Bold 11" --theme.font = "RobotoMono Nerd Font Bold 11"
theme.font = "Roboto Regular 11" theme.font = "Google Sans Bold 11"
theme.taglist_font = "Font Awesome 6 Free Solid 16" theme.switcher_font = "Google Sans Bold 12"
theme.icon_font = "Font Awesome 6 Free Solid 11" theme.taglist_font = "Font Awesome 6 Free Solid 16"
theme.sidebar_font = "Font Awesome 6 Free Solid 16" theme.icon_font = "Font Awesome 6 Free Solid 11"
theme.ui_font = "RobotoMono Nerd Font Medium 16" theme.sidebar_font = "Font Awesome 6 Free Solid 16"
theme.menu_font = "RobotoMono Nerd Font Bold 11" theme.ui_font = "RobotoMono Nerd Font Medium 16"
theme.menu_font = "RobotoMono Nerd Font Bold 11"
-- # Background Colors : -- # Background Colors :
theme.bg_normal = colors.black theme.bg_normal = colors.black
theme.bg_focus = colors.brightblack theme.bg_focus = colors.brightblack
theme.bg_urgent = colors.black theme.bg_urgent = colors.black
theme.bg_minimize = colors.black theme.bg_minimize = colors.black
-- # Foreground Colors : -- # Foreground Colors :
theme.fg_normal = colors.brightwhite theme.fg_normal = colors.brightwhite
theme.fg_focus = colors.brightwhite theme.fg_focus = colors.brightwhite
theme.fg_urgent = colors.brightred theme.fg_urgent = colors.brightred
theme.fg_minimize = colors.brightblack theme.fg_minimize = colors.brightblack
--- Systray --- Systray
--theme.bg_systray = colors.container --theme.bg_systray = colors.container
theme.systray_icon_spacing = dpi(12) theme.systray_icon_spacing = dpi(12)
-- Taglist : -- Taglist :
theme.taglist_spacing = dpi(8) theme.taglist_spacing = dpi(8)
theme.taglist_bg_focus = colors.container theme.taglist_bg_focus = colors.container
theme.taglist_bg_urgent = colors.container theme.taglist_bg_urgent = colors.container
theme.taglist_bg_empty = colors.container theme.taglist_bg_empty = colors.container
theme.taglist_fg_focus = colors.main_scheme theme.taglist_fg_focus = colors.main_scheme
theme.taglist_fg_empty = colors.brightblack theme.taglist_fg_empty = colors.brightblack
theme.taglist_fg_urgent = colors.brightred theme.taglist_fg_urgent = colors.brightred
-- Clients : -- Clients :
theme.useless_gap = dpi(4) theme.useless_gap = dpi(4)
theme.gap_single_client = true theme.gap_single_client = true
theme.rounded = dpi(8) theme.rounded = dpi(8)
theme.border_width = dpi(2) theme.border_width = dpi(2)
theme.border_normal = colors.black theme.border_normal = colors.black
theme.border_focus = colors.main_scheme theme.border_focus = colors.main_scheme
theme.border_marked = colors.brightblack theme.border_marked = colors.brightblack
-- Tasklist : -- Tasklist :
theme.tasklist_bg_normal = colors.black theme.tasklist_bg_normal = colors.black
theme.tasklist_bg_focus = colors.black theme.tasklist_bg_focus = colors.black
theme.tasklist_bg_urgent = colors.green theme.tasklist_bg_urgent = colors.green
theme.tasklist_plain_task_name = true theme.tasklist_plain_task_name = true
theme.tasklist_disable_task_name = false theme.tasklist_disable_task_name = false
theme.tasklist_disable_icon = true theme.tasklist_disable_icon = true
-- Notification : -- Notification :
theme.notification_spacing = 20 theme.notification_spacing = 20
-- Menu : -- Menu :
theme.submenu = "" theme.submenu = ""
theme.menu_bg_normal = colors.black theme.menu_bg_normal = colors.black
theme.menu_bg_focus = colors.brightblack theme.menu_bg_focus = colors.brightblack
theme.menu_border_color = colors.black theme.menu_border_color = colors.black
theme.menu_height = dpi(30) theme.menu_height = dpi(30)
theme.menu_width = dpi(180) theme.menu_width = dpi(180)
-- Icons : -- Icons :
theme.icon_theme = "/usr/share/icons/Papirus-Dark/16x16/apps" theme.icon_theme = "/usr/share/icons/Papirus-Dark/16x16/apps"
theme.awesome_icon = oip .."logoarch.png" theme.awesome_icon = oip .. "logoarch.png"
theme.pfp = oip .. "pfp.jpg" theme.pfp = oip .. "pfp.jpg"
theme.album_art = oip .. "album-art.png" theme.album_art = oip .. "album-art.png"
theme.user = string.gsub(os.getenv('USER'), '^%l', string.upper) theme.user = string.gsub(os.getenv('USER'), '^%l', string.upper)
theme.hostname = "@Neptune" theme.hostname = "@Neptune"
theme.weather_icon = oip .."weather_icon.png" theme.weather_icon = oip .. "weather_icon.png"
-- Titlebar : -- Titlebar :
theme.titlebar_size = dpi(20) theme.titlebar_size = dpi(20)
theme.titlebar_position = "left" theme.titlebar_position = "left"
theme.titlebar_bg_focus = colors.black theme.titlebar_bg_focus = colors.black
theme.titlebar_bg_normal = colors.black theme.titlebar_bg_normal = colors.black
theme.titlebar_fg_normal = colors.white theme.titlebar_fg_normal = colors.white
theme.titlebar_fg_focus = colors.brightwhite theme.titlebar_fg_focus = colors.brightwhite
-- Close Button : -- Close Button :
theme.titlebar_close_button_normal = tip.."close_normal.svg" theme.titlebar_close_button_normal = tip .. "close_normal.svg"
theme.titlebar_close_button_focus = tip.."close_focus.svg" theme.titlebar_close_button_focus = tip .. "close_focus.svg"
-- Minimize Button : -- Minimize Button :
theme.titlebar_minimize_button_normal = tip.."minimize_normal.svg" theme.titlebar_minimize_button_normal = tip .. "minimize_normal.svg"
theme.titlebar_minimize_button_focus = tip.."minimize_focus.svg" theme.titlebar_minimize_button_focus = tip .. "minimize_focus.svg"
-- Ontop Button : -- Ontop Button :
theme.titlebar_ontop_button_normal_inactive = tip.."ontop_normal_inactive.svg" theme.titlebar_ontop_button_normal_inactive = tip .. "ontop_normal_inactive.svg"
theme.titlebar_ontop_button_focus_inactive = tip.."ontop_focus_inactive.svg" theme.titlebar_ontop_button_focus_inactive = tip .. "ontop_focus_inactive.svg"
theme.titlebar_ontop_button_normal_active = tip.."ontop_normal_active.svg" theme.titlebar_ontop_button_normal_active = tip .. "ontop_normal_active.svg"
theme.titlebar_ontop_button_focus_active = tip.."ontop_focus_active.svg" theme.titlebar_ontop_button_focus_active = tip .. "ontop_focus_active.svg"
-- Sticky Button : -- Sticky Button :
theme.titlebar_sticky_button_normal_inactive = tip.."sticky_normal_inactive.svg" theme.titlebar_sticky_button_normal_inactive = tip .. "sticky_normal_inactive.svg"
theme.titlebar_sticky_button_focus_inactive = tip.."sticky_focus_inactive.svg" theme.titlebar_sticky_button_focus_inactive = tip .. "sticky_focus_inactive.svg"
theme.titlebar_sticky_button_normal_active = tip.."sticky_normal_active.svg" theme.titlebar_sticky_button_normal_active = tip .. "sticky_normal_active.svg"
theme.titlebar_sticky_button_focus_active = tip.."sticky_focus_active.svg" theme.titlebar_sticky_button_focus_active = tip .. "sticky_focus_active.svg"
-- Floating Button : -- Floating Button :
theme.titlebar_floating_button_normal_inactive = tip.."floating_normal_inactive.svg" theme.titlebar_floating_button_normal_inactive = tip .. "floating_normal_inactive.svg"
theme.titlebar_floating_button_focus_inactive = tip.."floating_focus_inactive.svg" theme.titlebar_floating_button_focus_inactive = tip .. "floating_focus_inactive.svg"
theme.titlebar_floating_button_normal_active = tip.."floating_normal_active.svg" theme.titlebar_floating_button_normal_active = tip .. "floating_normal_active.svg"
theme.titlebar_floating_button_focus_active = tip.."titlebar/stoplight/floating_focus_active.svg" theme.titlebar_floating_button_focus_active = tip .. "titlebar/stoplight/floating_focus_active.svg"
-- Maximized Button : -- Maximized Button :
theme.titlebar_maximized_button_normal_inactive = tip.."maximized_normal_inactive.svg" theme.titlebar_maximized_button_normal_inactive = tip .. "maximized_normal_inactive.svg"
theme.titlebar_maximized_button_focus_inactive = tip.."maximized_focus_inactive.svg" theme.titlebar_maximized_button_focus_inactive = tip .. "maximized_focus_inactive.svg"
theme.titlebar_maximized_button_normal_active = tip.."maximized_normal_active.svg" theme.titlebar_maximized_button_normal_active = tip .. "maximized_normal_active.svg"
theme.titlebar_maximized_button_focus_active = tip.."maximized_focus_active.svg" theme.titlebar_maximized_button_focus_active = tip .. "maximized_focus_active.svg"
-- Hovered Close Button -- Hovered Close Button
theme.titlebar_close_button_normal_hover = tip.. "close_normal_hover.svg" theme.titlebar_close_button_normal_hover = tip .. "close_normal_hover.svg"
theme.titlebar_close_button_focus_hover = tip.. "close_focus_hover.svg" theme.titlebar_close_button_focus_hover = tip .. "close_focus_hover.svg"
-- Hovered Minimize Buttin -- Hovered Minimize Buttin
theme.titlebar_minimize_button_normal_hover = tip.. "minimize_normal_hover.svg" theme.titlebar_minimize_button_normal_hover = tip .. "minimize_normal_hover.svg"
theme.titlebar_minimize_button_focus_hover = tip.. "minimize_focus_hover.svg" theme.titlebar_minimize_button_focus_hover = tip .. "minimize_focus_hover.svg"
-- Hovered Ontop Button -- Hovered Ontop Button
theme.titlebar_ontop_button_normal_inactive_hover = tip.. "ontop_normal_inactive_hover.svg" theme.titlebar_ontop_button_normal_inactive_hover = tip .. "ontop_normal_inactive_hover.svg"
theme.titlebar_ontop_button_focus_inactive_hover = tip.. "ontop_focus_inactive_hover.svg" theme.titlebar_ontop_button_focus_inactive_hover = tip .. "ontop_focus_inactive_hover.svg"
theme.titlebar_ontop_button_normal_active_hover = tip.. "ontop_normal_active_hover.svg" theme.titlebar_ontop_button_normal_active_hover = tip .. "ontop_normal_active_hover.svg"
theme.titlebar_ontop_button_focus_active_hover = tip.. "ontop_focus_active_hover.svg" theme.titlebar_ontop_button_focus_active_hover = tip .. "ontop_focus_active_hover.svg"
-- Hovered Sticky Button -- Hovered Sticky Button
theme.titlebar_sticky_button_normal_inactive_hover = tip.. "sticky_normal_inactive_hover.svg" theme.titlebar_sticky_button_normal_inactive_hover = tip .. "sticky_normal_inactive_hover.svg"
theme.titlebar_sticky_button_focus_inactive_hover = tip.. "sticky_focus_inactive_hover.svg" theme.titlebar_sticky_button_focus_inactive_hover = tip .. "sticky_focus_inactive_hover.svg"
theme.titlebar_sticky_button_normal_active_hover = tip.. "sticky_normal_active_hover.svg" theme.titlebar_sticky_button_normal_active_hover = tip .. "sticky_normal_active_hover.svg"
theme.titlebar_sticky_button_focus_active_hover = tip.. "sticky_focus_active_hover.svg" theme.titlebar_sticky_button_focus_active_hover = tip .. "sticky_focus_active_hover.svg"
-- Hovered Floating Button -- Hovered Floating Button
theme.titlebar_floating_button_normal_inactive_hover = tip.. "floating_normal_inactive_hover.svg" theme.titlebar_floating_button_normal_inactive_hover = tip .. "floating_normal_inactive_hover.svg"
theme.titlebar_floating_button_focus_inactive_hover = tip.. "floating_focus_inactive_hover.svg" theme.titlebar_floating_button_focus_inactive_hover = tip .. "floating_focus_inactive_hover.svg"
theme.titlebar_floating_button_normal_active_hover = tip.. "floating_normal_active_hover.svg" theme.titlebar_floating_button_normal_active_hover = tip .. "floating_normal_active_hover.svg"
theme.titlebar_floating_button_focus_active_hover = tip.. "floating_focus_active_hover.svg" theme.titlebar_floating_button_focus_active_hover = tip .. "floating_focus_active_hover.svg"
-- Hovered Maximized Button -- Hovered Maximized Button
theme.titlebar_maximized_button_normal_inactive_hover = tip.. "maximized_normal_inactive_hover.svg" theme.titlebar_maximized_button_normal_inactive_hover = tip .. "maximized_normal_inactive_hover.svg"
theme.titlebar_maximized_button_focus_inactive_hover = tip.. "maximized_focus_inactive_hover.svg" theme.titlebar_maximized_button_focus_inactive_hover = tip .. "maximized_focus_inactive_hover.svg"
theme.titlebar_maximized_button_normal_active_hover = tip.. "maximized_normal_active_hover.svg" theme.titlebar_maximized_button_normal_active_hover = tip .. "maximized_normal_active_hover.svg"
theme.titlebar_maximized_button_focus_active_hover = tip.. "maximized_focus_active_hover.svg" theme.titlebar_maximized_button_focus_active_hover = tip .. "maximized_focus_active_hover.svg"
-- Layoutbox icons : -- Layoutbox icons :
theme.layout_fairh = gcolor.recolor_image(lip.. "fairh.png", colors.main_scheme) theme.layout_fairh = gcolor.recolor_image(lip .. "fairh.png", colors.main_scheme)
theme.layout_fairv = gcolor.recolor_image(lip.. "fairv.png", colors.main_scheme) theme.layout_fairv = gcolor.recolor_image(lip .. "fairv.png", colors.main_scheme)
theme.layout_floating = gcolor.recolor_image(lip.. "floating.png", colors.main_scheme) theme.layout_floating = gcolor.recolor_image(lip .. "floating.png", colors.main_scheme)
theme.layout_magnifier = gcolor.recolor_image(lip.. "magnifier.png", colors.main_scheme) theme.layout_magnifier = gcolor.recolor_image(lip .. "magnifier.png", colors.main_scheme)
theme.layout_max = gcolor.recolor_image(lip.. "max.png", colors.main_scheme) theme.layout_max = gcolor.recolor_image(lip .. "max.png", colors.main_scheme)
theme.layout_fullscreen = gcolor.recolor_image(lip.. "fullscreen.png", colors.main_scheme) theme.layout_fullscreen = gcolor.recolor_image(lip .. "fullscreen.png", colors.main_scheme)
theme.layout_tilebottom = gcolor.recolor_image(lip.. "tilebottom.png", colors.main_scheme) theme.layout_tilebottom = gcolor.recolor_image(lip .. "tilebottom.png", colors.main_scheme)
theme.layout_tileleft = gcolor.recolor_image(lip.. "tileleft.png", colors.main_scheme) theme.layout_tileleft = gcolor.recolor_image(lip .. "tileleft.png", colors.main_scheme)
theme.layout_tile = gcolor.recolor_image(lip.. "tile.png", colors.main_scheme) theme.layout_tile = gcolor.recolor_image(lip .. "tile.png", colors.main_scheme)
theme.layout_tiletop = gcolor.recolor_image(lip.. "tiletop.png", colors.main_scheme) theme.layout_tiletop = gcolor.recolor_image(lip .. "tiletop.png", colors.main_scheme)
theme.layout_spiral = gcolor.recolor_image(lip.. "spiral.png", colors.main_scheme) theme.layout_spiral = gcolor.recolor_image(lip .. "spiral.png", colors.main_scheme)
theme.layout_dwindle = gcolor.recolor_image(lip.. "dwindle.png", colors.main_scheme) theme.layout_dwindle = gcolor.recolor_image(lip .. "dwindle.png", colors.main_scheme)
theme.layout_cornernw = gcolor.recolor_image(lip.. "cornernw.png", colors.main_scheme) theme.layout_cornernw = gcolor.recolor_image(lip .. "cornernw.png", colors.main_scheme)
theme.layout_cornerne = gcolor.recolor_image(lip.. "cornerne.png", colors.main_scheme) theme.layout_cornerne = gcolor.recolor_image(lip .. "cornerne.png", colors.main_scheme)
theme.layout_cornersw = gcolor.recolor_image(lip.. "cornersw.png", colors.main_scheme) theme.layout_cornersw = gcolor.recolor_image(lip .. "cornersw.png", colors.main_scheme)
-- Bling : -- Bling :
theme.layout_mstab = gcolor.recolor_image(lip.. "mstab.png", colors.main_scheme) theme.layout_mstab = gcolor.recolor_image(lip .. "mstab.png", colors.main_scheme)
theme.layout_vertical = gcolor.recolor_image(lip.. "vertical.png", colors.main_scheme) theme.layout_vertical = gcolor.recolor_image(lip .. "vertical.png", colors.main_scheme)
theme.layout_horizontal = gcolor.recolor_image(lip.. "horizontal.png", colors.main_scheme) theme.layout_horizontal = gcolor.recolor_image(lip .. "horizontal.png", colors.main_scheme)
theme.layout_centered = gcolor.recolor_image(lip.. "centered.png", colors.main_scheme) theme.layout_centered = gcolor.recolor_image(lip .. "centered.png", colors.main_scheme)
theme.layout_equalarea = gcolor.recolor_image(lip.. "equalarea.png", colors.main_scheme) theme.layout_equalarea = gcolor.recolor_image(lip .. "equalarea.png", colors.main_scheme)
theme.layout_deck = gcolor.recolor_image(lip.. "deck.png", colors.main_scheme) theme.layout_deck = gcolor.recolor_image(lip .. "deck.png", colors.main_scheme)
-- Bling window switcher :
theme.window_switcher_widget_bg = colors.container -- The bg color of the widget
theme.window_switcher_widget_border_width = 3 -- The border width of the widget
theme.window_switcher_widget_border_radius = 0 -- The border radius of the widget
theme.window_switcher_widget_border_color = colors.main_scheme -- The border color of the widget
theme.window_switcher_clients_spacing = 10 -- The space between each client item
theme.window_switcher_client_icon_horizontal_spacing = 5 -- The space between client icon and text
theme.window_switcher_client_width = 250 -- The width of one client widget
theme.window_switcher_client_height = 250 -- The height of one client widget
theme.window_switcher_client_margins = 10 -- The margin between the content and the border of the widget
theme.window_switcher_thumbnail_margins = 10 -- The margin between one client thumbnail and the rest of the widget
theme.thumbnail_scale = true -- If set to true, the thumbnails fit policy will be set to "fit" instead of "auto"
theme.window_switcher_name_margins = 10 -- The margin of one clients title to the rest of the widget
theme.window_switcher_name_valign = "center" -- How to vertically align one clients title
theme.window_switcher_name_forced_width = 200 -- The width of one title
theme.window_switcher_name_font = theme.switcher_font -- The font of all titles
theme.window_switcher_name_normal_color = colors
.white -- The color of one title if the client is unfocused
theme.window_switcher_name_focus_color = colors
.main_scheme -- The color of one title if the client is focused
theme.window_switcher_icon_valign = "center" -- How to vertically align the one icon
theme.window_switcher_icon_width = 0 --
theme.task_preview_widget_border_radius = 5 -- Border radius of the widget (With AA)
theme.task_preview_widget_bg = colors.container -- The bg color of the widget
theme.task_preview_widget_border_color = colors.container -- The border color of the widget
theme.task_preview_widget_border_width = 3 -- The border width of the widget
theme.task_preview_widget_margin = 10
theme.tag_preview_widget_border_radius = 5 -- Border radius of the widget (With AA)
theme.tag_preview_client_border_radius = 5 -- Border radius of each client in the widget (With AA)
theme.tag_preview_client_opacity = 0.5 -- Opacity of each client
theme.tag_preview_client_bg = colors.container -- The bg color of each client
theme.tag_preview_client_border_color = colors.main_scheme -- The border color of each client
theme.tag_preview_client_border_width = 3 -- The border width of each client
theme.tag_preview_widget_bg = colors.container -- The bg color of the widget
theme.tag_preview_widget_border_color = "#ffffff" -- The border color of the widget
theme.tag_preview_widget_border_width = 2 -- The border width of the widget
theme.tag_preview_widget_margin = 10 -- The margin of the widget
return theme return theme

View file

@ -0,0 +1,27 @@
-- Colors :
colors = {}
-- Dark colors
colors.black = "#181926"
colors.red = "#ed8796"
colors.green = "#a6da95"
colors.yellow = "#f5a97f"
colors.blue = "#8aadf4"
colors.magenta = "#c6a0f6"
colors.cyan = "#91d7e3"
colors.white = "#cad3f5"
-- Bright colors
colors.brightblack = "#24273a"
colors.brightred = "#ee99a0"
colors.brightgreen = "#8bd5ca"
colors.brightyellow = "#eed49f"
colors.brightblue = "#b7bdf8"
colors.brightmagenta = "#f5bde6"
colors.brightcyan = "#7dc4e4"
colors.brightwhite = "#a5adcb"
-- Other
colors.transparent = "#00000000"
colors.container = "#1e2030"
colors.main_scheme = "#f4dbd6"
colors.main_transparent = "#262626CC"
return colors

View file

@ -1,27 +1,27 @@
-- Colors : -- Colors :
colors = {} colors = {}
-- Dark colors -- Dark colors
colors.black = "#222222" colors.black = "#222222"
colors.red = "#cc241d" colors.red = "#cc241d"
colors.green = "#98971a" colors.green = "#98971a"
colors.yellow = "#d79921" colors.yellow = "#d79921"
colors.blue = "#458588" colors.blue = "#458588"
colors.magenta = "#b16286" colors.magenta = "#b16286"
colors.cyan = "#689d6a" colors.cyan = "#689d6a"
colors.white = "#acacac" colors.white = "#acacac"
-- Bright colors -- Bright colors
colors.brightblack = "#333333" colors.brightblack = "#333333"
colors.brightred = "#fb4934" colors.brightred = "#fb4934"
colors.brightgreen = "#b8bb26" colors.brightgreen = "#b8bb26"
colors.brightyellow = "#fabd2f" colors.brightyellow = "#fabd2f"
colors.brightblue = "#83a598" colors.brightblue = "#83a598"
colors.brightmagenta = "#d3869b" colors.brightmagenta = "#d3869b"
colors.brightcyan = "#8ec07c" colors.brightcyan = "#8ec07c"
colors.brightwhite = "#dfdfdf" colors.brightwhite = "#dfdfdf"
-- Other -- Other
colors.transparent = "#00000000" colors.transparent = "#00000000"
colors.container = "#303030" colors.container = "#303030"
colors.main_scheme = "#458588" colors.main_scheme = "#458588"
colors.main_transparent = "#262626CC" colors.main_transparent = "#303030CC"
return colors return colors

View file

@ -1,27 +1,27 @@
-- Colors : -- Colors :
colors = {} colors = {}
-- Dark colors -- Dark colors
colors.black = "#1B2224" colors.black = "#1B2224"
colors.red = "#a54242" colors.red = "#a54242"
colors.green = "#8c9440" colors.green = "#8c9440"
colors.yellow = "#de935f" colors.yellow = "#de935f"
colors.blue = "#548D91" colors.blue = "#548D91"
colors.magenta = "#85678f" colors.magenta = "#85678f"
colors.cyan = "#5e8d87" colors.cyan = "#5e8d87"
colors.white = "#acacac" colors.white = "#acacac"
-- Bright colors -- Bright colors
colors.brightblack = "#263033" colors.brightblack = "#263033"
colors.brightred = "#cc6666" colors.brightred = "#cc6666"
colors.brightgreen = "#b5bd68" colors.brightgreen = "#b5bd68"
colors.brightyellow = "#f0c674" colors.brightyellow = "#f0c674"
colors.brightblue = "#81a2be" colors.brightblue = "#81a2be"
colors.brightmagenta = "#b294bb" colors.brightmagenta = "#b294bb"
colors.brightcyan = "#8abeb7" colors.brightcyan = "#8abeb7"
colors.brightwhite = "#c5c8c6" colors.brightwhite = "#c5c8c6"
-- Other -- Other
colors.transparent = "#00000000" colors.transparent = "#00000000"
colors.container = "#222B2E" colors.container = "#222B2E"
colors.main_scheme = "#2F9B85" colors.main_scheme = "#2F9B85"
colors.main_transparent = "#1A2123CC" colors.main_transparent = "#1A2123CC"
return colors return colors

View file

@ -25,6 +25,8 @@ mylauncher = wibox.container.margin(mylauncher, dpi(0), dpi(0), dpi(6), dpi(6))
-- ~~~~~~~~~~~ -- ~~~~~~~~~~~
-- # Sidebar button : -- # Sidebar button :
local sidebar_button = require('ui.widgets.sidebar_button') local sidebar_button = require('ui.widgets.sidebar_button')
-- # notifications_list button :
local notifications_list_button = require('ui.widgets.notifications_list_button')
-- # Systray : -- # Systray :
local systray = require('ui.widgets.systray') local systray = require('ui.widgets.systray')
-- # Clock : -- # Clock :
@ -109,6 +111,7 @@ local function get_bar(s)
systray, systray,
sidebar_button, sidebar_button,
layoutbox(s), layoutbox(s),
notifications_list_button,
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
spacing = dpi(10) spacing = dpi(10)
}, },
@ -140,8 +143,8 @@ local function get_bar(s)
c.screen.mywibar.visible = true c.screen.mywibar.visible = true
end end
end end
client.connect_signal("property::fullscreen", remove_wibar) --client.connect_signal("property::fullscreen", remove_wibar)
client.connect_signal("request::unmanage", add_wibar) --client.connect_signal("request::unmanage", add_wibar)
end end

View file

@ -9,15 +9,16 @@ local wibox = require("wibox")
local beautiful = require("beautiful") local beautiful = require("beautiful")
local xresources = require("beautiful.xresources") local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi local dpi = xresources.apply_dpi
local naughty = require("naughty")
-- # Libs : -- # Libs :
-- ~~~~~~~~ -- ~~~~~~~~
local helpers = require("libs.helpers") local helpers = require("libs.helpers")
-- Tags : -- Tags :
--awful.util.tagnames = { "1", "2", "3", "4", "5", "6", "7", "8", "9" } awful.util.tagnames = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }
--awful.util.tagnames = { "", "", "", "", "", "", "", "", ""} -- font size : 14 --awful.util.tagnames = { "", "", "", "", "", "", "", "", ""} -- font size : 14
awful.util.tagnames = {"", "", "", "", "", "", "", "", ""} --awful.util.tagnames = { "", "", "", "", "", "", "", "", "" }
-- Each screen has its own tag table. -- Each screen has its own tag table.
screen.connect_signal("request::desktop_decoration", function(s) screen.connect_signal("request::desktop_decoration", function(s)
@ -25,68 +26,85 @@ screen.connect_signal("request::desktop_decoration", function(s)
end) end)
local function update_tag(item, tag, index) local function update_tag(item, tag, index)
if tag.selected then if tag.selected then
item.markup = helpers.colorize_text(" 󰮯 ", colors.main_scheme) item.markup = helpers.colorize_text(" 󰮯 ", colors.main_scheme)
elseif tag.urgent then elseif tag.urgent then
item.markup = helpers.colorize_text("", colors.red) item.markup = helpers.colorize_text("", colors.red)
elseif #tag:clients() > 0 then elseif #tag:clients() > 0 then
item.markup = helpers.colorize_text("", colors.white) item.markup = helpers.colorize_text("", colors.white)
else else
item.markup = helpers.colorize_text(" 󱙝 ", colors.white) item.markup = helpers.colorize_text(" 󱙝 ", colors.white)
end end
end end
local modkey = "Mod4"
return function(s) return function(s)
-- Taglist buttons
-- Taglist buttons local taglist_buttons = gears.table.join(
local taglist_buttons = gears.table.join( awful.button({}, 1, function(t) t:view_only() end),
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t) awful.button({ modkey }, 1, function(t)
if client.focus then if client.focus then
client.focus:move_to_tag(t) client.focus:move_to_tag(t)
end end
end), end),
awful.button({ }, 3, awful.tag.viewtoggle), awful.button({}, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t) awful.button({ modkey }, 3, function(t)
if client.focus then if client.focus then
client.focus:toggle_tag(t) client.focus:toggle_tag(t)
end end
end) end),
--awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end), awful.button({ }, 4, function(t) awful.tag.viewprev(t.screen) end),
--awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end), awful.button({ }, 5, function(t) awful.tag.viewnext(t.screen) end)
) )
-- Create a taglist widget -- Create a taglist widget
local taglist = awful.widget.taglist { local taglist = awful.widget.taglist {
screen = s, screen = s,
--filter = awful.widget.taglist.filter.all, filter = awful.widget.taglist.filter.all,
filter = function (t) return t.selected or #t:clients() > 0 end, -- Show only used Tags --filter = function(t) return t.selected or #t:clients() > 0 end, -- Show only used Tags
buttons = taglist_buttons, buttons = taglist_buttons,
layout = { layout = {
spacing = dpi(8), spacing = dpi(8),
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
}, },
style = { style = {
spacing = dpi(-4), spacing = dpi(-4),
}, },
widget_template = { widget_template = {
id = "tag", id = "tag",
font = theme.ui_font, font = theme.ui_font,
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
create_callback = function(self, c3, index, object) create_callback = function(self, c3, index, object)
update_tag(self, c3, index) update_tag(self, c3, index)
end,
update_callback = function(self, c3, index, object) self:connect_signal('mouse::enter', function()
-- BLING: Update the widget with the new tag
awesome.emit_signal("bling::tag_preview::update", c3)
-- BLING: Show the widget
awesome.emit_signal("bling::tag_preview::visibility", s, true)
if self.bg ~= '#ff0000' then
self.backup = self.bg
self.has_backup = true
end
self.bg = '#ff0000'
end)
self:connect_signal('mouse::leave', function()
-- BLING: Turn the widget off
--awesome.emit_signal("bling::tag_preview::visibility", s, false)
if self.has_backup then self.bg = self.backup end
end)
end,
update_callback = function(self, c3, index, object)
update_tag(self, c3, index) update_tag(self, c3, index)
end end
} }
} }
tags = wibox.widget{ tags = wibox.widget {
{ {
{ {
taglist, taglist,
@ -99,7 +117,7 @@ return function(s)
bg = colors.container, bg = colors.container,
shape = helpers.rrect(theme.rounded - 4), shape = helpers.rrect(theme.rounded - 4),
widget = wibox.container.background widget = wibox.container.background
}, },
top = dpi(4), top = dpi(4),
bottom = dpi(4), bottom = dpi(4),
left = dpi(0), left = dpi(0),
@ -107,7 +125,11 @@ return function(s)
widget = wibox.container.margin widget = wibox.container.margin
} }
--return taglist tags:connect_signal('mouse::leave', function()
return tags -- BLING: Turn the widget off
end awesome.emit_signal("bling::tag_preview::visibility", s, false)
end)
--return taglist
return tags
end

View file

@ -14,78 +14,93 @@ local dpi = xresources.apply_dpi
-- ~~~~~~~~ -- ~~~~~~~~
local helpers = require("libs.helpers") local helpers = require("libs.helpers")
return function(s)
-- Tasklist buttons return function(s)
local tasklist_buttons = gears.table.join( -- Tasklist buttons
awful.button({ }, 1, function (c) c:activate { context = "tasklist", action = "toggle_minimization" } end), local tasklist_buttons = gears.table.join(
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end), awful.button({}, 1, function(c) c:activate { context = "tasklist", action = "toggle_minimization" } end),
awful.button({ }, 4, function() awful.client.focus.byidx(-1) end), awful.button({}, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({ }, 5, function() awful.client.focus.byidx( 1) end) awful.button({}, 4, function() awful.client.focus.byidx(-1) end),
) awful.button({}, 5, function() awful.client.focus.byidx(1) end)
)
-- Create a tasklist widget -- Create a tasklist widget
local tasklist = awful.widget.tasklist local tasklist = awful.widget.tasklist
{
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = tasklist_buttons,
style = {
font = theme.font,
bg_normal = colors.container,
bg_focus = colors.container,
bg_minimize = colors.black ,
shape = helpers.rrect(dpi(4)),
},
layout = {
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal,
},
widget_template = {
{ {
{ screen = s,
{ filter = awful.widget.tasklist.filter.currenttags,
{ buttons = tasklist_buttons,
awful.widget.clienticon, style = {
forced_height = dpi(15), font = theme.font,
forced_width = dpi(15), bg_normal = colors.container,
halign = "center", bg_focus = colors.container,
valign = "center", bg_minimize = colors.black,
widget = wibox.container.place, shape = helpers.rrect(dpi(4)),
},
margins = dpi(2),
widget = wibox.container.margin,
},
{
nil,
nil,
{
nil,
{
widget = wibox.container.background,
id = "pointer",
bg = colors.main_scheme,
shape = gears.shape.rounded_bar,
forced_height = dpi(2),
forced_width = dpi(20)
},
expand = "none",
layout = wibox.layout.align.horizontal
},
layout = wibox.layout.align.vertical
},
layout = wibox.layout.stack,
}, },
forced_width = dpi(40), layout = {
id = "background_role", spacing = dpi(8),
widget = wibox.container.background, layout = wibox.layout.fixed.horizontal,
}, },
top = dpi(4), widget_template = {
bottom = dpi(4), create_callback = function(self, c, index, objects) --luacheck: no unused args
left = dpi(2), --self:get_children_by_id('clienticon')[1].client = c
right = dpi(2),
widget = wibox.container.margin -- BLING: Toggle the popup on hover and disable it off hover
} self:connect_signal('mouse::enter', function()
} awesome.emit_signal("bling::task_preview::visibility", s,
true, c)
end)
self:connect_signal('mouse::leave', function()
awesome.emit_signal("bling::task_preview::visibility", s,
false, c)
end)
end,
{
{
{
{
id = 'clienticon',
awful.widget.clienticon,
forced_height = dpi(15),
forced_width = dpi(15),
halign = "center",
valign = "center",
widget = wibox.container.place,
},
margins = dpi(2),
widget = wibox.container.margin,
},
{
nil,
nil,
{
nil,
{
widget = wibox.container.background,
id = "pointer",
bg = colors.main_scheme,
shape = gears.shape.rounded_bar,
forced_height = dpi(2),
forced_width = dpi(20)
},
expand = "none",
layout = wibox.layout.align.horizontal
},
layout = wibox.layout.align.vertical
},
nil,
layout = wibox.layout.stack,
},
forced_width = dpi(40),
id = "background_role",
widget = wibox.container.background,
},
top = dpi(4),
bottom = dpi(4),
left = dpi(2),
right = dpi(2),
widget = wibox.container.margin
},
}
return tasklist return tasklist
end end

View file

@ -0,0 +1,108 @@
-- ## Sidebar ##
-- ~~~~~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local beautiful = require ("beautiful")
local dpi = beautiful.xresources.apply_dpi
-- # Libs :
-- ~~~~~~~~
local helpers = require("libs.helpers")
local rubato = require("libs.rubato")
local function box_widget(widgets, width, height)
return wibox.widget {
{
{
widgets,
margins = dpi(16),
widget = wibox.container.margin,
},
forced_width = dpi(width),
forced_height = dpi(height),
shape = helpers.rrect(theme.rounded),
bg = colors.container,
widget = wibox.container.background,
},
margins = {left = dpi(20), right = dpi(20)},
widget = wibox.container.margin,
}
end
-- Get widgets
local notifications_list_core = require("ui.notifications-list.list")
local notifications_widget = notifications_list_core.widget
-- Combine some widgets
local notifications = box_widget(notifications_widget, 380, 150)
-- Sidebar
local notifications_list = wibox {
type = "dock",
visible = false,
ontop = true,
width = dpi(420),
height = dpi(836),
y = dpi(8),
bg = theme.bg,
shape = helpers.rrect(18),
}
-- Sidebar widget setup
notifications_list : setup {
{
notifications,
spacing = dpi(20),
layout = wibox.layout.flex.vertical,
},
margins = { top = dpi(20), bottom = dpi(20)},
widget = wibox.container.margin,
}
-- Slide animation
local slide = rubato.timed {
pos = helpers.screen.geometry.height,
rate = 60,
intro = 0.05,
duration = 0.2,
easing = rubato.quadratic,
subscribed = function(pos)
notifications_list.y = helpers.screen.geometry.y + pos
end
}
-- Timer of sidebar's death
notifications_list.timer = gears.timer {
timeout = 0.5,
single_shot = true,
callback = function()
notifications_list.visible = not notifications_list.visible
end
}
-- Toggle function
notifications_list.toggle = function()
if notifications_list.visible then
slide.target = helpers.screen.geometry.y - notifications_list.height
notifications_list.timer:start()
else
slide.target = helpers.screen.geometry.y + dpi(10)
notifications_list.visible = not notifications_list.visible
end
end
awful.placement.top_right(notifications_list, {honor_workarea = true, margins = beautiful.useless_gap * 3})
notifications_list.core = notifications_list_core
-- Get signal to execute the function (if that makes sense)
awesome.connect_signal("notifications_list::toggle", function()
notifications_list.toggle()
end)
return notifications_list

View file

@ -0,0 +1,147 @@
-- ## Clock ##
-- ~~~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local awful = require("awful")
local gears = require("gears")
local wibox = require("wibox")
local naughty = require("naughty")
local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi
local notifbox_layout = wibox.widget {
layout = wibox.layout.fixed.vertical,
spacing = dpi(7)
}
local function create_notifcation(n)
local icon_visibility
if n.icon == nil then
icon_visibility = false
else
icon_visibility = true
end
-- Action widget
local action_widget = {
{
{
id = "text_role",
align = "center",
font = "Roboto Mono 10",
widget = wibox.widget.textbox,
},
margins = { left = dpi(6), right = dpi(6) },
widget = wibox.container.margin,
},
widget = wibox.container.background,
}
-- Apply action widget ^
local actions = wibox.widget {
notification = n,
base_layout = wibox.widget {
spacing = dpi(8),
layout = wibox.layout.flex.horizontal,
},
widget_template = action_widget,
widget = naughty.list.actions,
}
local function space_h(length, circumstances)
return wibox.widget {
forced_width = length,
visible = circumstances,
layout = wibox.layout.fixed.horizontal,
}
end
-- Make other widgets
local title = wibox.widget.textbox()
title.font = "Roboto bold 14"
title.align = 'left'
title.markup = n.title
local message = wibox.widget.textbox()
message.font = "Roboto Medium 11"
message.align = 'left'
message.markup = n.message
local icon = wibox.widget {
nil,
{
{
image = n.icon or n.app_icon,
visible = icon_visibility,
widget = wibox.widget.imagebox,
},
strategy = "max",
width = dpi(30),
height = dpi(30),
widget = wibox.container.constraint,
},
expand = 'none',
layout = wibox.layout.align.vertical,
}
local container = wibox.widget {
{
title,
{
icon,
space_h(dpi(10), icon_visibility),
message,
layout = wibox.layout.fixed.horizontal,
},
actions,
spacing = dpi(10),
layout = wibox.layout.fixed.vertical,
},
margins = dpi(20),
widget = wibox.container.margin,
}
notifbox_layout:insert(
1,
container
)
end
naughty.connect_signal("request::display", function(n)
create_notifcation(n)
end)
local notif_core = {}
notif_core.is_read = true
notif_core.widget = wibox.widget {
{
{
text = "Dismiss all",
halign = "center",
valign = "center",
widget = wibox.widget.textbox
},
buttons = gears.table.join(
awful.button({}, 1, function()
notifbox_layout:reset()
end)
),
forced_width = 75,
shape = gears.shape.rounded_bar,
shape_border_width = 1,
shape_border_color = beautiful.bg_highlight,
widget = wibox.container.background
},
{
notifbox_layout,
layout = wibox.layout.flex.vertical
},
spacing = dpi(4),
layout = wibox.layout.fixed.vertical,
}
return notif_core

View file

@ -22,11 +22,11 @@ naughty.config.defaults.title = "Notification"
naughty.config.defaults.position = "top_right" naughty.config.defaults.position = "top_right"
naughty.config.defaults.border_width = 0 naughty.config.defaults.border_width = 0
local function create_notifcation(n) local function create_notifcation(n)
local time = os.date "%H:%M" local time = os.date "%H:%M"
local icon_visibility local icon_visibility
if n.icon == nil then if n.icon == nil then
icon_visibility = false icon_visibility = false
else else
icon_visibility = true icon_visibility = true
@ -41,7 +41,7 @@ local function create_notifcation(n)
font = "Roboto Mono 10", font = "Roboto Mono 10",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
margins = {left = dpi(6), right = dpi(6)}, margins = { left = dpi(6), right = dpi(6) },
widget = wibox.container.margin, widget = wibox.container.margin,
}, },
widget = wibox.container.background, widget = wibox.container.background,
@ -81,7 +81,7 @@ local function create_notifcation(n)
nil, nil,
{ {
{ {
image = n.icon, image = n.icon or n.app_icon,
visible = icon_visibility, visible = icon_visibility,
widget = wibox.widget.imagebox, widget = wibox.widget.imagebox,
}, },
@ -133,22 +133,20 @@ local function create_notifcation(n)
widget = wibox.container.constraint, widget = wibox.container.constraint,
}, },
bg = colors.container, bg = colors.container,
widget = wibox.container.background, widget = wibox.container.background,
} }
} }
end end
-- # Error handling : -- # Error handling :
naughty.connect_signal("request::display_error", function(message, startup) naughty.connect_signal("request::display_error", function(message, startup)
naughty.notification { naughty.notification {
urgency = "critical", urgency = "critical",
title = "Oops, an error happened"..(startup and " during startup!" or "!"), title = "Oops, an error happened" .. (startup and " during startup!" or "!"),
message = message message = message
} }
end) end)
naughty.connect_signal("request::display", function(n) naughty.connect_signal("request::display", function(n)
create_notifcation(n) create_notifcation(n)
end) end)

View file

@ -109,8 +109,9 @@ sidebar : setup {
local slide = rubato.timed { local slide = rubato.timed {
pos = helpers.screen.geometry.height, pos = helpers.screen.geometry.height,
rate = 60, rate = 60,
intro = 0.2, intro = 0.05,
duration = 0.4, duration = 0.2,
easing = rubato.quadratic,
subscribed = function(pos) subscribed = function(pos)
sidebar.y = helpers.screen.geometry.y + pos sidebar.y = helpers.screen.geometry.y + pos
end end
@ -146,8 +147,8 @@ awful.placement.top_right(sidebar, {honor_workarea = true, margins = beautiful.u
--}) --})
-- Get signal to execute the function (if that makes sense) -- Get signal to execute the function (if that makes sense)
awesome.connect_signal("sidebar::toggle", function(s) awesome.connect_signal("sidebar::toggle", function()
sidebar.toggle(s) sidebar.toggle()
end) end)
return sidebar return sidebar

View file

@ -6,7 +6,7 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
local beautiful = require ("beautiful") local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi local dpi = beautiful.xresources.apply_dpi
@ -20,18 +20,18 @@ local playerctl = require("libs.bling").signal.playerctl.lib()
-- widgets -- widgets
---------- ----------
-- gradientee music album art -- gradientee music album art
-- - - - - - - - - - - - - - -- - - - - - - - - - - - - -
local music_art_filter = wibox.widget({ local music_art_filter = wibox.widget({
{ {
bg = { bg = {
type = "linear", type = "linear",
from = { 0, 30 }, from = { 0, 30 },
to = { 0, 200}, to = { 0, 200 },
stops = { stops = {
{ 0, colors.transparent}, { 0, colors.transparent },
{ 1, colors.container } { 1, colors.container }
},
}, },
},
forced_height = dpi(85), forced_height = dpi(85),
forced_width = dpi(85), forced_width = dpi(85),
widget = wibox.container.background, widget = wibox.container.background,
@ -43,42 +43,42 @@ local music_art_filter = wibox.widget({
-- the different music elements -- the different music elements
-- - - - - - - - - - - - - - - -- - - - - - - - - - - - - - -
-- album art -- album art
local album_art = wibox.widget{ local album_art = wibox.widget {
widget = wibox.widget.imagebox, widget = wibox.widget.imagebox,
clip_shape = helpers.rrect(theme.rounded), clip_shape = helpers.rrect(theme.rounded),
forced_height = dpi(85), forced_height = dpi(85),
forced_width = dpi(85), forced_width = dpi(85),
image = theme.album_art image = theme.album_art
} }
-- playing yeah? -- playing yeah?
local playing_or = wibox.widget{ local playing_or = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("Now playing", colors.white), markup = helpers.colorize_text("Now playing", colors.white),
font = theme.font, font = theme.font,
align = "left", align = "left",
valign = "center" valign = "center"
} }
-- song artist -- song artist
local song_artist = wibox.widget{ local song_artist = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("Unknown", colors.white), markup = helpers.colorize_text("Unknown", colors.white),
font = theme.font, font = theme.font,
align = "left", align = "left",
valign = "center" valign = "center"
} }
-- song name -- song name
local song_name = wibox.widget{ local song_name = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("None", colors.white), markup = helpers.colorize_text("None", colors.white),
font = theme.font, font = theme.font,
align = "left", align = "left",
valign = "center" valign = "center"
} }
---------------------------------------- eo.Widgets ---------------------------------------- eo.Widgets
@ -87,30 +87,30 @@ local song_name = wibox.widget{
---------- ----------
-- toggle button -- toggle button
local toggle_button = wibox.widget{ local toggle_button = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("", colors.white), markup = helpers.colorize_text("", colors.white),
font = theme.sidebar_font, font = theme.sidebar_font,
align = "right", align = "right",
valign = "center" valign = "center"
} }
-- next button -- next button
local next_button = wibox.widget{ local next_button = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("", colors.white), markup = helpers.colorize_text("", colors.white),
font = theme.sidebar_font, font = theme.sidebar_font,
align = "right", align = "right",
valign = "center" valign = "center"
} }
-- prev button -- prev button
local prev_button = wibox.widget{ local prev_button = wibox.widget {
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
markup = helpers.colorize_text("", colors.white), markup = helpers.colorize_text("", colors.white),
font = theme.sidebar_font, font = theme.sidebar_font,
align = "right", align = "right",
valign = "center" valign = "center"
} }
local music_bar = wibox.widget({ local music_bar = wibox.widget({
@ -139,13 +139,13 @@ local next_command = function() playerctl:next() end
-- make it functional! -- make it functional!
toggle_button:buttons(gears.table.join( toggle_button:buttons(gears.table.join(
awful.button({}, 1, function() toggle_command() end))) awful.button({}, 1, function() toggle_command() end)))
next_button:buttons(gears.table.join( next_button:buttons(gears.table.join(
awful.button({}, 1, function() next_command() end))) awful.button({}, 1, function() next_command() end)))
prev_button:buttons(gears.table.join( prev_button:buttons(gears.table.join(
awful.button({}, 1, function() prev_command() end))) awful.button({}, 1, function() prev_command() end)))
@ -165,77 +165,75 @@ playerctl:connect_signal("metadata", function(_, title, artist, album_path, __,
end end
album_art:set_image(gears.surface.load_uncached(album_path)) album_art:set_image(gears.surface.load_uncached(album_path))
song_name:set_markup_silently(helpers.colorize_text(title, colors.white)) song_name:set_markup_silently(helpers.colorize_text(title, colors.white))
song_artist:set_markup_silently(helpers.colorize_text(artist, colors.white)) song_artist:set_markup_silently(helpers.colorize_text(artist, colors.white))
end) end)
-- playing/paused/{N/A} -- playing/paused/{N/A}
playerctl:connect_signal("playback_status", function(_, playing, __) playerctl:connect_signal("playback_status", function(_, playing, __)
if playing then if playing then
toggle_button.markup = helpers.colorize_text("", colors.white) toggle_button.markup = helpers.colorize_text("", colors.white)
else else
toggle_button.markup = helpers.colorize_text("", colors.white) toggle_button.markup = helpers.colorize_text("", colors.white)
end end
end) end)
-- time elapsed -- time elapsed
playerctl:connect_signal("position", function(_, interval_sec, length_sec) playerctl:connect_signal("position", function(_, interval_sec, length_sec)
music_bar.value = (interval_sec / length_sec) * 100 music_bar.value = (interval_sec / length_sec) * 100
music_length = length_sec music_length = length_sec
end) end)
-- mainbox -- mainbox
-- too messy -- too messy
------------ ------------
local music_box = wibox.widget { local music_box = wibox.widget {
{ {
{
album_art,
music_art_filter,
layout = wibox.layout.stack,
},
{
{
{ {
album_art, playing_or,
music_art_filter, nil,
layout = wibox.layout.stack,
},
{
{ {
{ {
playing_or, step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
nil, widget = wibox.container.scroll.horizontal,
{ forced_width = dpi(250),
{ speed = 30,
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, song_name,
widget = wibox.container.scroll.horizontal, },
forced_width = dpi(250), {
speed = 30, step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth,
song_name, widget = wibox.container.scroll.horizontal,
}, forced_width = dpi(250),
{ speed = 30,
step_function = wibox.container.scroll.step_functions.waiting_nonlinear_back_and_forth, song_artist,
widget = wibox.container.scroll.horizontal, },
forced_width = dpi(250), spacing = dpi(2),
speed = 30, layout = wibox.layout.fixed.vertical,
song_artist,
},
spacing = dpi(2),
layout = wibox.layout.fixed.vertical,
},
layout = wibox.layout.align.vertical,
expand = "none"
},
layout = wibox.layout.fixed.horizontal,
spacing = dpi(10)
}, },
widget = wibox.container.margin, layout = wibox.layout.align.vertical,
margins = {top = dpi(20), bottom = dpi(20), left = dpi(20), right = dpi(20)}, expand = "none"
}, },
layout = wibox.layout.stack, layout = wibox.layout.fixed.horizontal,
}, spacing = dpi(10)
widget = wibox.container.background, },
forced_height = dpi(150), widget = wibox.container.margin,
bg = colors.container, margins = { top = dpi(20), bottom = dpi(20), left = dpi(20), right = dpi(20) },
border_color = colors.container, },
shape = helpers.rrect(theme.rounded) layout = wibox.layout.stack,
},
widget = wibox.container.background,
forced_height = dpi(150),
bg = colors.container,
border_color = colors.container,
shape = helpers.rrect(theme.rounded)
} }
@ -245,26 +243,26 @@ return wibox.widget {
{ {
music_box, music_box,
{ {
{ {
music_bar, music_bar,
direction = "east", direction = "east",
widget = wibox.container.rotate, widget = wibox.container.rotate,
forced_width = dpi(2) forced_width = dpi(2)
}, },
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
spacing = dpi(20), spacing = dpi(20),
}, },
{ {
{ {
{ {
nil, nil,
{ {
prev_button, prev_button,
toggle_button, toggle_button,
next_button, next_button,
layout = wibox.layout.fixed.vertical, layout = wibox.layout.fixed.vertical,
spacing = dpi(22) spacing = dpi(22)
}, },
layout = wibox.layout.align.vertical, layout = wibox.layout.align.vertical,
expand = "none" expand = "none"
}, },
@ -285,5 +283,3 @@ return wibox.widget {
-- eof -- eof
------ ------

View file

@ -113,13 +113,13 @@ local mic = wibox.widget {
} }
local update_mic = function() local update_mic = function()
awful.spawn.easy_async_with_shell("pamixer --source 5891 --get-volume", function(stdout) awful.spawn.easy_async_with_shell("pactl get-source-volume 0 | awk '{print $5}' | cut -d '%' -f 1", function(stdout)
mic_slider.value = tonumber(stdout:match("%d+")) mic_slider.value = tonumber(stdout:match("%d+"))
end) end)
end end
mic_slider:connect_signal("property::value", function(_, mic_vol) mic_slider:connect_signal("property::value", function(_, mic_vol)
awful.spawn("pamixer --source 5891 --set-volume ".. mic_vol, false) awful.spawn("pactl set-source-volume 0 ".. mic_vol .. "%", false)
-- Update textbox widget text -- Update textbox widget text
mic_osd_value.text = mic_vol .. "%" mic_osd_value.text = mic_vol .. "%"
awesome.emit_signal("module::mic_osd_value", mic_vol) awesome.emit_signal("module::mic_osd_value", mic_vol)

View file

@ -6,48 +6,49 @@
local awful = require("awful") local awful = require("awful")
local gears = require("gears") local gears = require("gears")
local wibox = require("wibox") local wibox = require("wibox")
local beautiful = require ("beautiful") local beautiful = require("beautiful")
local naughty = require("naughty")
local dpi = beautiful.xresources.apply_dpi local dpi = beautiful.xresources.apply_dpi
-- Helper -- Helper
----------- -----------
local function round_widget(radius) local function round_widget(radius)
return function(cr,w,h) return function(cr, w, h)
gears.shape.rounded_rect(cr,w,h,radius) gears.shape.rounded_rect(cr, w, h, radius)
end end
end end
local function grouping_widget(w1,w2) local function grouping_widget(w1, w2)
local container = wibox.widget { local container = wibox.widget {
w1, w1,
{ {
nil, nil,
w2, w2,
expand = 'none', expand = 'none',
layout = wibox.layout.align.vertical, layout = wibox.layout.align.vertical,
}, },
spacing = dpi(18), spacing = dpi(18),
layout = wibox.layout.fixed.horizontal, layout = wibox.layout.fixed.horizontal,
} }
return container return container
end end
local function center_widget(widget) local function center_widget(widget)
return wibox.widget { return wibox.widget {
nil, nil,
{ {
nil, nil,
widget, widget,
expand = 'none', expand = 'none',
layout = wibox.layout.align.horizontal, layout = wibox.layout.align.horizontal,
}, },
expand = 'none', expand = 'none',
layout = wibox.layout.align.vertical, layout = wibox.layout.align.vertical,
} }
end end
-- Create_widgets -- Create_widgets
------------------- -------------------
-- Disk -- Disk
@ -57,15 +58,15 @@ d_icon.align = "left"
d_icon.markup = "" d_icon.markup = ""
local d_slider = wibox.widget { local d_slider = wibox.widget {
forced_width = dpi(220), forced_width = dpi(220),
forced_height = dpi(10), forced_height = dpi(10),
color = beautiful.red, color = beautiful.red,
background_color = "#663D3D", background_color = "#663D3D",
shape = round_widget(12), shape = round_widget(12),
bar_shape = round_widget(12), bar_shape = round_widget(12),
max_value = 100, max_value = 100,
value = 20, value = 20,
widget = wibox.widget.progressbar, widget = wibox.widget.progressbar,
} }
local disk = grouping_widget(d_icon, d_slider) local disk = grouping_widget(d_icon, d_slider)
@ -77,14 +78,14 @@ v_icon.align = "left"
v_icon.markup = "" v_icon.markup = ""
local v_slider = wibox.widget { local v_slider = wibox.widget {
forced_width = dpi(220), forced_width = dpi(220),
forced_height = dpi(10), forced_height = dpi(10),
color = beautiful.blue, color = beautiful.blue,
background_color = "#3D4B66", background_color = "#3D4B66",
shape = round_widget(12), shape = round_widget(12),
bar_shape = round_widget(12), bar_shape = round_widget(12),
max_value = 100, max_value = 100,
widget = wibox.widget.progressbar, widget = wibox.widget.progressbar,
} }
local volume = grouping_widget(v_icon, v_slider) local volume = grouping_widget(v_icon, v_slider)
@ -96,14 +97,14 @@ b_icon.align = "left"
b_icon.markup = "" b_icon.markup = ""
local b_slider = wibox.widget { local b_slider = wibox.widget {
forced_width = dpi(220), forced_width = dpi(220),
forced_height = dpi(10), forced_height = dpi(10),
color = beautiful.yellow, color = beautiful.yellow,
background_color = "#66523D", background_color = "#66523D",
shape = round_widget(12), shape = round_widget(12),
bar_shape = round_widget(12), bar_shape = round_widget(12),
max_value = 100, max_value = 100,
widget = wibox.widget.progressbar, widget = wibox.widget.progressbar,
} }
local brightness = grouping_widget(b_icon, b_slider) local brightness = grouping_widget(b_icon, b_slider)
@ -112,28 +113,30 @@ local brightness = grouping_widget(b_icon, b_slider)
------------------------------------ ------------------------------------
local function get_val() local function get_val()
awesome.connect_signal("signal::volume", function(vol, muted) awesome.connect_signal("signal::volume", function(vol, muted)
if muted then v_slider.value = 0 else if muted then
v_slider.color = beautiful.blue v_slider.value = 0
v_slider.value = tonumber(vol) else
end v_slider.color = beautiful.blue
end) v_slider.value = tonumber(vol)
end
end)
awesome.connect_signal("signal::brightness", function(bri) awesome.connect_signal("signal::brightness", function(bri)
b_slider.value = tonumber(bri) b_slider.value = tonumber(bri)
end) end)
awesome.connect_signal("signal::disk", function(disk_perc) awesome.connect_signal("signal::disk", function(disk_perc)
d_slider.value = tonumber(disk_perc) d_slider.value = tonumber(disk_perc)
end) end)
end end
get_val() get_val()
return center_widget(wibox.widget { return center_widget(wibox.widget {
disk, disk,
volume, volume,
brightness, brightness,
spacing = dpi(18), spacing = dpi(18),
layout = wibox.layout.fixed.vertical, layout = wibox.layout.fixed.vertical,
}) })

View file

@ -7,6 +7,7 @@ local beautiful = require("beautiful")
local dpi = beautiful.xresources.apply_dpi local dpi = beautiful.xresources.apply_dpi
local filesystem = gears.filesystem local filesystem = gears.filesystem
local icon_dir = filesystem.get_configuration_dir() .. "themes/icons/weather/" local icon_dir = filesystem.get_configuration_dir() .. "themes/icons/weather/"
local naughty = require("naughty")
-- # Libs : -- # Libs :
-- ~~~~~~~~ -- ~~~~~~~~
@ -85,7 +86,7 @@ local current_weather_widget = wibox.widget({
font = "Roboto Medium 10", font = "Roboto Medium 10",
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
}, },
spacing = dpi(-6), spacing = dpi( -6),
layout = wibox.layout.fixed.vertical, layout = wibox.layout.fixed.vertical,
}, },
widget = wibox.container.place, widget = wibox.container.place,
@ -132,8 +133,9 @@ local hourly_widget = function()
local time = widget:get_children_by_id("time")[1] local time = widget:get_children_by_id("time")[1]
local icon = widget:get_children_by_id("icon")[1] local icon = widget:get_children_by_id("icon")[1]
local temp = widget:get_children_by_id("tempareture")[1] local temp = widget:get_children_by_id("tempareture")[1]
temp:set_markup(math.floor(result.temp) .. "<sup><span>°</span></sup>")
time:set_text(os.date("%I%p", tonumber(result.dt))) temp:set_markup(math.floor(result.main.temp) .. "<sup><span>°</span></sup>")
time:set_text(os.date("%H", tonumber(result.dt)))
icon.image = icon_dir .. icon_map[result.weather[1].icon] .. ".svg" icon.image = icon_dir .. icon_map[result.weather[1].icon] .. ".svg"
icon:emit_signal("widget::redraw_needed") icon:emit_signal("widget::redraw_needed")
end end
@ -169,27 +171,19 @@ local weather_widget = wibox.widget({
layout = wibox.layout.fixed.vertical, layout = wibox.layout.fixed.vertical,
}) })
local api_key = "" local api_key = "7641c17cda8ed75684ed55704226c565"
local coordinates = {"", ""} local city_id = "2972315"
local show_hourly_forecast = true
local show_daily_forecast = true
local units = "metric" local units = "metric"
local url = ( local url = (
"https://api.openweathermap.org/data/2.5/onecall" "https://api.openweathermap.org/data/2.5/forecast"
.. "?lat=" .. "?appid="
.. coordinates[1] .. api_key
.. "&lon=" .. "&id="
.. coordinates[2] .. city_id
.. "&appid=" .. "&units="
.. api_key .. units
.. "&units=" )
.. units
.. "&exclude=minutely"
.. (show_hourly_forecast == false and ",hourly" or "")
.. (show_daily_forecast == false and ",daily" or "")
)
awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout, stderr) awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout, stderr)
if stderr == "" then if stderr == "" then
@ -200,19 +194,27 @@ awful.widget.watch(string.format(GET_FORECAST_CMD, url), 600, function(_, stdout
local humidity = current_weather_widget:get_children_by_id("humidity")[1] local humidity = current_weather_widget:get_children_by_id("humidity")[1]
local temp_current = current_weather_widget:get_children_by_id("tempareture_current")[1] local temp_current = current_weather_widget:get_children_by_id("tempareture_current")[1]
local feels_like = current_weather_widget:get_children_by_id("feels_like")[1] local feels_like = current_weather_widget:get_children_by_id("feels_like")[1]
icon.image = icon_dir .. icon_map[result.current.weather[1].icon] .. ".svg"
local current = result.list[1]
icon.image = icon_dir .. icon_map[current.weather[1].icon] .. ".svg"
icon:emit_signal("widget::redraw_needed") icon:emit_signal("widget::redraw_needed")
description:set_text(result.current.weather[1].description:gsub("^%l", string.upper)) description:set_text(current.weather[1].description:gsub("^%l", string.upper))
humidity:set_text("Humidity: " .. result.current.humidity .. "%") humidity:set_text("Humidity: " .. current.main.humidity .. "%")
temp_current:set_markup(math.floor(result.current.temp) .. "<sup><span>°</span></sup>") temp_current:set_markup(math.floor(current.main.temp) .. "<sup><span>°</span></sup>")
feels_like:set_markup("Feels like: " .. math.floor(result.current.feels_like) .. "<sup><span>°</span></sup>") feels_like:set_markup("Feels like: " .. math.floor(current.main.feels_like) .. "<sup><span>°</span></sup>")
-- Hourly widget setup -- Hourly widget setup
hourly_widget_1.update(result.hourly[1]) hourly_widget_1.update(result.list[1])
hourly_widget_2.update(result.hourly[2]) hourly_widget_2.update(result.list[2])
hourly_widget_3.update(result.hourly[3]) hourly_widget_3.update(result.list[3])
hourly_widget_4.update(result.hourly[4]) hourly_widget_4.update(result.list[4])
hourly_widget_5.update(result.hourly[5]) hourly_widget_5.update(result.list[5])
hourly_widget_6.update(result.hourly[6]) hourly_widget_6.update(result.list[6])
else
naughty.notify({
title = "Weather error",
text = stderr
})
end end
end) end)

View file

@ -0,0 +1,37 @@
-- ## Sidebar button ##
-- ~~~~~~~~~~~~~~~~~~~~
-- Requirements :
-- ~~~~~~~~~~~~~~
local gears = require("gears")
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require('beautiful')
local dpi = require('beautiful').xresources.apply_dpi
local notifications_list = require("ui.notifications-list")
local notifications_list_icon = wibox.widget{
markup = "",
font = theme.taglist_font,
valign = "center",
align = "center",
widget = wibox.widget.textbox
}
notifications_list_icon:connect_signal(
"button::press",
function()
notifications_list_icon.opacity = 0.6
notifications_list.toggle()
end)
notifications_list_icon:connect_signal(
"button::release",
function()
notifications_list_icon.opacity = 1
end)
--return sidebar_icon
return awful.widget.only_on_screen(notifications_list_icon, 'primary')

View file

@ -29,7 +29,7 @@ sidebar_icon:connect_signal(
"button::press", "button::press",
function() function()
sidebar_icon.opacity = 0.6 sidebar_icon.opacity = 0.6
sidebar.toggle(s) sidebar.toggle()
end) end)
sidebar_icon:connect_signal( sidebar_icon:connect_signal(
"button::release", "button::release",

View file

@ -0,0 +1,29 @@
local awful = require "awful"
local wibox = require "wibox"
local beautiful = require "beautiful"
local bling = require "libs.bling"
bling.widget.tag_preview.enable {
show_client_content = true, -- Whether or not to show the client content
x = 10, -- The x-coord of the popup
y = 10, -- The y-coord of the popup
scale = 0.25, -- The scale of the previews compared to the screen
honor_padding = true, -- Honor padding when creating widget size
honor_workarea = true, -- Honor work area when creating widget size
placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y)
awful.placement.bottom_left(c, {
margins = {
bottom = 45,
left = 5
},
parent = awful.screen.focused()
})
end,
background_widget = wibox.widget { -- Set a background image (like a wallpaper) for the widget
image = "/home/eric/Pictures/wallpapers/96300930_p0_x4_esrgan.jpg",
horizontal_fit_policy = "fit",
vertical_fit_policy = "fit",
widget = wibox.widget.imagebox
}
}

View file

@ -0,0 +1,17 @@
local awful = require "awful"
local bling = require "libs.bling"
bling.widget.task_preview.enable {
x = 20, -- The x-coord of the popup
y = 20, -- The y-coord of the popup
height = 200, -- The height of the popup
width = 200, -- The width of the popup
placement_fn = function(c) -- Place the widget using awful.placement (this overrides x & y)
awful.placement.bottom(c, {
margins = {
bottom = 45
},
parent = awful.screen.focused()
})
end
}

View file

@ -15,25 +15,29 @@ local helpers = require("libs.helpers")
local temprature = wibox.widget.textbox() local temprature = wibox.widget.textbox()
temprature.font = theme.font temprature.font = theme.font
watch('bash -c "sensors | awk \'/Core 0/ {print substr($3, 2) }\'"', 30, function(_, stdout) watch([[ bash -c "sensors | grep 'Tctl:' | awk '{print $2}'" ]], 30, function(_, stdout)
temprature.text = stdout local temp_num = tonumber(stdout:match("%d+"))
if temp_num == nil then
temp_num = -1
end
temprature.text = math.floor(temp_num) .. "°C"
end) end)
-- Icon : -- Icon :
local widget_icon = "" local widget_icon = ""
local icon = wibox.widget{ local icon = wibox.widget {
font = theme.icon_font, font = theme.icon_font,
markup = helpers.colorize_text(widget_icon, colors.main_scheme), markup = helpers.colorize_text(widget_icon, colors.main_scheme),
widget = wibox.widget.textbox, widget = wibox.widget.textbox,
valign = "center", valign = "center",
align = "center" align = "center"
} }
return wibox.widget { return wibox.widget {
icon, icon,
wibox.widget{ wibox.widget {
temprature, temprature,
fg = colors.brightwhite, fg = colors.brightwhite,
widget = wibox.container.background widget = wibox.container.background
}, },

View file

@ -0,0 +1,20 @@
local awful = require "awful"
local bling = require "libs.bling"
bling.widget.window_switcher.enable {
type = "thumbnail", -- set to anything other than "thumbnail" to disable client previews
-- keybindings (the examples provided are also the default if kept unset)
hide_window_switcher_key = "Escape", -- The key on which to close the popup
minimize_key = "n", -- The key on which to minimize the selected client
unminimize_key = "N", -- The key on which to unminimize all clients
kill_client_key = "q", -- The key on which to close the selected client
cycle_key = "Tab", -- The key on which to cycle through all clients
previous_key = "Left", -- The key on which to select the previous client
next_key = "Right", -- The key on which to select the next client
vim_previous_key = "h", -- Alternative key on which to select the previous client
vim_next_key = "l", -- Alternative key on which to select the next client
cycleClientsByIdx = awful.client.focus.byidx, -- The function to cycle the clients
filterClients = awful.widget.tasklist.filter.currenttags, -- The function to filter the viewed clients
}