Adding lots of changes
This commit is contained in:
		
							parent
							
								
									d4f511d8ce
								
							
						
					
					
						commit
						3488174a83
					
				
					 19 changed files with 462 additions and 98 deletions
				
			
		| 
						 | 
				
			
			@ -49,7 +49,7 @@ ruled.notification.connect_signal('request::rules', function()
 | 
			
		|||
			fg 					= '#ffffff',
 | 
			
		||||
			margin 				= dpi(16),
 | 
			
		||||
			position 			= 'bottom_middle',
 | 
			
		||||
			implicit_timeout	= 0
 | 
			
		||||
			implicit_timeout	= 15
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -62,7 +62,7 @@ ruled.notification.connect_signal('request::rules', function()
 | 
			
		|||
			fg 					= beautiful.fg_normal,
 | 
			
		||||
			margin 				= dpi(16),
 | 
			
		||||
			position 			= 'bottom_middle',
 | 
			
		||||
			implicit_timeout 	= 5
 | 
			
		||||
			implicit_timeout 	= 8
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -228,6 +228,7 @@ naughty.connect_signal("request::display", function(n)
 | 
			
		|||
							},
 | 
			
		||||
							bg     = beautiful.bg_normal,
 | 
			
		||||
							id     = "background_role",
 | 
			
		||||
                            shape = gears.shape.rounded_rect,
 | 
			
		||||
							widget = naughty.container.background,
 | 
			
		||||
						},
 | 
			
		||||
						strategy = "min",
 | 
			
		||||
| 
						 | 
				
			
			@ -247,9 +248,9 @@ naughty.connect_signal("request::display", function(n)
 | 
			
		|||
			},
 | 
			
		||||
			-- Margin of the fake BG to have a space between notification and the screen edge
 | 
			
		||||
			-- margins = dpi(15),--beautiful.notification_margin,
 | 
			
		||||
            right = dpi(20),
 | 
			
		||||
            left = dpi(20),
 | 
			
		||||
            bottom = dpi(20),
 | 
			
		||||
            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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										187
									
								
								awesome/rc.lua
									
										
									
									
									
								
							
							
						
						
									
										187
									
								
								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")
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +50,7 @@ require('module.backdrop')
 | 
			
		|||
-- require('module.menu')
 | 
			
		||||
require('module.volume-osd')
 | 
			
		||||
require('module.brightness-osd')
 | 
			
		||||
require('module.dynamic-wallpaper')
 | 
			
		||||
-- require('module.dynamic-wallpaper')
 | 
			
		||||
-- require('module.battery-notifier')
 | 
			
		||||
-- require('module.lockscreen')
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -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,8 +767,14 @@ awful.rules.rules = {
 | 
			
		|||
    -- Set Feh center
 | 
			
		||||
    { rule = {class = "feh"},
 | 
			
		||||
      properties = {
 | 
			
		||||
          placement = awful.placement.centered
 | 
			
		||||
          placement = awful.placement.centered,
 | 
			
		||||
          floating = true
 | 
			
		||||
    }},
 | 
			
		||||
    { rule = {class = "mpv"},
 | 
			
		||||
      properties = {
 | 
			
		||||
          floating = true
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
-- }}}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -720,9 +834,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)
 | 
			
		||||
| 
						 | 
				
			
			@ -735,3 +849,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