Browse Source

sidebar with tooltips

main
Kristof Vandam 5 years ago
parent
commit
142a90fcdd
  1. 5
      bindings/keys.lua
  2. BIN
      modules/.sidepanel.lua.swp
  3. 25
      modules/appdrawer.lua
  4. 19
      modules/panel.lua
  5. 90
      modules/sidepanel.lua
  6. 7
      preferences/apps.lua
  7. 3
      rc.lua
  8. 7
      themes/pixelos/init.lua

5
bindings/keys.lua

@ -32,7 +32,10 @@ awful.keyboard.append_global_keybindings({
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "p", function() menubar.show() end,
awful.key({ modkey }, "p", function()
menubar.show()
screen.emit_signal('appdrawer::open', awful.screen.focused())
end,
{description = "show the menubar", group = "launcher"}),
})

BIN
modules/.sidepanel.lua.swp

Binary file not shown.

25
modules/appdrawer.lua

@ -0,0 +1,25 @@
local awful = require('awful')
local wibox = require('wibox')
local gears = require('gears')
local timer = require("gears.timer")
local beautiful = require('beautiful')
local dpi = beautiful.xresources.apply_dpi
screen.connect_signal("appdrawer::open", function(s)
local drawer = wibox({
position = "left",
ontop = true,
stretch = false,
width = dpi(64),
height = s.workarea.height,
visible = true,
y = 48
})
drawer:setup {
expand = "none",
layout = wibox.layout.align.vertical,
}
end)

19
modules/panel.lua

@ -73,20 +73,6 @@ screen.connect_signal("request::desktop_decoration", function(s)
}
}
-- Create a tasklist widget
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.currenttags,
buttons = {
awful.button({ }, 1, function (c)
c:activate { context = "tasklist", action = "toggle_minimization" }
end),
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({ }, 4, function() awful.client.focus.byidx( 1) end),
awful.button({ }, 5, function() awful.client.focus.byidx(-1) end),
}
}
-- Create the wibox
s.mywibox = awful.wibar({ position = "top", height = 48, screen = s })
@ -97,8 +83,7 @@ screen.connect_signal("request::desktop_decoration", function(s)
layout = wibox.layout.fixed.horizontal,
mylauncher,
s.mytaglist,
s.mypromptbox,
s.mytasklist
s.mypromptbox
},
nil,
-- s.mytasklist, -- Middle widget
@ -111,4 +96,4 @@ screen.connect_signal("request::desktop_decoration", function(s)
date,
},
}
end)
end)

90
modules/sidepanel.lua

@ -1,33 +1,91 @@
local awful = require('awful')
local wibox = require('wibox')
local gears = require('gears')
local timer = require("gears.timer")
local beautiful = require('beautiful')
local dpi = beautiful.xresources.apply_dpi
screen.connect_signal("request::desktop_decoration", function(s)
local dock = awful.wibox({
x = s.workarea.width,
y = 0,
local dock = wibox({
position = "left",
ontop = true,
stretch = false,
width = dpi(64),
height = s.workarea.height,
visible = false
})
local dock_trigger = awful.wibox({
visible = false,
y = 48
})
s.mytasklist = awful.widget.tasklist {
screen = s,
filter = awful.widget.tasklist.filter.allscreen,
buttons = {
awful.button({ }, 1, function (c)
c:activate { context = "tasklist", action = "toggle_minimization" }
local t = c.first_tag
t:view_only()
end),
awful.button({ }, 3, function() awful.menu.client_list { theme = { width = 250 } } end),
awful.button({ }, 4, function() awful.client.focus.byidx( 1) end),
awful.button({ }, 5, function() awful.client.focus.byidx(-1) end),
},
layout = {
layout = wibox.layout.fixed.vertical
},
widget_template = {
{
wibox.widget.base.make_widget(),
forced_height = 5,
id = 'background_role',
widget = wibox.container.background,
},
{
{
id = 'clienticon',
widget = awful.widget.clienticon,
},
margins = 10,
widget = wibox.container.margin
},
nil,
create_callback = function(self, c, index, objects)
self:get_children_by_id('clienticon')[1].client = c
local tooltip = awful.tooltip({
objects = { self },
timer_function = function()
return c.name
end,
})
-- Then you can set tooltip props if required (should work as is)
tooltip.align = "left"
tooltip.mode = "outside"
tooltip.preferred_positions = {"left"}
tooltip.preferred_alignments = {"middle"}
end,
layout = wibox.layout.align.vertical,
},
}
dock:setup {
expand = "none",
layout = wibox.layout.align.vertical,
s.mytasklist,
}
local dock_trigger = awful.wibox({
position = "left",
width = 1,
bg = "#00000000",
opacity = 0,
ontop = true,
visible = true
})
local dock_hide_timer = timer({ timeout = 1})
dock_trigger:geometry({ width = 5, height = s.workarea.height })
dock_hide_timer:connect_signal("timeout", function() dock.visible = false; dock_hide_timer:stop() end )
dock_trigger:connect_signal("mouse::enter", function() dock.visible = true end)
dock:connect_signal("mouse::enter", function() if dock_hide_timer.started then dock_hide_timer:stop() end end)
dock:connect_signal("mouse::leave", function() dock_hide_timer:again() end)
end)
})
local dock_hide_timer = timer({ timeout = 1})
dock_trigger:geometry({ width = 5, height = s.workarea.height })
dock_hide_timer:connect_signal("timeout", function() dock.visible = false; dock_hide_timer:stop() end )
dock_trigger:connect_signal("mouse::enter", function() dock.visible = true end)
dock:connect_signal("mouse::enter", function() if dock_hide_timer.started then dock_hide_timer:stop() end end)
dock:connect_signal("mouse::leave", function() dock_hide_timer:again() end)
end)

7
preferences/apps.lua

@ -10,10 +10,7 @@ apps.default = {
}
local run_on_start_up = {
"picom",
"redshift",
"unclutter"
}
}
function apps.autostart()
for _, app in ipairs(run_on_start_up) do
@ -27,5 +24,3 @@ local run_on_start_up = {
end
apps.autostart()

3
rc.lua

@ -14,7 +14,8 @@ require('preferences.layouts')
require('modules.client')
require('modules.titlebar')
require('modules.panel')
-- require('modules.sidepanel')
require('modules.sidepanel')
require('modules.appdrawer')
require('bindings.keys')
-- BELOW NEEDS CLEANUP --

7
themes/pixelos/init.lua

@ -7,8 +7,13 @@ local assets = filesystem.get_configuration_dir() .. '/theme/assets/'
local theme = {}
-- Icon
theme.icon_theme = 'Papirus-Dark'
-- Font
theme.font = 'ProggyCleanTTCE Nerd Font Mono 12'
-- theme.font = 'ProggyCleanTTCE Nerd Font Mono 12'
theme.font = 'VictorMono Nerd Font Mono 10'
-- theme.font = 'Iosevka Nerd Font Mono 10'
-- Misc
-- -- Wallpaper Image

Loading…
Cancel
Save