added some keyboard shortcuts to README and lots of cleanup

This commit is contained in:
2021-07-15 13:06:48 -04:00
parent 8e825dbde4
commit 68f85b91b8
57 changed files with 110 additions and 2091 deletions

View File

@@ -167,59 +167,6 @@ dashboard:buttons(gears.table.join( -- Middle click - Hide dashboard
awful.button({}, 2, function() dashboard_hide() end),
awful.button({}, 3, function() dashboard_hide() end)))
local profile_picture = os.getenv("HOME") ..
"/.face"
local profile = wibox.widget {
wibox.widget {
{
{
{
{
image = profile_picture,
resize = true,
widget = wibox.widget.imagebox
},
resize = true,
top = dpi(12),
right = dpi(12),
left = dpi(12),
widget = wibox.container.margin
},
bg = beautiful.groups_bg,
shape = panel_style,
widget = wibox.container.background
},
forced_width = dpi(244),
forced_height = dpi(244),
visible = true,
bg = beautiful.bg_normal,
shape = panel_style,
widget = wibox.container.background
},
wibox.widget {
{
wibox.widget {
text = '@' .. username,
font = beautiful.font_large,
align = 'center',
valign = 'center',
widget = wibox.widget.textbox
},
bottom = dpi(8),
widget = wibox.container.margin
},
fg = beautiful.primary.hue_500,
widget = wibox.container.background
},
layout = wibox.layout.fixed.vertical
},
visible = true,
bg = beautiful.bg_normal,
shape = panel_style,
widget = wibox.container.background
}
local power_options = wibox.widget {
{
poweroff,
@@ -230,7 +177,7 @@ local power_options = wibox.widget {
layout = wibox.layout.flex.horizontal
},
visible = true,
bg = beautiful.primary.hue_900,
bg = beautiful.bg_normal,
shape = panel_style,
widget = wibox.container.background
}
@@ -242,19 +189,7 @@ local search_button = wibox.widget {
layout = wibox.layout.fixed.vertical
},
visible = true,
bg = beautiful.primary.hue_200,
shape = panel_style,
widget = wibox.container.background
}
local close_button = wibox.widget {
{
close,
bg = beautiful.primary.hue_600,
layout = wibox.layout.fixed.vertical
},
visible = true,
bg = beautiful.primary.hue_350,
bg = beautiful.bg_normal,
shape = panel_style,
widget = wibox.container.background
}
@@ -292,145 +227,6 @@ local hardware_monitor = wibox.widget {
widget = wibox.container.background
}
local cal = require('widget.calendar')
--[[local calwidget = wibox.widget {
{
nil,
{cal, margins = dpi(16), widget = wibox.container.margin},
nil,
layout = wibox.layout.flex.horizontal
},
resize = true,
shape = panel_style,
bg = beautiful.bg_normal,
widget = wibox.container.background
}]]
-- Fortune widget Credits: u/EmpressNoodle, github/elenapan
local fortune_command = "fortune -n 140 -s"
local fortune_update_interval = 3600
-- local fortune_command = "fortune -n 140 -s computers"
local fortune = wibox.widget {
font = "Roboto 11",
text = "You so poor you don't even have a cookie yet...",
widget = wibox.widget.textbox
}
local update_fortune = function()
awful.spawn.easy_async_with_shell(fortune_command, function(out)
-- Remove trailing whitespaces
out = out:gsub('^%s*(.-)%s*$', '%1')
fortune.markup = "<i>" .. out .. "</i>"
end)
end
gears.timer {
autostart = true,
timeout = fortune_update_interval,
single_shot = false,
call_now = true,
callback = update_fortune
}
local fortune_widget = wibox.widget {
{
{fortune, layout = wibox.layout.flex.horizontal},
margins = dpi(16),
widget = wibox.container.margin
},
bg = beautiful.primary.hue_700,
fg = beautiful.primary.hue_900,
shape = panel_style,
forced_height = dpi(112),
widget = wibox.container.background
}
local uptime_text = wibox.widget.textbox()
uptime_text.font = "Roboto 10"
uptime_text.valign = "center"
awful.widget.watch("uptime -p | sed 's/^...//'", 60, function(_, stdout)
local out = stdout:gsub('^%s*(.-)%s*up', '%1')
uptime_text.text = out
end)
local uptime_widget = wibox.widget {
{
{
{
image = icons.uptime,
resize = true,
forced_width = dpi(24),
widget = wibox.widget.imagebox
},
uptime_text,
spacing = dpi(8),
layout = wibox.layout.fixed.horizontal
},
margins = dpi(16),
widget = wibox.container.margin
},
bg = beautiful.bg_normal,
shape = panel_style,
forced_height = dpi(48),
forced_width = dpi(182),
widget = wibox.container.background
}
-- Bookmarks
function reddit_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "reddit.com")
end
function youtube_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "youtube.com")
end
function linkedin_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "linkedin.com")
end
function github_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "github.com")
end
function deviantart_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "deviantart.com")
end
function codeforces_command()
dashboard_hide()
awful.spawn(apps.default.browser .. " " .. "codeforces.com")
end
function files_command(directory)
dashboard_hide()
awful.spawn(apps.default.files .. " " .. directory)
end
local reddit = buildButton(icons.reddit, 'Reddit')
reddit:connect_signal('button::release', function() reddit_command() end)
local youtube = buildButton(icons.youtube, 'Youtube')
youtube:connect_signal('button::release', function() youtube_command() end)
local linkedin = buildButton(icons.linkedin, 'Linkedin')
linkedin:connect_signal('button::release', function() linkedin_command() end)
local github = buildButton(icons.github, 'Github')
github:connect_signal('button::release', function() github_command() end)
local deviantart = buildButton(icons.deviantart, 'Deviantart')
deviantart:connect_signal('button::release', function() deviantart_command() end)
local codeforces = buildButton(icons.codeforces, 'Codeforces')
codeforces:connect_signal('button::release', function() codeforces_command() end)
local home = buildLabel('Home')
home:connect_signal('button::release', function() files_command(".") end)
@@ -453,23 +249,9 @@ local documents = buildLabel('Documents')
documents:connect_signal('button::release',
function() files_command("Documents") end)
local bookmarks = wibox.widget {
{
{reddit, youtube, linkedin, layout = wibox.layout.flex.horizontal},
{github, deviantart, codeforces, layout = wibox.layout.ratio.horizontal},
layout = wibox.layout.fixed.vertical
},
visible = true,
bg = beautiful.bg_normal,
shape = panel_style,
forced_width = dpi(182),
widget = wibox.container.background
}
local places = wibox.widget {
{
{
home,
{ home,
desktop,
downloads,
pictures,
@@ -494,7 +276,6 @@ dashboard:setup{
{
{
search_button,
close_button,
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
@@ -503,15 +284,12 @@ dashboard:setup{
{
quick_settings,
hardware_monitor,
fortune_widget,
forced_width = dpi(300),
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
{
bookmarks,
places,
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
spacing = dpi(10),
@@ -519,19 +297,12 @@ dashboard:setup{
},
{
power_options,
uptime_widget,
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
},
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
{
profile,
calWidget,
spacing = dpi(10),
layout = wibox.layout.fixed.vertical
},
spacing = dpi(10),
layout = wibox.layout.fixed.horizontal
},