Skip to content
Browse files

remove awesome config

  • Loading branch information...
1 parent 2dc894b commit bad6921180558c883ad31895c284a297535c0e00 @caio committed
Showing with 0 additions and 947 deletions.
  1. +0 −113 awesome/calendar2.lua
  2. +0 −392 awesome/rc.lua
  3. +0 −74 awesome/runonce.lua
  4. +0 −129 awesome/scratch/drop.lua
  5. +0 −12 awesome/scratch/init.lua
  6. +0 −130 awesome/scratch/pad.lua
  7. +0 −97 awesome/themes/defaultmod/theme.lua
View
113 awesome/calendar2.lua
@@ -1,113 +0,0 @@
--- original code made by Bzed and published on http://awesome.naquadah.org/wiki/Calendar_widget
--- modified by Marc Dequènes (Duck) <Duck@DuckCorp.org> (2009-12-29), under the same licence,
--- and with the following changes:
--- + transformed to module
--- + the current day formating is customizable
-
-local string = string
---local print = print
-local tostring = tostring
-local os = os
-local capi = {
- mouse = mouse,
- screen = screen
-}
-local awful = require("awful")
-local naughty = require("naughty")
-module("calendar2")
-
-local calendar = {}
-local current_day_format = "<u>%s</u>"
-local fontname = "Droid Sans Mono"
-
-function displayMonth(month,year,weekStart)
- local t,wkSt=os.time{year=year, month=month+1, day=0},weekStart or 1
- local d=os.date("*t",t)
- local mthDays,stDay=d.day,(d.wday-d.day-wkSt+1)%7
-
- --print(mthDays .."\n" .. stDay)
- local lines = " "
-
- for x=0,6 do
- lines = lines .. os.date("%a ",os.time{year=2006,month=1,day=x+wkSt})
- end
-
- lines = lines .. "\n" .. os.date(" %V",os.time{year=year,month=month,day=1})
-
- local writeLine = 1
- while writeLine < (stDay + 1) do
- lines = lines .. " "
- writeLine = writeLine + 1
- end
-
- for d=1,mthDays do
- local x = d
- local t = os.time{year=year,month=month,day=d}
- if writeLine == 8 then
- writeLine = 1
- lines = lines .. "\n" .. os.date(" %V",t)
- end
- if os.date("%Y-%m-%d") == os.date("%Y-%m-%d", t) then
- x = string.format(current_day_format, d)
- end
- if (#(tostring(d)) == 1) then
- x = " " .. x
- end
- lines = lines .. " " .. x
- writeLine = writeLine + 1
- end
- local header = os.date("%B %Y\n",os.time{year=year,month=month,day=1})
-
- return header .. "\n" .. lines
-end
-
-function switchNaughtyMonth(switchMonths)
- if (#calendar < 3) then return end
- local swMonths = switchMonths or 1
- calendar[1] = calendar[1] + swMonths
- calendar[3].box.widgets[2].text = string.format('<span font_desc="%s">%s</span>', fontname, displayMonth(calendar[1], calendar[2], 2))
-end
-
-function addCalendarToWidget(mywidget, custom_current_day_format)
- if custom_current_day_format then current_day_format = custom_current_day_format end
-
- mywidget:add_signal('mouse::enter', function ()
- local month, year = os.date('%m'), os.date('%Y')
- calendar = { month, year,
- naughty.notify({
- text = string.format('<span font_desc="%s">%s</span>', fontname, displayMonth(month, year, 2)),
- timeout = 0,
- hover_timeout = 0.5,
- screen = capi.mouse.screen
- })
- }
- end)
- mywidget:add_signal('mouse::leave', function () naughty.destroy(calendar[3]) end)
-
- mywidget:buttons(awful.util.table.join(
- awful.button({ }, 1, function()
- switchNaughtyMonth(-1)
- end),
- awful.button({ }, 3, function()
- switchNaughtyMonth(1)
- end),
- awful.button({ }, 4, function()
- switchNaughtyMonth(-1)
- end),
- awful.button({ }, 5, function()
- switchNaughtyMonth(1)
- end),
- awful.button({ 'Shift' }, 1, function()
- switchNaughtyMonth(-12)
- end),
- awful.button({ 'Shift' }, 3, function()
- switchNaughtyMonth(12)
- end),
- awful.button({ 'Shift' }, 4, function()
- switchNaughtyMonth(-12)
- end),
- awful.button({ 'Shift' }, 5, function()
- switchNaughtyMonth(12)
- end)
- ))
-end
View
392 awesome/rc.lua
@@ -1,392 +0,0 @@
--- Standard awesome library
-require("awful")
-require("awful.autofocus")
-require("awful.rules")
--- Theme handling library
-require("beautiful")
--- Notification library
-require("naughty")
--- Widget library
---require("obvious")
-require("scratch")
-require("calendar2")
-
-function make_me_away ()
- awful.util.spawn_with_shell("[ -e ~/.weechat/weechat_fifo* ] && echo '*/away screen currently locked' > ~/.weechat/weechat_fifo*")
- awful.util.spawn_with_shell("xlock -mode blank && [ -e ~/.weechat/weechat_fifo* ] && echo '*/away' > ~/.weechat/weechat_fifo*")
-end
-
--- {{{ Variable definitions
--- Themes define colours, icons, and wallpapers
-beautiful.init(awful.util.getdir("config") .. "/themes/defaultmod/theme.lua")
-
--- This is used later as the default terminal and editor to run.
-terminal = "urxvtc"
-editor = os.getenv("EDITOR") or "vim"
-editor_cmd = terminal .. " -e " .. editor
-
--- Default modkey.
--- Usually, Mod4 is the key with a logo between Control and Alt.
--- If you do not like this or do not have such a key,
--- I suggest you to remap Mod4 to another key using xmodmap or other tools.
--- However, you can use another modifier like Mod1, but it may interact with others.
-modkey = "Mod4"
-
--- Table of layouts to cover with awful.layout.inc, order matters.
-layouts =
-{
- awful.layout.suit.floating,
- awful.layout.suit.tile,
- --awful.layout.suit.tile.left,
- awful.layout.suit.tile.bottom,
- --awful.layout.suit.tile.top,
- awful.layout.suit.fair,
- --awful.layout.suit.fair.horizontal,
- --awful.layout.suit.spiral,
- --awful.layout.suit.spiral.dwindle,
- awful.layout.suit.max,
- awful.layout.suit.max.fullscreen,
- awful.layout.suit.magnifier
-}
--- }}}
-
--- {{{ Tags
--- Define a tag table which hold all screen tags.
-tags = {}
-tags = {
- --names = { "⌘", "♐", "⌥", "ℵ"},
- names = { "", "", "", "", "", "" },
- --names = { "⢷", "⣨", "⡪", "⣌", "⣪", "⡝"},
- layout = {
- layouts[5], layouts[2], layouts[2], layouts[2], layouts[3], layouts[1]
- }
-}
-
-if screen.count() == 1 then
- tags[1] = awful.tag(tags.names, 1, tags.layout)
-elseif screen.count() == 2 then
- tags[2] = awful.tag({"web", "src", "term", "extra"}, 2,
- {layouts[5], layouts[2], layouts[3], layouts[3]})
- tags[1] = awful.tag({"mail", "irc", "misc"}, 1,
- {layouts[5], layouts[3], layouts[1]})
-else
- for s = 1, screen.count() do
- tags[s] = awful.tag({"fixme"}, s, {layouts[1]})
- end
-end
--- }}}
-
--- {{{ Custom widgets
--- }}}
-
--- {{{ Wibox
--- Create a textclock widget
-mytextclock = awful.widget.textclock({ align = "right" })
-calendar2.addCalendarToWidget(mytextclock, "<span color='red'>%s</span>")
-
-
--- Create a systray
-mysystray = widget({ type = "systray" })
-
--- Create a wibox for each screen and add it
-mywibox = {}
-mypromptbox = {}
-mylayoutbox = {}
-mytaglist = {}
-mytaglist.buttons = awful.util.table.join(
- awful.button({ }, 1, awful.tag.viewonly),
- awful.button({ modkey }, 1, awful.client.movetotag),
- awful.button({ }, 3, awful.tag.viewtoggle),
- awful.button({ modkey }, 3, awful.client.toggletag),
- awful.button({ }, 4, awful.tag.viewnext),
- awful.button({ }, 5, awful.tag.viewprev)
- )
-mytasklist = {}
-mytasklist.buttons = awful.util.table.join(
- awful.button({ }, 1, function (c)
- if not c:isvisible() then
- awful.tag.viewonly(c:tags()[1])
- end
- client.focus = c
- c:raise()
- end),
- awful.button({ }, 3, function ()
- if instance then
- instance:hide()
- instance = nil
- else
- instance = awful.menu.clients({ width=250 })
- end
- end),
- awful.button({ }, 4, function ()
- awful.client.focus.byidx(1)
- if client.focus then client.focus:raise() end
- end),
- awful.button({ }, 5, function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end))
-
-for s = 1, screen.count() do
- -- Create a promptbox for each screen
- mypromptbox[s] = awful.widget.prompt({ layout = awful.widget.layout.horizontal.leftright })
- -- 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)
- mylayoutbox[s]:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
- awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
- 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.label.all, mytaglist.buttons)
-
- -- Create a tasklist widget
- mytasklist[s] = awful.widget.tasklist(function(c)
- return awful.widget.tasklist.label.currenttags(c, s)
- end, mytasklist.buttons)
-
- -- Create the wibox
- mywibox[s] = awful.wibox({ position = "top", height="14", screen = s })
- -- Add widgets to the wibox - order matters
- mywibox[s].widgets = {
- {
- mytaglist[s],
- mypromptbox[s],
- layout = awful.widget.layout.horizontal.leftright
- },
- mylayoutbox[s],
- mytextclock,
- s == 1 and mysystray or nil,
- mytasklist[s],
- layout = awful.widget.layout.horizontal.rightleft
- }
-end
--- }}}
-
--- {{{ Mouse bindings
-root.buttons(awful.util.table.join(
- --awful.button({ }, 3, function () mymainmenu:toggle() end),
- awful.button({ }, 4, awful.tag.viewnext),
- awful.button({ }, 5, awful.tag.viewprev)
-))
--- }}}
-
--- {{{ Key bindings
-globalkeys = awful.util.table.join(
- awful.key({ modkey, }, "Left", awful.tag.viewprev ),
- awful.key({ modkey, }, "Right", awful.tag.viewnext ),
- awful.key({ modkey, }, "Escape", awful.tag.history.restore),
-
- awful.key({ modkey, }, "j",
- function ()
- awful.client.focus.byidx( 1)
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey, }, "k",
- function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end),
-
- -- Layout manipulation
- awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
- awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
- awful.key({ "Mod1", "Control" }, "Right", function () awful.screen.focus_relative( 1) end),
- awful.key({ "Mod1", "Control" }, "Left", function () awful.screen.focus_relative(-1) end),
- awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
- awful.key({ modkey, }, "Tab",
- function ()
- awful.client.focus.history.previous()
- if client.focus then
- client.focus:raise()
- end
- end),
-
- -- Standard program
- awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
- awful.key({ modkey, "Control" }, "r", awesome.restart),
- awful.key({ modkey, "Shift" }, "q", awesome.quit),
-
- awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end),
- awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end),
- awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end),
- awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end),
- awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end),
- awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end),
-
- -- xlock
- awful.key({ "Mod1", "Control" }, "l", function() make_me_away() end),
-
- -- Prompt
- awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() 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),
-
- -- Mouse toggle
- awful.key({}, "Menu", function()
- state = io.popen("synclient -l |grep -i touchpadoff| awk '{ print $3 }'"):read()
- flag = "0"
- if state == "0" then
- flag = "1"
- end
- awful.util.spawn("synclient TouchpadOff=" .. flag)
- end),
-
- -- Layout
- awful.key({ modkey, }, "Up", function () awful.layout.inc(layouts, 1) end),
- awful.key({ modkey, }, "Down", function () awful.layout.inc(layouts, -1) end),
-
- -- Float resize
- awful.key({ modkey }, "Next", function () awful.client.moveresize( 20, 20, -40, -40) end),
- awful.key({ modkey }, "Prior", function () awful.client.moveresize(-20, -20, 40, 40) end),
- awful.key({ modkey, "Shift" }, "Down", function () awful.client.moveresize( 0, 20, 0, 0) end),
- awful.key({ modkey, "Shift" }, "Up", function () awful.client.moveresize( 0, -20, 0, 0) end),
- awful.key({ modkey, "Shift" }, "Left", function () awful.client.moveresize(-20, 0, 0, 0) end),
- awful.key({ modkey, "Shift" }, "Right", function () awful.client.moveresize( 20, 0, 0, 0) end),
- awful.key({ modkey, "Control" }, "Down", function () awful.client.moveresize(0, 0, 0, 20) end),
- awful.key({ modkey, "Control" }, "Up", function () awful.client.moveresize(0, 0, 0, -20) end),
- awful.key({ modkey, "Control" }, "Left", function () awful.client.moveresize(0, 0, -20, 0) end),
- awful.key({ modkey, "Control" }, "Right", function () awful.client.moveresize(0, 0, 20, 0) end),
-
- -- Scratchpad
- awful.key({ modkey }, "space", function ()
- scratch.drop("urxvtc -e t scratch", "bottom", "center", 0.70, 0.40, true)
- end)
-)
-
-clientkeys = awful.util.table.join(
- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
- awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
- awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ),
- awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
- awful.key({ modkey, }, "o", awful.client.movetoscreen ),
- awful.key({ modkey, "Shift" }, "r", function (c) c:redraw() end),
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
- awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
- awful.key({ modkey, }, "m",
- function (c)
- c.maximized_horizontal = not c.maximized_horizontal
- c.maximized_vertical = not c.maximized_vertical
- end)
-)
-
--- Compute the maximum number of digit we need, limited to 9
-keynumber = 0
-for s = 1, screen.count() do
- keynumber = math.min(9, math.max(#tags[s], keynumber));
-end
-
--- Bind all key numbers to tags.
--- Be careful: we use keycodes to make it works on any keyboard layout.
--- This should map on the top row of your keyboard, usually 1 to 9.
-for i = 1, keynumber do
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewonly(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Control" }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewtoggle(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- function ()
- if client.focus and tags[client.focus.screen][i] then
- awful.client.movetotag(tags[client.focus.screen][i])
- end
- end),
- awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
- function ()
- if client.focus and tags[client.focus.screen][i] then
- awful.client.toggletag(tags[client.focus.screen][i])
- end
- end))
-end
-
-clientbuttons = awful.util.table.join(
- awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
- awful.button({ modkey }, 1, awful.mouse.client.move),
- awful.button({ modkey }, 3, awful.mouse.client.resize))
-
--- Set keys
-root.keys(globalkeys)
--- }}}
-
--- {{{ Rules
-awful.rules.rules = {
- -- All clients will match this rule.
- { rule = { },
- properties = { border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = true,
- keys = clientkeys,
- buttons = clientbuttons } },
- { rule_any = { class = { "MPlayer", "Nitrogen", "pidgin", "gimp" }, instance = { "pidgin" } },
- properties = { floating = true } },
-}
--- }}}
-
--- {{{ Signals
--- Signal function to execute when a new client appears.
-client.add_signal("manage", function (c, startup)
- -- Add a titlebar
- -- awful.titlebar.add(c, { modkey = modkey })
-
- -- Enable sloppy focus
- c:add_signal("mouse::enter", function(c)
- if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
- and awful.client.focus.filter(c) then
- client.focus = c
- end
- end)
-
- if not startup then
- -- Set the windows at the slave,
- -- i.e. put it at the end of others instead of setting it master.
- -- awful.client.setslave(c)
-
- -- Put windows in a smart way, only if they does not set an initial position.
- if not c.size_hints.user_position and not c.size_hints.program_position then
- awful.placement.no_overlap(c)
- awful.placement.no_offscreen(c)
- end
- end
-end)
-
-client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
-client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
--- }}}
-
--- Autorun {{{
-local r = require("runonce")
-local autostart = {
- "urxvtd -q -f -o",
- "~/etc/Dropbox/autostart",
-}
-
-for idx=1, #autostart do
- r.run(autostart[idx])
-end
-
-local runaways = {
- --"setxkbmap -model us -layout us -variant intl",
- --"xinput set-button-map 13 1 2 3 5 4 7 6",
-}
-
-for idx=1, #runaways do
- awful.util.spawn_with_shell(runaways[idx])
-end
--- }}}}
View
74 awesome/runonce.lua
@@ -1,74 +0,0 @@
--- @author Peter J. Kranz (Absurd-Mind, peter@myref.net)
--- Any questions, criticism or praise just drop me an email
-
-local M = {}
-
--- get the current Pid of awesome
-local function getCurrentPid()
- -- get awesome pid from pgrep
- local fpid = io.popen("pgrep -u " .. os.getenv("USER") .. " -o awesome")
- local pid = fpid:read("*n")
- fpid:close()
-
- -- sanity check
- if pid == nil then
- return -1
- end
-
- return pid
-end
-
-local function getOldPid(filename)
- -- open file
- local pidFile = io.open(filename)
- if pidFile == nil then
- return -1
- end
-
- -- read number
- local pid = pidFile:read("*n")
- pidFile:close()
-
- -- sanity check
- if pid <= 0 then
- return -1
- end
-
- return pid;
-end
-
-local function writePid(filename, pid)
- local pidFile = io.open(filename, "w+")
- pidFile:write(pid)
- pidFile:close()
-end
-
-local function shallExecute(oldPid, newPid)
- -- simple check if equivalent
- if oldPid == newPid then
- return false
- end
-
- return true
-end
-
-local function getPidFile()
- local host = io.lines("/proc/sys/kernel/hostname")()
- return awful.util.getdir("cache") .. "/awesome." .. host .. ".pid"
-end
-
--- run Once per real awesome start (config reload works)
--- does not cover "pkill awesome && awesome"
-function M.run(shellCommand)
- -- check and Execute
- if shallExecute(M.oldPid, M.currentPid) then
- awful.util.spawn_with_shell(shellCommand)
- end
-end
-
-M.pidFile = getPidFile()
-M.oldPid = getOldPid(M.pidFile)
-M.currentPid = getCurrentPid()
-writePid(M.pidFile, M.currentPid)
-
-return M
View
129 awesome/scratch/drop.lua
@@ -1,129 +0,0 @@
--------------------------------------------------------------------
--- 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:
--- require("scratch")
--- to the top of your rc.lua, and call it from a keybinding:
--- scratch.drop(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
-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
-
- if not dropdown[prog] then
- dropdown[prog] = {}
-
- -- Add unmanage signal for scratchdrop programs
- capi.client.add_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, width = width, 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
- capi.client.remove_signal("manage", spawnw)
- end
-
- -- Add manage signal and spawn the program
- capi.client.add_signal("manage", spawnw)
- awful.util.spawn_with_shell(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
-
-setmetatable(_M, { __call = function(_, ...) return toggle(...) end })
View
12 awesome/scratch/init.lua
@@ -1,12 +0,0 @@
----------------------------------------------------------------
--- Drop-down applications and scratchpad manager for awesome wm
----------------------------------------------------------------
--- Coded by: * Adrian C. (anrxc) <anrxc@sysphere.org>
--- Licensed under the WTFPL version 2
--- * http://sam.zoy.org/wtfpl/COPYING
----------------------------------------------------------------
-
-require("scratch.pad")
-require("scratch.drop")
-
-module("scratch")
View
130 awesome/scratch/pad.lua
@@ -1,130 +0,0 @@
----------------------------------------------------------------
--- Basic scratchpad manager for the awesome window manager
----------------------------------------------------------------
--- Coded by: * Adrian C. (anrxc) <anrxc@sysphere.org>
--- Licensed under the WTFPL version 2
--- * http://sam.zoy.org/wtfpl/COPYING
----------------------------------------------------------------
--- To use this module add:
--- require("scratch")
--- to the top of your rc.lua, and call:
--- scratch.pad.set(c, width, height, sticky, screen)
--- from a clientkeys binding, and:
--- scratch.pad.toggle(screen)
--- from a globalkeys binding.
---
--- Parameters:
--- c - Client to scratch or un-scratch
--- width - Width in absolute pixels, or width percentage
--- when <= 1 (0.50 (50% of the screen) by default)
--- height - Height in absolute pixels, or height percentage
--- when <= 1 (0.50 (50% 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 capi = {
- mouse = mouse,
- client = client,
- screen = screen
-}
-
--- Scratchpad: basic scratchpad manager for the awesome window manager
-module("scratch.pad")
-
-local scratchpad = {}
-
--- Toggle a set of properties on a client.
-local function toggleprop(c, prop)
- c.ontop = prop.ontop or false
- c.above = prop.above or false
- c.hidden = prop.hidden or false
- c.sticky = prop.stick or false
- c.skip_taskbar = prop.task or false
-end
-
--- Scratch the focused client, or un-scratch and tile it. If another
--- client is already scratched, replace it with the focused client.
-function set(c, width, height, sticky, screen)
- width = width or 0.50
- height = height or 0.50
- sticky = sticky or false
- screen = screen or capi.mouse.screen
-
- local function setscratch(c)
- -- Scratchpad is floating and has no titlebar
- awful.client.floating.set(c, true); awful.titlebar.remove(c)
-
- -- Scratchpad client properties
- toggleprop(c, {ontop=true, above=true, task=true, stick=sticky})
-
- -- Scratchpad 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
-
- c:geometry({ -- Scratchpad is always centered on screen
- x = screengeom.x + (screengeom.width - width) / 2,
- y = screengeom.y + (screengeom.height - height) / 2,
- width = width, height = height
- })
-
- -- Scratchpad should not loose focus
- c:raise(); capi.client.focus = c
- end
-
- -- Prepare a table for storing clients,
- if not scratchpad.pad then scratchpad.pad = {}
- -- add unmanage signal for scratchpad clients
- capi.client.add_signal("unmanage", function (c)
- for scr, cl in pairs(scratchpad.pad) do
- if cl == c then scratchpad.pad[scr] = nil end
- end
- end)
- end
-
- -- If the scratcphad is emtpy, store the client,
- if not scratchpad.pad[screen] then
- scratchpad.pad[screen] = c
- -- then apply geometry and properties
- setscratch(c)
- else -- If a client is already scratched,
- local oc = scratchpad.pad[screen]
- -- unscratch, and compare it with the focused client
- awful.client.floating.toggle(oc); toggleprop(oc, {})
- -- If it matches clear the table, if not replace it
- if oc == c then scratchpad.pad[screen] = nil
- else scratchpad.pad[screen] = c; setscratch(c) end
- end
-end
-
--- Move the scratchpad to the current workspace, focus and raise it
--- when it's hidden, or hide it when it's visible.
-function toggle(screen)
- screen = screen or capi.mouse.screen
-
- -- Check if we have a client on storage,
- if scratchpad.pad and
- scratchpad.pad[screen] ~= nil
- then -- and get it out, to play
- local c = scratchpad.pad[screen]
-
- -- If it's visible on another tag hide it,
- if c:isvisible() == false then c.hidden = true
- -- and move it to the current worskpace
- awful.client.movetotag(awful.tag.selected(screen), c)
- end
-
- -- Focus and raise if it's hidden,
- if c.hidden then
- awful.placement.centered(c)
- c.hidden = false
- c:raise(); capi.client.focus = c
- else -- hide it if it's not
- c.hidden = true
- end
- end
-end
View
97 awesome/themes/defaultmod/theme.lua
@@ -1,97 +0,0 @@
----------------------------
--- Default awesome theme --
----------------------------
-
-theme = {}
-theme.wallpaper_cmd = { "nitrogen --restore" }
-
-theme.font = "Droid Sans Mono 8"
-
-theme.bg_normal = "#0F0F0F"
-theme.bg_focus = "#0F0F0F"
---theme.bg_urgent = "#000000"
-theme.bg_urgent = "#000000"
-theme.bg_minimize = "#000000"
-
-theme.fg_normal = "#555555"
-theme.fg_focus = "#FFFFFF"
-theme.fg_urgent = "#ff0000"
-theme.fg_minimize = "#333333"
-
-theme.border_width = "0"
-theme.border_normal = "#151515"
-theme.border_focus = "#C6C6C6"
-theme.border_marked = "#000000"
-
-theme.basedir = "/usr/share/awesome/themes/default/"
-
-
--- There are other variable sets
--- overriding the default one when
--- defined, the sets are:
--- [taglist|tasklist]_[bg|fg]_[focus|urgent]
--- titlebar_[bg|fg]_[normal|focus]
--- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
--- mouse_finder_[color|timeout|animate_timeout|radius|factor]
--- Example:
---theme.taglist_bg_focus = "#ff0000"
-
--- Display the taglist squares
---theme.taglist_squares_sel = theme.basedir .. "taglist/squarefw.png"
---theme.taglist_squares_unsel = theme.basedir .. "taglist/squarew.png"
-
---theme.tasklist_floating_icon = theme.basedir .. "tasklist/floatingw.png"
-
--- Variables set for theming the menu:
--- menu_[bg|fg]_[normal|focus]
--- menu_[border_color|border_width]
-theme.menu_submenu_icon = theme.basedir .. "submenu.png"
-theme.menu_height = "15"
-theme.menu_width = "100"
-
--- You can add as many variables as
--- you wish and access them by using
--- beautiful.variable in your rc.lua
---theme.bg_widget = "#cc0000"
-
--- Define the image to load
-theme.titlebar_close_button_normal = theme.basedir .. "titlebar/close_normal.png"
-theme.titlebar_close_button_focus = theme.basedir .. "titlebar/close_focus.png"
-
-theme.titlebar_ontop_button_normal_inactive = theme.basedir .. "titlebar/ontop_normal_inactive.png"
-theme.titlebar_ontop_button_focus_inactive = theme.basedir .. "titlebar/ontop_focus_inactive.png"
-theme.titlebar_ontop_button_normal_active = theme.basedir .. "titlebar/ontop_normal_active.png"
-theme.titlebar_ontop_button_focus_active = theme.basedir .. "titlebar/ontop_focus_active.png"
-
-theme.titlebar_sticky_button_normal_inactive = theme.basedir .. "titlebar/sticky_normal_inactive.png"
-theme.titlebar_sticky_button_focus_inactive = theme.basedir .. "titlebar/sticky_focus_inactive.png"
-theme.titlebar_sticky_button_normal_active = theme.basedir .. "titlebar/sticky_normal_active.png"
-theme.titlebar_sticky_button_focus_active = theme.basedir .. "titlebar/sticky_focus_active.png"
-
-theme.titlebar_floating_button_normal_inactive = theme.basedir .. "titlebar/floating_normal_inactive.png"
-theme.titlebar_floating_button_focus_inactive = theme.basedir .. "titlebar/floating_focus_inactive.png"
-theme.titlebar_floating_button_normal_active = theme.basedir .. "titlebar/floating_normal_active.png"
-theme.titlebar_floating_button_focus_active = theme.basedir .. "titlebar/floating_focus_active.png"
-
-theme.titlebar_maximized_button_normal_inactive = theme.basedir .. "titlebar/maximized_normal_inactive.png"
-theme.titlebar_maximized_button_focus_inactive = theme.basedir .. "titlebar/maximized_focus_inactive.png"
-theme.titlebar_maximized_button_normal_active = theme.basedir .. "titlebar/maximized_normal_active.png"
-theme.titlebar_maximized_button_focus_active = theme.basedir .. "titlebar/maximized_focus_active.png"
-
--- You can use your own layout icons like this:
-theme.layout_fairh = theme.basedir .. "layouts/fairhw.png"
-theme.layout_fairv = theme.basedir .. "layouts/fairvw.png"
-theme.layout_floating = theme.basedir .. "layouts/floatingw.png"
-theme.layout_magnifier = theme.basedir .. "layouts/magnifierw.png"
-theme.layout_max = theme.basedir .. "layouts/maxw.png"
-theme.layout_fullscreen = theme.basedir .. "layouts/fullscreenw.png"
-theme.layout_tilebottom = theme.basedir .. "layouts/tilebottomw.png"
-theme.layout_tileleft = theme.basedir .. "layouts/tileleftw.png"
-theme.layout_tile = theme.basedir .. "layouts/tilew.png"
-theme.layout_tiletop = theme.basedir .. "layouts/tiletopw.png"
-theme.layout_spiral = theme.basedir .. "layouts/spiralw.png"
-theme.layout_dwindle = theme.basedir .. "layouts/dwindlew.png"
-
-theme.awesome_icon = "/usr/share/awesome/icons/awesome16.png"
-
-return theme

0 comments on commit bad6921

Please sign in to comment.
Something went wrong with that request. Please try again.