switched to cp -Rl
VictorFranzi
9 years ago
Binary diff not shown
Binary diff not shown
19 | 19 | -- assault -> batterie |
20 | 20 | local assault = require('assault') |
21 | 21 | |
22 | --lancer nm-applet | |
23 | os.execute("nm-applet &") | |
24 | --lancer checkgmail | |
25 | os.execute("checkgmail &") | |
26 | ||
27 | --lancer xautolock | |
28 | --os.execute("xautolock -time 8 -locker $HOME/.lock_screen/lock -notify 30 -notifier 'notify-send --urgency=critical \"Screen lock\" \"Screen will be locked in 30s\" -i $HOME/.lock_screen/lock.png -t 5000' &") | |
29 | --i've a home made lock screen (see i3lock-color-git on google) | |
30 | ||
31 | 22 | -- Mettre en français les langues |
32 | 23 | os.setlocale("fr_FR.UTF-8", "time") |
24 | ||
25 | ||
33 | 26 | |
34 | 27 | -- {{{ Error handling |
35 | 28 | -- Check if awesome encountered an error during startup and fell back to |
61 | 54 | beautiful.init("/usr/share/awesome/themes/gladious/theme.lua") |
62 | 55 | |
63 | 56 | -- SET WALLPAPER |
64 | --theme.wallpaper = "$HOME/Wallpaper/wp_darktosun.png" | |
65 | -- set your own wallpaper here | |
66 | ||
57 | theme.wallpaper = "/home/victor/Wallpaper/square_final.png" | |
67 | 58 | |
68 | 59 | -- This is used later as the default terminal and editor to run. |
69 | 60 | terminal = "urxvtc" |
119 | 110 | -- {{{ Menu |
120 | 111 | -- Create a laucher widget and a main menu |
121 | 112 | myawesomemenu = { |
122 | { "Manual", terminal .. " -e man awesome" , "$HOME/.config/awesome/icones/man.png" }, | |
123 | { "Edit config", terminal .. " -e nano $HOME/.config/awesome/rc.lua" }, | |
124 | { "Restart", awesome.restart, "$HOME/.config/awesome/icones/restart.png" }, | |
125 | { "Quit", awesome.quit , "$HOME/.config/awesome/icones/shutdown.png" } | |
113 | { "Manual", terminal .. " -e man awesome" , "/home/victor/.config/awesome/icones/man.png" }, | |
114 | { "Edit config", terminal .. " -e nano /home/victor/.config/awesome/rc.lua" }, | |
115 | { "Restart", awesome.restart, "/home/victor/.config/awesome/icones/restart.png" }, | |
116 | { "Quit", awesome.quit , "/home/victor/.config/awesome/icones/shutdown.png" } | |
126 | 117 | |
127 | 118 | } |
128 | 119 | |
129 | 120 | menuapplications = { |
130 | { "Firefox", "firefox", "$HOME/.config/awesome/icones/firefox.png" }, | |
131 | { "Emacs", "emacs", "$HOME/.config/awesome/icones/emacs.png" }, | |
132 | { "gVim", "gvim" , "$HOME/.config/awesome/icones/gvim.png" }, | |
133 | { "Eclipse", "eclipse" , "$HOME/.config/awesome/icones/eclipse.png" }, | |
134 | { "TexStudio", "texstudio" , "$HOME/.config/awesome/icones/texstudio.png" }, | |
135 | { "gEdit", "gedit" , "$HOME/.config/awesome/icones/gedit.png" }, | |
136 | { "Sublime Text", "subl" , "$HOME/.config/awesome/icones/sublimetext.png" }, | |
137 | { "LibreOffice", "libreoffice" , "$HOME/.config/awesome/icones/libreoffice.png" }, | |
138 | { "CherryTree", "cherrytree", "$HOME/.config/awesome/icones/cherrytree.png" }, | |
139 | { "PCManFM", "pcmanfm" , "$HOME/.config/awesome/icones/pcmanfm.png" }, | |
140 | { "Dropbox", "dropbox" , "$HOME/.config/awesome/icones/dropbox.png" }, | |
141 | { "irssi", terminal .. " -e irssi" , "$HOME/.config/awesome/icones/irssi.png" }, | |
142 | { "weechat", terminal .. " -e weechat" , "$HOME/.config/awesome/icones/weechat.png" }, | |
143 | { "HexChat", "hexchat" , "$HOME/.config/awesome/icones/hexchat.png" } | |
121 | { "Firefox", "firefox", "/home/victor/.config/awesome/icones/firefox.png" }, | |
122 | { "Emacs", "emacs", "/home/victor/.config/awesome/icones/emacs.png" }, | |
123 | { "gVim", "gvim" , "/home/victor/.config/awesome/icones/gvim.png" }, | |
124 | { "Eclipse", "eclipse" , "/home/victor/.config/awesome/icones/eclipse.png" }, | |
125 | { "TexStudio", "texstudio" , "/home/victor/.config/awesome/icones/texstudio.png" }, | |
126 | { "gEdit", "gedit" , "/home/victor/.config/awesome/icones/gedit.png" }, | |
127 | { "Sublime Text", "subl" , "/home/victor/.config/awesome/icones/sublimetext.png" }, | |
128 | { "LibreOffice", "libreoffice" , "/home/victor/.config/awesome/icones/libreoffice.png" }, | |
129 | { "CherryTree", "cherrytree", "/home/victor/.config/awesome/icones/cherrytree.png" }, | |
130 | { "PCManFM", "pcmanfm" , "/home/victor/.config/awesome/icones/pcmanfm.png" }, | |
131 | { "Dropbox", "dropbox" , "/home/victor/.config/awesome/icones/dropbox.png" }, | |
132 | { "irssi", terminal .. " -e irssi" , "/home/victor/.config/awesome/icones/irssi.png" }, | |
133 | { "weechat", terminal .. " -e weechat" , "/home/victor/.config/awesome/icones/weechat.png" }, | |
134 | { "HexChat", "hexchat" , "/home/victor/.config/awesome/icones/hexchat.png" } | |
144 | 135 | } |
145 | 136 | |
137 | menujeux = { | |
138 | { "GLTron", "gltron" }, | |
139 | { "TeeWorlds", "teeworlds", "/home/victor/.config/awesome/icones/teeworlds.png" } | |
140 | } | |
141 | ||
146 | 142 | mymainmenu = awful.menu({ items = { { "Awesome", myawesomemenu }, |
147 | { "Applications", menuapplications, beautiful.awesome_icon }, | |
148 | { "Terminal", terminal , "$HOME/.config/awesome/icones/term_logo.png" }, | |
149 | { "Lock", "$HOME/.lock_screen/lock", "$HOME/.config/awesome/icones/lock.png" }, | |
143 | { "Applications", menuapplications, beautiful.awesome_icon }, | |
144 | { "Jeux", menujeux, "/home/victor/.config/awesome/icones/menujeux.png" }, | |
145 | { "Terminal", terminal , "/home/victor/.config/awesome/icones/term_logo.png" }, | |
146 | { "Lock", "/home/victor/.lock_screen/lock", "/home/victor/.config/awesome/icones/lock.png" }, | |
150 | 147 | { "Reboot", terminal .. " -e reboot" }, |
151 | { "Shutdown", terminal .. " -e shutdown -f now" , "$HOME/.config/awesome/icones/shutdown.png" } | |
148 | { "Shutdown", terminal .. " -e poweroff" , "/home/victor/.config/awesome/icones/shutdown.png" } | |
152 | 149 | } |
153 | 150 | }) |
154 | 151 | |
403 | 400 | awful.key({}, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Images/ 2>/dev/null'") end), |
404 | 401 | awful.key({}, "XF86MyComputer", function() awful.util.spawn("pcmanfm") end), |
405 | 402 | awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("amixer set Master 5+ unmute; amixer set Headphone unmute; amixer set Speaker unmute") end), |
406 | awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5- unmute") end), | |
403 | awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5- unmute; amixer set Headphone unmute; amixer set Speaker unmute") end), | |
407 | 404 | awful.key({}, "XF86AudioMute", function() awful.util.spawn("amixer set Master toggle") end), |
408 | 405 | awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn("xbacklight +5") end), |
409 | 406 | awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn("xbacklight -5") end), |
410 | awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("$HOME/.lock_screen/lock") end), | |
407 | awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("/home/victor/.lock_screen/lock") end), | |
411 | 408 | awful.key({ modkey, "Shift" }, "Return", function () awful.util.spawn("firefox") end), |
412 | 409 | |
413 | 410 |
0 | -------------------------- | |
1 | ----- awesome/rc.lua ----- | |
2 | -------------------------- | |
3 | ||
4 | ||
5 | -- Standard awesome library | |
6 | gears = require("gears") | |
7 | awful = require("awful") | |
8 | awful.rules = require("awful.rules") | |
9 | require("awful.autofocus") | |
10 | -- Widget and layout library | |
11 | wibox = require("wibox") | |
12 | -- Theme handling library | |
13 | beautiful = require("beautiful") | |
14 | -- Notification library | |
15 | naughty = require("naughty") | |
16 | menubar = require("menubar") | |
17 | vicious = require("vicious") | |
18 | ||
19 | -- assault -> batterie | |
20 | local assault = require('assault') | |
21 | ||
22 | --lancer nm-applet | |
23 | os.execute("nm-applet &") | |
24 | ||
25 | --lancer xautolock | |
26 | os.execute("xautolock -time 8 -locker /home/victor/.lock_screen/lock -notify 30 -notifier 'notify-send --urgency=critical \"Screen lock\" \"Screen will be locked in 30s\" -i /home/victor/.lock_screen/lock.png -t 5000' &") | |
27 | os.execute("notify-send \"Bienvenue\" \"Bonjour seigneur, comment allez-vous ?\" -t 10000 -i &") | |
28 | ||
29 | -- Mettre en français les langues | |
30 | os.setlocale("fr_FR.UTF-8", "time") | |
31 | ||
32 | -- {{{ Error handling | |
33 | -- Check if awesome encountered an error during startup and fell back to | |
34 | -- another config (This code will only ever execute for the fallback config) | |
35 | if awesome.startup_errors then | |
36 | naughty.notify({ preset = naughty.config.presets.critical, | |
37 | title = "Oops, there were errors during startup!", | |
38 | text = awesome.startup_errors }) | |
39 | end | |
40 | ||
41 | -- Handle runtime errors after startup | |
42 | do | |
43 | local in_error = false | |
44 | awesome.connect_signal("debug::error", function (err) | |
45 | -- Make sure we don't go into an endless error loop | |
46 | if in_error then return end | |
47 | in_error = true | |
48 | ||
49 | naughty.notify({ preset = naughty.config.presets.critical, | |
50 | title = "Oops, an error happened!", | |
51 | text = err }) | |
52 | in_error = false | |
53 | end) | |
54 | end | |
55 | -- }}} | |
56 | ||
57 | -- {{{ Variable definitions | |
58 | -- Themes define colours, icons, font and wallpapers. | |
59 | beautiful.init("/usr/share/awesome/themes/vicious/theme.lua") | |
60 | ||
61 | -- SET WALLPAPER | |
62 | theme.wallpaper = "/home/victor/Wallpaper/wp_darktosun.png" | |
63 | ||
64 | -- This is used later as the default terminal and editor to run. | |
65 | terminal = "urxvtc" | |
66 | editor = os.getenv("EDITOR") or "nano" | |
67 | editor_cmd = terminal .. " -e " .. editor | |
68 | ||
69 | -- Default modkey. | |
70 | -- Usually, Mod4 is the key with a logo between Control and Alt. | |
71 | -- If you do not like this or do not have such a key, | |
72 | -- I suggest you to remap Mod4 to another key using xmodmap or other tools. | |
73 | -- However, you can use another modifier like Mod1, but it may interact with others. | |
74 | modkey = "Mod4" | |
75 | ||
76 | -- Table of layouts to cover with awful.layout.inc, order matters. | |
77 | local layouts = | |
78 | { | |
79 | awful.layout.suit.tile, | |
80 | awful.layout.suit.tile.left, | |
81 | awful.layout.suit.tile.bottom, | |
82 | awful.layout.suit.tile.top, | |
83 | awful.layout.suit.fair, | |
84 | awful.layout.suit.fair.horizontal, | |
85 | awful.layout.suit.spiral, | |
86 | awful.layout.suit.floating, | |
87 | -- awful.layout.suit.spiral.dwindle, | |
88 | -- awful.layout.suit.max, | |
89 | -- awful.layout.suit.max.fullscreen, | |
90 | -- awful.layout.suit.magnifier | |
91 | } | |
92 | -- }}} | |
93 | ||
94 | -- {{{ Wallpaper | |
95 | if beautiful.wallpaper then | |
96 | for s = 1, screen.count() do | |
97 | gears.wallpaper.maximized(beautiful.wallpaper, s, true) | |
98 | end | |
99 | end | |
100 | -- }}} | |
101 | ||
102 | -- {{{ Tags | |
103 | -- Define a tag table which will hold all screen tags. | |
104 | tags = { | |
105 | names = { "α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι" }, | |
106 | layout = { layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], | |
107 | layouts[1], layouts[1], layouts[1], layouts[1] | |
108 | }} | |
109 | for s = 1, screen.count() do | |
110 | -- Each screen has its own tag table. | |
111 | tags[s] = awful.tag(tags.names, s, tags.layout) | |
112 | end | |
113 | -- }}} | |
114 | ||
115 | -- {{{ Menu | |
116 | -- Create a laucher widget and a main menu | |
117 | myawesomemenu = { | |
118 | { "Manual", terminal .. " -e man awesome" , "/home/victor/.config/awesome/icones/man.png" }, | |
119 | { "Edit config", terminal .. " -e nano /home/victor/.config/awesome/rc.lua" }, | |
120 | { "Restart", awesome.restart, "/home/victor/.config/awesome/icones/restart.png" }, | |
121 | { "Quit", awesome.quit , "/home/victor/.config/awesome/icones/shutdown.png" } | |
122 | ||
123 | } | |
124 | ||
125 | menuapplications = { | |
126 | { "Firefox", "firefox", "/home/victor/.config/awesome/icones/firefox.png" }, | |
127 | { "Emacs", "emacs", "/home/victor/.config/awesome/icones/emacs.png" }, | |
128 | { "gVim", "gvim" , "/home/victor/.config/awesome/icones/gvim.png" }, | |
129 | { "Eclipse", "eclipse" , "/home/victor/.config/awesome/icones/eclipse.png" }, | |
130 | { "TexStudio", "texstudio" , "/home/victor/.config/awesome/icones/texstudio.png" }, | |
131 | { "gEdit", "gedit" , "/home/victor/.config/awesome/icones/gedit.png" }, | |
132 | { "Sublime Text", "subl" , "/home/victor/.config/awesome/icones/sublimetext.png" }, | |
133 | { "LibreOffice", "libreoffice" , "/home/victor/.config/awesome/icones/libreoffice.png" }, | |
134 | { "CherryTree", "cherrytree", "/home/victor/.config/awesome/icones/cherrytree.png" }, | |
135 | { "PCManFM", "pcmanfm" , "/home/victor/.config/awesome/icones/pcmanfm.png" }, | |
136 | { "irssi", terminal .. " -e irssi" , "/home/victor/.config/awesome/icones/irssi.png" }, | |
137 | { "weechat", terminal .. " -e weechat" , "/home/victor/.config/awesome/icones/weechat.png" } | |
138 | } | |
139 | ||
140 | mymainmenu = awful.menu({ items = { { "Awesome", myawesomemenu }, | |
141 | { "Applications", menuapplications, beautiful.awesome_icon }, | |
142 | { "Terminal", terminal , "/home/victor/.config/awesome/icones/term_logo.png" }, | |
143 | { "Lock", "/home/victor/.lock_screen/lock", "/home/victor/.config/awesome/icones/lock.png" }, | |
144 | { "Reboot", terminal .. " -e reboot" }, | |
145 | { "Shutdown", terminal .. " -e shutdown -f now" , "/home/victor/.config/awesome/icones/shutdown.png" } | |
146 | } | |
147 | }) | |
148 | ||
149 | mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, | |
150 | menu = mymainmenu }) | |
151 | ||
152 | -- Menubar configuration | |
153 | menubar.utils.terminal = terminal -- Set the terminal for applications that require it | |
154 | -- }}} | |
155 | ||
156 | -- {{{ Wibox | |
157 | -- Create a textclock widget | |
158 | mytextclock = awful.widget.textclock() | |
159 | ||
160 | ------------------------------------------------------ | |
161 | ||
162 | -- {{{ Battery State | |
163 | ||
164 | myassault = assault({ | |
165 | battery = "BAT0", | |
166 | adapter = "AC", | |
167 | width = 36, | |
168 | height = 14, | |
169 | stroke_width = 1, | |
170 | font = sans, | |
171 | critical_level = 0.15, | |
172 | normal_color = "AECF96", | |
173 | critical_color = "#FF5656", | |
174 | charging_color = "#00bfff" | |
175 | }) | |
176 | ||
177 | ||
178 | ||
179 | -- {{{ Volume state | |
180 | local alsawidget = | |
181 | { | |
182 | channel = "Master", | |
183 | step = "5%", | |
184 | colors = | |
185 | { | |
186 | unmute = "#AECF96", | |
187 | mute = "#FF5656" | |
188 | }, | |
189 | mixer = terminal .. " -e alsamixer", -- or whatever your preferred sound mixer is | |
190 | ||
191 | } | |
192 | -- widget | |
193 | alsawidget.bar = awful.widget.progressbar () | |
194 | alsawidget.bar:set_width (8) | |
195 | alsawidget.bar:set_height(14) | |
196 | alsawidget.bar:set_vertical (true) | |
197 | alsawidget.bar:set_background_color ("#787878") | |
198 | alsawidget.bar:set_color (alsawidget.colors.unmute) | |
199 | alsawidget.bar:buttons (awful.util.table.join ( | |
200 | awful.button ({}, 1, function() | |
201 | awful.util.spawn (alsawidget.mixer) | |
202 | end), | |
203 | awful.button ({}, 3, function() | |
204 | awful.util.spawn ("amixer sset " .. alsawidget.channel .. " toggle") | |
205 | vicious.force ({ alsawidget.bar }) | |
206 | end), | |
207 | awful.button ({}, 4, function() | |
208 | awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") | |
209 | vicious.force ({ alsawidget.bar }) | |
210 | end), | |
211 | awful.button ({}, 5, function() | |
212 | awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") | |
213 | vicious.force ({ alsawidget.bar }) | |
214 | end) | |
215 | )) | |
216 | -- tooltip | |
217 | alsawidget.tooltip = awful.tooltip ({ objects = { alsawidget.bar } }) | |
218 | ||
219 | -- register the widget through vicious | |
220 | vicious.register (alsawidget.bar, vicious.widgets.volume, function (widget, args) | |
221 | alsawidget._current_level = args[1] | |
222 | if args[2] == "♩" | |
223 | then | |
224 | alsawidget._muted = true | |
225 | alsawidget.tooltip:set_text (" [Muted] ") | |
226 | widget:set_color (alsawidget.colors.mute) | |
227 | return 100 | |
228 | end | |
229 | alsawidget._muted = false | |
230 | alsawidget.tooltip:set_text (" " .. alsawidget.channel .. ": " .. args[1] .. "% ") | |
231 | widget:set_color (alsawidget.colors.unmute) | |
232 | return args[1] | |
233 | end, 5, alsawidget.channel) | |
234 | ||
235 | ||
236 | ----------------------------------------------------- | |
237 | ----------------------------------------------------- | |
238 | ||
239 | -- Create a wibox for each screen and add it | |
240 | wiboxtop = {} | |
241 | wiboxbottom = {} | |
242 | mypromptbox = {} | |
243 | mylayoutbox = {} | |
244 | mytaglist = {} | |
245 | mytaglist.buttons = awful.util.table.join( | |
246 | awful.button({ }, 1, awful.tag.viewonly), | |
247 | awful.button({ modkey }, 1, awful.client.movetotag), | |
248 | awful.button({ }, 3, awful.tag.viewtoggle), | |
249 | awful.button({ modkey }, 3, awful.client.toggletag), | |
250 | awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), | |
251 | awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) | |
252 | ) | |
253 | mytasklist = {} | |
254 | mytasklist.buttons = awful.util.table.join( | |
255 | awful.button({ }, 1, function (c) | |
256 | if c == client.focus then | |
257 | c.minimized = true | |
258 | else | |
259 | -- Without this, the following | |
260 | -- :isvisible() makes no sense | |
261 | c.minimized = false | |
262 | if not c:isvisible() then | |
263 | awful.tag.viewonly(c:tags()[1]) | |
264 | end | |
265 | -- This will also un-minimize | |
266 | -- the client, if needed | |
267 | client.focus = c | |
268 | c:raise() | |
269 | end | |
270 | end), | |
271 | awful.button({ }, 3, function () | |
272 | if instance then | |
273 | instance:hide() | |
274 | instance = nil | |
275 | else | |
276 | instance = awful.menu.clients({ | |
277 | theme = { width = 250 } | |
278 | }) | |
279 | end | |
280 | end), | |
281 | awful.button({ }, 4, function () | |
282 | awful.client.focus.byidx(1) | |
283 | if client.focus then client.focus:raise() end | |
284 | end), | |
285 | awful.button({ }, 5, function () | |
286 | awful.client.focus.byidx(-1) | |
287 | if client.focus then client.focus:raise() end | |
288 | end)) | |
289 | ||
290 | for s = 1, screen.count() do | |
291 | -- Create a promptbox for each screen | |
292 | mypromptbox[s] = awful.widget.prompt() | |
293 | -- Create an imagebox widget which will contains an icon indicating which layout we're using. | |
294 | -- We need one layoutbox per screen. | |
295 | mylayoutbox[s] = awful.widget.layoutbox(s) | |
296 | mylayoutbox[s]:buttons(awful.util.table.join( | |
297 | awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), | |
298 | awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), | |
299 | awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), | |
300 | awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) | |
301 | -- Create a taglist widget | |
302 | mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) | |
303 | ||
304 | -- Create a tasklist widget | |
305 | mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) | |
306 | ||
307 | -- Create the wibox | |
308 | wiboxtop[s] = awful.wibox({ position = "top", screen = s }) | |
309 | ||
310 | -- Widgets that are aligned to the left | |
311 | local left_layout = wibox.layout.fixed.horizontal() | |
312 | left_layout:add(mylauncher) | |
313 | left_layout:add(mytaglist[s]) | |
314 | left_layout:add(mypromptbox[s]) | |
315 | ||
316 | -- Widgets that are aligned to the right | |
317 | local right_layout = wibox.layout.fixed.horizontal() | |
318 | if s == 1 then right_layout:add(wibox.widget.systray()) end | |
319 | right_layout:add(myassault) | |
320 | right_layout:add(alsawidget.bar) | |
321 | right_layout:add(mytextclock) | |
322 | --right_layout:add(mylayoutbox[s]) | |
323 | ||
324 | -- Now bring it all together (with the tasklist in the middle) | |
325 | local layout = wibox.layout.align.horizontal() | |
326 | layout:set_left(left_layout) | |
327 | --layout:set_middle(mytasklist[s]) | |
328 | layout:set_right(right_layout) | |
329 | ||
330 | wiboxtop[s]:set_widget(layout) | |
331 | ||
332 | -- Create the bottom wibox | |
333 | wiboxbottom[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 20 }) | |
334 | ||
335 | -- Widgets that are aligned to the bottom left | |
336 | bottom_left_layout = wibox.layout.fixed.horizontal() | |
337 | ||
338 | -- Widgets that are aligned to the bottom right | |
339 | bottom_right_layout = wibox.layout.fixed.horizontal() | |
340 | bottom_right_layout:add(mylayoutbox[s]) | |
341 | ||
342 | -- Now bring it all together (with the tasklist in the middle) | |
343 | bottom_layout = wibox.layout.align.horizontal() | |
344 | bottom_layout:set_left(bottom_left_layout) | |
345 | bottom_layout:set_middle(mytasklist[s]) | |
346 | bottom_layout:set_right(bottom_right_layout) | |
347 | wiboxbottom[s]:set_widget(bottom_layout) | |
348 | ||
349 | ||
350 | end | |
351 | -- }}} | |
352 | ||
353 | -- {{{ Mouse bindings | |
354 | root.buttons(awful.util.table.join( | |
355 | awful.button({ }, 3, function () mymainmenu:toggle() end), | |
356 | awful.button({ }, 4, awful.tag.viewnext), | |
357 | awful.button({ }, 5, awful.tag.viewprev) | |
358 | )) | |
359 | -- }}} | |
360 | ||
361 | -- {{{ Key bindings | |
362 | globalkeys = awful.util.table.join( | |
363 | awful.key({ modkey, }, "Left", awful.tag.viewprev ), | |
364 | awful.key({ modkey, }, "Right", awful.tag.viewnext ), | |
365 | awful.key({ modkey, }, "Escape", awful.tag.history.restore), | |
366 | ||
367 | awful.key({ modkey, }, "j", | |
368 | function () | |
369 | awful.client.focus.byidx( 1) | |
370 | if client.focus then client.focus:raise() end | |
371 | end), | |
372 | awful.key({ modkey, }, "k", | |
373 | function () | |
374 | awful.client.focus.byidx(-1) | |
375 | if client.focus then client.focus:raise() end | |
376 | end), | |
377 | awful.key({ modkey, }, "w", function () mymainmenu:show() end), | |
378 | ||
379 | -- Layout manipulation | |
380 | awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), | |
381 | awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), | |
382 | awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), | |
383 | awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), | |
384 | awful.key({ modkey, }, "u", awful.client.urgent.jumpto), | |
385 | awful.key({ modkey, }, "Tab", | |
386 | function () | |
387 | awful.client.focus.history.previous() | |
388 | if client.focus then | |
389 | client.focus:raise() | |
390 | end | |
391 | end), | |
392 | ||
393 | ||
394 | -- TOUCHES FN, PRINT ECRAN ET LE BORDEL | |
395 | ||
396 | ||
397 | awful.key({}, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Images/ 2>/dev/null'") end), | |
398 | awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("amixer set Master 5%+ unmute") end), | |
399 | awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5%- unmute") end), | |
400 | awful.key({}, "XF86AudioMute", function() awful.util.spawn("amixer set Master toggle") end), | |
401 | awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn("xbacklight +10") end), | |
402 | awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn("xbacklight -10") end), | |
403 | awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("/home/victor/.lock_screen/lock") end), | |
404 | ||
405 | ||
406 | -- Standard program | |
407 | awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), | |
408 | awful.key({ modkey, }, "q", awesome.restart), | |
409 | awful.key({ modkey, "Shift" }, "q", awesome.quit), | |
410 | ||
411 | awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), | |
412 | awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), | |
413 | awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), | |
414 | awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), | |
415 | awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), | |
416 | awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), | |
417 | awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), | |
418 | awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), | |
419 | ||
420 | awful.key({ modkey, "Control" }, "n", awful.client.restore), | |
421 | ||
422 | -- Prompt | |
423 | awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), | |
424 | ||
425 | awful.key({ modkey }, "x", | |
426 | function () | |
427 | awful.prompt.run({ prompt = "Run Lua code: " }, | |
428 | mypromptbox[mouse.screen].widget, | |
429 | awful.util.eval, nil, | |
430 | awful.util.getdir("cache") .. "/history_eval") | |
431 | end), | |
432 | -- Menubar | |
433 | awful.key({ modkey }, "p", function() menubar.show() end) | |
434 | ) | |
435 | ||
436 | clientkeys = awful.util.table.join( | |
437 | awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), | |
438 | awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), | |
439 | awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), | |
440 | awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), | |
441 | awful.key({ modkey, }, "o", awful.client.movetoscreen ), | |
442 | awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), | |
443 | awful.key({ modkey, }, "n", | |
444 | function (c) | |
445 | -- The client currently has the input focus, so it cannot be | |
446 | -- minimized, since minimized clients can't have the focus. | |
447 | c.minimized = true | |
448 | end), | |
449 | awful.key({ modkey, }, "m", | |
450 | function (c) | |
451 | c.maximized_horizontal = not c.maximized_horizontal | |
452 | c.maximized_vertical = not c.maximized_vertical | |
453 | end) | |
454 | ) | |
455 | ||
456 | -- Bind all key numbers to tags. | |
457 | -- Be careful: we use keycodes to make it works on any keyboard layout. | |
458 | -- This should map on the top row of your keyboard, usually 1 to 9. | |
459 | for i = 1, 9 do | |
460 | globalkeys = awful.util.table.join(globalkeys, | |
461 | -- View tag only. | |
462 | awful.key({ modkey }, "#" .. i + 9, | |
463 | function () | |
464 | local screen = mouse.screen | |
465 | local tag = awful.tag.gettags(screen)[i] | |
466 | if tag then | |
467 | awful.tag.viewonly(tag) | |
468 | end | |
469 | end), | |
470 | -- Toggle tag. | |
471 | awful.key({ modkey, "Control" }, "#" .. i + 9, | |
472 | function () | |
473 | local screen = mouse.screen | |
474 | local tag = awful.tag.gettags(screen)[i] | |
475 | if tag then | |
476 | awful.tag.viewtoggle(tag) | |
477 | end | |
478 | end), | |
479 | -- Move client to tag. | |
480 | awful.key({ modkey, "Shift" }, "#" .. i + 9, | |
481 | function () | |
482 | if client.focus then | |
483 | local tag = awful.tag.gettags(client.focus.screen)[i] | |
484 | if tag then | |
485 | awful.client.movetotag(tag) | |
486 | end | |
487 | end | |
488 | end), | |
489 | -- Toggle tag. | |
490 | awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, | |
491 | function () | |
492 | if client.focus then | |
493 | local tag = awful.tag.gettags(client.focus.screen)[i] | |
494 | if tag then | |
495 | awful.client.toggletag(tag) | |
496 | end | |
497 | end | |
498 | end)) | |
499 | end | |
500 | ||
501 | clientbuttons = awful.util.table.join( | |
502 | awful.button({ }, 1, function (c) client.focus = c; c:raise() end), | |
503 | awful.button({ modkey }, 1, awful.mouse.client.move), | |
504 | awful.button({ modkey }, 3, awful.mouse.client.resize)) | |
505 | ||
506 | -- Set keys | |
507 | root.keys(globalkeys) | |
508 | -- }}} | |
509 | ||
510 | -- {{{ Rules | |
511 | -- Rules to apply to new clients (through the "manage" signal). | |
512 | awful.rules.rules = { | |
513 | -- All clients will match this rule. | |
514 | { rule = { }, | |
515 | properties = { border_width = beautiful.border_width, | |
516 | border_color = beautiful.border_normal, | |
517 | focus = awful.client.focus.filter, | |
518 | raise = true, | |
519 | keys = clientkeys, | |
520 | size_hints_honor = false, | |
521 | buttons = clientbuttons } }, | |
522 | { rule = { class = "MPlayer" }, | |
523 | properties = { floating = true } }, | |
524 | { rule = { class = "pinentry" }, | |
525 | properties = { floating = true } }, | |
526 | { rule = { class = "gimp" }, | |
527 | properties = { floating = true } }, | |
528 | -- Set Firefox to always map on tags number 2 of screen 1. | |
529 | -- { rule = { class = "Firefox" }, | |
530 | -- properties = { tag = tags[1][2] } }, | |
531 | } | |
532 | -- }}} | |
533 | ||
534 | -- {{{ Signals | |
535 | -- Signal function to execute when a new client appears. | |
536 | client.connect_signal("manage", function (c, startup) | |
537 | -- Enable sloppy focus | |
538 | c:connect_signal("mouse::enter", function(c) | |
539 | if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier | |
540 | and awful.client.focus.filter(c) then | |
541 | client.focus = c | |
542 | end | |
543 | end) | |
544 | ||
545 | if not startup then | |
546 | -- Set the windows at the slave, | |
547 | -- i.e. put it at the end of others instead of setting it master. | |
548 | -- awful.client.setslave(c) | |
549 | ||
550 | -- Put windows in a smart way, only if they does not set an initial position. | |
551 | if not c.size_hints.user_position and not c.size_hints.program_position then | |
552 | awful.placement.no_overlap(c) | |
553 | awful.placement.no_offscreen(c) | |
554 | end | |
555 | end | |
556 | ||
557 | local titlebars_enabled = false | |
558 | if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then | |
559 | -- buttons for the titlebar | |
560 | local buttons = awful.util.table.join( | |
561 | awful.button({ }, 1, function() | |
562 | client.focus = c | |
563 | c:raise() | |
564 | awful.mouse.client.move(c) | |
565 | end), | |
566 | awful.button({ }, 3, function() | |
567 | client.focus = c | |
568 | c:raise() | |
569 | awful.mouse.client.resize(c) | |
570 | end) | |
571 | ) | |
572 | ||
573 | -- Widgets that are aligned to the left | |
574 | local left_layout = wibox.layout.fixed.horizontal() | |
575 | left_layout:add(awful.titlebar.widget.iconwidget(c)) | |
576 | left_layout:buttons(buttons) | |
577 | ||
578 | -- Widgets that are aligned to the right | |
579 | local right_layout = wibox.layout.fixed.horizontal() | |
580 | right_layout:add(awful.titlebar.widget.floatingbutton(c)) | |
581 | right_layout:add(awful.titlebar.widget.maximizedbutton(c)) | |
582 | right_layout:add(awful.titlebar.widget.stickybutton(c)) | |
583 | right_layout:add(awful.titlebar.widget.ontopbutton(c)) | |
584 | right_layout:add(awful.titlebar.widget.closebutton(c)) | |
585 | ||
586 | -- The title goes in the middle | |
587 | local middle_layout = wibox.layout.flex.horizontal() | |
588 | local title = awful.titlebar.widget.titlewidget(c) | |
589 | title:set_align("center") | |
590 | middle_layout:buttons(buttons) | |
591 | middle_layout:buttons(buttons) | |
592 | ||
593 | -- Now bring it all together | |
594 | local layout = wibox.layout.align.horizontal() | |
595 | layout:set_left(left_layout) | |
596 | layout:set_right(right_layout) | |
597 | layout:set_middle(middle_layout) | |
598 | ||
599 | awful.titlebar(c):set_widget(layout) | |
600 | end | |
601 | end) | |
602 | ||
603 | client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) | |
604 | client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) | |
605 | -- }}} |
0 | -------------------------------- | |
1 | -- "Gladious" awesome theme -- | |
2 | -- By Piczel -- | |
3 | -------------------------------- | |
4 | ||
5 | -- Alternative icon sets and widget icons: | |
6 | -- * http://awesome.naquadah.org/wiki/Nice_Icons | |
7 | ||
8 | -- {{{ Main | |
9 | theme = {} | |
10 | theme.wallpaper = "/usr/share/awesome/themes/gladious/gladious-background.png" | |
11 | -- }}} | |
12 | ||
13 | -- {{{ Styles | |
14 | theme.font = "sans 8" | |
15 | ||
16 | -- {{{ Colors | |
17 | theme.fg_normal = "#DCDCCC" | |
18 | theme.fg_focus = "#F0DFAF" | |
19 | theme.fg_urgent = "#CC9393" | |
20 | theme.bg_normal = "#3F3F3F" | |
21 | theme.bg_focus = "#1E2320" | |
22 | theme.bg_urgent = "#3F3F3F" | |
23 | theme.bg_systray = theme.bg_normal | |
24 | -- }}} | |
25 | ||
26 | -- {{{ Borders | |
27 | theme.border_width = 1 | |
28 | theme.border_normal = "#3F3F3F" | |
29 | theme.border_focus = "#6F6F6F" | |
30 | theme.border_marked = "#CC9393" | |
31 | -- }}} | |
32 | ||
33 | -- {{{ Titlebars | |
34 | theme.titlebar_bg_focus = "#254090" | |
35 | theme.titlebar_bg_normal = "#3F3F3F" | |
36 | -- }}} | |
37 | ||
38 | -- There are other variable sets | |
39 | -- overriding the default one when | |
40 | -- defined, the sets are: | |
41 | -- [taglist|tasklist]_[bg|fg]_[focus|urgent] | |
42 | -- titlebar_[normal|focus] | |
43 | -- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] | |
44 | -- Example: | |
45 | theme.taglist_bg_focus = "#2A2A2A" | |
46 | theme.taglist_fg_focus = "#6C94A6" | |
47 | -- }}} | |
48 | ||
49 | -- {{{ Widgets | |
50 | -- You can add as many variables as | |
51 | -- you wish and access them by using | |
52 | -- beautiful.variable in your rc.lua | |
53 | --theme.fg_widget = "#AECF96" | |
54 | --theme.fg_center_widget = "#88A175" | |
55 | --theme.fg_end_widget = "#FF5656" | |
56 | --theme.bg_widget = "#494B4F" | |
57 | --theme.border_widget = "#3F3F3F" | |
58 | -- }}} | |
59 | ||
60 | -- {{{ Mouse finder | |
61 | theme.mouse_finder_color = "#CC9393" | |
62 | -- mouse_finder_[timeout|animate_timeout|radius|factor] | |
63 | -- }}} | |
64 | ||
65 | -- {{{ Menu | |
66 | -- Variables set for theming the menu: | |
67 | -- menu_[bg|fg]_[normal|focus] | |
68 | -- menu_[border_color|border_width] | |
69 | theme.menu_height = 18 | |
70 | theme.menu_width = 120 | |
71 | theme.menu_border_color = "#6F6F6F" | |
72 | -- }}} | |
73 | ||
74 | -- {{{ Icons | |
75 | -- {{{ Taglist | |
76 | theme.taglist_squares_sel = "/usr/share/awesome/themes/gladious/taglist/squarefz.png" | |
77 | theme.taglist_squares_unsel = "/usr/share/awesome/themes/gladious/taglist/squarez.png" | |
78 | --theme.taglist_squares_resize = "false" | |
79 | -- }}} | |
80 | ||
81 | -- {{{ Misc | |
82 | theme.awesome_icon = "/usr/share/awesome/themes/gladious/awesome-icon.png" | |
83 | theme.menu_submenu_icon = "/usr/share/awesome/themes/gladious/submenu.png" | |
84 | -- }}} | |
85 | ||
86 | -- {{{ Layout | |
87 | theme.layout_tile = "/usr/share/awesome/themes/gladious/layouts/tile.png" | |
88 | theme.layout_tileleft = "/usr/share/awesome/themes/gladious/layouts/tileleft.png" | |
89 | theme.layout_tilebottom = "/usr/share/awesome/themes/gladious/layouts/tilebottom.png" | |
90 | theme.layout_tiletop = "/usr/share/awesome/themes/gladious/layouts/tiletop.png" | |
91 | theme.layout_fairv = "/usr/share/awesome/themes/gladious/layouts/fairv.png" | |
92 | theme.layout_fairh = "/usr/share/awesome/themes/gladious/layouts/fairh.png" | |
93 | theme.layout_spiral = "/usr/share/awesome/themes/gladious/layouts/spiral.png" | |
94 | theme.layout_dwindle = "/usr/share/awesome/themes/gladious/layouts/dwindle.png" | |
95 | theme.layout_max = "/usr/share/awesome/themes/gladious/layouts/max.png" | |
96 | theme.layout_fullscreen = "/usr/share/awesome/themes/gladious/layouts/fullscreen.png" | |
97 | theme.layout_magnifier = "/usr/share/awesome/themes/gladious/layouts/magnifier.png" | |
98 | theme.layout_floating = "/usr/share/awesome/themes/gladious/layouts/floating.png" | |
99 | -- }}} | |
100 | ||
101 | -- {{{ Titlebar | |
102 | theme.titlebar_close_button_focus = "/usr/share/awesome/themes/gladious/titlebar/close_focus.png" | |
103 | theme.titlebar_close_button_normal = "/usr/share/awesome/themes/gladious/titlebar/close_normal.png" | |
104 | ||
105 | theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/ontop_focus_active.png" | |
106 | theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/ontop_normal_active.png" | |
107 | theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/ontop_focus_inactive.png" | |
108 | theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/ontop_normal_inactive.png" | |
109 | ||
110 | theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/sticky_focus_active.png" | |
111 | theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/sticky_normal_active.png" | |
112 | theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/sticky_focus_inactive.png" | |
113 | theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/sticky_normal_inactive.png" | |
114 | ||
115 | theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/floating_focus_active.png" | |
116 | theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/floating_normal_active.png" | |
117 | theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/floating_focus_inactive.png" | |
118 | theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/floating_normal_inactive.png" | |
119 | ||
120 | theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/maximized_focus_active.png" | |
121 | theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/maximized_normal_active.png" | |
122 | theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/maximized_focus_inactive.png" | |
123 | theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/maximized_normal_inactive.png" | |
124 | -- }}} | |
125 | -- }}} | |
126 | ||
127 | return theme |
0 | #!/bin/bash | |
1 | ||
2 | actual="$(cat /sys/class/power_supply/BAT0/capacity)" | |
3 | ||
4 | if [ $actual -eq "100" ] # && cat /sys/class/power_supply/BAT0/status -eq "Charging" ] | |
5 | then | |
6 | notify-send --urgency=critical 'Batterie pleine' 'Retirez le chargeur' | |
7 | fi | |
8 | ||
9 | if [ $actual -le "15" ] # && cat /sys/class/power_supply/BAT0/status -eq "Discharging" ] | |
10 | then | |
11 | notify-send --urgency=critical 'Batterie faible !' 'Branchez le chargeur' | |
12 | fi | |
13 |
0 | #!/bin/sh | |
1 | ||
2 | # i3-get-window-criteria - Get criteria for use with i3 config commands | |
3 | ||
4 | # To use, run this script, then click on a window. | |
5 | # Output is in the format: [<name>=<value> <name>=<value> ...] | |
6 | ||
7 | # Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion, | |
8 | # quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`, | |
9 | # reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807 | |
10 | ||
11 | PROGNAME=`basename "$0"` | |
12 | ||
13 | # Check for xwininfo and xprop | |
14 | for cmd in xwininfo xprop; do | |
15 | if ! which $cmd > /dev/null 2>&1; then | |
16 | echo "$PROGNAME: $cmd: command not found" >&2 | |
17 | exit 1 | |
18 | fi | |
19 | done | |
20 | ||
21 | match_int='[0-9][0-9]*' | |
22 | match_string='".*"' | |
23 | match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference | |
24 | ||
25 | { | |
26 | # Run xwininfo, get window id | |
27 | window_id=`xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p"` | |
28 | echo "id=$window_id" | |
29 | ||
30 | # Run xprop, transform its output into i3 criteria. Handle fallback to | |
31 | # WM_NAME when _NET_WM_NAME isn't set | |
32 | xprop -id $window_id | | |
33 | sed -nr \ | |
34 | -e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \ | |
35 | -e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \ | |
36 | -e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \ | |
37 | -e "/^_NET_WM_NAME\(UTF8_STRING\) = ($match_qstring)$/{s//title=\1/; h}" \ | |
38 | -e '${g; p}' | |
39 | } | sort | tr "\n" " " | sed -r 's/^(.*) $/[\1]\n/' |
3 | 3 | } |
4 | 4 | |
5 | 5 | uploadImage "$@" | xclip -selection c |
6 | notify-send "Done" | |
6 | notify-send "Done" -t 5000 | |
7 | 7 | |
8 | 8 | exit |
9 | 9 |
0 | #!/bin/bash | |
1 | ||
2 | zenity --question --text="Etes vous sûr de vouloir quitter i3 ?" | |
3 | if [ $? = 0 ]; then | |
4 | kill $(pidof Xorg) | |
5 | else | |
6 | exit | |
7 | fi |
0 | #!/usr/bin/env bash | |
1 | # pipes.sh: Animated pipes terminal screensaver. | |
2 | # | |
3 | # This modified version is maintained at: | |
4 | # | |
5 | # https://github.com/livibetter/pipes.sh | |
6 | ||
7 | # options: | |
8 | # s = straight [5-15] | |
9 | # f = rate [20-100] | |
10 | # t = style [0-5] | |
11 | # r = ttl | |
12 | ||
13 | VERSION=0.1.0 | |
14 | ||
15 | M=32768 | |
16 | p=1 | |
17 | f=75 s=13 r=2000 t=0 | |
18 | w=$(tput cols) h=$(tput lines) | |
19 | # ab -> idx = a*4 + b | |
20 | # 0: up, 1: right, 2: down, 3: left | |
21 | # 00 means going up , then going up -> ┃ | |
22 | # 12 means going right, then going down -> ┓ | |
23 | sets=( | |
24 | "┃┏ ┓┛━┓ ┗┃┛┗ ┏━" | |
25 | "│╭ ╮╯─╮ ╰│╯╰ ╭─" | |
26 | "│┌ ┐┘─┐ └│┘└ ┌─" | |
27 | "║╔ ╗╝═╗ ╚║╝╚ ╔═" | |
28 | "|+ ++-+ +|++ +-" | |
29 | "|/ \/-\ \|/\ /-" | |
30 | ) | |
31 | v=() | |
32 | RNDSTART=0 | |
33 | NOCOLOR=0 | |
34 | ||
35 | OPTIND=1 | |
36 | while getopts "p:t:f:s:r:RChv" arg; do | |
37 | case $arg in | |
38 | p) ((p=(OPTARG>0)?OPTARG:p));; | |
39 | t) ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG);; | |
40 | f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));; | |
41 | s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));; | |
42 | r) ((r=(OPTARG>=0)?OPTARG:r));; | |
43 | R) RNDSTART=1;; | |
44 | C) NOCOLOR=1;; | |
45 | h) echo -e "Usage: $(basename $0) [OPTION]..." | |
46 | echo -e "Animated pipes terminal screensaver.\n" | |
47 | echo -e " -p [1-]\tnumber of pipes (D=1)." | |
48 | echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)." | |
49 | echo -e " -f [20-100]\tframerate (D=75)." | |
50 | echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." | |
51 | echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)." | |
52 | echo -e " -R \t\trandom starting point." | |
53 | echo -e " -C \t\tno color." | |
54 | echo -e " -h\t\thelp (this screen)." | |
55 | echo -e " -v\t\tprint version number.\n" | |
56 | exit 0;; | |
57 | v) echo "$(basename -- "$0") $VERSION" | |
58 | exit 0 | |
59 | esac | |
60 | done | |
61 | ||
62 | # set default values if not by options | |
63 | ((${#V[@]})) || V=(0) | |
64 | ||
65 | # Attempt to workaround for Bash versions < 4, such as 3.2 on Mac: | |
66 | # https://gist.github.com/livibetter/4689307/#comment-892368 | |
67 | # Untested--in conduction of using shebang `env bash`--should fall back to | |
68 | # `sleep` | |
69 | printf -v SLEEP "read -t0.0$((1000/f)) -n 1" | |
70 | if $SLEEP &>/dev/null; (($? != 142)); then | |
71 | printf -v SLEEP "sleep 0.0$((1000/f))" | |
72 | fi | |
73 | ||
74 | cleanup() { | |
75 | # clear up standard input | |
76 | read -t 0 && cat </dev/stdin>/dev/null | |
77 | ||
78 | tput rmcup | |
79 | tput cnorm | |
80 | stty echo | |
81 | exit 0 | |
82 | } | |
83 | trap cleanup SIGHUP SIGINT SIGTERM | |
84 | ||
85 | for (( i=1; i<=p; i++ )); do | |
86 | c[i]=$((i%8)) n[i]=0 l[i]=0 | |
87 | ((x[i]=RNDSTART==1?RANDOM*w/32768:w/2)) | |
88 | ((y[i]=RNDSTART==1?RANDOM*h/32768:h/2)) | |
89 | v[i]=${V[${#V[@]} * RANDOM / M]} | |
90 | done | |
91 | ||
92 | stty -echo | |
93 | tput smcup | |
94 | tput reset | |
95 | tput civis | |
96 | # any key press exits the loop and this script | |
97 | while $SLEEP; (($? > 128)) || [[ $SLEEP = sleep* ]] && (($? == 0)); do | |
98 | for (( i=1; i<=p; i++ )); do | |
99 | # New position: | |
100 | ((${l[i]}%2)) && ((x[i]+=-${l[i]}+2,1)) || ((y[i]+=${l[i]}-1)) | |
101 | ||
102 | # Loop on edges (change color on loop): | |
103 | ((${x[i]}>w||${x[i]}<0||${y[i]}>h||${y[i]}<0)) && ((c[i]=RANDOM%8, v[i]=V[${#V[@]}*RANDOM/M])) | |
104 | ((x[i]=(x[i]+w)%w)) | |
105 | ((y[i]=(y[i]+h)%h)) | |
106 | ||
107 | # New random direction: | |
108 | ((n[i]=RANDOM%s-1)) | |
109 | ((n[i]=(${n[i]}>1||${n[i]}==0)?${l[i]}:${l[i]}+${n[i]})) | |
110 | ((n[i]=(${n[i]}<0)?3:${n[i]}%4)) | |
111 | ||
112 | # Print: | |
113 | tput cup ${y[i]} ${x[i]} | |
114 | [[ $NOCOLOR == 0 ]] && echo -ne "\033[1;3${c[i]}m" | |
115 | echo -n "${sets[v[i]]:l[i]*4+n[i]:1}" | |
116 | l[i]=${n[i]} | |
117 | done | |
118 | ((r>0 && t*p>=r)) && tput reset && tput civis && t=0 || ((t++)) | |
119 | done | |
120 | ||
121 | cleanup |
11 | 11 | |
12 | 12 | file="$HOME/.todo" |
13 | 13 | ( [ -e "$file" ] || touch "$file" ) && [ ! -w "$file" ] && echo cannot write to $file && exit 1 |
14 | ||
15 | ||
16 | ||
14 | 17 | if [[ -z $1 || $1 == "--help" || $1 == "-h" || $1 == "help" ]]; then |
15 | echo "┌──────[ todo ]──[ version 0.0.1 ]─────── ─ ─" | |
18 | echo "┌──────[ todo ]──[ version 0.0.2 ]─────── ─ ─" | |
16 | 19 | echo "│ usage: todo <options>" |
17 | 20 | echo "│ author: xero harrison - http://xero.nu" |
18 | 21 | echo "├────────────────[ options ]"───────────── ─ ─ |
2 | 2 | bat_n="$(cat /sys/class/power_supply/BAT0/energy_now)" |
3 | 3 | bat_f="$(cat /sys/class/power_supply/BAT0/energy_full)" |
4 | 4 | |
5 | #let "percent=$bat_n/$bat_f*100" | |
6 | ||
7 | 5 | percent=$(echo "$bat_n/$bat_f*100" | bc -l | cut -d"." -f1) |
8 | 6 | |
9 | if [ $percent -eq "100" ] | |
7 | actual="$(cat /sys/class/power_supply/BAT0/capacity)" | |
8 | ||
9 | if [ $actual -eq "100" ] # && cat /sys/class/power_supply/BAT0/status -eq "Charging" ] | |
10 | 10 | then |
11 | 11 | notify-send --urgency=critical 'Batterie pleine' 'Retirez le chargeur' |
12 | 12 | fi |
13 | 13 | |
14 | if [ $percent -le "15" ] | |
14 | if [ $actual -le "15" ] # && cat /sys/class/power_supply/BAT0/status -eq "Discharging" ] | |
15 | 15 | then |
16 | 16 | notify-send --urgency=critical 'Batterie faible !' 'Branchez le chargeur' |
17 | 17 | fi |
0 | # Shadow | |
1 | shadow = true; | |
2 | no-dnd-shadow = true; | |
3 | no-dock-shadow = true; | |
4 | clear-shadow = true; | |
5 | shadow-radius = 7; | |
6 | shadow-offset-x = -7; | |
7 | shadow-offset-y = -7; | |
8 | # shadow-opacity = 0.7; | |
9 | # shadow-red = 0.0; | |
10 | # shadow-green = 0.0; | |
11 | # shadow-blue = 0.0; | |
12 | shadow-exclude = [ | |
13 | "name = 'Notification'", | |
14 | "class_g = 'Conky'", | |
15 | "class_g ?= 'Notify-osd'", | |
16 | "class_g = 'Cairo-clock'", | |
17 | "_GTK_FRAME_EXTENTS@:c" | |
18 | ]; | |
19 | # shadow-exclude = "n:e:Notification"; | |
20 | # shadow-exclude-reg = "x10+0+0"; | |
21 | # xinerama-shadow-crop = true; | |
22 | ||
23 | # Opacity | |
24 | menu-opacity = 0.8; | |
25 | #inactive-opacity = 0.8; | |
26 | # active-opacity = 0.8; | |
27 | frame-opacity = 0.7; | |
28 | inactive-opacity-override = false; | |
29 | alpha-step = 0.06; | |
30 | # inactive-dim = 0.2; | |
31 | # inactive-dim-fixed = true; | |
32 | # blur-background = true; | |
33 | # blur-background-frame = true; | |
34 | blur-kern = "3x3box" | |
35 | # blur-kern = "5,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1" | |
36 | # blur-background-fixed = true; | |
37 | blur-background-exclude = [ | |
38 | "window_type = 'dock'", | |
39 | "window_type = 'desktop'", | |
40 | "_GTK_FRAME_EXTENTS@:c" | |
41 | ]; | |
42 | # opacity-rule = [ "80:class_g = 'URxvt'" ]; | |
43 | ||
44 | # Fading | |
45 | fading = true; | |
46 | # fade-delta = 30; | |
47 | fade-in-step = 0.1; | |
48 | fade-out-step = 0.1; | |
49 | # no-fading-openclose = true; | |
50 | # no-fading-destroyed-argb = true; | |
51 | fade-exclude = [ ]; | |
52 | ||
53 | # Other | |
54 | backend = "xrender" | |
55 | mark-wmwin-focused = true; | |
56 | mark-ovredir-focused = true; | |
57 | # use-ewmh-active-win = true; | |
58 | detect-rounded-corners = true; | |
59 | detect-client-opacity = true; | |
60 | refresh-rate = 0; | |
61 | vsync = "none"; | |
62 | dbe = false; | |
63 | paint-on-overlay = true; | |
64 | # sw-opti = true; | |
65 | # unredir-if-possible = true; | |
66 | # unredir-if-possible-delay = 5000; | |
67 | # unredir-if-possible-exclude = [ ]; | |
68 | focus-exclude = [ "class_g = 'Cairo-clock'" ]; | |
69 | detect-transient = true; | |
70 | detect-client-leader = true; | |
71 | invert-color-include = [ ]; | |
72 | # resize-damage = 1; | |
73 | ||
74 | # GLX backend | |
75 | # glx-no-stencil = true; | |
76 | glx-copy-from-front = false; | |
77 | # glx-use-copysubbuffermesa = true; | |
78 | # glx-no-rebind-pixmap = true; | |
79 | glx-swap-method = "undefined"; | |
80 | # glx-use-gpushader4 = true; | |
81 | # xrender-sync = true; | |
82 | # xrender-sync-fence = true; | |
83 | ||
84 | # Window type settings | |
85 | wintypes: | |
86 | { | |
87 | tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; }; | |
88 | }; |
15 | 15 | # Font for window titles. Will also be used by the bar unless a different font |
16 | 16 | # is used in the bar {} block below. |
17 | 17 | #font pango: Ubuntu Mono, Icons 10 |
18 | font pango: Roboto Medium 10 | |
18 | font pango: Roboto Medium 9 | |
19 | 19 | |
20 | 20 | # resolv i3 transparancy bug |
21 | 21 | new_window pixel |
22 | 22 | |
23 | ||
24 | ||
25 | # This font is widely installed, provides lots of unicode glyphs, right-to-left | |
26 | # text rendering and scalability on retina/hidpi displays (thanks to pango). | |
27 | #font pango:DejaVu Sans Mono 8 | |
28 | 23 | |
29 | 24 | |
30 | 25 | |
119 | 114 | # toggle tiling / floating |
120 | 115 | bindsym $mod+Shift+space floating toggle |
121 | 116 | |
117 | # specifics floating windows | |
118 | for_window[class="Transmission"] floating enable | |
119 | for_window[class="GParted"] floating enable | |
120 | for_window[class="System-config-lvm"] floating enable | |
121 | ||
122 | 122 | |
123 | 123 | |
124 | 124 | # change focus between tiling / floating windows |
142 | 142 | set $tag3 "3:" |
143 | 143 | set $tag4 "4:" |
144 | 144 | set $tag5 "5:" |
145 | set $tag6 "6:6" | |
145 | set $tag6 "6:" | |
146 | 146 | set $tag7 "7:7" |
147 | 147 | set $tag8 "8:8" |
148 | 148 | set $tag9 "9:9" |
264 | 264 | |
265 | 265 | bindsym XF86AudioRaiseVolume exec "amixer set Master 5+ unmute" |
266 | 266 | bindsym XF86AudioLowerVolume exec "amixer set Master 5- unmute" |
267 | bindsym XF86AudioMute exec "amixer set Master toggle; amixet set Headphone unmute; amixer set Speaker unmute" | |
268 | ||
267 | bindsym XF86AudioMute exec "amixer set Master toggle; amixer set Headphone unmute; amixer set Speaker unmute" | |
268 | ||
269 | ||
270 | bindsym $mod+c exec --no-startup-id j4-dmenu-desktop --dmenu="rofi -i -dmenu -p ''" |
0 | 0 | #!/bin/bash |
1 | 1 | |
2 | loc="34090" | |
2 | loc="75013" | |
3 | 3 | |
4 | 4 | mph=$(cliweather $loc| grep 'Wind:' | cut -d' ' -f2) |
5 | 5 | kmh=$(echo "$(($mph*(8/5)))" | cut -d'.' -f1) |
0 | The MIT License (MIT) | |
1 | ||
2 | Copyright (c) 2014 Dolores Portalatin | |
3 | ||
4 | Permission is hereby granted, free of charge, to any person obtaining a copy | |
5 | of this software and associated documentation files (the "Software"), to deal | |
6 | in the Software without restriction, including without limitation the rights | |
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
8 | copies of the Software, and to permit persons to whom the Software is | |
9 | furnished to do so, subject to the following conditions: | |
10 | ||
11 | The above copyright notice and this permission notice shall be included in all | |
12 | copies or substantial portions of the Software. | |
13 | ||
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
20 | SOFTWARE. | |
21 |
28 | 28 | fi |
29 | 29 | |
30 | 30 | # try to use a forked version of i3lock with prepared parameters |
31 | i3lock $PARAM -i $IMAGE > /dev/null 2>&1 | |
31 | i3lock-color $PARAM -i $IMAGE > /dev/null 2>&1 | |
32 | 32 | |
33 | 33 | if [ $? -ne 0 ]; then |
34 | 34 | # We have failed, lets get back to stock one |
35 | i3lock -i $IMAGE | |
35 | i3lock-color -i $IMAGE | |
36 | 36 | fi |
37 | 37 | |
38 | 38 | rm $IMAGE |