Merge branch 'master' of github.com:ChrisCochrun/.dotfiles
This commit is contained in:
commit
a2eac14c07
19 changed files with 497 additions and 134 deletions
|
@ -15,9 +15,9 @@ naughty.config.defaults.ontop = true
|
|||
naughty.config.defaults.icon_size = dpi(32)
|
||||
naughty.config.defaults.timeout = 5
|
||||
naughty.config.defaults.title = 'System Notification'
|
||||
naughty.config.defaults.margin = dpi(16)
|
||||
naughty.config.defaults.margin = dpi(20)
|
||||
naughty.config.defaults.border_width = 0
|
||||
naughty.config.defaults.position = 'top_right'
|
||||
naughty.config.defaults.position = 'bottom_middle'
|
||||
naughty.config.defaults.shape = function(cr, w, h) gears.shape.rounded_rect(cr, w, h, dpi(6)) end
|
||||
|
||||
-- Apply theme variables
|
||||
|
@ -44,12 +44,12 @@ ruled.notification.connect_signal('request::rules', function()
|
|||
ruled.notification.append_rule {
|
||||
rule = { urgency = 'critical' },
|
||||
properties = {
|
||||
font = 'SF Pro Text Bold 10',
|
||||
font = 'VictorMono Nerd Font 10',
|
||||
bg = '#ff0000',
|
||||
fg = '#ffffff',
|
||||
margin = dpi(16),
|
||||
position = 'top_right',
|
||||
implicit_timeout = 0
|
||||
position = 'bottom_middle',
|
||||
implicit_timeout = 15
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -57,12 +57,12 @@ ruled.notification.connect_signal('request::rules', function()
|
|||
ruled.notification.append_rule {
|
||||
rule = { urgency = 'normal' },
|
||||
properties = {
|
||||
font = 'SF Pro Text Regular 10',
|
||||
font = 'VictorMono Nerd Font 10',
|
||||
bg = beautiful.transparent,
|
||||
fg = beautiful.fg_normal,
|
||||
margin = dpi(16),
|
||||
position = 'top_right',
|
||||
implicit_timeout = 5
|
||||
position = 'bottom_middle',
|
||||
implicit_timeout = 8
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -70,11 +70,11 @@ ruled.notification.connect_signal('request::rules', function()
|
|||
ruled.notification.append_rule {
|
||||
rule = { urgency = 'low' },
|
||||
properties = {
|
||||
font = 'SF Pro Text Regular 10',
|
||||
font = 'VictorMono Nerd Font 10',
|
||||
bg = beautiful.transparent,
|
||||
fg = beautiful.fg_normal,
|
||||
margin = dpi(16),
|
||||
position = 'top_right',
|
||||
position = 'bottom_middle',
|
||||
implicit_timeout = 5
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
local actions_template = wibox.widget {
|
||||
notification = n,
|
||||
base_layout = wibox.widget {
|
||||
spacing = dpi(0),
|
||||
spacing = dpi(4),
|
||||
layout = wibox.layout.flex.horizontal
|
||||
},
|
||||
widget_template = {
|
||||
|
@ -126,7 +126,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
{
|
||||
{
|
||||
id = 'text_role',
|
||||
font = 'SF Pro Text Regular 10',
|
||||
font = 'VictorMono Nerd Font 10',
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
widget = wibox.container.place
|
||||
|
@ -135,10 +135,10 @@ naughty.connect_signal("request::display", function(n)
|
|||
},
|
||||
bg = beautiful.groups_bg,
|
||||
shape = gears.shape.rounded_rect,
|
||||
forced_height = dpi(30),
|
||||
forced_height = dpi(35),
|
||||
widget = wibox.container.background
|
||||
},
|
||||
margins = dpi(4),
|
||||
margins = dpi(8),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
style = { underline_normal = false, underline_selected = true },
|
||||
|
@ -164,7 +164,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
{
|
||||
{
|
||||
markup = n.app_name or 'System Notification',
|
||||
font = 'SF Pro Text Bold 10',
|
||||
font = 'VictorMono Nerd Font 10',
|
||||
align = 'center',
|
||||
valign = 'center',
|
||||
widget = wibox.widget.textbox
|
||||
|
@ -217,7 +217,7 @@ naughty.connect_signal("request::display", function(n)
|
|||
margins = dpi(0),
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
bg = beautiful.transparent,
|
||||
bg = beautiful.bg_normal,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
-- Notification action list
|
||||
|
@ -226,8 +226,9 @@ naughty.connect_signal("request::display", function(n)
|
|||
spacing = dpi(4),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
},
|
||||
bg = beautiful.transparent,
|
||||
bg = beautiful.bg_normal,
|
||||
id = "background_role",
|
||||
shape = gears.shape.rounded_rect,
|
||||
widget = naughty.container.background,
|
||||
},
|
||||
strategy = "min",
|
||||
|
@ -240,13 +241,17 @@ naughty.connect_signal("request::display", function(n)
|
|||
},
|
||||
-- Anti-aliasing container
|
||||
-- Real BG
|
||||
bg = beautiful.background,
|
||||
bg = beautiful.bg_normal,
|
||||
-- This will be the anti-aliased shape of the notification
|
||||
shape = gears.shape.rounded_rect,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
-- Margin of the fake BG to have a space between notification and the screen edge
|
||||
margins = dpi(5),--beautiful.notification_margin,
|
||||
-- margins = dpi(15),--beautiful.notification_margin,
|
||||
right = dpi(10),
|
||||
left = dpi(10),
|
||||
bottom = dpi(10),
|
||||
top = dpi(5),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ local spawn = require('awful.spawn')
|
|||
|
||||
screen.connect_signal("request::desktop_decoration", function(s)
|
||||
|
||||
s.show_vol_osd = false
|
||||
s.show_vol_osd = true
|
||||
|
||||
local osd_header = wibox.widget {
|
||||
text = 'Volume',
|
||||
|
@ -59,7 +59,7 @@ screen.connect_signal("request::desktop_decoration", function(s)
|
|||
|
||||
local volume_level = vol_osd_slider:get_value()
|
||||
|
||||
spawn('amixer -D pulse sset Master ' .. volume_level .. '%', false)
|
||||
spawn('amixer set Master ' .. volume_level .. '%', false)
|
||||
|
||||
-- Update textbox widget text
|
||||
osd_value.text = volume_level .. '%'
|
||||
|
@ -141,8 +141,8 @@ screen.connect_signal("request::desktop_decoration", function(s)
|
|||
maximum_height = osd_height,
|
||||
maximum_width = osd_width,
|
||||
offset = dpi(5),
|
||||
shape = gears.shape.rectangle,
|
||||
bg = beautiful.transparent,
|
||||
shape = gears.shape.rounded_rect,
|
||||
bg = "#282a36",
|
||||
preferred_anchors = 'middle',
|
||||
preferred_positions = {'left', 'right', 'top', 'bottom'},
|
||||
|
||||
|
@ -167,7 +167,6 @@ screen.connect_signal("request::desktop_decoration", function(s)
|
|||
widget = wibox.container.margin
|
||||
|
||||
},
|
||||
bg = beautiful.background,
|
||||
shape = gears.shape.rounded_rect,
|
||||
widget = wibox.container.background()
|
||||
}
|
||||
|
@ -214,12 +213,12 @@ screen.connect_signal("request::desktop_decoration", function(s)
|
|||
|
||||
if right_panel and left_panel then
|
||||
if right_panel.visible then
|
||||
awful.placement.bottom_left(focused.volume_osd_overlay, { margins = {
|
||||
awful.placement.bottom_left(focused.volume_osd_overlay, { margins = {
|
||||
left = osd_margin + left_panel.width,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = osd_margin,
|
||||
},
|
||||
},
|
||||
parent = focused }
|
||||
)
|
||||
return
|
||||
|
@ -228,37 +227,37 @@ screen.connect_signal("request::desktop_decoration", function(s)
|
|||
|
||||
if right_panel then
|
||||
if right_panel.visible then
|
||||
awful.placement.bottom_left(focused.volume_osd_overlay, { margins = {
|
||||
awful.placement.bottom_left(focused.volume_osd_overlay, { margins = {
|
||||
left = osd_margin,
|
||||
right = 0,
|
||||
top = 0,
|
||||
bottom = osd_margin,
|
||||
},
|
||||
},
|
||||
parent = focused }
|
||||
)
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
awful.placement.bottom_right(focused.volume_osd_overlay, { margins = {
|
||||
awful.placement.centered(focused.volume_osd_overlay, { margins = {
|
||||
left = 0,
|
||||
right = osd_margin,
|
||||
top = 0,
|
||||
top = dpi(800),
|
||||
bottom = osd_margin,
|
||||
},
|
||||
},
|
||||
parent = focused }
|
||||
)
|
||||
end
|
||||
|
||||
awesome.connect_signal(
|
||||
'module::volume_osd:show',
|
||||
'module::volume_osd:show',
|
||||
function(bool)
|
||||
placement_placer()
|
||||
awful.screen.focused().volume_osd_overlay.visible = bool
|
||||
if bool then
|
||||
timer_rerun()
|
||||
awesome.emit_signal(
|
||||
'module::brightness_osd:show',
|
||||
'module::brightness_osd:show',
|
||||
false
|
||||
)
|
||||
else
|
||||
|
|
226
awesome/rc.lua
226
awesome/rc.lua
|
@ -5,6 +5,8 @@ pcall(require, "luarocks.loader")
|
|||
-- Standard awesome library
|
||||
local gears = require("gears")
|
||||
local awful = require("awful")
|
||||
local xresources = require("beautiful.xresources")
|
||||
local dpi = xresources.apply_dpi
|
||||
require("awful.autofocus")
|
||||
-- Widget and layout library
|
||||
local wibox = require("wibox")
|
||||
|
@ -19,6 +21,8 @@ local hotkeys_popup = require("awful.hotkeys_popup")
|
|||
require("awful.hotkeys_popup.keys")
|
||||
|
||||
|
||||
-- require('layout')
|
||||
|
||||
-- Widgets to add
|
||||
-- local batteryarc_widget = require("awesome-wm-widget.batteryarc-widget.batteryarc")
|
||||
|
||||
|
@ -51,30 +55,30 @@ require('module.brightness-osd')
|
|||
-- require('module.lockscreen')
|
||||
|
||||
|
||||
-- {{{ Error handling
|
||||
-- Check if awesome encountered an error during startup and fell back to
|
||||
-- another config (This code will only ever execute for the fallback config)
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, there were errors during startup!",
|
||||
text = awesome.startup_errors })
|
||||
end
|
||||
-- -- {{{ Error handling
|
||||
-- -- Check if awesome encountered an error during startup and fell back to
|
||||
-- -- another config (This code will only ever execute for the fallback config)
|
||||
-- if awesome.startup_errors then
|
||||
-- naughty.notify({ preset = naughty.config.presets.critical,
|
||||
-- title = "Oops, there were errors during startup!",
|
||||
-- text = awesome.startup_errors })
|
||||
-- end
|
||||
|
||||
-- Handle runtime errors after startup
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal("debug::error", function (err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then return end
|
||||
in_error = true
|
||||
-- -- Handle runtime errors after startup
|
||||
-- do
|
||||
-- local in_error = false
|
||||
-- awesome.connect_signal("debug::error", function (err)
|
||||
-- -- Make sure we don't go into an endless error loop
|
||||
-- if in_error then return end
|
||||
-- in_error = true
|
||||
|
||||
naughty.notify({ preset = naughty.config.presets.critical,
|
||||
title = "Oops, an error happened!",
|
||||
text = tostring(err) })
|
||||
in_error = false
|
||||
end)
|
||||
end
|
||||
-- }}}
|
||||
-- naughty.notify({ preset = naughty.config.presets.critical,
|
||||
-- title = "Oops, an error happened!",
|
||||
-- text = tostring(err) })
|
||||
-- in_error = false
|
||||
-- end)
|
||||
-- end
|
||||
-- -- }}}
|
||||
|
||||
-- {{{ Variable definitions
|
||||
-- Themes define colours, icons, font and wallpapers.
|
||||
|
@ -95,6 +99,7 @@ altkey = "Mod1"
|
|||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
awful.layout.layouts = {
|
||||
awful.layout.suit.magnifier,
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.floating,
|
||||
-- awful.layout.suit.tile.left,
|
||||
|
@ -106,7 +111,6 @@ awful.layout.layouts = {
|
|||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.max,
|
||||
-- awful.layout.suit.max.fullscreen,
|
||||
-- awful.layout.suit.magnifier,
|
||||
-- awful.layout.suit.corner.nw,
|
||||
-- awful.layout.suit.corner.ne,
|
||||
-- awful.layout.suit.corner.sw,
|
||||
|
@ -201,12 +205,57 @@ end
|
|||
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
|
||||
screen.connect_signal("property::geometry", set_wallpaper)
|
||||
|
||||
|
||||
-- mynewpanel:setup {
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- expand = "outside",
|
||||
-- { -- Left widgets
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- -- wibox.container.margin (s.mytaglist,25,0,0,0),
|
||||
-- -- wibox.container.margin (s.mytasklist,25,25,0,0), -- Middle widget
|
||||
-- -- s.myemptywidget,
|
||||
-- spacing = 15
|
||||
-- },
|
||||
-- -- mytextclock,
|
||||
-- { -- Right widgets
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- -- s.myemptywidget,
|
||||
-- -- s.myemptywidget,
|
||||
-- -- s.myrightwidgets,
|
||||
-- },
|
||||
-- }
|
||||
|
||||
awful.screen.connect_for_each_screen(function(s)
|
||||
-- Wallpaper
|
||||
set_wallpaper(s)
|
||||
|
||||
-- Each screen has its own tag table.
|
||||
awful.tag({ "main", "www", "code", "fun"}, s, awful.layout.layouts[1])
|
||||
awful.tag({ "◉", "◉", "◉", "◉"}, s, awful.layout.layouts[1])
|
||||
|
||||
|
||||
yoffset = dpi(35)
|
||||
xoffset = dpi(18)
|
||||
|
||||
mypanel = wibox
|
||||
({
|
||||
x = s.geometry.x + xoffset,
|
||||
y = s.geometry.height - yoffset,
|
||||
height = dpi(25),
|
||||
width = s.geometry.width - (xoffset * 2),
|
||||
ontop = true,
|
||||
stretch = false,
|
||||
type = "dock",
|
||||
screen = s,
|
||||
shape = gears.shape.rounded_bar,
|
||||
-- widget = wibox.widget.textbox
|
||||
bg = beautiful.bg_normal,
|
||||
fg = beautiful.fg_normal,
|
||||
opacity = 0.65,
|
||||
})
|
||||
|
||||
mypanel:struts {
|
||||
bottom = dpi(30)
|
||||
}
|
||||
|
||||
-- Create a promptbox for each screen
|
||||
s.mypromptbox = awful.widget.prompt()
|
||||
|
@ -226,8 +275,11 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
}
|
||||
|
||||
-- Create a systray widget
|
||||
s.mysystray = wibox.widget.systray()
|
||||
|
||||
s.mysystray = {
|
||||
wibox.widget.systray(),
|
||||
-- bg = "#00FF0066",
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
-- Create a tasklist widget
|
||||
-- s.mytasklist = awful.widget.tasklist {
|
||||
-- screen = s,
|
||||
|
@ -251,7 +303,7 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
spacing_widget = {
|
||||
{
|
||||
forced_width = 5,
|
||||
forced_height = 30,
|
||||
forced_height = dpi(20),
|
||||
-- shape = gears.shape.circle,
|
||||
widget = wibox.widget.separator
|
||||
},
|
||||
|
@ -271,7 +323,7 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
id = 'icon_role',
|
||||
widget = wibox.widget.imagebox,
|
||||
},
|
||||
margins = 4,
|
||||
margins = 2,
|
||||
widget = wibox.container.margin,
|
||||
},
|
||||
{
|
||||
|
@ -288,45 +340,88 @@ awful.screen.connect_for_each_screen(function(s)
|
|||
widget = wibox.container.background,
|
||||
},
|
||||
}
|
||||
-- Create the wibox
|
||||
s.mywibox = awful.wibar({ position = "bottom", screen = s })
|
||||
-- Create Battery, Network, and Volume widget
|
||||
s.battery = require('widget.battery')()
|
||||
s.network = require('widget.network')()
|
||||
-- s.volume = require('widget.volume-slider')()
|
||||
s.volume = require('widget.volume')()
|
||||
s.updater = require('widget.package-updater')()
|
||||
|
||||
-- Create the wibox
|
||||
-- s.mywibox = awful.wibar({
|
||||
-- y = s.geometry.y + dpi(1080) - yoffset,
|
||||
-- position = "bottom",
|
||||
-- screen = s})
|
||||
|
||||
s.myrightwidgets =
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.align.horizontal,
|
||||
s.mytasklist, -- Middle widget
|
||||
s.mysystray,
|
||||
s.mylayoutbox,
|
||||
{
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.volume,
|
||||
s.mysystray,
|
||||
s.updater,
|
||||
s.network,
|
||||
s.battery,
|
||||
wibox.container.margin (s.mylayoutbox,0,25,0,0),
|
||||
},
|
||||
-- bg = "#00FF0066",
|
||||
widget = wibox.container.background,
|
||||
}
|
||||
-- Empty widget to use for spacing
|
||||
s.myemptywidget = wibox.widget{
|
||||
markup = '',
|
||||
align = '',
|
||||
valign = '',
|
||||
widget = wibox.widget.textbox
|
||||
}
|
||||
-- Add widgets to the wibox
|
||||
s.mywibox:setup {
|
||||
-- s.mywibox:setup {
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- expand = "outside",
|
||||
-- { -- Left widgets
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- wibox.container.margin (s.mytaglist,25,0,0,0),
|
||||
-- wibox.container.margin (s.mytasklist,25,25,0,0), -- Middle widget
|
||||
-- s.myemptywidget,
|
||||
-- spacing = 15
|
||||
-- },
|
||||
-- mytextclock,
|
||||
-- { -- Right widgets
|
||||
-- layout = wibox.layout.align.horizontal,
|
||||
-- s.myemptywidget,
|
||||
-- s.myemptywidget,
|
||||
-- s.myrightwidgets,
|
||||
-- },
|
||||
-- }
|
||||
|
||||
-- Add widgets to the wibox
|
||||
mypanel:setup {
|
||||
layout = wibox.layout.align.horizontal,
|
||||
expand = "outside",
|
||||
{ -- Left widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
wibox.container.margin (s.mytaglist,25,0,0,0),
|
||||
s.mypromptbox,
|
||||
layout = wibox.layout.align.horizontal,
|
||||
wibox.container.margin (s.mytaglist,15,0,-3,0),
|
||||
wibox.container.margin (s.mytasklist,25,25,0,0), -- Middle widget
|
||||
s.myemptywidget,
|
||||
spacing = 15
|
||||
},
|
||||
wibox.container.margin (s.mytasklist,35,35,0,0), -- Middle widget
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.fixed.horizontal,
|
||||
s.mysystray,
|
||||
-- s.volume,
|
||||
s.updater,
|
||||
s.network,
|
||||
s.battery,
|
||||
mytextclock,
|
||||
wibox.container.margin (s.mylayoutbox,0,25,0,0),
|
||||
{ -- Right widgets
|
||||
layout = wibox.layout.align.horizontal,
|
||||
s.myemptywidget,
|
||||
s.myemptywidget,
|
||||
s.myrightwidgets,
|
||||
},
|
||||
visible = true,
|
||||
}
|
||||
|
||||
mypanel.visible = true
|
||||
-- return mypanel
|
||||
end)
|
||||
-- }}}
|
||||
|
||||
testwibox = wibox {x = 20, y = 10, width = 10, height = 10, ontop = true, bg = "#000000"}
|
||||
|
||||
testwibox:to_widget()
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(gears.table.join(
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||
|
@ -403,6 +498,12 @@ globalkeys = gears.table.join(
|
|||
awful.key({ modkey, "Shift" }, "q", awesome.quit,
|
||||
{description = "quit awesome", group = "awesome"}),
|
||||
|
||||
-- Programs
|
||||
awful.key({ modkey, }, "b", function () awful.spawn("firefox") end,
|
||||
{description = "open firefox", group = "apps"}),
|
||||
awful.key({ modkey, }, "e", function () awful.spawn("emacsclient -c") end,
|
||||
{description = "open emacs frame connected to server", group = "apps"}),
|
||||
|
||||
awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
|
||||
{description = "increase master width factor", group = "layout"}),
|
||||
awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
|
||||
|
@ -434,13 +535,17 @@ globalkeys = gears.table.join(
|
|||
|
||||
-- Volume Keys
|
||||
awful.key({}, "XF86AudioLowerVolume", function ()
|
||||
awful.util.spawn("amixer -q -D pulse sset Master 5%-", false)
|
||||
awful.util.spawn("amixer set Master 5%-", false)
|
||||
awesome.emit_signal('widget::volume')
|
||||
awesome.emit_signal('module::volume_osd:show', true)
|
||||
end),
|
||||
awful.key({}, "XF86AudioRaiseVolume", function ()
|
||||
awful.util.spawn("amixer -q -D pulse sset Master 5%+", false)
|
||||
awful.util.spawn("amixer -q set Master 5%+", false)
|
||||
awesome.emit_signal('widget::volume')
|
||||
awesome.emit_signal('module::volume_osd:show', true)
|
||||
end),
|
||||
awful.key({}, "XF86AudioMute", function ()
|
||||
awful.util.spawn("amixer -D pulse set Master 1+ toggle", false)
|
||||
awful.util.spawn("amixer set Master 1+ toggle", false)
|
||||
end),
|
||||
-- Media Keys
|
||||
awful.key({}, "XF86AudioPlay", function()
|
||||
|
@ -493,7 +598,7 @@ clientkeys = gears.table.join(
|
|||
c:raise()
|
||||
end,
|
||||
{description = "toggle fullscreen", group = "client"}),
|
||||
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
|
||||
awful.key({ modkey, }, "q", function (c) c:kill() end,
|
||||
{description = "close", group = "client"}),
|
||||
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
|
||||
{description = "toggle floating", group = "client"}),
|
||||
|
@ -632,12 +737,15 @@ awful.rules.rules = {
|
|||
"Wpa_gui",
|
||||
"veromix",
|
||||
"xtightvncviewer",
|
||||
"mpv",
|
||||
"gl",
|
||||
"feh"},
|
||||
|
||||
-- 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.
|
||||
name = {
|
||||
"Event Tester", -- xev.
|
||||
"remove images?" -- darktable delete window.
|
||||
},
|
||||
role = {
|
||||
"AlarmWindow", -- Thunderbird's calendar.
|
||||
|
@ -659,9 +767,10 @@ awful.rules.rules = {
|
|||
-- Set Feh center
|
||||
{ rule = {class = "feh"},
|
||||
properties = {
|
||||
placement = awful.placement.centered
|
||||
placement = awful.placement.centered,
|
||||
floating = true
|
||||
}},
|
||||
{ rule = {class = "FelgoLiveClient"},
|
||||
{ rule = {class = "FelgoLiveClient", "mpv"},
|
||||
properties = {floating = true, ontop = true}
|
||||
}
|
||||
}
|
||||
|
@ -723,9 +832,9 @@ client.connect_signal("request::titlebars", function(c)
|
|||
end)
|
||||
|
||||
-- Enable sloppy focus, so that focus follows mouse.
|
||||
client.connect_signal("mouse::enter", function(c)
|
||||
c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
end)
|
||||
-- client.connect_signal("mouse::enter", function(c)
|
||||
-- c:emit_signal("request::activate", "mouse_enter", {raise = false})
|
||||
-- end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
|
||||
|
@ -738,3 +847,4 @@ awful.spawn.with_shell("libinput-gestures-setup start")
|
|||
awful.spawn.with_shell("flameshot")
|
||||
awful.spawn.with_shell("feh --bg-fill ~/Pictures/wallpapers/RoyalKing.png")
|
||||
awful.spawn.with_shell("/usr/lib/polkit-kde-authentication-agent-1")
|
||||
awful.spawn.with_shell("emacs -daemon")
|
||||
|
|
|
@ -15,10 +15,13 @@ local theme = {}
|
|||
|
||||
theme.font = "VictorMono Nerd Font SemiBold 10"
|
||||
|
||||
-- COLORS
|
||||
-- Try to build a theme off of SNAZZY
|
||||
theme.bg_normal = "#282a36"
|
||||
theme.bg_light = "#34353e"
|
||||
theme.bg_focus = "#43454f"
|
||||
theme.bg_urgent = "#ff5c57"
|
||||
theme.bg_minimize = "#78787e"
|
||||
theme.bg_urgent = "#ff5c57"
|
||||
theme.bg_systray = theme.bg_normal
|
||||
|
||||
theme.fg_normal = "#a5a5a9"
|
||||
|
@ -48,7 +51,7 @@ theme.border_marked = "#00000000"
|
|||
--theme.taglist_bg_focus = "#ff0000"
|
||||
|
||||
-- Generate taglist squares:
|
||||
local taglist_square_size = dpi(8)
|
||||
local taglist_square_size = dpi(0)
|
||||
theme.taglist_squares_sel = theme_assets.taglist_squares_sel(
|
||||
taglist_square_size, theme.fg_normal
|
||||
)
|
||||
|
@ -86,17 +89,17 @@ theme.menu_width = dpi(100)
|
|||
theme.wibar_shape = gears.shape.rounded_bar
|
||||
theme.wibar_bg = theme.bg_normal
|
||||
theme.wibar_fg = theme.fg_normal
|
||||
-- theme.wibar_y = 1030
|
||||
-- theme.wibar_x = 0
|
||||
theme.wibar_y = 1030
|
||||
theme.wibar_x = 0
|
||||
-- theme.wibar_stretch = false
|
||||
theme.wibar_border_width = dpi(5)
|
||||
theme.wibar_border_color = nil
|
||||
theme.wibar_border_width = dpi(0)
|
||||
theme.wibar_border_color = ""
|
||||
-- theme.wibar_ontop = nil
|
||||
-- theme.wibar_cursor = nil
|
||||
theme.wibar_opacity = 0.7
|
||||
theme.wibar_opacity = 0.6
|
||||
-- theme.wibar_type = nil
|
||||
theme.wibar_width = dpi(1900)
|
||||
theme.wibar_height = dpi(30)
|
||||
theme.wibar_width = dpi(1850)
|
||||
-- theme.wibar_height = dpi(20)
|
||||
-- theme.wibar_bgimage = nil
|
||||
|
||||
-- Define the image to load
|
||||
|
|
|
@ -5,6 +5,7 @@ function build(widget)
|
|||
local container =
|
||||
wibox.widget {
|
||||
widget,
|
||||
-- bg = beautiful.theme_bg,
|
||||
widget = wibox.container.background
|
||||
}
|
||||
local old_cursor, old_wibox
|
||||
|
|
|
@ -56,7 +56,7 @@ local return_button = function()
|
|||
local widget_button = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
margins = dpi(7),
|
||||
margins = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
|
|
|
@ -40,7 +40,7 @@ local return_button = function()
|
|||
local widget_button = wibox.widget {
|
||||
{
|
||||
widget,
|
||||
margins = dpi(7),
|
||||
margins = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
widget = clickable_container
|
||||
|
@ -119,4 +119,4 @@ local return_button = function()
|
|||
|
||||
end
|
||||
|
||||
return return_button
|
||||
return return_button
|
||||
|
|
150
awesome/widget/volume/init.lua
Normal file
150
awesome/widget/volume/init.lua
Normal file
|
@ -0,0 +1,150 @@
|
|||
local wibox = require('wibox')
|
||||
local gears = require('gears')
|
||||
local awful = require('awful')
|
||||
local beautiful = require('beautiful')
|
||||
local naughty = require('naughty')
|
||||
|
||||
local watch = awful.widget.watch
|
||||
local spawn = awful.spawn
|
||||
|
||||
local dpi = beautiful.xresources.apply_dpi
|
||||
|
||||
local icons = require('theme.icons')
|
||||
|
||||
local return_widget = function ()
|
||||
|
||||
local slider = wibox.widget {
|
||||
nil,
|
||||
{
|
||||
id = 'vol_slider',
|
||||
bar_shape = gears.shape.rounded_rect,
|
||||
bar_height = dpi(2),
|
||||
bar_color = '#ffffff20',
|
||||
bar_active_color = '#f2f2f2EE',
|
||||
handle_color = '#ffffff',
|
||||
handle_shape = gears.shape.circle,
|
||||
handle_width = dpi(15),
|
||||
handle_border_color = '#00000012',
|
||||
handle_border_width = dpi(1),
|
||||
maximum = 100,
|
||||
widget = wibox.widget.slider,
|
||||
},
|
||||
nil,
|
||||
expand = 'none',
|
||||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
|
||||
local volume_slider = slider.vol_slider
|
||||
|
||||
volume_slider:connect_signal(
|
||||
'property::value',
|
||||
function()
|
||||
|
||||
local volume_level = volume_slider:get_value()
|
||||
|
||||
spawn('amixer sset Master ' ..
|
||||
volume_level .. '%',
|
||||
false
|
||||
)
|
||||
|
||||
-- Update volume osd
|
||||
awesome.emit_signal(
|
||||
'module::volume_osd',
|
||||
volume_level
|
||||
)
|
||||
|
||||
end
|
||||
)
|
||||
|
||||
volume_slider:buttons(
|
||||
gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
4,
|
||||
nil,
|
||||
function()
|
||||
if volume_slider:get_value() > 100 then
|
||||
volume_slider:set_value(100)
|
||||
return
|
||||
end
|
||||
volume_slider:set_value(volume_slider:get_value() + 5)
|
||||
end
|
||||
),
|
||||
awful.button(
|
||||
{},
|
||||
5,
|
||||
nil,
|
||||
function()
|
||||
if volume_slider:get_value() < 0 then
|
||||
volume_slider:set_value(0)
|
||||
return
|
||||
end
|
||||
volume_slider:set_value(volume_slider:get_value() - 5)
|
||||
end
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
local update_slider = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[bash -c "amixer get Master"]],
|
||||
function(stdout)
|
||||
|
||||
local volume = string.match(stdout, '(%d?%d?%d)%%')
|
||||
|
||||
-- debugging
|
||||
-- naughty.notify{ title = "Volume changed", message = volume}
|
||||
volume_slider:set_value(tonumber(volume))
|
||||
end
|
||||
)
|
||||
|
||||
end
|
||||
|
||||
-- Update on startup
|
||||
update_slider()
|
||||
|
||||
-- The emit will come from the global keybind
|
||||
awesome.connect_signal(
|
||||
'widget::volume',
|
||||
function()
|
||||
update_slider()
|
||||
end
|
||||
)
|
||||
|
||||
-- The emit will come from the OSD
|
||||
awesome.connect_signal(
|
||||
'widget::volume:update',
|
||||
function(value)
|
||||
volume_slider:set_value(tonumber(value))
|
||||
end
|
||||
)
|
||||
|
||||
local volume_setting = wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
image = icons.volume,
|
||||
resize = true,
|
||||
widget = wibox.widget.imagebox
|
||||
},
|
||||
top = dpi(2),
|
||||
bottom = dpi(2),
|
||||
widget = wibox.container.margin
|
||||
},
|
||||
slider,
|
||||
spacing = dpi(2),
|
||||
layout = wibox.layout.fixed.horizontal
|
||||
|
||||
},
|
||||
left = dpi(2),
|
||||
right = dpi(2),
|
||||
forced_width = dpi(140),
|
||||
-- forced_height = dpi(48),
|
||||
widget = wibox.container.margin
|
||||
}
|
||||
|
||||
return volume_setting
|
||||
end
|
||||
|
||||
return return_widget
|
|
@ -39,7 +39,7 @@ volume_slider:connect_signal(
|
|||
|
||||
local volume_level = volume_slider:get_value()
|
||||
|
||||
spawn('amixer -D pulse sset Master ' ..
|
||||
spawn('amixer set Master ' ..
|
||||
volume_level .. '%',
|
||||
false
|
||||
)
|
||||
|
@ -85,7 +85,7 @@ volume_slider:buttons(
|
|||
|
||||
local update_slider = function()
|
||||
awful.spawn.easy_async_with_shell(
|
||||
[[bash -c "amixer -D pulse sget Master"]],
|
||||
[[bash -c "amixer sget Master"]],
|
||||
function(stdout)
|
||||
|
||||
local volume = string.match(stdout, '(%d?%d?%d)%%')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue