summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-03-14 12:43:30 +0100
committerache <ache@ache.one>2017-03-14 12:43:30 +0100
commit7f9e1fa35643ada6f9b68b8b602b26c7184836ef (patch)
treed0455c83d6d4bea8ee4850296b1b9db3a1353b31
parentInit commit (diff)
No shitfy ...
-rw-r--r--rc.lua222
1 files changed, 68 insertions, 154 deletions
diff --git a/rc.lua b/rc.lua
index 657f3e2..6fa66ed 100644
--- a/rc.lua
+++ b/rc.lua
@@ -1,5 +1,3 @@
--- default rc.lua for shifty
---
-- Standard awesome library
local gears = require("gears")
local awful = require("awful")
@@ -12,18 +10,16 @@ local beautiful = require("beautiful")
local naughty = require("naughty")
local vicious = require("vicious")
local menubar = require("menubar")
--- shifty - dynamic tagging library
-local shifty = require("lib.shifty.init")
awful.screen = require("awful.screen")
+local hotkeys_popup = require("awful.hotkeys_popup").widget
+-- Lain
+local lain = require("lain")
-local naughty = require("naughty")
--- Lain
-local lain = require("lain")
-- {{{ Error handling
-- Check if awesome encountered an error during startup and fell back to
@@ -67,8 +63,7 @@ editor_cmd = terminal .. " -e " .. editor
modkey = "Mod4"
-- Table of layouts to cover with awful.layout.inc, order matters.
-local layouts =
-{
+awful.layout.layouts = {
lain.layout.uselesspiral, --1
lain.layout.uselessfairnogap, --2
awful.layout.suit.tile, --3
@@ -83,91 +78,19 @@ if beautiful.wallpaper then
end
-- }}}
--- Shifty configured tags.
-shifty.config.tags = {
- ["一"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 1,
- screen = 1,
- },
- ["二"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 2,
- },
- ["三"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 3,
- },
- ["四"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 4,
- },
- ["五"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 5,
- },
- ["六"] = {
- layout = layouts[2],
- mwfact = 0.60,
- init = true,
- position = 6,
- },
- ["七"] = {
- layout = layouts[1],
- mwfact = 0.60,
- init = true,
- position = 7,
- },
- ["八"] = {
- layout = layouts[1],
- mwfact = 0.60,
- init = true,
- position = 8,
- },
-}
--- SHIFTY: application matching rules
--- order here matters, early rules will be applied first
-shifty.config.apps = {
- { match = {""},
- buttons = awful.util.table.join(
- awful.button({}, 1, function (c) client.focus = c; c:raise() end),
- awful.button({modkey}, 1, function(c)
- client.focus = c
- c:raise()
- awful.mouse.client.move(c)
- end),
- awful.button({modkey}, 3, awful.mouse.client.resize)
- )
- },
-}
+awful.screen.connect_for_each_screen(function(s)
+ awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1])
+
+ s.mylayoutbox = awful.widget.layoutbox(s)
+ s.mylayoutbox:buttons(awful.util.table.join(
+ awful.button({ }, 1, function () awful.layout.inc( 1) end),
+ awful.button({ }, 3, function () awful.layout.inc(-1) end),
+ awful.button({ }, 4, function () awful.layout.inc( 1) end),
+ awful.button({ }, 5, function () awful.layout.inc(-1) end)))
+end)
+
--- SHIFTY: default tag creation rules
--- parameter description
--- * floatBars : if floating clients should always have a titlebar
--- * guess_name : should shifty try and guess tag names when creating
--- new (unconfigured) tags?
--- * guess_position: as above, but for position parameter
--- * run : function to exec when shifty creates a new tag
--- * all other parameters (e.g. layout, mwfact) follow awesome's tag API
-shifty.config.defaults = {
- layout = awful.layout.suit.tile,
- ncol = 1,
- mwfact = 0.10,
- floatBars = false,
- guess_name = true,
- guess_position = false,
-}
-- {{{ Menu
-- Create a laucher widget and a main menu
@@ -380,6 +303,7 @@ for s = 1, screen.count() do
-- Create a promptbox for each screen
mypromptbox[s] = awful.widget.prompt()
screen[s].mypromptbox = mypromptbox[s]
+
-- Create a taglist widget
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
@@ -422,11 +346,6 @@ mytimer:start()
end
-- }}}
--- SHIFTY: initialize shifty
--- the assignment of shifty.taglist must always be after its actually
--- initialized with awful.widget.taglist.new()
-shifty.taglist = mytaglist
-shifty.init()
wp_timer = timer { timeout = 15 }
wp_timer:connect_signal("timeout", function() showHideWibox() end)
@@ -457,7 +376,7 @@ layoutKkb = 1
-- {{{ Key bindings
globalkeys = awful.util.table.join(
- -- Raccour cis perso
+ -- Raccourcis perso
awful.key({ }, "XF86AudioRaiseVolume", function ()
awful.util.spawn("amixer set Master 9%+") end),
awful.key({ }, "XF86AudioLowerVolume", function ()
@@ -493,26 +412,6 @@ globalkeys = awful.util.table.join(
awful.key({ modkey, "Control" }, "Right", function() awful.screen.focus_relative( 1) end ),
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
- -- Shifty: keybindings specific to shifty
- awful.key({modkey, "Shift"}, "d", shifty.del), -- delete a tag
- -- awful.key({modkey, "Shift"}, "n", shifty.send_prev), -- client to prev tag
- -- awful.key({modkey}, "n", shifty.send_next), -- client to next tag
- awful.key({modkey, "Control"},
- "n",
- function()
- local t = awful.tag.selected()
- local s = awful.util.cycle(screen.count(), awful.tag.getscreen(t) + 1)
- awful.tag.history.restore()
- t = shifty.tagtoscr(s, t)
- awful.tag.viewonly(t)
- end),
- awful.key({modkey}, "a", shifty.add), -- creat a new tag
- awful.key({modkey, "Shift"}, "r", shifty.rename), -- rename a tag
- awful.key({modkey, "Control"}, "a", act ),
- awful.key({modkey, "Shift"}, "a", -- nopopup new tag
- function()
- shifty.add({nopopup = true})
- end),
awful.key({ modkey, }, "Tab",
function ()
@@ -624,7 +523,6 @@ globalkeys = awful.util.table.join(
clientkeys = awful.util.table.join(
awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
awful.key({ modkey, }, "c", function (c)
-
if c.name == "Lecteur multimédia VLC" then
awful.util.spawn_with_shell('sleep 0.3;xte "keydown Control_L" "keydown v" "keyup v" "keyup Control_L"')
else
@@ -637,7 +535,6 @@ clientkeys = awful.util.table.join(
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
awful.key({ modkey, }, "o", awful.client.movetoscreen ),
-- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
- awful.key({ modkey, "Shift" }, "o", function (c) shifty.create_titlebar(c) awful.titlebar(c) c.border_width = 1 end),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
@@ -726,40 +623,6 @@ clientkeys = awful.util.table.join(
)
--- SHIFTY: assign client keys to shifty for use in
--- match() function(manage hook)
-shifty.config.clientkeys = clientkeys
-shifty.config.modkey = modkey
-
--- 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, (shifty.config.maxtags or 9) do
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. i + 9,
- function ()
- awful.tag.viewonly(shifty.getpos(i))
- end),
- awful.key({ modkey, "Control" }, "#" .. i + 9,
- function ()
- awful.tag.viewtoggle(shifty.getpos(i))
- end),
- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- function ()
- if client.focus then
- local t = shifty.getpos(i)
- awful.client.movetotag(t)
- awful.tag.viewonly(t)
- end
- end),
- awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
- function ()
- if client.focus then
- awful.client.toggletag(shifty.getpos(i))
- end
- end))
-end
-
-- {{{ Signals
@@ -838,6 +701,57 @@ end)
root.keys(globalkeys)
-- }}}
+-- {{{ Rules
+-- Rules to apply to new clients (through the "manage" signal).
+awful.rules.rules = {
+ -- All clients will match this rule.
+ { rule = { },
+ properties = { border_width = beautiful.border_width,
+ border_color = beautiful.border_normal,
+ focus = awful.client.focus.filter,
+ raise = true,
+ keys = clientkeys,
+ buttons = clientbuttons,
+ screen = awful.screen.preferred,
+ placement = awful.placement.no_overlap+awful.placement.no_offscreen
+ }
+ },
+
+ -- Floating clients.
+ { rule_any = {
+ instance = {
+ "DTA", -- Firefox addon DownThemAll.
+ "copyq", -- Includes session name in class.
+ },
+ class = {
+ "Arandr",
+ "Gpick",
+ "Kruler",
+ "MessageWin", -- kalarm.
+ "Sxiv",
+ "Wpa_gui",
+ "pinentry",
+ "veromix",
+ "xtightvncviewer"},
+
+ name = {
+ "Event Tester", -- xev.
+ },
+ role = {
+ "AlarmWindow", -- Thunderbird's calendar.
+ "pop-up", -- e.g. Google Chrome's (detached) Developer Tools.
+ }
+ }, properties = { floating = true }},
+
+ -- Add titlebars to normal clients and dialogs
+ { rule_any = {type = { "normal", "dialog" }
+ }, properties = { titlebars_enabled = true }
+ },
+}
+
+
+
+
-- awful.util.spawn_with_shell("volumeicon")
--awful.util.spawn_with_shell("nitrogen --restore")
-- awful.util.spawn_with_shell("setxkbmap fr")