fixed bluetooth and taskbar, tasklist icons
This commit is contained in:
@@ -10,32 +10,32 @@ return function()
|
||||
local globalkeys = gears.table.join(
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"s",
|
||||
"#39",
|
||||
hotkeys_popup.show_help,
|
||||
{ description = "Cheat sheet", group = "Awesome" }
|
||||
),
|
||||
-- Tag browsing
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Left",
|
||||
"#113",
|
||||
awful.tag.viewprev,
|
||||
{ description = "View previous tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Right",
|
||||
"#114",
|
||||
awful.tag.viewnext,
|
||||
{ description = "View next tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Escape",
|
||||
"#66",
|
||||
awful.tag.history.restore,
|
||||
{ description = "Go back to last tag", group = "Tag" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"j",
|
||||
"#44",
|
||||
function()
|
||||
awful.client.focus.byidx(1)
|
||||
end,
|
||||
@@ -43,7 +43,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"k",
|
||||
"#45",
|
||||
function()
|
||||
awful.client.focus.byidx(-1)
|
||||
end,
|
||||
@@ -51,7 +51,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"w",
|
||||
"#25",
|
||||
function()
|
||||
user_vars.main_menu:show()
|
||||
end,
|
||||
@@ -59,7 +59,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"j",
|
||||
"#44",
|
||||
function()
|
||||
awful.client.swap.byidx(1)
|
||||
end,
|
||||
@@ -67,7 +67,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"k",
|
||||
"#45",
|
||||
function()
|
||||
awful.client.swap.byidx(-1)
|
||||
end,
|
||||
@@ -75,7 +75,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"j",
|
||||
"#44",
|
||||
function()
|
||||
awful.screen.focus_relative(1)
|
||||
end,
|
||||
@@ -83,7 +83,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"k",
|
||||
"#45",
|
||||
function()
|
||||
awful.screen.focus_relative(-1)
|
||||
end,
|
||||
@@ -91,13 +91,13 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"u",
|
||||
"#30",
|
||||
awful.client.urgent.jumpto,
|
||||
{ description = "Jump to urgent client", group = "Client" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Return",
|
||||
"#36",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.terminal)
|
||||
end,
|
||||
@@ -105,13 +105,13 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"r",
|
||||
"#27",
|
||||
awesome.restart,
|
||||
{ description = "Reload awesome", group = "Awesome" }
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"l",
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incmwfact(0.05)
|
||||
end,
|
||||
@@ -119,7 +119,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"h",
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incmwfact(-0.05)
|
||||
end,
|
||||
@@ -127,7 +127,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"h",
|
||||
"#43",
|
||||
function()
|
||||
awful.tag.incncol(1, nil, true)
|
||||
end,
|
||||
@@ -135,7 +135,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Control" },
|
||||
"l",
|
||||
"#46",
|
||||
function()
|
||||
awful.tag.incncol(-1, nil, true)
|
||||
end,
|
||||
@@ -143,7 +143,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"space",
|
||||
"#65",
|
||||
function()
|
||||
awful.layout.inc(-1)
|
||||
end,
|
||||
@@ -151,7 +151,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"Return",
|
||||
"#36",
|
||||
function()
|
||||
awful.layout.inc(1)
|
||||
end,
|
||||
@@ -159,7 +159,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"d",
|
||||
"#40",
|
||||
function()
|
||||
awful.spawn("rofi -show drun -theme ~/.config/rofi/rofi.rasi")
|
||||
end,
|
||||
@@ -167,7 +167,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"Tab",
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
@@ -175,7 +175,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ "Mod1" },
|
||||
"Tab",
|
||||
"#23",
|
||||
function()
|
||||
awful.spawn("rofi -show window -theme ~/.config/rofi/window.rasi")
|
||||
end,
|
||||
@@ -183,7 +183,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"e",
|
||||
"#26",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.file_manager)
|
||||
end,
|
||||
@@ -191,7 +191,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey, "Shift" },
|
||||
"e",
|
||||
"#26",
|
||||
function()
|
||||
awesome.emit_signal("module::powermenu:show")
|
||||
end,
|
||||
@@ -199,7 +199,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{},
|
||||
"Print",
|
||||
"#107",
|
||||
function()
|
||||
awful.spawn(user_vars.vars.screenshot_program)
|
||||
end,
|
||||
@@ -297,7 +297,7 @@ return function()
|
||||
),
|
||||
awful.key(
|
||||
{ modkey },
|
||||
"space",
|
||||
"#65",
|
||||
function()
|
||||
awesome.emit_signal("kblayout::toggle")
|
||||
end,
|
||||
|
||||
@@ -31,17 +31,26 @@ return function(s, widgets)
|
||||
{
|
||||
{
|
||||
widgets[1],
|
||||
margins = dpi(6),
|
||||
left = dpi(6),
|
||||
right = dpi(3),
|
||||
top = dpi(6),
|
||||
bottom = dpi(6),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
{
|
||||
widgets[2],
|
||||
margins = dpi(6),
|
||||
left = dpi(3),
|
||||
right = dpi(3),
|
||||
top = dpi(6),
|
||||
bottom = dpi(6),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
{
|
||||
widgets[3],
|
||||
margins = dpi(6),
|
||||
left = dpi(3),
|
||||
right = dpi(6),
|
||||
top = dpi(6),
|
||||
bottom = dpi(6),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
forced_height = 45,
|
||||
|
||||
@@ -7,7 +7,7 @@ local naughty = require("naughty")
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = "ERROR in Awesome config!",
|
||||
title = "! Not so Awesome ERROR !",
|
||||
text = awesome.startup_errors
|
||||
})
|
||||
end
|
||||
@@ -16,7 +16,7 @@ do
|
||||
local in_error = false
|
||||
awesome.connect_signal(
|
||||
"debug::error",
|
||||
function (err)
|
||||
function(err)
|
||||
if in_error then
|
||||
return
|
||||
end
|
||||
@@ -30,4 +30,4 @@ do
|
||||
in_error = false
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
|
||||
return function ()
|
||||
return function()
|
||||
local layouts = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.fair,
|
||||
}
|
||||
|
||||
return layouts
|
||||
end
|
||||
end
|
||||
|
||||
@@ -15,8 +15,19 @@ end
|
||||
-- If you want different default programs, wallpaper path or modkey; edit this file.
|
||||
local _M = {
|
||||
|
||||
-- Write the terminal command to start anything here
|
||||
autostart = {
|
||||
"picom --experimental-backends",
|
||||
"xfce4-power-manager",
|
||||
"light-locker --lock-on-suspend --lock-on-lid &",
|
||||
"flatpak run com.spotify.Client",
|
||||
"discord",
|
||||
"/usr/lib/policykit-1-gnome/polkit-gnome-authentication-agent-1"
|
||||
},
|
||||
|
||||
-- Type 'ip a' and check your wlan and ethernet name
|
||||
network = {
|
||||
wlan = "",
|
||||
wlan = "wlo1",
|
||||
ethernet = "eno1"
|
||||
},
|
||||
|
||||
|
||||
@@ -6,31 +6,19 @@
|
||||
-- ██║ ██║╚███╔███╔╝███████╗███████║╚██████╔╝██║ ╚═╝ ██║███████╗╚███╔███╔╝██║ ╚═╝ ██║ --
|
||||
-- ╚═╝ ╚═╝ ╚══╝╚══╝ ╚══════╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚══╝╚══╝ ╚═╝ ╚═╝ --
|
||||
-----------------------------------------------------------------------------------------
|
||||
if os.getenv "LOCAL_LUA_DEBUGGER_VSCODE" == "1" then
|
||||
require("lldebugger").start()
|
||||
end
|
||||
|
||||
-- Default Awesome Libs
|
||||
local awful = require("awful")
|
||||
local beautiful = require("beautiful")
|
||||
local gears = require("gears")
|
||||
local menubar = require("menubar")
|
||||
|
||||
-- Global Namespace
|
||||
user_vars = {}
|
||||
user_vars.vars = require("main.user_variables")
|
||||
|
||||
-- Error Handling
|
||||
require("main.error_handling")
|
||||
|
||||
-- Default Theme and Custom Wallpaper
|
||||
beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua")
|
||||
beautiful.wallpaper = user_vars.vars.wallpaper
|
||||
modkey = user_vars.vars.modkey
|
||||
|
||||
require("main.theme")
|
||||
|
||||
-- Load Local User Libs
|
||||
local main = {
|
||||
layouts = require("main.layouts"),
|
||||
tags = require("main.tags"),
|
||||
@@ -38,7 +26,6 @@ local main = {
|
||||
rules = require("main.rules")
|
||||
}
|
||||
|
||||
-- Load all Shortcuts from Local User Libs
|
||||
local bindings = {
|
||||
global_buttons = require("bindings.global_buttons"),
|
||||
client_buttons = require("bindings.client_buttons"),
|
||||
@@ -48,37 +35,23 @@ local bindings = {
|
||||
}
|
||||
|
||||
user_vars.Layouts = main.layouts()
|
||||
|
||||
awful.layout.layouts = main.layouts()
|
||||
|
||||
user_vars.tags = main.tags()
|
||||
|
||||
user_vars.main_menu = awful.menu({
|
||||
items = main.menu()
|
||||
})
|
||||
|
||||
--[[ -- A Variable needed in Statusbar (helper)
|
||||
user_vars.launcher = awful.widget.launcher({
|
||||
image = beautiful.awesome_icon,
|
||||
menu = user_vars.main_menu
|
||||
}) ]]
|
||||
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = user_vars.vars.terminal
|
||||
|
||||
-- Set root
|
||||
root.buttons(bindings.global_buttons())
|
||||
root.keys(bindings.bind_to_tags(bindings.global_keys()))
|
||||
|
||||
-- Default statusbar
|
||||
require("crylia_bar.init")
|
||||
|
||||
-- Rules to apply to new clients
|
||||
awful.rules.rules = main.rules(
|
||||
bindings.client_keys(),
|
||||
bindings.client_buttons()
|
||||
)
|
||||
|
||||
-- Signals
|
||||
require("main.signals")
|
||||
|
||||
require("theme.crylia.tools.auto_starter")
|
||||
--Autostarter(user_vars.vars.autostart)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 MiB |
@@ -1 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /></svg>
|
||||
|
Before Width: | Height: | Size: 336 B |
@@ -13,9 +13,9 @@ local wibox = require("wibox")
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/brightness/"
|
||||
|
||||
-- TODO: fix backlight keys and osd not working correctly
|
||||
return function (s)
|
||||
return function(s)
|
||||
|
||||
local brightness_osd_widget = wibox.widget{
|
||||
local brightness_osd_widget = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
@@ -101,7 +101,7 @@ return function (s)
|
||||
|
||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:connect_signal(
|
||||
"property::value",
|
||||
function ()
|
||||
function()
|
||||
local brightness_value = brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:get_value()
|
||||
-- Performance is horrible, or it overrides and executes at the same time as the keybindings
|
||||
--awful.spawn("xbacklight -set " .. brightness_value, false)
|
||||
@@ -131,11 +131,11 @@ return function (s)
|
||||
end
|
||||
)
|
||||
|
||||
local update_slider = function ()
|
||||
local update_slider = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ sleep 0.1 && xbacklight -get ]],
|
||||
function (stdout)
|
||||
stdout = stdout:sub(1,-9)
|
||||
function(stdout)
|
||||
stdout = stdout:sub(1, -9)
|
||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(tonumber(stdout))
|
||||
end
|
||||
)
|
||||
@@ -143,48 +143,49 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"module::brightness_slider:update",
|
||||
function ()
|
||||
function()
|
||||
update_slider()
|
||||
end
|
||||
)
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::brightness:update",
|
||||
function (value)
|
||||
function(value)
|
||||
brightness_osd_widget.container.osd_layout.icon_slider_layout.slider_layout.brightness_slider:set_value(tonumber(value))
|
||||
end
|
||||
)
|
||||
|
||||
update_slider()
|
||||
|
||||
local brightness_container = awful.popup{
|
||||
local brightness_container = awful.popup {
|
||||
widget = wibox.container.background,
|
||||
ontop = true,
|
||||
bg = color.color["Grey900"] .. "00",
|
||||
stretch = false,
|
||||
visible = false,
|
||||
placement = function (c) awful.placement.centered(c, {margins = {top = dpi(200)}}) end,
|
||||
shape = function (cr, width, height)
|
||||
screen = s,
|
||||
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 15)
|
||||
end
|
||||
}
|
||||
|
||||
local hide_brightness_osd = gears.timer{
|
||||
local hide_brightness_osd = gears.timer {
|
||||
timeout = 2,
|
||||
autostart = true,
|
||||
callback = function ()
|
||||
callback = function()
|
||||
brightness_container.visible = false
|
||||
end
|
||||
}
|
||||
|
||||
brightness_container:setup{
|
||||
brightness_container:setup {
|
||||
brightness_osd_widget,
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
}
|
||||
|
||||
awesome.connect_signal(
|
||||
"widget::brightness_osd:rerun",
|
||||
function ()
|
||||
function()
|
||||
if hide_brightness_osd.started then
|
||||
hide_brightness_osd:again()
|
||||
else
|
||||
@@ -195,14 +196,16 @@ return function (s)
|
||||
|
||||
awesome.connect_signal(
|
||||
"module::brightness_osd:show",
|
||||
function ()
|
||||
brightness_container.visible = true
|
||||
function()
|
||||
if s == mouse.screen then
|
||||
brightness_container.visible = true
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
brightness_container:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
brightness_container.visible = true
|
||||
hide_brightness_osd:stop()
|
||||
end
|
||||
@@ -210,9 +213,9 @@ return function (s)
|
||||
|
||||
brightness_container:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
brightness_container.visible = true
|
||||
hide_brightness_osd:again()
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -195,7 +195,7 @@ local create_titlebar_borderhack = function(c, bg, position)
|
||||
local borderhack = awful.titlebar(c, {
|
||||
position = position,
|
||||
bg = bg,
|
||||
size = "2"
|
||||
size = "4"
|
||||
})
|
||||
borderhack:setup {
|
||||
{
|
||||
|
||||
@@ -184,6 +184,7 @@ echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+
|
||||
bg = color.color["Grey900"] .. "00",
|
||||
stretch = false,
|
||||
visible = false,
|
||||
screen = s,
|
||||
placement = function(c) awful.placement.centered(c, { margins = { top = dpi(200) } }) end,
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 15)
|
||||
@@ -206,7 +207,9 @@ echo $(pacmd list-sinks | awk '/^\s+name: /{indefault = $2 == "<'$SINK'>"} /^\s+
|
||||
awesome.connect_signal(
|
||||
"module::volume_osd:show",
|
||||
function()
|
||||
volume_container.visible = true
|
||||
if s == mouse.screen then
|
||||
volume_container.visible = true
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
local awful = require("awful")
|
||||
|
||||
-- Autostart programs
|
||||
--awful.spawn.with_shell("~/.screenlayout/single_screen.sh")
|
||||
awful.spawn.with_shell("picom --experimental-backends")
|
||||
awful.spawn.with_shell("xfce4-power-manager")
|
||||
awful.spawn.with_shell("light-locker --lock-on-suspend --lock-on-lid &")
|
||||
function Autostarter(table)
|
||||
for i, t in ipairs(table) do
|
||||
awful.spawn.with_shell(t);
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,53 +1,56 @@
|
||||
-----------------------------------------------------
|
||||
-- Helper to get icons from a program/program name --
|
||||
-----------------------------------------------------
|
||||
|
||||
local naughty = require("naughty")
|
||||
-- tries to find a matching file name in /usr/share/icons/THEME/RESOLUTION/apps/ and if not found tried with first letter
|
||||
-- as uppercase, this should get almost all icons to work with the papirus theme atleast
|
||||
-- TODO: try with more icon themes
|
||||
function Get_icon(theme, c, is_steam)
|
||||
if theme and c then
|
||||
local clientName
|
||||
if theme ~= nil and c ~= nil then
|
||||
local clientName = c.name
|
||||
-- TODO: Access steamdb api to fetch the clienticon if there is no icon found in this theme
|
||||
if is_steam then
|
||||
clientName = "steam_icon_" .. tostring(c) .. ".svg"
|
||||
else
|
||||
if type(c) == type("") then
|
||||
clientName = string.lower(c) .. ".svg"
|
||||
else
|
||||
if c.class ~= nil then
|
||||
clientName = string.lower(c.class) .. ".svg"
|
||||
elseif clientName ~= nil then
|
||||
clientName = string.lower(c.name) .. ".svg"
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
local resolutions = {"128x128", "96x96", "64x64", "48x48", "42x42", "32x32", "24x24", "16x16"}
|
||||
local resolutions = { "128x128", "96x96", "64x64", "48x48", "42x42", "32x32", "24x24", "16x16" }
|
||||
for i, res in ipairs(resolutions) do
|
||||
local iconDir = "/usr/share/icons/" .. theme .. "/" .. res .."/apps/"
|
||||
local iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
||||
local ioStream = io.open(iconDir .. clientName, "r")
|
||||
if ioStream ~= nil then
|
||||
return iconDir .. clientName
|
||||
else
|
||||
clientName = clientName:gsub("^%l", string.upper)
|
||||
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .."/apps/"
|
||||
iconDir = "/usr/share/icons/" .. theme .. "/" .. res .. "/apps/"
|
||||
ioStream = io.open(iconDir .. clientName, "r")
|
||||
if ioStream ~= nil then
|
||||
if ioStream ~= nil then
|
||||
return iconDir .. clientName
|
||||
elseif type(c) ~= type("") then
|
||||
local naughty = require("naughty")
|
||||
if pcall(
|
||||
function ()
|
||||
function()
|
||||
if c:Get_icon(1) then
|
||||
error("icon error")
|
||||
error("icon error")
|
||||
else
|
||||
return c:Get_icon(1)
|
||||
end
|
||||
end
|
||||
end
|
||||
) then
|
||||
return nil
|
||||
end
|
||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/Zoom.svg"
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return nil
|
||||
if c.icon == nil then
|
||||
return "/usr/share/icons/Papirus-Dark/128x128/apps/application-default-icon.svg"
|
||||
else
|
||||
return c.icon
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
-------------------------------------------------------------
|
||||
-- This is a button widget to add a new tag to the taglist --
|
||||
-------------------------------------------------------------
|
||||
|
||||
-- !!! THIS WIDGET IS OBSCOLETE !!!
|
||||
|
||||
-- Awesome Libs
|
||||
local awful = require("awful")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local wibox = require("wibox")
|
||||
|
||||
-- User Libs
|
||||
local color = require("theme.crylia.colors")
|
||||
|
||||
-- Icon directory path
|
||||
local icondir = awful.util.getdir("config") .. "theme/crylia/assets/icons/addtag/"
|
||||
|
||||
-- Returns the add tag button widget
|
||||
return function()
|
||||
|
||||
-- This is the widget that gets dispayed
|
||||
local add_tag_button = wibox.widget {
|
||||
{
|
||||
{
|
||||
image = gears.color.recolor_image(icondir .. "plus.svg", color.color["White"]),
|
||||
widget = wibox.widget.imagebox,
|
||||
resize = false
|
||||
},
|
||||
margins = dpi(4),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
bg = color.color["Grey900"],
|
||||
shape = function(cr, width, height)
|
||||
gears.shape.rounded_rect(cr, width, height, 5)
|
||||
end,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
|
||||
-- Keybindings and Mouse click bindings
|
||||
add_tag_button:buttons(
|
||||
gears.table.join(
|
||||
-- Add a new tag
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
nil,
|
||||
function()
|
||||
awful.tag.add()
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
-- Signals
|
||||
local old_wibox, old_cursor, old_bg
|
||||
add_tag_button:connect_signal(
|
||||
"mouse::enter",
|
||||
function()
|
||||
old_bg = add_tag_button.bg
|
||||
add_tag_button.bg = "#ffffff" .. "12"
|
||||
local w = mouse.current_wibox
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
w.cursor = "hand1"
|
||||
end
|
||||
end
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
add_tag_button.bg = "#ffffff" .. "24"
|
||||
end
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"button::release",
|
||||
function()
|
||||
add_tag_button.bg = "#ffffff" .. "12"
|
||||
end
|
||||
)
|
||||
add_tag_button:connect_signal(
|
||||
"mouse::leave",
|
||||
function()
|
||||
add_tag_button.bg = old_bg
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
return add_tag_button
|
||||
end
|
||||
@@ -7,6 +7,7 @@ local awful = require("awful")
|
||||
local color = require("theme.crylia.colors")
|
||||
local dpi = require("beautiful").xresources.apply_dpi
|
||||
local gears = require("gears")
|
||||
local naughty = require("naughty")
|
||||
local wibox = require("wibox")
|
||||
require("main.signals")
|
||||
|
||||
@@ -51,54 +52,34 @@ return function()
|
||||
local bluetooth_state = "off"
|
||||
local connected_device = "nothing"
|
||||
|
||||
-- ! if you don't have a bluetooth device then this function will
|
||||
-- ! spawn hundereds of processes of bluetoothctl, this will be bad
|
||||
-- TODO: Check for a bluetooth controller first, maybe use a different program
|
||||
local get_bluetooth_information = function()
|
||||
-- awful.spawn.easy_async_with_shell(
|
||||
-- [[ bluetoothctl show | grep Powered | awk '{print $2}' ]],
|
||||
-- function(stdout)
|
||||
-- local icon = icondir .. "bluetooth"
|
||||
-- stdout = stdout:gsub("\n", "")
|
||||
-- if stdout == "yes" then
|
||||
-- icon = icon .. "-on"
|
||||
-- bluetooth_state = "on"
|
||||
-- awful.spawn.easy_async_with_shell(
|
||||
-- [[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
|
||||
-- function(stdout2)
|
||||
-- if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
||||
-- else
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
|
||||
-- connected_device = stdout2
|
||||
-- end
|
||||
-- end
|
||||
-- )
|
||||
-- else
|
||||
-- icon = icon .. "-off"
|
||||
-- bluetooth_state = "off"
|
||||
-- bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
||||
-- end
|
||||
-- bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
|
||||
-- end
|
||||
-- )
|
||||
end
|
||||
|
||||
local bluetooth_update = gears.timer {
|
||||
timeout = 5,
|
||||
autostart = true,
|
||||
call_now = true,
|
||||
callback = function()
|
||||
--[[ awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl list",
|
||||
function(stdout)
|
||||
if stdout ~= nil or stdout:gsub("\n", ""):match("") then
|
||||
get_bluetooth_information()
|
||||
awful.widget.watch(
|
||||
"rfkill list bluetooth",
|
||||
5,
|
||||
function(stdout)
|
||||
local icon = icondir .. "bluetooth"
|
||||
if stdout:match('Soft blocked: yes') or stdout:gsub("\n", "") == '' then
|
||||
icon = icon .. "-off"
|
||||
bluetooth_state = "off"
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n")
|
||||
else
|
||||
icon = icon .. "-on"
|
||||
bluetooth_state = "on"
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[ bluetoothctl info | grep Name: | awk '{ first = $1; $1 = ""; print $0 }' ]],
|
||||
function(stdout2)
|
||||
if stdout2 == nil or stdout2:gsub("\n", "") == "" then
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently not connected")
|
||||
else
|
||||
bluetooth_tooltip:set_text("Bluetooth is turned " .. bluetooth_state .. "\n" .. "You are currently connected to:" .. connected_device)
|
||||
connected_device = stdout2
|
||||
end
|
||||
end
|
||||
end
|
||||
) ]]
|
||||
end
|
||||
}
|
||||
)
|
||||
end
|
||||
bluetooth_widget.icon_margin.icon_layout.icon:set_image(gears.color.recolor_image(icon .. ".svg", color.color["Grey900"]))
|
||||
end,
|
||||
bluetooth_widget
|
||||
)
|
||||
|
||||
-- Signals
|
||||
Hover_signal(bluetooth_widget, color.color["Blue200"])
|
||||
@@ -106,24 +87,45 @@ return function()
|
||||
bluetooth_widget:connect_signal(
|
||||
"button::press",
|
||||
function()
|
||||
if bluetooth_state == "on" then
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl power off",
|
||||
function(stdout)
|
||||
get_bluetooth_information()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"rfkill list bluetooth",
|
||||
function(stdout)
|
||||
if stdout:gsub("\n", "") == '' then
|
||||
if bluetooth_state == "on" then
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[
|
||||
rfkill unblock bluetooth
|
||||
sleep 1
|
||||
bluetoothctl power on
|
||||
]],
|
||||
function()
|
||||
naughty.notify({
|
||||
Title = "System Notification",
|
||||
app_name = "Bluetooth",
|
||||
message = "Bluetooth activated"
|
||||
})
|
||||
end
|
||||
)
|
||||
else
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[
|
||||
bluetoothctl power off
|
||||
rfkill block bluetooth
|
||||
]],
|
||||
function()
|
||||
naughty.notify({
|
||||
Title = "System Notification",
|
||||
app_name = "Bluetooth",
|
||||
message = "Bluetooth deactivated"
|
||||
})
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
else
|
||||
awful.spawn.easy_async_with_shell(
|
||||
"bluetoothctl power on",
|
||||
function(stdout)
|
||||
get_bluetooth_information()
|
||||
end
|
||||
)
|
||||
end
|
||||
end
|
||||
)
|
||||
end
|
||||
)
|
||||
|
||||
get_bluetooth_information()
|
||||
return bluetooth_widget
|
||||
end
|
||||
|
||||
@@ -84,7 +84,6 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
tag_widget:buttons(create_buttons(buttons, object))
|
||||
|
||||
local text, bg_color, bg_image, icon, args = label(object, tag_label)
|
||||
local naughty = require("naughty")
|
||||
tag_label:set_text(object.index)
|
||||
if object.urgent == true then
|
||||
tag_widget:set_bg(color.color["RedA200"])
|
||||
|
||||
@@ -64,10 +64,6 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
if buttons then
|
||||
local btns = {}
|
||||
for _, b in ipairs(buttons) do
|
||||
-- Create a proxy button object: it will receive the real
|
||||
-- press and release events, and will propagate them to the
|
||||
-- button object the user provided, but with the object as
|
||||
-- argument.
|
||||
local btn = awful.button {
|
||||
modifiers = b.modifiers,
|
||||
button = b.button,
|
||||
@@ -93,7 +89,11 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
else
|
||||
local text_full = text:match('>(.-)<')
|
||||
if text_full then
|
||||
text = object.class:sub(1, 20)
|
||||
if object.class == nil then
|
||||
text = object.name
|
||||
else
|
||||
text = object.class:sub(1, 20)
|
||||
end
|
||||
task_tool_tip:set_text(text_full)
|
||||
task_tool_tip:add_to_object(task_widget)
|
||||
else
|
||||
@@ -110,6 +110,7 @@ local list_update = function(widget, buttons, label, data, objects)
|
||||
task_widget.container.layout_it.margin.layout_icon.icon:set_image(Get_icon("Papirus-Dark", object))
|
||||
widget:add(task_widget)
|
||||
widget:set_spacing(dpi(6))
|
||||
|
||||
local old_wibox, old_cursor, old_bg
|
||||
task_widget:connect_signal(
|
||||
"mouse::enter",
|
||||
|
||||
Reference in New Issue
Block a user