-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'rabbithole-theme-workspacemenu' into rabbithole-theme
- Loading branch information
Showing
6 changed files
with
234 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,77 @@ | ||
-------------------------------------------------------------------------------------------------------------- | ||
-- This is the statusbar, every widget, module and so on is combined to all the stuff you see on the screen -- | ||
-------------------------------------------------------------------------------------------------------------- | ||
-- Awesome Libs | ||
local awful = require("awful") | ||
local color = require("src.theme.colors") | ||
local dpi = require("beautiful").xresources.apply_dpi | ||
local gears = require("gears") | ||
local wibox = require("wibox") | ||
|
||
return function(s, widgets) | ||
|
||
local top_right = awful.popup { | ||
widget = wibox.container.background, | ||
ontop = false, | ||
bg = 'DeepPurpleA700', --color["PinkA100"], | ||
visible = true, | ||
screen = s, | ||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end, | ||
shape = function(cr, width, height) | ||
gears.shape.rounded_rect(cr, width, height, 10) | ||
end | ||
} | ||
|
||
top_right:struts { | ||
top = 55 | ||
} | ||
-- Custom local libraries | ||
local color = require("src.theme.colors") | ||
|
||
local function prepare_widgets(widgets) | ||
local layout = { | ||
forced_height = 40, | ||
layout = wibox.layout.fixed.horizontal | ||
-- This returns a widget for the right bar | ||
return function(s, widgets) | ||
-- create right wibar as a floating popup widget | ||
local top_right = awful.popup { | ||
widget = wibox.container.background, | ||
ontop = false, | ||
bg = color["BlueA400"], | ||
visible = true, | ||
screen = s, | ||
placement = function(c) awful.placement.top_right(c, { margins = dpi(10) }) end, | ||
-- rounded edges | ||
shape = function(cr, width, height) | ||
gears.shape.rounded_rect(cr, width, height, 10) | ||
end | ||
} | ||
-- this sets the distance between the top of the screen and the clients | ||
top_right:struts { | ||
top = 55 | ||
} | ||
for i, widget in pairs(widgets) do | ||
if i == 1 then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(6), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
elseif i == #widgets then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(6), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
else | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
end | ||
|
||
local function prepare_widgets(widgets) | ||
local layout = { | ||
forced_height = 40, | ||
layout = wibox.layout.fixed.horizontal | ||
} | ||
for i, widget in pairs(widgets) do | ||
if i == 1 then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(6), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
elseif i == #widgets then | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(6), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
else | ||
table.insert(layout, | ||
{ | ||
widget, | ||
left = dpi(3), | ||
right = dpi(3), | ||
top = dpi(6), | ||
bottom = dpi(6), | ||
widget = wibox.container.margin | ||
}) | ||
end | ||
end | ||
return layout | ||
return layout | ||
end | ||
|
||
top_right:setup { | ||
nil, | ||
nil, | ||
prepare_widgets(widgets), | ||
layout = wibox.layout.align.horizontal | ||
} | ||
top_right:setup { | ||
nil, | ||
nil, | ||
prepare_widgets(widgets), | ||
layout = wibox.layout.align.horizontal | ||
} | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
-- Awesome libs | ||
local wibox = require("wibox") | ||
local gears = require("gears") | ||
|
||
-- Define the button widget function | ||
local function create_button_widget(args) | ||
local args = args or {} | ||
local bg_normal = args.bg_normal or "#333333" | ||
local bg_hover = args.bg_hover or "#444444" | ||
local bg_press = args.bg_press or "#555555" | ||
local fg_normal = args.fg_normal or "#ffffff" | ||
local fg_hover = args.fg_hover or "#ffffff" | ||
local fg_press = args.fg_press or "#ffffff" | ||
local font = args.font or "sans 10" | ||
local shape = args.shape or function(cr, width, height) gears.shape.rectangle(cr, width, height) end | ||
local shadow = args.shadow or false | ||
local text = args.text or "" | ||
local onclick = args.onclick or function() end | ||
|
||
local button = wibox.widget { | ||
{ | ||
{ | ||
{ | ||
text = text, | ||
font = font, | ||
align = "center", | ||
valign = "center", | ||
widget = wibox.widget.textbox | ||
}, | ||
margins = 5, | ||
widget = wibox.container.margin | ||
}, | ||
bg = bg_normal, | ||
shape = shape, | ||
widget = wibox.container.background | ||
}, | ||
forced_width = 100, | ||
forced_height = 30, | ||
widget = wibox.container.constraint | ||
} | ||
|
||
-- Change button background color and text color on hover and press | ||
button:connect_signal("mouse::enter", function() | ||
button:get_children_by_id("bg")[1].bg = bg_hover | ||
button:get_children_by_id("text")[1].markup = "<b>" .. text .. "</b>" | ||
button:get_children_by_id("text")[1].fg = fg_hover | ||
end) | ||
button:connect_signal("mouse::leave", function() | ||
button:get_children_by_id("bg")[1].bg = bg_normal | ||
button:get_children_by_id("text")[1].markup = text | ||
button:get_children_by_id("text")[1].fg = fg_normal | ||
end) | ||
button:connect_signal("button::press", function() | ||
button:get_children_by_id("bg")[1].bg = bg_press | ||
button:get_children_by_id("text")[1].fg = fg_press | ||
end) | ||
button:connect_signal("button::release", function() | ||
button:get_children_by_id("bg")[1].bg = bg_hover | ||
button:get_children_by_id("text")[1].fg = fg_hover | ||
onclick() | ||
end) | ||
|
||
-- Add a shadow to the button if specified | ||
if shadow then | ||
button = wibox.widget { | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
shape = shape, | ||
widget = wibox.container.background | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
}, | ||
widget = wibox.container.background | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
}, | ||
widget = wibox.container.background | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
}, | ||
widget = wibox.container.background | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
}, | ||
widget = wibox.container.background | ||
} | ||
button = wibox.widget { | ||
{ | ||
{ | ||
button, | ||
widget = wibox.container.background | ||
}, | ||
widget = wibox.container.margin | ||
}, | ||
shape = shape, | ||
widget = wibox.container.background | ||
} | ||
end | ||
|
||
return button | ||
end |