-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from timroes/awesome4
Awesome v4 config
- Loading branch information
Showing
57 changed files
with
963 additions
and
1,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
root = true | ||
|
||
[*.lua] | ||
indent_style = tab | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- This configuration handles urgent clients (clients with demands_attention hint). | ||
|
||
local awful = require('awful') | ||
local lunaconf = require('lunaconf') | ||
|
||
local function jump_to_urgent() | ||
local next_urgent = awful.client.urgent.get() | ||
if next_urgent then | ||
client.focus = next_urgent | ||
next_urgent:raise() | ||
end | ||
end | ||
|
||
-- On MOD + backslash jump to next window that has the urgent hint set | ||
lunaconf.keys.globals( | ||
awful.key({ lunaconf.config.MOD }, '\\', jump_to_urgent) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,77 @@ | ||
local awful = require("awful") | ||
local config = require("lunaconf.config") | ||
local awful = require('awful') | ||
local lunaconf = require('lunaconf') | ||
|
||
local layouts = { | ||
awful.layout.suit.max, | ||
awful.layout.suit.tile.right | ||
} | ||
|
||
tags = {} | ||
tag_keys = root.keys() | ||
local screens_in_order = {} | ||
|
||
for s = 1, screen.count() do | ||
-- Get name for screen tag (horizontal position of screen) | ||
local tagname = screen_position(s) | ||
-- Create tag for that name and select it | ||
local tag = awful.tag.add(tagname, { screen = s, layout = layouts[1], screen_tag = true }) | ||
tag.selected = true | ||
-- Create the primary tag on each screen | ||
awful.screen.connect_for_each_screen(function(s) | ||
-- Create the new primary tag for this screen (leave it's name empty yet) | ||
-- since the screen.list signal will take care renaming it in a moment | ||
local tag = awful.tag.add('-', { | ||
screen = s, -- Set the screen to the current | ||
layout = layouts[1], -- Set its layout to the default layout | ||
is_primary = true, -- Add a custom flag to mark it as the primary for this screen | ||
selected = true | ||
}) | ||
-- Attach the tag as the primary tag to the given screen | ||
s.primary_tag = tag | ||
end) | ||
|
||
-- Switch to tag | ||
local tagFocus = function() | ||
if client.focus and client.focus.screen == s and awful.tag.selected(s) == tag then | ||
--- Iterate over all screens and give their primary tag the name of their screen | ||
--- position. Also save this renamed order in screens_in_order, which will be | ||
--- used to lookup the screens in hotkeys. | ||
local function rename_screen_tags() | ||
screens_in_order = {} | ||
lunaconf.screens.iterate_in_order(function(pos, s) | ||
screens_in_order[pos] = s | ||
s.primary_tag.name = tostring(pos) | ||
end) | ||
end | ||
|
||
-- Rename screen tags if screen list changes or if the geometry of a screen changes | ||
screen.connect_signal('list', rename_screen_tags) | ||
screen.connect_signal('property::geometry', rename_screen_tags) | ||
rename_screen_tags() | ||
|
||
local function focus_tag(screen_position) | ||
local s = screens_in_order[screen_position] | ||
-- Ignore key presses if there is no screen with that position | ||
if s then | ||
if client.focus and client.focus.screen == s and s.selected_tag == s.primary_tag then | ||
-- If screen is already focused switch to next client | ||
awful.client.focus.byidx(1) | ||
if client.focus then client.focus:raise() end | ||
else | ||
if not tag.selected then | ||
awful.tag.viewmore({ tag }, s) | ||
if not s.primary_tag.selected then | ||
awful.tag.viewmore({ s.primary_tag }, s) | ||
end | ||
-- Focus last focused client on this tag | ||
local focus = awful.client.focus.history.get(s, 0) | ||
if focus then client.focus = focus end | ||
end | ||
end | ||
-- Move to tag | ||
local moveToTag = function() | ||
if not client.focus then return end | ||
awful.client.movetotag(tag, client.focus) | ||
end | ||
end | ||
|
||
-- Assign key shortcuts for every tag | ||
tag_keys = awful.util.table.join(tag_keys, | ||
-- Switch to tag | ||
awful.key({ config.MOD }, "#" .. tagname + 9, tagFocus), -- Numbers | ||
awful.key({ config.MOD }, "#" .. tagname + 86, tagFocus), -- Numpad keys | ||
-- Move client to tag | ||
awful.key({ config.MOD, "Control" }, "#" .. tagname + 9, moveToTag), | ||
awful.key({ config.MOD, "Control" }, "#" .. tagname + 86, moveToTag) | ||
) | ||
-- Add hotkeys to navigate to screens between 1 and 9 | ||
for i = 1, 9 do | ||
local key = awful.key({ lunaconf.config.MOD }, '#' .. i + 9, function() | ||
focus_tag(i) | ||
end) | ||
lunaconf.keys.globals(key) | ||
end | ||
|
||
tag_keys = awful.util.table.join(tag_keys, | ||
-- Switch layouts for the current screen | ||
awful.key({ config.MOD }, "s", function() | ||
-- Only allow split screen on regular (screen) tags | ||
local cur_tag = awful.tag.selected(client.focus.screen) | ||
if #cur_tag.name <= 1 then | ||
awful.layout.inc(layouts, 1, client.focus.screen) | ||
end | ||
end) | ||
) | ||
local switch_layout = awful.key({ lunaconf.config.MOD }, "s", function() | ||
-- Only allow split screen on screen tags | ||
local cur_tag = client.focus.screen.selected_tag | ||
if cur_tag.is_primary then | ||
awful.layout.inc(layouts, 1, client.focus.screen) | ||
end | ||
end) | ||
|
||
root.keys(tag_keys) | ||
lunaconf.keys.globals(switch_layout) |
Oops, something went wrong.