update awesome config
|
@ -1,6 +1,6 @@
|
|||
[submodule "awesome/vicious"]
|
||||
path = awesome/vicious
|
||||
url = http://git.sysphere.org/vicious
|
||||
[submodule "pentadactyl/external/pentadactyl-solarized"]
|
||||
path = pentadactyl/external/pentadactyl-solarized
|
||||
url = https://github.com/claytron/pentadactyl-solarized
|
||||
[submodule "awesome/lain"]
|
||||
path = awesome/lain
|
||||
url = https://github.com/copycat-killer/lain
|
||||
|
|
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 324 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
Before Width: | Height: | Size: 326 B After Width: | Height: | Size: 326 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 329 B |
|
@ -0,0 +1 @@
|
|||
Subproject commit 27ebd0a30d9634ea403a4c9f3c2139c2498faaea
|
286
awesome/rc.lua
|
@ -16,7 +16,12 @@ local beautiful = require("beautiful")
|
|||
-- Notification library
|
||||
local naughty = require("naughty")
|
||||
-- widget library
|
||||
local vicious = require("vicious")
|
||||
local drop = require("scratchdrop")
|
||||
local lain = require("lain")
|
||||
|
||||
|
||||
markup = lain.util.markup
|
||||
|
||||
|
||||
-- {{{ Error handling
|
||||
-- Check if awesome encountered an error during startup and fell back to
|
||||
|
@ -65,7 +70,7 @@ modkey = "Mod4"
|
|||
local layouts =
|
||||
{
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.tile,
|
||||
lain.layout.uselesstile,
|
||||
awful.layout.suit.tile.left,
|
||||
awful.layout.suit.tile.bottom,
|
||||
awful.layout.suit.tile.top,
|
||||
|
@ -75,8 +80,13 @@ local layouts =
|
|||
awful.layout.suit.spiral.dwindle,
|
||||
awful.layout.suit.max,
|
||||
awful.layout.suit.max.fullscreen,
|
||||
awful.layout.suit.magnifier
|
||||
awful.layout.suit.magnifier,
|
||||
lain.layout.termfair,
|
||||
lain.layout.centerwork,
|
||||
lain.layout.centerfair
|
||||
}
|
||||
|
||||
--lain.layout.termfair.nmaster = 3
|
||||
-- }}}
|
||||
|
||||
-- {{{ Wallpaper
|
||||
|
@ -91,63 +101,38 @@ local layouts =
|
|||
-- {{{ Tags
|
||||
-- Define a tag table which hold all screen tags.
|
||||
tags = {}
|
||||
for s = 1, screen.count() do
|
||||
-- Each screen has its own tag table.
|
||||
local tagNames = { "term", "web", "dev", "chat", "edu", "media", "misc", 8, 9 }
|
||||
local tagLayouts = { 1, 2, 2, 2, 1, 1, 1, 1, 1 }
|
||||
if screen.count() == 1 then
|
||||
for s = 1, screen.count() do
|
||||
-- Each screen has its own tag table.
|
||||
local tagNames = { "term", "web", "work1", "irc", "work2", "media", 7, "skype", 9 }
|
||||
local tagLayouts = { 13, 2, 2, 2, 1, 1, 1, 1, 1 }
|
||||
for i,l in ipairs(tagLayouts) do
|
||||
tagLayouts[i] = layouts[l]
|
||||
end
|
||||
tags[s] = awful.tag(tagNames, s, tagLayouts)
|
||||
end
|
||||
else
|
||||
local tagNames1 = {"term", "web", "work1", 4, "work2", "media", 7, 8, 9}
|
||||
local tagLayouts1 = {13, 15, 15, 1, 2, 1, 1, 1, 1}
|
||||
local tagNames2 = {"term", 2, 3, "chat", 5, "music", 7, "skype", 9}
|
||||
local tagLayouts2 = { 13, 15, 2, 2, 1, 2, 1, 2, 1}
|
||||
for s = 1, screen.count() do
|
||||
local tagNames = tagNames1; local tagLayouts = tagLayouts1;
|
||||
if s == 2 then
|
||||
tagNames = tagNames2
|
||||
tagLayouts = tagLayouts2
|
||||
end
|
||||
for i,l in ipairs(tagLayouts) do
|
||||
tagLayouts[i] = layouts[l]
|
||||
end
|
||||
tags[s] = awful.tag(tagNames, s, tagLayouts)
|
||||
awful.tag.setnmaster(3, tags[s][1])
|
||||
awful.tag.setnmaster(2, tags[s][2])
|
||||
end
|
||||
end
|
||||
-- }}}
|
||||
|
||||
|
||||
-- {{{ Menu
|
||||
-- Create a laucher widget and a main menu
|
||||
myawesomemenu = {
|
||||
{ "manual", terminal .. " -e man awesome" },
|
||||
{ "edit config", editor_cmd .. " " .. awesome.conffile },
|
||||
{ "restart", awesome.restart },
|
||||
{ "quit", awesome.quit }
|
||||
}
|
||||
|
||||
-- applications menu
|
||||
myappsmenu = {
|
||||
{ "firefox", "firefox" },
|
||||
{ "luakit", "luakit" },
|
||||
{ "htop", terminal .. " -e htop" },
|
||||
{ "ranger", terminal .. " -e ranger" },
|
||||
{ "chromium", "chromium" },
|
||||
{ "quassel", "quassel" }
|
||||
}
|
||||
-- system
|
||||
mysystemmenu = {
|
||||
{ "lock", function () awful.util.spawn("/home/yorick/dotfiles/bin/lock.sh") end },
|
||||
{ "Suspend", "systemctl suspend" },
|
||||
{ "Restart", "systemctl reboot" },
|
||||
{ "Shutdown", "systemctl poweroff" },
|
||||
}
|
||||
|
||||
mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
|
||||
{ "apps", myappsmenu },
|
||||
{ "system", mysystemmenu },
|
||||
{ "open terminal", terminal }
|
||||
}
|
||||
})
|
||||
|
||||
mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon,
|
||||
menu = mymainmenu })
|
||||
|
||||
|
||||
awful.menu.menu_keys = { up = { "k", "Up" },
|
||||
down = { "j", "Down" },
|
||||
exec = { "l", "Return", "Right" },
|
||||
enter = { "Right" },
|
||||
back = { "h", "Left" },
|
||||
close = { "q", "Escape" },
|
||||
}
|
||||
|
||||
-- {{{ Wibox
|
||||
|
||||
-- stolen spacers
|
||||
|
@ -160,82 +145,24 @@ sqb_left:set_markup("<span color='" .. beautiful.dgrey .. "'>[</span>")
|
|||
|
||||
|
||||
-- clock
|
||||
clock_time = awful.widget.textclock('<span color="#d0d0d0">%H:%M</span>')
|
||||
clock_day = awful.widget.textclock('<span color="#d0d0d0">%a %d/%m</span>')
|
||||
clock = awful.widget.textclock('<span color="#d0d0d0">%H:%M %a %d/%m</span>')
|
||||
clock_icon = wibox.widget.imagebox()
|
||||
clock_icon:set_image(icon_dir .. "/clock.png")
|
||||
|
||||
-- battery
|
||||
battery_widget = wibox.widget.textbox()
|
||||
battery_icon = wibox.widget.imagebox()
|
||||
battery_icon:set_image(icon_dir .. "/bat_empty_01.png") -- todo: change based on fullness
|
||||
do
|
||||
local icon_full = icon_dir .. "/bat_full_01.png"
|
||||
local icon_low = icon_dir .. "/bat_low_01.png"
|
||||
local icon_empty = icon_dir .. "/bat_empty_01.png"
|
||||
local show_Naughtyfication = true
|
||||
local arguments = nil
|
||||
|
||||
if show_Naughtyfication then
|
||||
local battery = nil
|
||||
local battery = require("widgets.battery")
|
||||
local brightness = require("widgets.brightness")
|
||||
local volume = require("widgets.volume")
|
||||
|
||||
local battery_state = {
|
||||
["⌁"] = "unknown",
|
||||
["↯"] = "charged",
|
||||
["+"] = "charging",
|
||||
["-"] = "discharging"
|
||||
}
|
||||
|
||||
function remove_battery()
|
||||
if battery ~= nil then
|
||||
naughty.destroy(battery)
|
||||
battery = nil
|
||||
end
|
||||
function taglist_filter(t, args)
|
||||
if t.selected or #t:clients() > 0 then
|
||||
return awful.widget.taglist.filter.all(t, args)
|
||||
end
|
||||
function add_battery()
|
||||
if arguments == nil then
|
||||
return
|
||||
end
|
||||
remove_battery()
|
||||
local text = "\n" .. battery_state[arguments[1]]
|
||||
if arguments[3] ~= "N/A" then
|
||||
text = text .. "\n" .. arguments[3] .. "h/min remaining"
|
||||
end
|
||||
battery = naughty.notify({
|
||||
text = "<b><span color='" .. beautiful.dgrey .. "'>battery</span></b>\n" .. text,
|
||||
timeout = 0,
|
||||
screen = mouse.screen,
|
||||
opacity = 0.8,
|
||||
--ontop = true,
|
||||
})
|
||||
end
|
||||
|
||||
battery_widget:connect_signal("mouse::enter", add_battery)
|
||||
battery_widget:connect_signal("mouse::leave", remove_battery)
|
||||
|
||||
end
|
||||
|
||||
vicious.register(battery_widget, vicious.widgets.bat, function (widget, args)
|
||||
arguments = args
|
||||
|
||||
if args[2] < 10 then
|
||||
naughty.notify({ title="<span color='" .. beautiful.dgrey .. "'>Low Battery Level!</span>\n",
|
||||
text="" .. args[3] .. " min remaining",
|
||||
timeout=35 })
|
||||
battery_icon:set_image(icon_empty)
|
||||
return "<span color='" .. beautiful.lpink .. "'>" .. args[2] .. args[1] .. "</span>"
|
||||
elseif args[2] < 30 then
|
||||
battery_icon:set_image(icon_low)
|
||||
return "<span color='" .. beautiful.lpink .. "'>" .. args[2] .. args[1] .. "</span>"
|
||||
else
|
||||
battery_icon:set_image(icon_full)
|
||||
return "<span color='" .. beautiful.dgreen .. "'>" .. args[2] .. args[1] .. "</span>"
|
||||
end
|
||||
end, 96, "BAT0")
|
||||
end
|
||||
|
||||
|
||||
-- Create a wibox for each screen and add it
|
||||
mywibox = {}
|
||||
mypromptbox = {}
|
||||
mylayoutbox = {}
|
||||
mytaglist = {}
|
||||
mytaglist.buttons = awful.util.table.join(
|
||||
|
@ -281,9 +208,14 @@ mytasklist.buttons = awful.util.table.join(
|
|||
if client.focus then client.focus:raise() end
|
||||
end))
|
||||
|
||||
local function add(layout, widget1, widget2)
|
||||
layout:add(sqb_left)
|
||||
if widget1 then layout:add(widget1) end
|
||||
if widget2 then layout:add(widget2) end
|
||||
layout:add(sqb_right)
|
||||
end
|
||||
|
||||
for s = 1, screen.count() do
|
||||
-- Create a promptbox for each screen
|
||||
mypromptbox[s] = awful.widget.prompt()
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||
|
@ -293,7 +225,7 @@ for s = 1, screen.count() do
|
|||
awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
|
||||
awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
|
||||
-- Create a taglist widget
|
||||
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
|
||||
mytaglist[s] = awful.widget.taglist(s, taglist_filter, mytaglist.buttons)
|
||||
|
||||
-- Create a tasklist widget
|
||||
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
|
||||
|
@ -303,36 +235,21 @@ for s = 1, screen.count() do
|
|||
|
||||
-- Widgets that are aligned to the left
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
left_layout:add(mylauncher)
|
||||
left_layout:add(sqb_left)
|
||||
left_layout:add(mytaglist[s])
|
||||
left_layout:add(sqb_right)
|
||||
left_layout:add(mypromptbox[s])
|
||||
add(left_layout, mytaglist[s])
|
||||
|
||||
-- Widgets that are aligned to the right
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
if s == 1 then
|
||||
right_layout:add(sqb_left)
|
||||
right_layout:add(wibox.widget.systray())
|
||||
right_layout:add(sqb_right)
|
||||
add(right_layout, wibox.widget.systray())
|
||||
right_layout:add(spacer)
|
||||
end
|
||||
--right_layout:add(sqb_left)
|
||||
-- right_layout:add(google_reader_label)
|
||||
-- right_layout:add(google_reader_widget)
|
||||
--right_layout:add(sqb_right)
|
||||
--right_layout:add(spacer)
|
||||
right_layout:add(sqb_left)
|
||||
right_layout:add(battery_icon)
|
||||
right_layout:add(battery_widget)
|
||||
right_layout:add(sqb_right)
|
||||
add(right_layout, brightness.icon, brightness.widget)
|
||||
right_layout:add(spacer)
|
||||
right_layout:add(sqb_left)
|
||||
right_layout:add(clock_icon)
|
||||
right_layout:add(clock_day)
|
||||
add(right_layout, volume.icon, volume.widget)
|
||||
right_layout:add(spacer)
|
||||
right_layout:add(clock_time)
|
||||
right_layout:add(sqb_right)
|
||||
add(right_layout, battery.icon, battery.widget)
|
||||
right_layout:add(spacer)
|
||||
add(right_layout, clock_icon, clock)
|
||||
right_layout:add(spacer)
|
||||
right_layout:add(mylayoutbox[s])
|
||||
|
||||
|
@ -348,8 +265,6 @@ end
|
|||
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function () mymainmenu:hide() end),
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
))
|
||||
|
@ -371,7 +286,6 @@ globalkeys = awful.util.table.join(
|
|||
awful.client.focus.byidx(-1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.key({ modkey, }, "w", function () mymainmenu:show() end),
|
||||
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||
|
@ -404,27 +318,20 @@ globalkeys = awful.util.table.join(
|
|||
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
|
||||
awful.key({ modkey }, "z", function () drop("urxvt", nil, nil, nil, 0.3, true) end),
|
||||
|
||||
-- dmenu launcher
|
||||
awful.key({ modkey }, "e", function () awful.util.spawn("/home/yorick/dotfiles/bin/dlaunch.sh") end),
|
||||
awful.key({ modkey }, "=", function () awful.util.spawn("/home/yorick/dotfiles/bin/dcalc.sh") end),
|
||||
|
||||
awful.key({ modkey }, "x",
|
||||
function ()
|
||||
awful.prompt.run({ prompt = "Run Lua code: " },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
awful.util.eval, nil,
|
||||
awful.util.getdir("cache") .. "/history_eval")
|
||||
end),
|
||||
-- locking
|
||||
awful.key({ modkey, "Control", "Shift" }, "l", function () awful.util.spawn("/home/yorick/dotfiles/bin/lock.sh") end),
|
||||
-- brightness adjustment
|
||||
awful.key({ }, "XF86MonBrightnessDown", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh down") end),
|
||||
awful.key({ }, "XF86MonBrightnessUp", function() awful.util.spawn("/home/yorick/dotfiles/bin/brightne.sh up") end),
|
||||
awful.key({ }, "XF86AudioMute", function() awful.util.spawn("/home/yorick/dotfiles/bin/mute_toggle.sh") end),
|
||||
awful.key({ }, "XF86AudioLowerVolume", function() awful.util.spawn("/home/yorick/dotfiles/bin/vol_down.sh") end),
|
||||
awful.key({ }, "XF86AudioRaiseVolume", function() awful.util.spawn("/home/yorick/dotfiles/bin/vol_up.sh") end),
|
||||
-- brightness, volume
|
||||
awful.key({ }, "XF86MonBrightnessDown", brightness.down),
|
||||
awful.key({ }, "XF86MonBrightnessUp", brightness.up),
|
||||
awful.key({ }, "XF86AudioMute", volume.mute),
|
||||
awful.key({ }, "XF86AudioLowerVolume", volume.down),
|
||||
awful.key({ }, "XF86AudioRaiseVolume", volume.up),
|
||||
-- awesome screenshotness
|
||||
awful.key({ modkey }, "s", function() awful.util.spawn("/home/yorick/dotfiles/bin/screenshot_public.sh") end)
|
||||
)
|
||||
|
@ -446,7 +353,8 @@ clientkeys = awful.util.table.join(
|
|||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
end)
|
||||
end),
|
||||
awful.key({ modkey, "Control" }, "m", lain.util.magnify_client)
|
||||
)
|
||||
|
||||
-- Compute the maximum number of digit we need, limited to 9
|
||||
|
@ -497,6 +405,8 @@ clientbuttons = awful.util.table.join(
|
|||
root.keys(globalkeys)
|
||||
-- }}}
|
||||
|
||||
|
||||
local snd_screen = screen.count() > 1 and 2 or 1
|
||||
-- {{{ Rules
|
||||
awful.rules.rules = {
|
||||
-- All clients will match this rule.
|
||||
|
@ -506,21 +416,20 @@ awful.rules.rules = {
|
|||
focus = awful.client.focus.filter,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons } },
|
||||
{ rule = { class = "MPlayer" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "pinentry" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "gimp" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { class = "Tilda" },
|
||||
properties = { floating = true } },
|
||||
{ rule = { instance = "plugin-container" },
|
||||
properties = { floating = true } },
|
||||
-- Set Firefox to always map on tags number 2 of screen 1.
|
||||
{ rule = { class = "Firefox" },
|
||||
properties = { tag = tags[1][2] } },
|
||||
{ rule = { class = "Skype" }, -- This one!!!
|
||||
properties = { size_hints_honor = false } },
|
||||
{ rule = { class = "Skype" },
|
||||
properties = { size_hints_honor = false, -- skype.
|
||||
tag = tags[snd_screen][8] } },
|
||||
{ rule = { class = "Spotify" },
|
||||
properties = { tag = tags[snd_screen][6] } },
|
||||
{ rule = { class = "Quasselclient" },
|
||||
properties = { tag = tags[snd_screen][4] } },
|
||||
}
|
||||
-- }}}
|
||||
|
||||
|
@ -547,43 +456,6 @@ client.connect_signal("manage", function (c, startup)
|
|||
end
|
||||
end
|
||||
|
||||
local titlebars_enabled = false
|
||||
if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
|
||||
-- Widgets that are aligned to the left
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
left_layout:add(awful.titlebar.widget.iconwidget(c))
|
||||
|
||||
-- Widgets that are aligned to the right
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
right_layout:add(awful.titlebar.widget.floatingbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.maximizedbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.stickybutton(c))
|
||||
right_layout:add(awful.titlebar.widget.ontopbutton(c))
|
||||
right_layout:add(awful.titlebar.widget.closebutton(c))
|
||||
|
||||
-- The title goes in the middle
|
||||
local title = awful.titlebar.widget.titlewidget(c)
|
||||
title:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.move(c)
|
||||
end),
|
||||
awful.button({ }, 3, function()
|
||||
client.focus = c
|
||||
c:raise()
|
||||
awful.mouse.client.resize(c)
|
||||
end)
|
||||
))
|
||||
|
||||
-- Now bring it all together
|
||||
local layout = wibox.layout.align.horizontal()
|
||||
layout:set_left(left_layout)
|
||||
layout:set_right(right_layout)
|
||||
layout:set_middle(title)
|
||||
|
||||
awful.titlebar(c):set_widget(layout)
|
||||
end
|
||||
end)
|
||||
|
||||
client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
-------------------------------------------------------------------
|
||||
-- Drop-down applications manager for the awesome window manager
|
||||
-------------------------------------------------------------------
|
||||
-- Coded by: * Lucas de Vries <lucas@glacicle.com>
|
||||
-- Hacked by: * Adrian C. (anrxc) <anrxc@sysphere.org>
|
||||
-- Licensed under the WTFPL version 2
|
||||
-- * http://sam.zoy.org/wtfpl/COPYING
|
||||
-------------------------------------------------------------------
|
||||
-- To use this module add:
|
||||
-- local scratchdrop = require("scratchdrop")
|
||||
-- to the top of your rc.lua, and call it from a keybinding:
|
||||
-- scratchdrop(prog, vert, horiz, width, height, sticky, screen)
|
||||
--
|
||||
-- Parameters:
|
||||
-- prog - Program to run; "urxvt", "gmrun", "thunderbird"
|
||||
-- vert - Vertical; "bottom", "center" or "top" (default)
|
||||
-- horiz - Horizontal; "left", "right" or "center" (default)
|
||||
-- width - Width in absolute pixels, or width percentage
|
||||
-- when <= 1 (1 (100% of the screen) by default)
|
||||
-- height - Height in absolute pixels, or height percentage
|
||||
-- when <= 1 (0.25 (25% of the screen) by default)
|
||||
-- sticky - Visible on all tags, false by default
|
||||
-- screen - Screen (optional), mouse.screen by default
|
||||
-------------------------------------------------------------------
|
||||
|
||||
-- Grab environment
|
||||
local pairs = pairs
|
||||
local awful = require("awful")
|
||||
local setmetatable = setmetatable
|
||||
local capi = {
|
||||
mouse = mouse,
|
||||
client = client,
|
||||
screen = screen
|
||||
}
|
||||
|
||||
-- Scratchdrop: drop-down applications manager for the awesome window manager
|
||||
local scratchdrop = {} -- module scratch.drop
|
||||
|
||||
local dropdown = {}
|
||||
|
||||
-- Create a new window for the drop-down application when it doesn't
|
||||
-- exist, or toggle between hidden and visible states when it does
|
||||
function toggle(prog, vert, horiz, width, height, sticky, screen)
|
||||
vert = vert or "top"
|
||||
horiz = horiz or "center"
|
||||
width = width or 1
|
||||
height = height or 0.25
|
||||
sticky = sticky or false
|
||||
screen = screen or capi.mouse.screen
|
||||
|
||||
-- Determine signal usage in this version of awesome
|
||||
local attach_signal = capi.client.connect_signal or capi.client.add_signal
|
||||
local detach_signal = capi.client.disconnect_signal or capi.client.remove_signal
|
||||
|
||||
if not dropdown[prog] then
|
||||
dropdown[prog] = {}
|
||||
|
||||
-- Add unmanage signal for scratchdrop programs
|
||||
attach_signal("unmanage", function (c)
|
||||
for scr, cl in pairs(dropdown[prog]) do
|
||||
if cl == c then
|
||||
dropdown[prog][scr] = nil
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
if not dropdown[prog][screen] then
|
||||
spawnw = function (c)
|
||||
dropdown[prog][screen] = c
|
||||
|
||||
-- Scratchdrop clients are floaters
|
||||
awful.client.floating.set(c, true)
|
||||
|
||||
-- Client geometry and placement
|
||||
local screengeom = capi.screen[screen].workarea
|
||||
|
||||
if width <= 1 then width = screengeom.width * width end
|
||||
if height <= 1 then height = screengeom.height * height end
|
||||
|
||||
if horiz == "left" then x = screengeom.x
|
||||
elseif horiz == "right" then x = screengeom.width - width
|
||||
else x = screengeom.x+(screengeom.width-width)/2 end
|
||||
|
||||
if vert == "bottom" then y = screengeom.height + screengeom.y - height
|
||||
elseif vert == "center" then y = screengeom.y+(screengeom.height-height)/2
|
||||
else y = screengeom.y - screengeom.y end
|
||||
|
||||
-- Client properties
|
||||
c:geometry({ x = x, y = y + mywibox[mouse.screen].height, width = width - 2, height = height })
|
||||
c.ontop = true
|
||||
c.above = true
|
||||
c.skip_taskbar = true
|
||||
if sticky then c.sticky = true end
|
||||
if c.titlebar then awful.titlebar.remove(c) end
|
||||
|
||||
c:raise()
|
||||
capi.client.focus = c
|
||||
detach_signal("manage", spawnw)
|
||||
end
|
||||
|
||||
-- Add manage signal and spawn the program
|
||||
attach_signal("manage", spawnw)
|
||||
awful.util.spawn(prog, false)
|
||||
else
|
||||
-- Get a running client
|
||||
c = dropdown[prog][screen]
|
||||
|
||||
-- Switch the client to the current workspace
|
||||
if c:isvisible() == false then c.hidden = true
|
||||
awful.client.movetotag(awful.tag.selected(screen), c)
|
||||
end
|
||||
|
||||
-- Focus and raise if hidden
|
||||
if c.hidden then
|
||||
-- Make sure it is centered
|
||||
--if vert == "center" then awful.placement.center_vertical(c) end
|
||||
--if horiz == "center" then awful.placement.center_horizontal(c) end
|
||||
c.hidden = false
|
||||
c:raise()
|
||||
capi.client.focus = c
|
||||
else -- Hide and detach tags if not
|
||||
c.hidden = true
|
||||
local ctags = c:tags()
|
||||
for i, t in pairs(ctags) do
|
||||
ctags[i] = nil
|
||||
end
|
||||
c:tags(ctags)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return setmetatable(scratchdrop, { __call = function(_, ...) return toggle(...) end })
|
|
@ -34,7 +34,7 @@ theme = {}
|
|||
theme.font = "Source Code Pro 9"
|
||||
|
||||
theme.bg_normal = solar_base03 .. "d9"
|
||||
theme.bg_focus = transparent
|
||||
theme.bg_focus = solar_base02
|
||||
theme.bg_urgent = "#b0b0b0"
|
||||
theme.bg_minimize = transparent
|
||||
theme.bg_systray = "#202020aa"
|
||||
|
@ -45,6 +45,8 @@ theme.fg_urgent = "#000000"
|
|||
theme.fg_minimize = solar_base01
|
||||
|
||||
|
||||
theme.useless_gap_width = 10
|
||||
|
||||
theme.dgrey = solar_base0
|
||||
theme.lpink = solar_orange
|
||||
theme.dgreen = solar_green
|
||||
|
@ -125,7 +127,7 @@ theme.layout_max = awesome_path .. "layouts/maxw.png"
|
|||
theme.layout_fullscreen = awesome_path .. "layouts/fullscreenw.png"
|
||||
theme.layout_tilebottom = awesome_path .. "layouts/tilebottomw.png"
|
||||
theme.layout_tileleft = awesome_path .. "layouts/tileleftw.png"
|
||||
theme.layout_tile = awesome_path .. "layouts/tilew.png"
|
||||
theme.layout_uselesstile = awesome_path .. "layouts/tilew.png"
|
||||
theme.layout_tiletop = awesome_path .. "layouts/tiletopw.png"
|
||||
theme.layout_spiral = awesome_path .. "layouts/spiralw.png"
|
||||
theme.layout_dwindle = awesome_path .. "layouts/dwindlew.png"
|
||||
|
@ -136,5 +138,12 @@ theme.awesome_icon = "/home/yorick/dotfiles/awesome/icons/lambda.png"
|
|||
-- from /usr/share/icons and /usr/share/icons/hicolor will be used.
|
||||
theme.icon_theme = nil
|
||||
|
||||
theme.lain_icons = "/home/yorick/dotfiles/awesome/lain/icons/layout/default/"
|
||||
theme.layout_termfair = theme.lain_icons .. "termfairw.png"
|
||||
theme.layout_centerfair = theme.lain_icons .. "centerfairw.png"
|
||||
theme.layout_cascade = theme.lain_icons .. "cascadew.png"
|
||||
theme.layout_cascadetile = theme.lain_icons .. "cascadetilew.png"
|
||||
theme.layout_centerwork = theme.lain_icons .. "centerworkw.png"
|
||||
|
||||
return theme
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
Subproject commit d63343efda83a24c52abfd58159c212a918d951d
|
|
@ -0,0 +1,91 @@
|
|||
-- Standard awesome library
|
||||
-- Widget and layout library
|
||||
local wibox = require("wibox")
|
||||
-- Theme handling library
|
||||
local beautiful = require("beautiful")
|
||||
-- Notification library
|
||||
local naughty = require("naughty")
|
||||
-- widget library
|
||||
local lain = require("lain")
|
||||
local markup = lain.util.markup
|
||||
|
||||
|
||||
function hover_popup(widget, text)
|
||||
local cur_notification = nil
|
||||
|
||||
local function remove_old()
|
||||
if cur_notification ~= nil then
|
||||
naughty.destroy(cur_notification)
|
||||
cur_notification = nil
|
||||
end
|
||||
end
|
||||
local function add_new()
|
||||
t = text()
|
||||
if t == nil then return end
|
||||
remove_old()
|
||||
cur_notification = naughty.notify({
|
||||
text = t,
|
||||
timeout = 0,
|
||||
screen = mouse.screen,
|
||||
opacity = 0.8,
|
||||
--ontop = true,
|
||||
})
|
||||
end
|
||||
widget:connect_signal("mouse::enter", add_new)
|
||||
widget:connect_signal("mouse::leave", remove_old)
|
||||
end
|
||||
|
||||
-- battery
|
||||
-- battery_widget = wibox.widget.textbox()
|
||||
local battery = {
|
||||
icon = wibox.widget.imagebox();
|
||||
widget = nil;
|
||||
}
|
||||
do
|
||||
local bat_state
|
||||
battery.widget = lain.widgets.bat({
|
||||
settings = function()
|
||||
bat_state = bat_now
|
||||
local icon_full = icon_dir .. "/bat_full_01.png"
|
||||
local icon_low = icon_dir .. "/bat_low_01.png"
|
||||
local icon_empty = icon_dir .. "/bat_empty_01.png"
|
||||
local statemap = {
|
||||
["Unknown"] = "⌁";
|
||||
["Full"] = "↯";
|
||||
["Charging"] = "+";
|
||||
["Discharging"] = "-";
|
||||
}
|
||||
local color = beautiful.white
|
||||
if bat_now.perc == "N/A" then
|
||||
perc = "AC "
|
||||
else
|
||||
if tonumber(bat_now.perc) < 10 then
|
||||
battery.icon:set_image(icon_empty)
|
||||
color = beautiful.lpink
|
||||
elseif tonumber(bat_now.perc) < 30 then
|
||||
battery.icon:set_image(icon_low)
|
||||
color = beautiful.lpink
|
||||
else
|
||||
battery.icon:set_image(icon_full)
|
||||
color = beautiful.dgreen
|
||||
end
|
||||
perc = statemap[bat_now.status] .. bat_now.perc .. "%"
|
||||
end
|
||||
widget:set_markup(markup(color, perc))
|
||||
end
|
||||
})
|
||||
|
||||
local function popup_text()
|
||||
if bat_state == nil then return end
|
||||
local text = "\n" .. bat_state.status
|
||||
if bat_state.time ~= "N/A" and bat_state.time ~= "00:00" then
|
||||
text = text .. "\n" .. bat_state.time .. "h/min left"
|
||||
end
|
||||
return markup.bold(markup(beautiful.dgrey, "battery")) .. "\n" .. text
|
||||
end
|
||||
|
||||
hover_popup(battery.widget, popup_text)
|
||||
|
||||
end
|
||||
|
||||
return battery
|
|
@ -0,0 +1,38 @@
|
|||
local awful = require("awful")
|
||||
|
||||
local wibox = require("wibox")
|
||||
-- widget library
|
||||
local lain = require("lain")
|
||||
|
||||
local script = "/home/yorick/dotfiles/bin/brightne.sh"
|
||||
local bness_widget = lain.widgets.base({
|
||||
cmd = script .. " get",
|
||||
settings = (function()
|
||||
widget:set_text(output)
|
||||
end),
|
||||
timeout = 20
|
||||
})
|
||||
local brightness = {
|
||||
icon = wibox.widget.imagebox(),
|
||||
widget = bness_widget,
|
||||
down = (function()
|
||||
os.execute(script .. " down")
|
||||
bness_widget.update()
|
||||
end),
|
||||
up = (function()
|
||||
os.execute(script .. " up")
|
||||
bness_widget.update()
|
||||
end),
|
||||
fix = (function()
|
||||
os.execute(script .. " fix")
|
||||
bness_widget.update()
|
||||
end),
|
||||
}
|
||||
brightness.widget:buttons(awful.util.table.join(
|
||||
awful.button({}, 1, brightness.fix),
|
||||
awful.button({}, 4, brightness.up),
|
||||
awful.button({}, 5, brightness.down)
|
||||
))
|
||||
brightness.icon:set_image(icon_dir .. "/half.png")
|
||||
|
||||
return brightness
|
|
@ -0,0 +1,47 @@
|
|||
local awful = require("awful")
|
||||
|
||||
local wibox = require("wibox")
|
||||
-- widget library
|
||||
local lain = require("lain")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
local vol_icon = wibox.widget.imagebox()
|
||||
local volumewidget = lain.widgets.alsa({
|
||||
settings = function()
|
||||
local level = volume_now.level .. "%"
|
||||
if volume_now.status == "off" then
|
||||
vol_icon:set_image(icon_dir .. "/spkr_02.png")
|
||||
level = markup(beautiful.lpink, level)
|
||||
else
|
||||
vol_icon:set_image(icon_dir .. "/spkr_01.png")
|
||||
end
|
||||
|
||||
widget:set_markup(level)
|
||||
end
|
||||
})
|
||||
local volume = {
|
||||
widget = volumewidget,
|
||||
icon = vol_icon,
|
||||
mute = (function()
|
||||
os.execute(string.format("amixer set %s toggle", volumewidget.channel))
|
||||
volumewidget.update()
|
||||
end),
|
||||
down = (function()
|
||||
os.execute(string.format("amixer set %s 1%%-", volumewidget.channel))
|
||||
volumewidget.update()
|
||||
end),
|
||||
up = (function()
|
||||
os.execute(string.format("amixer set %s 1%%+", volumewidget.channel))
|
||||
volumewidget.update()
|
||||
end)
|
||||
};
|
||||
vol_icon:buttons(awful.util.table.join(awful.button({ }, 1, volume.mute)))
|
||||
volumewidget:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1, function ()
|
||||
awful.util.spawn("pavucontrol")
|
||||
end),
|
||||
awful.button({}, 4, volume.up),
|
||||
awful.button({}, 5, volume.down)
|
||||
))
|
||||
|
||||
return volume
|
|
@ -56,7 +56,6 @@ max() {
|
|||
|
||||
set_bl() {
|
||||
set_raw $(scale_to_bl $1)
|
||||
volnoti-show -s /usr/local/share/pixmaps/volnoti/display-brightness-symbolic.svg $(scale_from_to $1 100)
|
||||
}
|
||||
|
||||
get() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
dmenu_args="-fn -*-termsyn-medium-*-*-*-12-*-*-*-*-*-*-* -nb #1D1E24 -nf #8DA893 -sb #1D1E24 -sf #C18E44 $@"
|
||||
#!/usr/bin/env bash
|
||||
dmenu_args="-fn SourceCodePro:pixelsize=17 -nb "#002b36" -nf "#839496" -sb "#073642" -sf "#93a1a1" $@"
|
||||
|
||||
xsel -o | dmenu $dmenu_args -p Calculate: | xargs echo | calc -p | dmenu $dmenu_args -p "Answer:" | xsel -i
|
||||
xclip -o | dmenu $dmenu_args -p Calculate: | xargs echo | bc | dmenu $dmenu_args -p "Answer:" | xclip -i
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/sh
|
||||
(
|
||||
yeganesh -x -- -fn "-*-termsyn-medium-*-*-*-12-*-*-*-*-*-*-*" -p "run: " -i -f -nb "#1D1E24" -nf "#8DA893" -sb "#1D1E24" -sf "#C18E44" $@
|
||||
yeganesh -x -- -fn "SourceCodePro:pixelsize=17" -p "run: " -i -f -nb "#002b36" -nf "#839496" -sb "#073642" -sf "#93a1a1" $@
|
||||
) | ${SHELL:-"/bin/sh"} &
|
||||
|
|
40
bin/lock.sh
|
@ -1,4 +1,38 @@
|
|||
#!/bin/sh
|
||||
xset dpms 0 0 10
|
||||
( sleep 1s; xset dpms force off) &
|
||||
( slock && xset dpms 0 0 600 )
|
||||
#xset dpms 0 0 10
|
||||
#( sleep 1s; xset dpms force off) &
|
||||
#( slock && xset dpms 0 0 600 )
|
||||
# sleep 0.1s
|
||||
# i3lock -d
|
||||
|
||||
scrot /tmp/screen.png
|
||||
convert /tmp/screen.png -scale 10% -scale 1000% /tmp/screen.png
|
||||
|
||||
# if [[ -f $HOME/.config/screen-lock.png ]]
|
||||
# then
|
||||
# # placement x/y
|
||||
# PX=0
|
||||
# PY=0
|
||||
# # lockscreen image info
|
||||
# R=$(file ~/.config/screen-lock.png | grep -o '[0-9]* x [0-9]*')
|
||||
# RX=$(echo $R | cut -d' ' -f 1)
|
||||
# RY=$(echo $R | cut -d' ' -f 3)
|
||||
|
||||
# SR=$(xrandr --query | grep ' connected' | cut -f3 -d' ')
|
||||
# for RES in $SR
|
||||
# do
|
||||
# # monitor position/offset
|
||||
# SRX=$(echo $RES | cut -d'x' -f 1) # x pos
|
||||
# SRY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 1) # y pos
|
||||
# SROX=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 2) # x offset
|
||||
# SROY=$(echo $RES | cut -d'x' -f 2 | cut -d'+' -f 3) # y offset
|
||||
# PX=$(($SROX + $SRX/2 - $RX/2))
|
||||
# PY=$(($SROY + $SRY/2 - $RY/2))
|
||||
|
||||
# # convert /tmp/screen.png $HOME/.config/screen-lock.png -geometry +$PX+$PY -composite -matte /tmp/screen.png
|
||||
# echo "done"
|
||||
# done
|
||||
# fi
|
||||
# dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Stop
|
||||
# i3lock -I 10 -d -e -u -n -i /tmp/screen.png
|
||||
i3lock -d -i /tmp/screen.png
|