├── icons
├── bat.png
├── clock.png
├── cpu.png
├── disk.png
├── feed.png
├── mem.png
├── music.png
├── netio.png
├── temp.png
├── wifi.png
├── bat-low.png
├── pacman.png
├── restart.png
├── volume.png
├── bat-charge.png
├── bat-empty.png
├── bat-full.png
├── ethernet.png
├── ip-global.png
├── ip-local.png
├── poweroff.png
├── volume-low.png
├── volume-full.png
├── volume-mute.png
├── bat-full-on-power.png
├── bat-empty-on-power.png
├── README.markdown
└── LICENSE
├── foobar
├── background.png
├── taglist_sel.png
├── taglist_unsel.png
└── theme.lua
├── .gitmodules
├── Readme.md
└── rc.lua
/icons/bat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat.png
--------------------------------------------------------------------------------
/icons/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/clock.png
--------------------------------------------------------------------------------
/icons/cpu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/cpu.png
--------------------------------------------------------------------------------
/icons/disk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/disk.png
--------------------------------------------------------------------------------
/icons/feed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/feed.png
--------------------------------------------------------------------------------
/icons/mem.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/mem.png
--------------------------------------------------------------------------------
/icons/music.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/music.png
--------------------------------------------------------------------------------
/icons/netio.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/netio.png
--------------------------------------------------------------------------------
/icons/temp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/temp.png
--------------------------------------------------------------------------------
/icons/wifi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/wifi.png
--------------------------------------------------------------------------------
/icons/bat-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-low.png
--------------------------------------------------------------------------------
/icons/pacman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/pacman.png
--------------------------------------------------------------------------------
/icons/restart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/restart.png
--------------------------------------------------------------------------------
/icons/volume.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/volume.png
--------------------------------------------------------------------------------
/icons/bat-charge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-charge.png
--------------------------------------------------------------------------------
/icons/bat-empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-empty.png
--------------------------------------------------------------------------------
/icons/bat-full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-full.png
--------------------------------------------------------------------------------
/icons/ethernet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/ethernet.png
--------------------------------------------------------------------------------
/icons/ip-global.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/ip-global.png
--------------------------------------------------------------------------------
/icons/ip-local.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/ip-local.png
--------------------------------------------------------------------------------
/icons/poweroff.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/poweroff.png
--------------------------------------------------------------------------------
/icons/volume-low.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/volume-low.png
--------------------------------------------------------------------------------
/foobar/background.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/foobar/background.png
--------------------------------------------------------------------------------
/foobar/taglist_sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/foobar/taglist_sel.png
--------------------------------------------------------------------------------
/icons/volume-full.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/volume-full.png
--------------------------------------------------------------------------------
/icons/volume-mute.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/volume-mute.png
--------------------------------------------------------------------------------
/foobar/taglist_unsel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/foobar/taglist_unsel.png
--------------------------------------------------------------------------------
/icons/bat-full-on-power.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-full-on-power.png
--------------------------------------------------------------------------------
/icons/bat-empty-on-power.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Mic92/awesome-dotfiles/HEAD/icons/bat-empty-on-power.png
--------------------------------------------------------------------------------
/icons/README.markdown:
--------------------------------------------------------------------------------
1 | These are some icons, I use for my window manager.
2 |
3 | They are out of the icon pack [fugue-icons](http://p.yusukekamiyamane.com/).
4 |
5 | I extract the images out of the psd-files to upscale them to 32x32.
6 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "lognotify"]
2 | path = lognotify
3 | url = git://github.com/Mic92/lognotify.git
4 | [submodule "vicious"]
5 | path = vicious
6 | url = git@github.com:Mic92/vicious.git
7 | [submodule "awesome-themes"]
8 | path = awesome-themes
9 | url = https://github.com/mikar/awesome-themes.git
10 | [submodule "utils"]
11 | path = utils
12 | url = git://github.com/Mic92/utils.git
13 | [submodule "tyrannical"]
14 | path = tyrannical
15 | url = https://github.com/Elv13/tyrannical.git
16 |
--------------------------------------------------------------------------------
/Readme.md:
--------------------------------------------------------------------------------
1 | awesome config
2 | ==============
3 |
4 | Here is my personal configuration of awesome.
5 | Currently I use awesome v3.5.4 (Brown Paper Bag)
6 |
7 | with the following modules:
8 |
9 | * [tyrannical](https://github.com/Elv13/tyrannical)
10 | * dynamic tagging configuration system
11 | * [vicious](https://github.com/Mic92/vicious)
12 | * modular widget library
13 |
14 | Personally I build awesome with luajit ([awesome-luajit-git](https://aur.archlinux.org/packages/awesome-luajit-git/) in AUR, if you are on archlinux)
15 |
16 | * [lognotify](https://github.com/Mic92/lognotify) -> depends on inotify and luasocket (read the Readme of lognotify)
17 |
18 | * in [utils](https://github.com/Mic92/utils) repository:
19 | - iwlist (wrapper around iwlist to display wifi-networks)
20 | - wimpd (widget for mpd, depends on luasocket)
21 | - cal (calendar popup)
22 |
23 |
24 | Here is a screenshot:
25 | 
26 |
--------------------------------------------------------------------------------
/icons/LICENSE:
--------------------------------------------------------------------------------
1 | Fugue Icons
2 |
3 | (C) 2011 Yusuke Kamiyamane. All rights reserved.
4 | These icons are licensed under a Creative Commons
5 | Attribution 3.0 License.
6 |
7 |
8 | If you can't or don't want to provide attribution, please
9 | purchase a royalty-free license.
10 |
11 |
12 | I'm unavailable for custom icon design work. But your
13 | suggestions are always welcome!
14 |
15 |
16 | ------------------------------------------------------------
17 |
18 | - geotag
19 |
20 | (C) Geotag Icon Project. All rights reserved.
21 |
22 |
23 | Geotag icon is licensed under a Creative Commons
24 | Attribution-Share Alike 3.0 License or LGPL.
25 |
26 |
27 |
28 | - language
29 |
30 | (C) Language Icon Project. All rights reserved.
31 |
32 |
33 | Language icon is licensed under a Creative Commons
34 | Attribution-Share Alike 3.0 License.
35 |
36 |
37 | - open-share
38 |
39 | (C) Open Share Icon Project. All rights reserved.
40 |
41 |
42 | Open Share icon is licensed under a Creative Commons
43 | Attribution-Share Alike 3.0 License.
44 |
45 |
46 | - opml
47 |
48 | (C) OPML Icon Project. All rights reserved.
49 |
50 |
51 | OPML icon is licensed under a Creative Commons
52 | Attribution-Share Alike 2.5 License.
53 |
54 |
55 | - share
56 |
57 | (C) Share Icon Project. All rights reserved.
58 |
59 |
60 | Share icon is licensed under a GPL or LGPL or BSD or
61 | Creative Commons Attribution 2.5 License.
62 |
63 |
64 |
65 |
66 |
67 | - xfn
68 |
69 | (C) Wolfgang Bartelme. All rights reserved.
70 |
71 |
72 | XFN icon is licensed under a Creative Commons
73 | Attribution-Share Alike 2.5 License.
74 |
--------------------------------------------------------------------------------
/foobar/theme.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | foobar is derived from foo, a high contrast awesome3 theme, by rob
3 | changeset compared to the origin:
4 | - default sans font
5 | - archlinux blue and a decent white as focus colors
6 | - wider menu (just my personal preference)
7 | --]]
8 |
9 | --{{{ Main
10 | local awful = require("awful")
11 |
12 | theme = {}
13 |
14 | themedir = debug.getinfo(1).source
15 | themedir = themedir:sub(2,#themedir - #("/theme.lua"))
16 | local awesome_dir = "/usr/share/awesome"
17 | -- compatibility with nixos
18 | if awful.util.file_readable("/run/current-system/sw/bin/awesome") then
19 | awesome_dir = awful.util.pread([[echo -n $(dirname "$(readlink -f /run/current-system/sw/bin/awesome)")/../share/awesome/]])
20 | end
21 | --}}}
22 |
23 | theme.font = "SauceCodePro Nerd Font Mono Regular 12"
24 |
25 | theme.bg_normal = "#333333"
26 | theme.bg_focus = "#1793d1"
27 | theme.bg_urgent = "#00ff00"
28 | theme.bg_minimize = "#444444"
29 | theme.bg_systray = theme.bg_normal
30 |
31 | theme.fg_normal = "#999999"
32 | theme.fg_focus = "#fafafa"
33 | theme.fg_urgent = "#111111"
34 | theme.fg_minimize = "#ffffff"
35 |
36 | theme.border_width = 2
37 | theme.border_normal = "#333333"
38 | theme.border_focus = "#1793d1"
39 | theme.border_marked = "#91231c"
40 |
41 | -- There are other variable sets
42 | -- overriding the default one when
43 | -- defined, the sets are:
44 | -- [taglist|tasklist]_[bg|fg]_[focus|urgent]
45 | -- titlebar_[bg|fg]_[normal|focus]
46 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color]
47 | -- mouse_finder_[color|timeout|animate_timeout|radius|factor]
48 | -- Example:
49 | --theme.taglist_bg_focus = "#ff0000"
50 |
51 | -- Display the taglist squares
52 | theme.taglist_squares_sel = themedir .. "/taglist_sel.png"
53 | theme.taglist_squares_unsel = themedir .. "/taglist_unsel.png"
54 |
55 | -- Variables set for theming the menu:
56 | -- menu_[bg|fg]_[normal|focus]
57 | -- menu_[border_color|border_width]
58 | theme.menu_submenu_icon = "share/awesome/themes/default/submenu.png"
59 | theme.menu_height = 15
60 | theme.menu_width = 130
61 |
62 | -- You can add as many variables as
63 | -- you wish and access them by using
64 | -- beautiful.variable in your rc.lua
65 | --theme.bg_widget = "#cc0000"
66 |
67 | -- Define the image to load
68 | theme.titlebar_close_button_normal = awesome_dir .. "themes/default/titlebar/close_normal.png"
69 | theme.titlebar_close_button_focus = awesome_dir .. "themes/default/titlebar/close_focus.png"
70 |
71 | theme.titlebar_ontop_button_normal_inactive = awesome_dir .. "themes/default/titlebar/ontop_normal_inactive.png"
72 | theme.titlebar_ontop_button_focus_inactive = awesome_dir .. "themes/default/titlebar/ontop_focus_inactive.png"
73 | theme.titlebar_ontop_button_normal_active = awesome_dir .. "themes/default/titlebar/ontop_normal_active.png"
74 | theme.titlebar_ontop_button_focus_active = awesome_dir .. "themes/default/titlebar/ontop_focus_active.png"
75 |
76 | theme.titlebar_sticky_button_normal_inactive = awesome_dir .. "themes/default/titlebar/sticky_normal_inactive.png"
77 | theme.titlebar_sticky_button_focus_inactive = awesome_dir .. "themes/default/titlebar/sticky_focus_inactive.png"
78 | theme.titlebar_sticky_button_normal_active = awesome_dir .. "themes/default/titlebar/sticky_normal_active.png"
79 | theme.titlebar_sticky_button_focus_active = awesome_dir .. "themes/default/titlebar/sticky_focus_active.png"
80 |
81 | theme.titlebar_floating_button_normal_inactive = awesome_dir .. "themes/default/titlebar/floating_normal_inactive.png"
82 | theme.titlebar_floating_button_focus_inactive = awesome_dir .. "themes/default/titlebar/floating_focus_inactive.png"
83 | theme.titlebar_floating_button_normal_active = awesome_dir .. "themes/default/titlebar/floating_normal_active.png"
84 | theme.titlebar_floating_button_focus_active = awesome_dir .. "themes/default/titlebar/floating_focus_active.png"
85 |
86 | theme.titlebar_maximized_button_normal_inactive = awesome_dir .. "themes/default/titlebar/maximized_normal_inactive.png"
87 | theme.titlebar_maximized_button_focus_inactive = awesome_dir .. "themes/default/titlebar/maximized_focus_inactive.png"
88 | theme.titlebar_maximized_button_normal_active = awesome_dir .. "themes/default/titlebar/maximized_normal_active.png"
89 | theme.titlebar_maximized_button_focus_active = awesome_dir .. "themes/default/titlebar/maximized_focus_active.png"
90 |
91 | theme.wallpaper = themedir .. "/background.png"
92 |
93 | -- You can use your own layout icons like this:
94 | theme.layout_fairh = awesome_dir .. "themes/default/layouts/fairhw.png"
95 | theme.layout_fairv = awesome_dir .. "themes/default/layouts/fairvw.png"
96 | theme.layout_floating = awesome_dir .. "themes/default/layouts/floatingw.png"
97 | theme.layout_magnifier = awesome_dir .. "themes/default/layouts/magnifierw.png"
98 | theme.layout_max = awesome_dir .. "themes/default/layouts/maxw.png"
99 | theme.layout_fullscreen = awesome_dir .. "themes/default/layouts/fullscreenw.png"
100 | theme.layout_tilebottom = awesome_dir .. "themes/default/layouts/tilebottomw.png"
101 | theme.layout_tileleft = awesome_dir .. "themes/default/layouts/tileleftw.png"
102 | theme.layout_tile = awesome_dir .. "themes/default/layouts/tilew.png"
103 | theme.layout_tiletop = awesome_dir .. "themes/default/layouts/tiletopw.png"
104 | theme.layout_spiral = awesome_dir .. "themes/default/layouts/spiralw.png"
105 | theme.layout_dwindle = awesome_dir .. "themes/default/layouts/dwindlew.png"
106 |
107 | theme.awesome_icon = awesome_dir .. "icons/awesome16.png"
108 |
109 | -- Define the icon theme for application icons. If not set then the icons
110 | -- from share/icons and /usr/share/icons/hicolor will be used.
111 | theme.icon_theme = nil
112 |
113 | return theme
114 | -- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
115 |
--------------------------------------------------------------------------------
/rc.lua:
--------------------------------------------------------------------------------
1 | --[[
2 | awesome.lua - main config of my window manager
3 | awesome v3.5.4 (Brown Paper Bag)
4 | os: archlinux x86_64
5 | cpu: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
6 | grapic: Intel Graphics 4400
7 | screen: 1920 x 1080
8 | --]]
9 |
10 | -- {{{ Awesome Library
11 | print("[awesome] Entered awesome.lua: "..os.date())
12 |
13 | -- Standard awesome library
14 | local gears = require("gears")
15 | local awful = require("awful")
16 | local tyrannical = require("tyrannical")
17 | awful.rules = require("awful.rules")
18 | require("awful.autofocus")
19 | -- Widget and layout library
20 | local wibox = require("wibox")
21 | -- Theme handling library
22 | local beautiful = require("beautiful")
23 | -- Notification library
24 | local naughty = require("naughty")
25 | local menubar = require("menubar")
26 | local hotkeys_popup = require("awful.hotkeys_popup").widget
27 | -- widget library
28 | local vicious = require("vicious")
29 | vicious.contrib = require("vicious.contrib")
30 | --local lognotify = require("lognotify")
31 | -- calendar widget
32 | local cal = require("utils.cal")
33 | -- wrapper for pango markup
34 | local markup = require("utils.markup")
35 | -- scan for wlan accesspoints using iwlist
36 | local iwlist = require("utils.iwlist")
37 | -- MPD widget based on mpd.lua
38 | local wimpd = require("utils.wimpd")
39 | local mpc = wimpd.new()
40 |
41 | -- enable luajit
42 | pcall(function() jit.on() end)
43 | -- }}}
44 |
45 | -- {{{ Error handling
46 | -- Check if awesome encountered an error during startup and fell back to
47 | -- another config (This code will only ever execute for the fallback config)
48 | if awesome.startup_errors then
49 | naughty.notify({ preset = naughty.config.presets.critical,
50 | title = "Oops, there were errors during startup!",
51 | text = awesome.startup_errors })
52 | end
53 |
54 | -- Handle runtime errors after startup
55 | do
56 | local in_error = false
57 | awesome.connect_signal("debug::error", function (err)
58 | -- Make sure we don't go into an endless error loop
59 | if in_error then return end
60 | in_error = true
61 |
62 | naughty.notify({ preset = naughty.config.presets.critical,
63 | title = "Oops, an error happened!",
64 | text = tostring(err) })
65 | in_error = false
66 | end)
67 | end
68 | -- }}}
69 |
70 | -- {{{ Variable definitions
71 | -- Themes define colours, icons, font and wallpapers.
72 | --local theme_path = "/usr/share/awesome/themes/default/theme.lua"
73 | --local theme_path = "/usr/share/awesome/themes/sky/theme.lua"
74 | local theme_path = awful.util.getdir("config").."/foobar/theme.lua"
75 |
76 | beautiful.init(theme_path)
77 |
78 | -- Use normal colors instead of focus colors for tooltips
79 | beautiful.tooltip_bg = beautiful.bg_normal
80 | beautiful.tooltip_fg = beautiful.fg_normal
81 |
82 | -- This is used later as the default terminal and editor to run.
83 | local spawn_with_systemd = function(app)
84 | return "systemd-run --user --unit '"..app.."' '"..app.."'"
85 | end
86 | local terminal = "alacritty"
87 | local editor = os.getenv("EDITOR") or "vim"
88 | local browser = "firefox"
89 | local mail = "thunderbird"
90 | local editor_cmd = terminal.." -e "..editor
91 |
92 | -- Default modkey.
93 | -- Usually, Mod4 is the key with a logo between Control and Alt.
94 | -- If you do not like this or do not have such a key,
95 | -- I suggest you to remap Mod4 to another key using xmodmap or other tools.
96 | -- However, you can use another modifier like Mod1, but it may interact with others.
97 | local modkey = "Mod4"
98 | local modkey2 = "Mod1"
99 | local icon_path = awful.util.getdir("config").."/icons/"
100 |
101 | -- Table of layouts to cover with awful.layout.inc, order matters.
102 | local layouts = {
103 | awful.layout.suit.tile, -- 1
104 | awful.layout.suit.tile.left, -- 2
105 | awful.layout.suit.tile.bottom, -- 3
106 | awful.layout.suit.tile.top, -- 4
107 | -- awful.layout.suit.fair,
108 | -- awful.layout.suit.fair.horizontal,
109 | -- awful.layout.suit.spiral,
110 | -- awful.layout.suit.spiral.dwindle,
111 | awful.layout.suit.floating, -- 5
112 | awful.layout.suit.max, -- 6
113 | awful.layout.suit.max.fullscreen, -- 7
114 | -- awful.layout.suit.magnifier,
115 | -- awful.layout.suit.corner.nw,
116 | -- awful.layout.suit.corner.ne,
117 | -- awful.layout.suit.corner.sw,
118 | -- awful.layout.suit.corner.se,
119 | }
120 | -- }}}
121 |
122 | -- First, set some settings
123 | tyrannical.settings.default_layout = awful.layout.suit.tile.left
124 | tyrannical.settings.mwfact = 0.66
125 |
126 | tyrannical.tags = {
127 | {
128 | name = "1:web",
129 | position = 1,
130 | init = true,
131 | exclusive = true,
132 | screen = 1,
133 | layout = awful.layout.suit.tile,
134 | exec_once = { browser },
135 | class = { "Firefox", "Opera", "Chromium", "Aurora", "chromium-browser" },
136 | },
137 | {
138 | name = "2:dev",
139 | position = 2,
140 | exclusive = true,
141 | init = true,
142 | screen = 1,
143 | layout = awful.layout.suit.max,
144 | exec_once = { terminal },
145 | class = {
146 | "xterm" , "urxvt" , "aterm", "URxvt", "XTerm", "alacritty", "emacs"
147 | },
148 | match = {
149 | "konsole"
150 | }
151 | },
152 | {
153 | name = "3:im",
154 | position = 3,
155 | exclusive = true,
156 | mwfact = 0.25,
157 | init = true,
158 | layout = awful.layout.suit.tile,
159 | --exec_once = { "gajim" },
160 | class = { "Kopete", "Pidgin", "gajim", "Dino", ".gajim-wrapped", "rambox",
161 | "Daily", -- thunderbird
162 | "Thunderbird", "birdie", "evolution" }
163 | },
164 | {
165 | name = "4:doc",
166 | position = 4,
167 | exclusive = true,
168 | init = false,
169 | layout = awful.layout.suit.max,
170 | class = { "Evince", "GVim", "keepassx", "libreoffice" }
171 | },
172 | {
173 | name = "5:java",
174 | position = 5,
175 | exclusive = true,
176 | init = false,
177 | layout = awful.layout.suit.tile,
178 | class = { "Eclipse", "NetBeans IDE", "jetbrains%-idea%-ce" }
179 | },
180 | {
181 | name = "d:own",
182 | position = 6,
183 | exclusive = true,
184 | init = false,
185 | layout = awful.layout.suit.tile,
186 | class = { "gpodder", "JDownloader", "Transmission" }
187 | },
188 | {
189 | name = "s:kype",
190 | position = 7,
191 | exclusive = true,
192 | init = false,
193 | layout = awful.layout.suit.tile,
194 | exec_once = { "pcmanfm" },
195 | class = { "skype" }
196 | },
197 | {
198 | name = "p:cfm",
199 | position = 7,
200 | exclusive = true,
201 | init = false,
202 | layout = awful.layout.suit.tile,
203 | exec_once = { "pcmanfm" },
204 | class = { "pcmanfm", "dolphin", "nautilus", "thunar" }
205 | },
206 | {
207 | name = "a:rio",
208 | position = 9,
209 | exclusive = true,
210 | init = false,
211 | layout = awful.layout.suit.max,
212 | class = { "sonata", "Goggles Music"},
213 | match = { "ncmpcpp" }
214 | },
215 | {
216 | name = "v:ideo",
217 | position = 10,
218 | exclusive = true,
219 | init = false,
220 | layout = awful.layout.suit.max ,
221 | class = { "MPlayer", "VLC", "Smplayer" }
222 | },
223 | {
224 | name = "w:ine",
225 | position = 11,
226 | exclusive = true,
227 | init = false,
228 | layout = awful.layout.suit.tile,
229 | class = { "Wine" }
230 | },
231 | }
232 |
233 | tyrannical.properties.intrusive = {
234 | "gmrun", "qalculate", "gnome-calculator", "Komprimieren", "Wicd", "Valauncher"
235 | }
236 |
237 | tyrannical.properties.ontop = {
238 | "gmrun", "qalculate", "gnome-calculator", "Komprimieren", "Wicd", "Valauncher", "MPlayer", "pinentry"
239 | }
240 |
241 | tyrannical.properties.floating = {
242 | "MPlayer", "pinentry", "yubioath-desktop"
243 | }
244 |
245 | full_screen_apps = {"Firefox", "Opera", "Chromium", "Aurora", "Thunderbird", "evolution"}
246 |
247 | tyrannical.properties.maximized_horizontal = full_screen_apps
248 | tyrannical.properties.maximized_vertical = full_screen_apps
249 |
250 | tyrannical.properties.size_hints_honor = {
251 | xterm = false, URxvt = false, aterm = false
252 | }
253 | --}}}
254 |
255 | -- {{{ Wallpaper
256 | if beautiful.wallpaper then
257 | for s = 1, screen.count() do
258 | gears.wallpaper.maximized(beautiful.wallpaper, s, true)
259 | end
260 | end
261 | -- }}}
262 |
263 |
264 | -- {{{ Menu
265 | -- Create a laucher widget and a main menu
266 | local myawesomemenu = {
267 | { "manual", terminal .. " -e man awesome" },
268 | { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/awesome.lua" },
269 | { "powersafe off", "xset s off" },
270 | { "xrandr", "xrandr --auto" },
271 | { "arandr", "arandr" },
272 | { "restart", awesome.restart },
273 | { "quit", awesome.quit }
274 | }
275 |
276 | local mymainmenu = awful.menu({ items = {
277 | { "awesome", myawesomemenu, gears.filesystem.get_themes_dir() .. beautiful.awesome_icon },
278 | { "open terminal", terminal },
279 | { "Firefox", spawn_with_systemd("firefox") },
280 | { "Bildschirmsperre", "slimlock" },
281 | { "Schlaf", "systemctl suspend" },
282 | { "Ruhezustand", "systemctl hibernate" },
283 | { "Neustarten", "systemctl reboot", icon_path.."restart.png" },
284 | { "Herunterfahren", "systemctl poweroff", icon_path.."poweroff.png" },
285 | }})
286 |
287 | local mylauncher = awful.widget.launcher({
288 | image = beautiful.awesome_icon,
289 | menu = mymainmenu
290 | })
291 | -- }}}
292 |
293 | -- {{{ Naughty log notify
294 | print("[awesome] Enable naughty log notify")
295 | --ilog = lognotify{
296 | -- logs = {
297 | -- mpd = { file = os.getenv("HOME").."/.mpd/log", ignore = {"player_thread: played"} },
298 | -- pacman = { file = "/var/log/pacman.log", },
299 | -- kernel = { file = "/var/log/kernel.log", ignore = {"Mark"} },
300 | -- awesome = { file = awful.util.getdir("config").."/log", ignore = {"[awesome]"} },
301 | -- },
302 | -- interval = 1,
303 | -- naughty_timeout = 15
304 | --}
305 | --ilog:start()
306 | -- }}}
307 |
308 | -- Transparent notifications
309 | naughty.config.presets.normal.opacity = 0.8
310 | naughty.config.presets.low.opacity = 0.8
311 | naughty.config.presets.critical.opacity = 0.8
312 |
313 | -- {{{ Vicious and MPD
314 | print("[awesome] initialize vicious")
315 |
316 | local function nerdfonts(string)
317 | -- https://github.com/ryanoasis/nerd-fonts
318 | local icon = wibox.widget.textbox()
319 | icon:set_markup(' '..string..' ')
320 | return icon
321 | end
322 |
323 | local function conkyicon(string)
324 | -- https://github.com/Mic92/awesome-dotfiles/releases/tag/download
325 | local icon = wibox.widget.textbox()
326 | icon:set_markup(' '..string..' ')
327 | return icon
328 | end
329 |
330 | -- {{{ Date and time
331 | -- Create a textclock widget
332 | local mytextclock = wibox.widget.textclock()
333 | local clockicon = nerdfonts("")
334 | -- Register calendar tooltip
335 | -- To use fg_focus, you have to set a different tooltip_fg_color since the
336 | -- default is already beautiful.fg_focus.
337 | -- (beautiful.bg_normal in my case)
338 | cal.register(clockicon, markup.fg(beautiful.fg_focus,"%s"))
339 | local uptimetooltip = awful.tooltip({})
340 | uptimetooltip:add_to_object(mytextclock)
341 | mytextclock:connect_signal("mouse::enter", function()
342 | local args = vicious.widgets.uptime()
343 | local text = (" Uptime %dd %dh %dmin "):format(args[1], args[2], args[3])
344 | uptimetooltip:set_markup(text)
345 | end)
346 | -- }}}
347 |
348 | local testwidget = wibox.widget.textbox()
349 |
350 | -- {{{ Battery
351 | local batwidget = wibox.widget.textbox()
352 | local bat2widget = wibox.widget.textbox()
353 |
354 | local baticon = nerdfonts("")
355 | local pulsebox = wibox.container.margin(pulsebar, 2, 2, 4, 4)
356 |
357 | vicious.register(batwidget, vicious.widgets.bat, "$1$2% $3h", 7, "BAT1")
358 | vicious.register(bat2widget, vicious.widgets.bat, "$1$2% $3h", 7, "BAT0")
359 | -- }}}
360 |
361 | --{{{ Pulseaudio
362 | local pulseicon = nerdfonts("")
363 | -- Initialize widgets
364 | local pulsewidget = wibox.widget.textbox()
365 | local pulsebar = wibox.widget.progressbar()
366 | local pulsebox = wibox.widget {
367 | {
368 | max_value = 1,
369 | widget = pulsebar,
370 | shape = gears.shape.rounded_bar,
371 | border_width = 0.5,
372 | border_color = "#000000",
373 | color = {
374 | type = "linear",
375 | from = { 0, 0 },
376 | to = { 0, 30 },
377 | stops = {
378 | { 0, "#AECF96" },
379 | { 1, "#FF5656" }
380 | }
381 | }
382 | },
383 | forced_height = 10,
384 | forced_width = 8,
385 | direction = 'east',
386 | color = beautiful.fg_widget,
387 | layout = wibox.container.rotate,
388 | }
389 | local pulsebox = wibox.container.margin(pulsebox, 1, 1, 3, 3)
390 |
391 | -- Enable caching
392 | vicious.cache(vicious.contrib.pulse)
393 |
394 | local audio_card = {"Master", "-D", "pulse"}
395 |
396 | local function pulse_volume(delta)
397 | awful.util.spawn("amixer")
398 | vicious.force({ pulsewidget, pulsebar})
399 | end
400 |
401 | local function pulse_toggle()
402 | awful.util.spawn("amixer -q sset Master -D pulse toggle")
403 | vicious.force({ pulsewidget, pulsebar})
404 | end
405 |
406 | vicious.register(pulsebar, vicious.widgets.volume, "$1", 7, audio_card)
407 | vicious.register(pulsewidget, vicious.widgets.volume, function (widget, args)
408 | s = string.format("%.f%%", args[1])
409 | if args[2] == "♩" then -- mute
410 | return ""..s..""
411 | end
412 | return s
413 | end, 7, audio_card)
414 |
415 | pulsewidget:buttons(awful.util.table.join(
416 | awful.button({ }, 1, function() awful.util.spawn("pavucontrol") end), --left click
417 | awful.button({ }, 2, function() pulse_toggle() end),
418 | awful.button({ }, 4, function() pulse_volume(5) end), -- scroll up
419 | awful.button({ }, 5, function() pulse_volume(-5) end))) -- scroll down
420 |
421 | pulsebar:buttons(pulsewidget:buttons())
422 | pulseicon:buttons(pulsewidget:buttons())
423 | --}}}
424 |
425 | -- {{{ CPU usage
426 | local cpuwidget = wibox.widget.textbox()
427 | --local cpuicon = wibox.widget.imagebox()
428 | --cpuicon:set_image(icon_path.."cpu.png")
429 | local cpuicon = nerdfonts("")
430 | -- Initialize widgets
431 | vicious.register(cpuwidget, vicious.widgets.cpu,
432 | function (widget, args)
433 | local text
434 | -- list all cpu cores
435 | for i=1,#args do
436 | -- alerts, if system is stressed
437 | --args[i] = markup.fg(markup.gradient(1,100,args[i]),args[i])
438 | if args[i] > 90 then
439 | args[i] = markup.fg("#FF5656", args[i]) -- light red
440 | elseif args[i] > 70 then
441 | args[i] = markup.fg("#AECF96", args[i]) -- light green
442 | end
443 |
444 | -- append to list
445 | if i > 2 then
446 | text = text.."/"..args[i].."%"
447 | else
448 | text = args[i].."%"
449 | end
450 | end
451 | return text
452 | end, 7)
453 | -- Register buttons
454 | cpuwidget:buttons( awful.button({ }, 1, function () awful.util.spawn(terminal .. " -e htop") end) )
455 | cpuicon:buttons( cpuwidget:buttons() )
456 |
457 | -- }}}
458 |
459 | -- {{{ CPU temperature
460 | local thermalwidget = wibox.widget.textbox()
461 | local thermalicon = nerdfonts("")
462 | vicious.register(thermalwidget, vicious.widgets.thermal, "$1°C", 7, {"thermal_zone0", "sys"})
463 | -- }}}
464 |
465 | -- {{{ Memory usage
466 | -- Initialize widget
467 | local memwidget = wibox.widget.textbox()
468 | local memicon = conkyicon("J")
469 | vicious.register(memwidget, vicious.widgets.mem, "$2MB/$3MB ", 7)
470 |
471 | -- Register buttons
472 | memwidget:buttons( cpuwidget:buttons() )
473 | memicon:buttons( cpuwidget:buttons() )
474 | -- }}}
475 |
476 | -- {{{ Net usage
477 | local netwidget = wibox.widget.textbox()
478 | local neticon = conkyicon("i")
479 | -- list all ethernet and wlan devices (including usb tethering)
480 | vicious.register(netwidget, vicious.widgets.net,
481 | function (widget, args)
482 | local down, up
483 | for k, v in pairs(args) do
484 | local dev = k:match("^{eth[^ ]+") or k:match("^{wlan[^ ]+")
485 | if dev ~= nil then
486 | down, up = args[dev.." down_kb}"], args[dev.." up_kb}"]
487 | if (down ~= "0.0" and down ~= nil) or (up ~= "0.0" and up ~= nil) then
488 | neticon.visible = true
489 | return string.format("%skb/%skb", up, down)
490 | end
491 | end
492 | end
493 | neticon.visible = false
494 | return ""
495 | end, 7)
496 | -- Register buttons
497 | netwidget:buttons( awful.button({ }, 1, function () awful.util.spawn(terminal .. " -e sudo nethogs -d 2 -p wlp3s0") end) )
498 | neticon:buttons( netwidget:buttons() )
499 | -- }}}
500 |
501 | -- {{{ Disk I/O
502 | local ioicon = conkyicon("K")
503 | --ioicon:set_image(icon_path.."disk.png")
504 | --ioicon.visible = true
505 | local iowidget = wibox.widget.textbox()
506 | vicious.register(iowidget, vicious.widgets.dio, "SSD ${sda read_mb}/${sda write_mb}MB (${sda iotime_s}s)", 7)
507 | -- Register buttons
508 | iowidget:buttons( awful.button({ }, 1, function () awful.util.spawn(terminal .. " -e sudo iotop") end) )
509 | -- }}}
510 |
511 | --{{{ Pacman
512 | local pkgwidget = wibox.widget.textbox()
513 | local pkgicon = wibox.widget.imagebox()
514 | pkgicon:set_image(icon_path.."pacman.png")
515 | -- Don't show icon by default
516 | pkgicon.visible = false
517 |
518 | -- Use a cronjob to update the packagelist http://bbs.archlinux.org/viewtopic.php?id=84115
519 | vicious.register(pkgwidget, vicious.widgets.pkg,
520 | function(widget, args)
521 | -- Check wheter pacman db is locked. Don't use aweful.util.file_readable,
522 | -- because the db.lck isn't readable at all.
523 | local db_locked = os.execute("[[ -f /var/lib/pacman/db.lck ]] && exit 1 || exit 0")
524 | -- Don't disturb me, unless enough updates are collect and pacman doesn't run
525 | if args[1] < 8 or db_locked ~= 0 then
526 | -- If you use powerpill, it is important to check wheter it runs!
527 | pkgicon.visible = false
528 | return ""
529 | else
530 | pkgicon.visible = true
531 | return markup.urgent("Updates "..args[1]).." "
532 | end
533 | end, 1, "Arch")
534 | vicious.register(pkgwidget, vicious.widgets.pkg, " Updates: $1", 1, "Arch")
535 |
536 | pkgwidget:buttons( awful.button({ }, 1,
537 | function ()
538 | pkgwidget.visible, pkgicon.visible = false, false
539 | -- URxvt specific
540 | awful.util.spawn(terminal.." -title 'Yaourt Upgrade' -e zsh -c 'yaourt -Syu --aur'")
541 | end))
542 | pkgicon:buttons( pkgwidget:buttons() )
543 | --}}}
544 |
545 | -- {{{ MPD
546 | local wimpc = wibox.widget.textbox()
547 | local mpcicon = nerdfonts("")
548 | mpc.attach(wimpc)
549 |
550 | -- Register Buttons in both widget
551 | mpcicon:buttons( wimpc:buttons(awful.util.table.join(
552 | awful.button({ }, 1, function () mpc:toggle_play() mpc:update() end), -- left click
553 | awful.button({ }, 2, function () awful.util.spawn("sonata") end), -- middle click
554 | awful.button({ }, 3, function () awful.util.spawn("urxvt -e ncmpcpp")end), -- right click
555 | awful.button({ }, 4, function () mpc:seek(5) mpc:update() end), -- scroll up
556 | awful.button({ }, 5, function () mpc:seek(-5) mpc:update() end) -- scroll down
557 | )))
558 | -- }}}
559 |
560 | --{{{ Wifi
561 | local wifiwidget = wibox.widget.textbox()
562 | local wifiicon = nerdfonts("")
563 | local wifitooltip= awful.tooltip({})
564 | wifitooltip:add_to_object(wifiwidget)
565 | vicious.register(wifiwidget, vicious.widgets.wifiiw, function(widget, args)
566 | local tooltip = ("mode %s chan %s rate %s Mb/s"):format(
567 | args["{mode}"], args["{chan}"], args["{rate}"])
568 | local quality = args["{linp}"]
569 | wifitooltip:set_markup(tooltip)
570 | local name = awful.util.escape(args["{ssid}"])
571 | --return ("%s: .1f%%"):format(name, quality)
572 | return ("%s:"):format(name)
573 | end, 5, "wlp3s0")
574 | wifiicon:buttons( wifiwidget:buttons(awful.util.table.join(
575 | awful.button({}, 1, function()
576 | local networks = iwlist.scan_networks("wlp3s0")
577 | if #networks > 0 then
578 | local msg = {}
579 | for i, ap in ipairs(networks) do
580 | local line = "ESSID: %s MAC: %s Qual.: %.2f%% %s"
581 | local enc = iwlist.get_encryption(ap)
582 | msg[i] = line:format(ap.essid, ap.address, ap.quality, enc)
583 | end
584 | naughty.notify({text = table.concat(msg, "\n")})
585 | else
586 | end
587 | end),
588 | awful.button({ "Shift" }, 1, function ()
589 | -- restart-auto-wireless is just a script of mine,
590 | -- which just restart netcfg
591 | local wpa_cmd = "sudo restart-auto-wireless && notify-send 'wpa_actiond' 'restarted' || notify-send 'wpa_actiond' 'error on restart'"
592 | awful.util.spawn_with_shell(wpa_cmd)
593 | end), -- left click
594 | awful.button({ }, 3, function () vicious.force{wifiwidget} end) -- right click
595 | )))
596 | --}}}
597 |
598 | local btcwidget = wibox.widget.textbox()
599 | local btcicon = nerdfonts("")
600 | vicious.register(btcwidget, vicious.contrib.btc, "${price}£", 1800, "GBP")
601 | -- }}}
602 |
603 | -- {{{ Wibox
604 | print("[awesome] initialize wibox")
605 |
606 | -- Create a wibox for each screen and add it
607 | local mywibox = {}
608 | local mystatusbox = {}
609 | local mypromptbox = {}
610 | local mylayoutbox = {}
611 | local mytaglist = {}
612 | mytaglist.buttons = awful.util.table.join(
613 | awful.button({ }, 1, awful.tag.viewonly),
614 | awful.button({ modkey }, 1, awful.client.movetotag),
615 | awful.button({ }, 3, awful.tag.viewtoggle),
616 | awful.button({ modkey }, 3, awful.client.toggletag),
617 | awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
618 | awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
619 | )
620 | local mytasklist = {}
621 | mytasklist.buttons = awful.util.table.join(
622 | awful.button({ }, 1,
623 | function (c)
624 | if c == client.focus then
625 | c.minimized = true
626 | else
627 | -- Without this, the following
628 | -- :isvisible() makes no sense
629 | c.minimized = false
630 | if not c:isvisible() then
631 | awful.tag.viewonly(c:tags()[1])
632 | end
633 | -- This will also un-minimize
634 | -- the client, if needed
635 | client.focus = c
636 | c:raise()
637 | end
638 | end),
639 | awful.button({ }, 3,
640 | function ()
641 | if instance then
642 | instance:hide()
643 | instance = nil
644 | else
645 | instance = awful.menu.clients({ width=250 })
646 | end
647 | end),
648 | awful.button({ }, 4,
649 | function ()
650 | awful.client.focus.byidx(1)
651 | if client.focus then client.focus:raise() end
652 | end),
653 | awful.button({ }, 5,
654 | function ()
655 | awful.client.focus.byidx(-1)
656 | if client.focus then client.focus:raise() end
657 | end))
658 |
659 | for s = 1, screen.count() do
660 | -- Create a promptbox for each screen
661 | mypromptbox[s] = awful.widget.prompt()
662 | -- Create an imagebox widget which will contains an icon indicating which layout we're using.
663 | -- We need one layoutbox per screen.
664 | mylayoutbox[s] = awful.widget.layoutbox(s)
665 | mylayoutbox[s]:buttons(awful.util.table.join(
666 | awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
667 | awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end),
668 | awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end),
669 | awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end)))
670 | -- Create a taglist widget
671 | mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons)
672 |
673 | -- Create a tasklist widget
674 | mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
675 | -- Create the wibox
676 | mywibox[s] = awful.wibar({ position = "top", screen = s })
677 |
678 | local left_layout = wibox.layout.fixed.horizontal()
679 | left_layout:add(mylauncher)
680 | left_layout:add(mytaglist[s])
681 | left_layout:add(mypromptbox[s])
682 |
683 | local right_layout = wibox.layout.fixed.horizontal()
684 | if s == 1 then right_layout:add(wibox.widget.systray()) end
685 | right_layout:add(wifiicon)
686 | right_layout:add(wifiwidget)
687 | right_layout:add(baticon)
688 | right_layout:add(batwidget)
689 | right_layout:add(bat2widget)
690 | right_layout:add(pulseicon)
691 | right_layout:add(pulsewidget)
692 | right_layout:add(pulsebox)
693 | right_layout:add(clockicon)
694 | right_layout:add(mytextclock)
695 | right_layout:add(mylayoutbox[s])
696 |
697 | local layout = wibox.layout.align.horizontal()
698 | layout:set_left(left_layout)
699 | layout:set_middle(mytasklist[s])
700 | layout:set_right(right_layout)
701 |
702 | mywibox[s]:set_widget(layout)
703 |
704 | mystatusbox[s] = awful.wibar({ position = "bottom", screen = s })
705 | local left_layout2 = wibox.layout.fixed.horizontal()
706 |
707 | left_layout2:add(testwidget)
708 |
709 | left_layout2:add(cpuicon)
710 | left_layout2:add(cpuwidget)
711 | left_layout2:add(thermalicon)
712 | left_layout2:add(thermalwidget)
713 | left_layout2:add(memicon)
714 | left_layout2:add(memwidget)
715 | left_layout2:add(ioicon)
716 | left_layout2:add(iowidget)
717 | left_layout2:add(neticon)
718 | left_layout2:add(netwidget)
719 | left_layout2:add(btcicon)
720 | left_layout2:add(btcwidget)
721 |
722 | local right_layout2 = wibox.layout.fixed.horizontal()
723 | right_layout2:add(mpcicon)
724 | right_layout2:add(wimpc)
725 | right_layout2:add(pkgicon)
726 | right_layout2:add(pkgwidget)
727 |
728 | local layout2 = wibox.layout.align.horizontal()
729 | layout2:set_left(left_layout2)
730 | layout2:set_right(right_layout2)
731 |
732 | mystatusbox[s]:set_widget(layout2)
733 |
734 |
735 | end
736 | -- }}}
737 |
738 | -- {{{ Mouse bindings
739 | root.buttons(awful.util.table.join(
740 | awful.button({ }, 3, function () mymainmenu:toggle() end),
741 | awful.button({ }, 4, awful.tag.viewnext),
742 | awful.button({ }, 5, awful.tag.viewprev)
743 | ))
744 | -- }}}
745 |
746 | local function random_string(len)
747 | local res = {}
748 | for i=1, len do
749 | -- from range a-z
750 | res[i] = string.char(math.random(97, 122))
751 | end
752 | return table.concat(res)
753 | end
754 |
755 |
756 | -- {{{ Key bindings
757 | globalkeys = awful.util.table.join(
758 | awful.key({ modkey, }, "s", hotkeys_popup.show_help,
759 | {description="show help", group="awesome"}),
760 | awful.key({ modkey, }, "Left", awful.tag.viewprev,
761 | {description = "view previous", group = "tag"}),
762 | awful.key({ modkey, }, "Right", awful.tag.viewnext,
763 | {description = "view next", group = "tag"}),
764 | awful.key({ modkey, }, "Escape", awful.tag.history.restore,
765 | {description = "go back", group = "tag"}),
766 |
767 | awful.key({ modkey, }, "j",
768 | function ()
769 | awful.client.focus.byidx( 1)
770 | end,
771 | {description = "focus next by index", group = "client"}
772 | ),
773 | awful.key({ modkey, }, "k",
774 | function ()
775 | awful.client.focus.byidx(-1)
776 | end,
777 | {description = "focus previous by index", group = "client"}
778 | ),
779 | awful.key({ modkey, }, "w", function () mymainmenu:show() end,
780 | {description = "show main menu", group = "awesome"}),
781 |
782 | -- Layout manipulation
783 | awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
784 | {description = "swap with next client by index", group = "client"}),
785 | awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
786 | {description = "swap with previous client by index", group = "client"}),
787 | awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
788 | {description = "focus the next screen", group = "screen"}),
789 | awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
790 | {description = "focus the previous screen", group = "screen"}),
791 | awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
792 | {description = "jump to urgent client", group = "client"}),
793 | awful.key({ modkey, }, "Tab",
794 | function ()
795 | awful.client.focus.history.previous()
796 | if client.focus then
797 | client.focus:raise()
798 | end
799 | end,
800 | {description = "go back", group = "client"}),
801 |
802 | -- move float clients without a mouse
803 | awful.key({ modkey, modkey2 }, "h", function () awful.client.moveresize(-20, 0, 0, 0) end),
804 | awful.key({ modkey, modkey2 }, "j", function () awful.client.moveresize(0, 20, 0, 0) end),
805 | awful.key({ modkey, modkey2 }, "k", function () awful.client.moveresize(0, -20, 0, 0) end),
806 | awful.key({ modkey, modkey2 }, "l", function () awful.client.moveresize(20, 0, 0, 0) end),
807 |
808 | -- Standard program
809 | awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
810 | {description = "open a terminal", group = "launcher"}),
811 | awful.key({ modkey, "Control" }, "r", awesome.restart,
812 | {description = "reload awesome", group = "awesome"}),
813 | -- this also locks the screen because of xss-lock
814 | awful.key({ modkey, "Control" }, "l", function() awful.util.spawn("xset dpms force standby") end,
815 | {description = "blank screen ", group = "launcher"}),
816 | awful.key({ modkey, "Shift" }, "q", awesome.quit,
817 | {description = "quit awesome", group = "awesome"}),
818 |
819 | awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end,
820 | {description = "increase master width factor", group = "layout"}),
821 | awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end,
822 | {description = "decrease master width factor", group = "layout"}),
823 | awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
824 | {description = "increase the number of master clients", group = "layout"}),
825 | awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
826 | {description = "decrease the number of master clients", group = "layout"}),
827 | awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
828 | {description = "increase the number of columns", group = "layout"}),
829 | awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
830 | {description = "decrease the number of columns", group = "layout"}),
831 | awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
832 | {description = "select next", group = "layout"}),
833 | awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
834 | {description = "select previous", group = "layout"}),
835 |
836 | awful.key({ modkey, "Control" }, "n",
837 | function ()
838 | local c = awful.client.restore()
839 | -- Focus restored client
840 | if c then
841 | client.focus = c
842 | c:raise()
843 | end
844 | end,
845 | {description = "restore minimized", group = "client"}),
846 |
847 | -- Prompt
848 | --awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
849 | -- {description = "run prompt", group = "launcher"}),
850 | awful.key({ modkey }, "r", function () awful.util.spawn("rofi -show run -modi run") end),
851 | awful.key({ modkey }, "x",
852 | function ()
853 | awful.prompt.run {
854 | prompt = "Run Lua code: ",
855 | textbox = awful.screen.focused().mypromptbox.widget,
856 | exe_callback = awful.util.eval,
857 | history_path = awful.util.get_cache_dir() .. "/history_eval"
858 | }
859 | end,
860 | {description = "lua execute prompt", group = "awesome"}),
861 | -- Menubar
862 | awful.key({ modkey }, "p", function() menubar.show() end,
863 | {description = "show the menubar", group = "launcher"}),
864 | -- {{{ Custom Bindings
865 | -- mpd control
866 | awful.key({ "Shift" }, "space", function () mpc:toggle_play() mpc:update() end),
867 | awful.key({ }, "XF86AudioPlay", function () mpc:toggle_play() mpc:update() end),
868 | awful.key({ }, "XF86AudioNext", function () mpc:next() mpc:update() end),
869 | awful.key({ }, "XF86AudioPrev", function () mpc:previous() mpc:update() end),
870 |
871 | -- use a systemd.path to automatically upload this image to my server and copy
872 | -- the public link to clipboard
873 | awful.key({modkey }, "Print", function ()
874 | awful.util.spawn("scrot '%Y-%m-%d."..random_string(5)..".png' --exec 'eog \"$f\"; mv \"$f\" /home/joerg/Bilder'")
875 | end),
876 | awful.key({modkey, "Shift" }, "Print", false, function ()
877 | awful.util.spawn("scrot '%Y-%m-%d."..random_string(5)..".png' --select --exec 'eog \"$f\"; mv \"$f\" /home/joerg/Bilder'")
878 | end),
879 |
880 | awful.key({ }, "XF86Display", function()
881 | -- switch between external and internal display
882 | -- source: https://wiki.archlinux.org/index.php/Xrandr#Scripts
883 | os.execute('bash -c \'xrandr --output eDP1 --mode "1400x1050"; sleep 1; xrandr --output eDP1 --mode "1920x1080"\'')
884 | end),
885 |
886 | -- Volume keyboard control
887 | awful.key({ }, "XF86AudioRaiseVolume", function () pulse_volume(5) end),
888 | awful.key({ }, "XF86AudioLowerVolume", function () pulse_volume(-5)end),
889 | awful.key({ }, "XF86AudioMute", function () pulse_toggle() end),
890 |
891 | awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 10") end),
892 | awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 10") end),
893 |
894 | -- Calculator
895 | awful.key({ modkey }, "c", function () awful.util.spawn("gnome-calculator") end),
896 | awful.key({ modkey, "Control" }, "c", function () awful.util.spawn("qalculate-gtk") end)
897 | -- }}}
898 | )
899 |
900 | clientkeys = awful.util.table.join(
901 | awful.key({ modkey, }, "f",
902 | function (c)
903 | c.fullscreen = not c.fullscreen
904 | c:raise()
905 | end,
906 | {description = "toggle fullscreen", group = "client"}),
907 | awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
908 | {description = "close", group = "client"}),
909 | awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
910 | {description = "toggle floating", group = "client"}),
911 | awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
912 | {description = "move to master", group = "client"}),
913 | awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
914 | {description = "move to screen", group = "client"}),
915 | awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
916 | {description = "toggle keep on top", group = "client"}),
917 | awful.key({ modkey, }, "n",
918 | function (c)
919 | -- The client currently has the input focus, so it cannot be
920 | -- minimized, since minimized clients can't have the focus.
921 | c.minimized = true
922 | end ,
923 | {description = "minimize", group = "client"}),
924 | awful.key({ modkey, }, "m",
925 | function (c)
926 | c.maximized = not c.maximized
927 | c:raise()
928 | end ,
929 | {description = "maximize", group = "client"})
930 | )
931 |
932 | -- Bind all key numbers to tags.
933 | -- Be careful: we use keycodes to make it works on any keyboard layout.
934 | -- This should map on the top row of your keyboard, usually 1 to 9.
935 | for i = 1, 9 do
936 | globalkeys = awful.util.table.join(globalkeys,
937 | -- View tag only.
938 | awful.key({ modkey }, "#" .. i + 9,
939 | function ()
940 | local screen = awful.screen.focused()
941 | local tag = screen.tags[i]
942 | if tag then
943 | tag:view_only()
944 | end
945 | end,
946 | {description = "view tag #"..i, group = "tag"}),
947 | -- Toggle tag display.
948 | awful.key({ modkey, "Control" }, "#" .. i + 9,
949 | function ()
950 | local screen = awful.screen.focused()
951 | local tag = screen.tags[i]
952 | if tag then
953 | awful.tag.viewtoggle(tag)
954 | end
955 | end,
956 | {description = "toggle tag #" .. i, group = "tag"}),
957 | -- Move client to tag.
958 | awful.key({ modkey, "Shift" }, "#" .. i + 9,
959 | function ()
960 | if client.focus then
961 | local tag = client.focus.screen.tags[i]
962 | if tag then
963 | client.focus:move_to_tag(tag)
964 | end
965 | end
966 | end,
967 | {description = "move focused client to tag #"..i, group = "tag"}),
968 | -- Toggle tag on focused client.
969 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
970 | function ()
971 | if client.focus then
972 | local tag = client.focus.screen.tags[i]
973 | if tag then
974 | client.focus:toggle_tag(tag)
975 | end
976 | end
977 | end,
978 | {description = "toggle focused client on tag #" .. i, group = "tag"})
979 | )
980 | end
981 |
982 |
983 | clientbuttons = awful.util.table.join(
984 | awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
985 | awful.button({ modkey }, 1, awful.mouse.client.move),
986 | awful.button({ modkey }, 3, awful.mouse.client.resize))
987 |
988 | -- Set keys
989 | root.keys(globalkeys)
990 | -- }}}
991 |
992 | -- {{{ Rules
993 | -- Rules to apply to new clients (through the "manage" signal).
994 | awful.rules.rules = {
995 | -- All clients will match this rule.
996 | { rule = { },
997 | properties = { border_width = beautiful.border_width,
998 | border_color = beautiful.border_normal,
999 | focus = awful.client.focus.filter,
1000 | keys = clientkeys,
1001 | buttons = clientbuttons,
1002 | screen = awful.screen.preferred,
1003 | placement = awful.placement.no_overlap+awful.placement.no_offscreen
1004 | }
1005 | },
1006 | { rule = { class = "MPlayer" },
1007 | properties = { floating = true } },
1008 | { rule = { class = "pinentry" },
1009 | properties = { floating = true } },
1010 | { rule = { class = "gimp" },
1011 | properties = { floating = true } },
1012 | { rule = { class = "Gajim.py" },
1013 | callback = awful.client.setslave },
1014 | -- Add titlebars to normal clients and dialogs
1015 | -- Set Firefox to always map on the tag named "2" on screen 1.
1016 | -- { rule = { class = "Firefox" },
1017 | -- properties = { screen = 1, tag = "2" } },
1018 | }
1019 | -- }}}
1020 |
1021 | -- {{{ Signals
1022 | -- Signal function to execute when a new client appears.
1023 | client.connect_signal("manage", function (c)
1024 | if not awesome.startup then
1025 | -- Set the windows at the slave,
1026 | -- i.e. put it at the end of others instead of setting it master.
1027 | -- awful.client.setslave(c)
1028 |
1029 | -- Put windows in a smart way, only if they does not set an initial position.
1030 | if not c.size_hints.user_position and not c.size_hints.program_position then
1031 | awful.placement.no_overlap(c)
1032 | awful.placement.no_offscreen(c)
1033 | end
1034 | end
1035 |
1036 | local titlebars_enabled = false
1037 | if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then
1038 | -- buttons for the titlebar
1039 | local buttons = awful.util.table.join(
1040 | awful.button({ }, 1, function()
1041 | client.focus = c
1042 | c:raise()
1043 | awful.mouse.client.move(c)
1044 | end),
1045 | awful.button({ }, 3, function()
1046 | client.focus = c
1047 | c:raise()
1048 | awful.mouse.client.resize(c)
1049 | end)
1050 | )
1051 |
1052 | -- Widgets that are aligned to the left
1053 | local left_layout = wibox.layout.fixed.horizontal()
1054 | left_layout:add(awful.titlebar.widget.iconwidget(c))
1055 | left_layout:buttons(buttons)
1056 |
1057 | -- Widgets that are aligned to the right
1058 | local right_layout = wibox.layout.fixed.horizontal()
1059 | right_layout:add(awful.titlebar.widget.floatingbutton(c))
1060 | right_layout:add(awful.titlebar.widget.maximizedbutton(c))
1061 | right_layout:add(awful.titlebar.widget.stickybutton(c))
1062 | right_layout:add(awful.titlebar.widget.ontopbutton(c))
1063 | right_layout:add(awful.titlebar.widget.closebutton(c))
1064 |
1065 | -- The title goes in the middle
1066 | local middle_layout = wibox.layout.flex.horizontal()
1067 | local title = awful.titlebar.widget.titlewidget(c)
1068 | title:set_align("center")
1069 | middle_layout:add(title)
1070 | middle_layout:buttons(buttons)
1071 |
1072 | -- Now bring it all together
1073 | local layout = wibox.layout.align.horizontal()
1074 | layout:set_left(left_layout)
1075 | layout:set_right(right_layout)
1076 | layout:set_middle(middle_layout)
1077 |
1078 | awful.titlebar(c):set_widget(layout)
1079 | end
1080 | end)
1081 |
1082 | -- Enable sloppy focus, so that focus follows mouse.
1083 | client.connect_signal("mouse::enter", function(c)
1084 | if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
1085 | and awful.client.focus.filter(c) then
1086 | client.focus = c
1087 | end
1088 | end)
1089 |
1090 | client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end)
1091 | client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
1092 | -- }}}
1093 |
1094 | -- {{{ Welcome Message
1095 | print("[awesome] Send welcome message")
1096 |
1097 | naughty.notify{
1098 | title = "Awesome "..awesome.version.." started!",
1099 | text = string.format("Welcome %s. Your host is %s.\nIt is %s",
1100 | os.getenv("USER"), awful.util.pread("hostname"):match("[^\n]*"), os.date()),
1101 | timeout = 7 }
1102 | -- }}}
1103 |
1104 | -- Java helper
1105 | awful.util.spawn("wmname LG3D")
1106 | awful.util.spawn(spawn_with_systemd("rambox"))
1107 | awful.util.spawn(spawn_with_systemd("dino"))
1108 | awful.util.spawn(spawn_with_systemd("thunderbird"))
1109 | awful.util.spawn(spawn_with_systemd("firefox"))
1110 | awful.util.spawn("systemctl --user import-environment XDG_SESSION_PATH")
1111 | awful.util.spawn(spawn_with_systemd("light-locker"))
1112 |
1113 | -- vim: foldmethod=marker:filetype=lua:expandtab:shiftwidth=2:tabstop=2:softtabstop=2:textwidth=80
1114 |
--------------------------------------------------------------------------------