Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API updates and async calls. #2

Open
wants to merge 224 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
41bb25a
Chenge the volume interface
Oct 7, 2011
2dd469a
Disable dictionary bindings
Oct 8, 2011
adac702
Create a REDME with basic depencies
Oct 8, 2011
192088d
Change terminal to urxvt
Oct 8, 2011
2d00059
Change volume control keybings
Oct 10, 2011
b6fabd4
Comment britness functions
Oct 10, 2011
5381b09
Quote the sound interface on volume_adjust function
Oct 11, 2011
699cefb
Change volume_adjust to use get_volume to check the volume instead of…
Oct 11, 2011
5a95ef8
volume_adjust retuns the volume
Oct 11, 2011
0290cc8
Add a space in amixer set command, volume_adjust now works, properly
Oct 11, 2011
90249b0
Change terminal and browser
Oct 12, 2011
14e9020
Change tags names to more readable ones
Oct 12, 2011
ab93238
Remove rules for apps i dont use
Oct 12, 2011
91831ce
Remove more tags
Oct 17, 2011
55203b8
Change Firefox rules by luakit
Oct 18, 2011
8393af0
Make MPlayer float all the time
Oct 18, 2011
b255f72
Fix some indent in tags table
Oct 18, 2011
8b52d5e
Change the wallpaper4
Oct 18, 2011
5e997b5
Remove double terminal keybing bug
Oct 18, 2011
089c3c1
Set tiled layout as default on most of tags
Oct 18, 2011
296a613
Change the ICAO weather code to the near aeroport
Oct 20, 2011
62cd6fa
City is now read from ICAO station data
Oct 20, 2011
66c77d9
Harcoded the country in the weather info
Oct 20, 2011
23459a6
Change the temperature unit to Celcius
Oct 20, 2011
72e6df9
Add some extra info on the weather tooltip, there is now a indicator …
Oct 20, 2011
50bac4b
The volume interface is now called master again
Nov 19, 2011
ed3ac56
Change volume interface
Nov 22, 2011
f1f5568
Merge branch 'test'
Nov 22, 2011
e04303b
Change the wallpaper stretch to fullscreen
Dec 12, 2011
c951434
Remove local shifty
Nov 22, 2011
2c76658
Updated depency info and working version
Dec 5, 2011
711e081
Main tag is the only initiated now
Mar 24, 2012
bc5b349
Mplayer2 produces a new window name
Apr 23, 2012
a592758
Change windows border colors, marked is now the normal color and vice…
Jun 4, 2012
6b353f2
Call vicious to an object
Aug 13, 2012
982f6f8
Remove trailing whitespaces
Aug 14, 2012
26275ee
Volume keybindings reset
Aug 14, 2012
c3b17aa
Script to get keyboard keycodes
Sep 7, 2012
7b24f7c
Deduging script
Sep 7, 2012
edb9856
README Markdown documentation
Sep 7, 2012
287f226
Disable right-click menu.
Jan 16, 2013
de5e66c
Use new widget library instace methods
Jan 16, 2013
46a94ae
Use new set_image method.
Jan 16, 2013
9bf4cbe
Comment out gradient colors
Jan 16, 2013
abc1d1a
Change image wibox height propriety.
Jan 17, 2013
34b6a91
Repacle add_signal with connect_signal
Jan 17, 2013
377e234
Return ramdom value for the time being on the fs widget.
Jan 17, 2013
71ed5e5
Change widget buttons method call.
Jan 17, 2013
c3dff38
New widget instancing method for systray type.
Jan 17, 2013
0a402e4
Comment out widget margins.
Jan 17, 2013
c9ba1af
Remove date and time widget
Jan 23, 2013
fa91b23
Remove hoover calender on the date and time widget
Jan 23, 2013
c0adb1c
Remove wifi widget
Jan 23, 2013
cf9b09b
Remove weather widget
Jan 23, 2013
5f2c6e7
Remove filesystem widget
Jan 23, 2013
693094c
Remove memory usage widget
Jan 23, 2013
01fe11c
Remove volume widget
Jan 23, 2013
318ce30
Use volume functions directly.
Jan 23, 2013
1661e79
Remove battery widget.
Jan 23, 2013
e0a67b4
Remove all widget tooltips.
Jan 23, 2013
f1ea6af
Bye Bye, Vicious !
Jan 23, 2013
2d84da3
Remove widget margins.
Jan 23, 2013
6905716
Deprecated stuff.
Jan 23, 2013
da80631
Check the current screen before moving to previous on next tags.
Jan 23, 2013
6d469cc
Tasklist button operation update.
Jan 23, 2013
ca5f17b
New layout API on screen wibox creation.
Jan 23, 2013
9a27cde
Shifty prompbox is deprecaded.
Jan 23, 2013
35918be
New Shifty API usage and new keybings for those same functions.
Jan 23, 2013
475e773
Require Awesome WM libraris to local namespace
Feb 27, 2013
77eaa7c
Bye Bye Shifty.
Feb 27, 2013
5ddbfa8
Require awfuk locally.
Feb 27, 2013
49bcb0d
New layout list.
Feb 27, 2013
05fa49f
Set tags on awful only.
Feb 27, 2013
162d3c5
Require wibox and awful locally.
Feb 27, 2013
8678b81
Require awful locally for the global-keybindings file.
Feb 27, 2013
f8b1773
Remove client move to another that keybindings. For now.
Feb 27, 2013
cb2f642
Require awful locally on client keybindings.
Feb 27, 2013
81ad05f
Set global keybindings and mouse bindings.
Feb 27, 2013
17ec0ad
Rules common to all the clients.
Feb 28, 2013
7898ab0
Make Mplayer float.
Feb 28, 2013
71183c7
Move Signals logic to own file.
Feb 28, 2013
c984c47
Client Signals to update tittle bars on window creation/destruction.
Feb 28, 2013
2377bb3
No need to set taskbar height.
Feb 28, 2013
88d1410
Use theme.wallpaper to set the wallpaper.
Feb 28, 2013
6f3c90b
Require signals file.
Feb 28, 2013
f46f77b
Proper currenttags call.
Feb 28, 2013
25dd0e9
Move default apps and keys to rc.lua
Feb 28, 2013
ed3bff6
Rearrange rc.lua
Feb 28, 2013
650a794
Set wallapaper with gears.
Feb 28, 2013
ecebf70
Changes the wallpaper to a king of the hammers night event.
Feb 28, 2013
e2b614e
Replace add_signal with connect_signal.
Mar 1, 2013
e2d82e9
Require beautiful locally on the signals file.
Mar 1, 2013
2084531
Naughty calling typo.
Mar 1, 2013
790bbc1
Dump awful.rules.rules table with penlight.
Mar 1, 2013
1544b5b
Fuck inline char limits.
Mar 1, 2013
aa998d6
Change the taskbar to a darkhish with a blue focus style.
Mar 1, 2013
7b9548a
Set minimized clients colors to a greyish blue.
Mar 1, 2013
d79623f
visible() was replaced by isvisible() in 3.5
Mar 1, 2013
61098b7
Local scope for wibox tables.
Mar 1, 2013
d69f64d
Fuck me and my typos, this is not how you spell properties.
Mar 1, 2013
df9628f
Change MPlayer to mplayer2 in rules.
Mar 1, 2013
86495bd
Global scope on wibox elements.
Mar 1, 2013
46695ee
Keep luakit on the www tag.
Mar 1, 2013
e253454
Enable auto focus.
Mar 1, 2013
6f1e1cf
Keybindings to move to another tag.
Mar 1, 2013
9525599
Merge two tags keybind.
Mar 1, 2013
3c44820
Move client to another tag keybind.
Mar 1, 2013
3d1b759
Toggle client on another tag keybind.
Mar 1, 2013
ad864ff
Modules can only return one value.
Mar 1, 2013
41fde3d
Tile as default layout on all tags.
Mar 1, 2013
04e6c09
Remove global mouse bindings.
Mar 1, 2013
e87769f
Text Clock Widget.
Mar 4, 2013
1456aea
Select window border in blue color.
Mar 5, 2013
c75f521
Use gettags method to get the tag instead of the tags table,
Mar 7, 2013
2064acb
Set tags with tyranical
Mar 7, 2013
112f1ae
Get luakit tag with gettags.
Mar 7, 2013
7509012
Spawn luakit on www tag.
Mar 12, 2013
a0a469b
Update README
Mar 12, 2013
7251717
Merge Awesome 3.5 support
Mar 12, 2013
eac1ed0
Tyranical rules to make mplayer2 floating and centered.
Mar 12, 2013
c6b4571
Force Xephyr to float and be centered.
Mar 12, 2013
7ee43be
Add tags for the 2nd monitor.
Aug 29, 2013
7938f4f
Remname the tags all toghether.
Oct 30, 2013
0712e95
Set mpv to float.
Oct 31, 2013
a72e466
Call the rc script on the current directory.
Mar 8, 2014
b329004
Ignore Temporary files.
Mar 8, 2014
2c41b9f
Add tyrannical as submodule.
Mar 8, 2014
fc26b7a
Fix current tools.
Mar 8, 2014
38c4d9e
Tyrannical typo fix.
Mar 8, 2014
dd95abd
A system tray.
Mar 8, 2014
2cc898c
Battery widget stub.
Mar 10, 2014
33c4394
Add a timer to the update function.
Mar 10, 2014
4eba318
Add a basic widget functionality.
Mar 10, 2014
2237276
Load the battery icon on the image widget.
Mar 10, 2014
d73070b
Remove naught notifications from the battery values.
Mar 10, 2014
0fb8ef1
Reorganize widget format.
Mar 10, 2014
ed4f06f
Set new format that fits the image background.
Mar 10, 2014
6b0fd98
Reformulate the battery widget using a base widget.
Mar 11, 2014
3ec0465
Move the update function out of the worker object.
Mar 11, 2014
7d86cdf
Rename metafunction to new.
Mar 12, 2014
a642fd4
Total needs to be a decimal value, percentage needs to be int.
Mar 12, 2014
76fd26a
Change battery meter color based on status.
Mar 12, 2014
bfbd9a3
Removing one more pixel to the rectangle width just makes it a perfect
Mar 12, 2014
ecb1037
Naughty notications on for the battery status changes.
Mar 12, 2014
10196b6
Set default battery status levels.
Mar 12, 2014
d0fe590
Add a charging icon when the battery is in charging time.
Mar 12, 2014
5c90652
Import radical for some sweet menus.
Mar 12, 2014
2651b3d
Finnally a battery widget working.
Mar 12, 2014
fcc95be
Support a not connected battery.
Mar 17, 2014
be7b3b8
Lets not be wasteful. Closing the stream on time.
Mar 17, 2014
e022bc1
Set the metatable skeleton.
Mar 22, 2014
4e2c738
Get the volume method.
Mar 22, 2014
c98bfb1
Use the local table was info table.
Mar 22, 2014
8fb9ede
Remove weird symbol from paste code.
Mar 22, 2014
723cdcc
Correct the icons loading path.
Mar 22, 2014
ed25333
Stub the volume widget.
Mar 22, 2014
fe0de94
Return on the correct table for the metatable.
Mar 22, 2014
5e1e83e
Get the volume widget on the wibox.
Mar 22, 2014
59b02f6
Start using a layout.
Mar 22, 2014
70bb1d4
Textbox widget with volume.
Mar 24, 2014
7fa4e41
Make getvolume to main table.
Mar 24, 2014
33a97da
Set the volume function.
Mar 24, 2014
d2e0ff6
Call the new new volume set functions.
Mar 24, 2014
f3db5f7
Typo.
Mar 24, 2014
371c6a3
Add object function get.
Apr 11, 2014
1bc529d
Amixer does not need wildcards.
Apr 11, 2014
e9b5c92
Volume update timer.
Apr 11, 2014
1a13d5f
Refactor fancy notify.
Apr 11, 2014
5c79174
Use volume functions on the controls.
Apr 11, 2014
dd7e249
Set functions is now a menber of volume.
Apr 11, 2014
8639efd
Use volume widget volume control commands.
Apr 11, 2014
cf17d2d
Stub notify library.
Apr 18, 2014
db21907
Use new notify library.
Apr 18, 2014
06fcf7f
Remove old fancy notify.
Apr 18, 2014
c4b92fe
Icon parameter is now a full string.
Apr 19, 2014
4db737c
Fancy volume notification.
Apr 19, 2014
29bcec2
Return an int instead of a string on the volume state.
Apr 19, 2014
009887d
Update volume icon based on volume.
Apr 19, 2014
8401cec
Volume mute and unmute support.
Apr 19, 2014
4bcded6
Volume mute/unmute keybind.
Apr 19, 2014
f2c846b
Remove old volume functions.
Apr 19, 2014
f89f253
Move notify to a library directory.
Apr 19, 2014
aa8c36a
Volume widget and control.
Apr 19, 2014
e4f1346
My default browser is dwb now.
Apr 19, 2014
c8955b9
Return 0 instead of nil if the volume fails to read.
Jun 22, 2014
8371b31
Fix volume control commands.
Jun 22, 2014
37147b6
Proper volume control on the thinkpad.
Jun 22, 2014
6df0a76
Remove the control device out of mute get function.
Jun 30, 2014
2cde8fc
Trow an error message when the volume can not be read.
Jun 30, 2014
825f823
Volume control enhancements.
Jun 30, 2014
ded9d6e
I forgot a goddman fucking comma.
Jul 4, 2014
baaef7c
Add keybing to turn off the display
Jul 22, 2015
6722cce
Add brightness widget
Jul 23, 2015
7686a39
Add brightness widget to the toolbar
Jul 23, 2015
c729392
Add brightness control keybinds
Jul 23, 2015
be885ae
Add documentation with common mistakes
Jul 23, 2015
fb00bbf
Fix get keycodes script
Jul 23, 2015
a7fded1
Add screen backlight control widget
Jul 23, 2015
2cd0619
Replace tyrannical tags with awful
Dec 13, 2015
7f2110c
Replace tyranical properties with awful rules
Dec 13, 2015
3a0f35e
Update README
Dec 13, 2015
5bd87d0
Remove uneded directories
Dec 13, 2015
9799580
Remove tyrannical
Dec 13, 2015
4f035a8
Remove temp file
Dec 13, 2015
49e3af0
Remove vim shebang
Dec 13, 2015
18cd76e
Update theme colors to match the system
Dec 13, 2015
4b0cdea
Update theme colors
Dec 13, 2015
24b044e
Remove submodules
Dec 13, 2015
6ee5924
Change editor to neovim
Dec 13, 2015
852b70c
Change browser to firefox
Dec 13, 2015
5de6e61
Change screenlock
Dec 13, 2015
3294cc7
Remove keybind to blank the screen
Dec 13, 2015
0bc753f
Use ranger instead of thunar
Dec 13, 2015
0f20d96
Remove commented code
Dec 13, 2015
95404b8
Update settings
Dec 13, 2015
43e355c
Changed deprecated awful.tag.gettags(screen) to screen.tags
BeniaminK May 15, 2019
4eef14b
Changed deprecated awful.tag.viewonly(tag) to tag:view_only().
BeniaminK May 15, 2019
42ae1cc
Changed old API to new ones (gears.timer etc.)
BeniaminK May 15, 2019
6d2df71
Updated awful.tag.getscreen(t) to t.screen
BeniaminK May 15, 2019
d673ab3
Volume widget - changed blocking API to async.
BeniaminK May 15, 2019
32383c1
Brightness widget - changed blocking API to async.
BeniaminK May 15, 2019
feee7d3
Changing awful.util.spawn to awful.spawn.spawn and moving unused misc…
BeniaminK May 16, 2019
c48e0b4
Removed misc.notification that was a duplication of the brightness wi…
BeniaminK May 16, 2019
1c54859
Icons moved to the theme and proper destinations set based on beautif…
BeniaminK May 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Temp files
*swp
*swo
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Masterkorp's Awesome configuration

This is my Awesome WM config, originaly based on Guff's config.

### Testing
You can test the config with the debug.sh script on the scripts folder. Opens a
nested X session, so it can be tested within another WM

### Dependencies
[Awesome WM](http://awesome.naquadah.org/) 3.5 or higher

[Xephyr](http://www.freedesktop.org/wiki/Software/Xephyr) for the debug script
9 changes: 6 additions & 3 deletions cfg/client-bindings.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
clientkeys = awful.util.table.join(
local awful = require("awful")

local clientbinds = {}
clientbinds.keys = 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 ),
Expand All @@ -16,9 +19,9 @@ clientkeys = awful.util.table.join(
awful.key({ modkey, }, "/", awful.mouse.client.resize)
)

clientbuttons = awful.util.table.join(
clientbinds.buttons = 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))

shifty.config.clientkeys = clientkeys
return clientbinds
145 changes: 62 additions & 83 deletions cfg/global-bindings.lua
Original file line number Diff line number Diff line change
@@ -1,39 +1,30 @@
require("misc.dict")
local awful = require("awful")
local brightness = require("cfg.widgets.brightness")
local volume = require("cfg.widgets.volume")

globalkeys = awful.util.table.join(
local globalkeys = awful.util.table.join(
-- Special function keys
awful.key({ }, "XF86MonBrightnessUp", brightness_up),
awful.key({ }, "XF86MonBrightnessDown", brightness_down),
awful.key({ }, "XF86ScreenSaver", function () awful.util.spawn("lualock -n") end),
awful.key({ }, "XF86AudioLowerVolume", volume_down_and_update),
awful.key({ }, "XF86AudioRaiseVolume", volume_up_and_update),
awful.key({ }, "XF86AudioMute", volume_mute_and_update),
awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'") end),

-- Briteness is controled by hardware on this laptop
awful.key({ }, "XF86MonBrightnessDown", function () brightness:down(5) end),
awful.key({ }, "XF86MonBrightnessUp", function () brightness:up(5) end),
awful.key({ modkey, }, "f", function () awful.spawn.spawn("xscreensaver-command --lock") end),
awful.key({ modkey, }, "F12", function () volume:set(5) end),
awful.key({ modkey, }, "F11", function () volume:set(-5) end),
awful.key({ modkey, }, "F10", function () volume:mute() end),
awful.key({ }, "Print", function () awful.spawn.spawn("scrot -e 'mv $f ~/Pictures/ && xdg-open ~/Pictures/$f'") end),

-- MPD keys
awful.key({ modkey, "Shift" }, "Up", function () awful.util.spawn("ncmpcpp toggle") end),
awful.key({ modkey, "Shift" }, "Down", function () awful.util.spawn("ncmpcpp stop") end),
awful.key({ modkey, "Shift" }, "Left", function () awful.util.spawn("ncmpcpp prev") end),
awful.key({ modkey, "Shift" }, "Right", function () awful.util.spawn("ncmpcpp next") end),
awful.key({ modkey, "Shift" }, "Up", function () awful.spawn.spawn("ncmpcpp toggle") end),
awful.key({ modkey, "Shift" }, "Down", function () awful.spawn.spawn("ncmpcpp stop") end),
awful.key({ modkey, "Shift" }, "Left", function () awful.spawn.spawn("ncmpcpp prev") end),
awful.key({ modkey, "Shift" }, "Right", function () awful.spawn.spawn("ncmpcpp next") end),

-- Shifty keys
awful.key({ modkey, "Control" }, "t", function() shifty.add({ rel_index = 1 }) end),
awful.key({ modkey, "Shift" }, "t", function() shifty.add({ rel_index = 1, nopopup = true }) end),
awful.key({ modkey, "Control" }, "g", shifty.rename),
awful.key({ modkey, "Control" }, "w", shifty.del),

-- Launch my terminal setup
awful.key({ modkey, }, "g",
function()
awful.util.spawn("sakura")
awful.util.spawn("sakura -f \"Terminus (TTF) 9\"")
awful.util.spawn("sakura -f \"Terminus (TTF) 9\"")
end
),
awful.key({ modkey, }, "Return", function() awful.spawn.spawn("urxvt") end ),
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, }, "e", function () awful.util.spawn("thunar") end),
awful.key({ modkey, }, "e", function () awful.spawn.spawn("urxvt -e ranger") end),
awful.key({ modkey, }, "j",
function ()
awful.client.focus.byidx( 1)
Expand Down Expand Up @@ -61,7 +52,6 @@ globalkeys = awful.util.table.join(
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),

Expand All @@ -75,25 +65,6 @@ globalkeys = awful.util.table.join(
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end),

-- Prompt
awful.key({ modkey, }, ";",
function ()
awful.prompt.run({ prompt = "Dict: " }, mypromptbox[mouse.screen].widget,
function(word)
local definition = awful.util.pread("dict " .. word .. " 2>&1")
naughty.notify({ text = definition, timeout = 13, title = word,
width = 400, font = "Sans 7" })
end, dict_cb, awful.util.getdir("cache") .. "/dict")
end
),
awful.key({ modkey, "Control" }, ";",
function ()
if selection() then
definition = awful.util.pread("dict " .. selection() .. " 2>&1")
naughty.notify({ text = definition, timeout = 13,
title = selection(), width = 400, font = "Sans 7" })
end
end
),
awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),

awful.key({ modkey }, "x",
Expand All @@ -103,8 +74,8 @@ globalkeys = awful.util.table.join(
awful.util.eval, nil,
awful.util.getdir("cache") .. "/history_eval")
end),
-- all minimized clients are restored
awful.key({ modkey, "Shift" }, "n",
-- all minimized clients are restored
awful.key({ modkey, "Shift" }, "n",
function()
local tags = awful.tag.selectedlist()
for j=1, #tags do
Expand All @@ -115,7 +86,7 @@ globalkeys = awful.util.table.join(
end
end),
-- show desktop/unminimize
awful.key({ modkey }, "d",
awful.key({ modkey }, "d",
function()
local tag = awful.tag.selected()
for i=1, #tag:clients() do
Expand All @@ -127,38 +98,46 @@ globalkeys = awful.util.table.join(
end)
)

for i=1, ( shifty.config.maxtags or 9 ) do

globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey }, i,
function ()
local t = awful.tag.viewonly(shifty.getpos(i))
end))
globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Control" }, i,
function ()
local t = shifty.getpos(i)
t.selected = not t.selected
end))
globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Control", "Shift" }, i,
function ()
if client.focus then
awful.client.toggletag(shifty.getpos(i))
for i = 1, 9 do
globalkeys = awful.util.table.join(globalkeys,
-- Move to another tag
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = mouse.screen
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end))
-- move clients to other tags
globalkeys = awful.util.table.join(globalkeys, awful.key({ modkey, "Shift" }, i,
function ()
if client.focus then
local t = shifty.getpos(i)
awful.client.movetotag(t)
--awful.tag.viewonly(t)
end
),
-- Merge two tags
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = mouse.screen
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end
),
-- Move client to tag
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
local tag = client.focus.screen.tags[i]
if client.focus and tag then
awful.client.movetotag(tag)
end
end))
end
),
-- Toggle client on another tag too
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
local tag = client.focus.screen.tags[i]
if client.focus and tag then
awful.client.toggletag(tag)
end
end
)
)
end

globalbuttons = awful.util.table.join(
awful.button({ }, 3, function () mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
)

shifty.config.globalkeys = globalkeys
root.keys(globalkeys)
47 changes: 28 additions & 19 deletions cfg/rules.lua
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
client.add_signal("manage", function (c, startup)
local awful = require("awful")
awful.rules = require("awful.rules")
local beautiful = require("beautiful")
local clientbinds = require("cfg.client-bindings")

-- 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)
awful.rules.rules = {
-- Rules to all the clients
{ rule = { },
properties = {
border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
keys = clientbinds.keys,
buttons = clientbinds.buttons
}
},
{ rule = { class = "mpv" },
properties = {
floating = true,
centered = true
}
},
{ rule = { class = "Xephyr" },
properties = {
floating = true,
centered = true
}
}
}

if not startup then
-- 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)
61 changes: 61 additions & 0 deletions cfg/signals.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")

client.connect_signal("manage", function (c, startup)
-- Enable sloppy focus
c:connect_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
-- 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

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)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
Loading