diff --git a/awesome/icones/menujeux.png b/awesome/icones/menujeux.png new file mode 100644 index 0000000..eb0090d Binary files /dev/null and b/awesome/icones/menujeux.png differ diff --git a/awesome/icones/teeworlds.png b/awesome/icones/teeworlds.png new file mode 100644 index 0000000..269b3ce Binary files /dev/null and b/awesome/icones/teeworlds.png differ diff --git a/awesome/rc.lua b/awesome/rc.lua index c589039..4ca0264 100755 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -20,17 +20,10 @@ -- assault -> batterie local assault = require('assault') ---lancer nm-applet -os.execute("nm-applet &") ---lancer checkgmail -os.execute("checkgmail &") - ---lancer xautolock ---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' &") ---i've a home made lock screen (see i3lock-color-git on google) - -- Mettre en français les langues os.setlocale("fr_FR.UTF-8", "time") + + -- {{{ Error handling -- Check if awesome encountered an error during startup and fell back to @@ -62,9 +55,7 @@ beautiful.init("/usr/share/awesome/themes/gladious/theme.lua") -- SET WALLPAPER ---theme.wallpaper = "$HOME/Wallpaper/wp_darktosun.png" --- set your own wallpaper here - +theme.wallpaper = "/home/victor/Wallpaper/square_final.png" -- This is used later as the default terminal and editor to run. terminal = "urxvtc" @@ -120,36 +111,42 @@ -- {{{ Menu -- Create a laucher widget and a main menu myawesomemenu = { - { "Manual", terminal .. " -e man awesome" , "$HOME/.config/awesome/icones/man.png" }, - { "Edit config", terminal .. " -e nano $HOME/.config/awesome/rc.lua" }, - { "Restart", awesome.restart, "$HOME/.config/awesome/icones/restart.png" }, - { "Quit", awesome.quit , "$HOME/.config/awesome/icones/shutdown.png" } + { "Manual", terminal .. " -e man awesome" , "/home/victor/.config/awesome/icones/man.png" }, + { "Edit config", terminal .. " -e nano /home/victor/.config/awesome/rc.lua" }, + { "Restart", awesome.restart, "/home/victor/.config/awesome/icones/restart.png" }, + { "Quit", awesome.quit , "/home/victor/.config/awesome/icones/shutdown.png" } } menuapplications = { - { "Firefox", "firefox", "$HOME/.config/awesome/icones/firefox.png" }, - { "Emacs", "emacs", "$HOME/.config/awesome/icones/emacs.png" }, - { "gVim", "gvim" , "$HOME/.config/awesome/icones/gvim.png" }, - { "Eclipse", "eclipse" , "$HOME/.config/awesome/icones/eclipse.png" }, - { "TexStudio", "texstudio" , "$HOME/.config/awesome/icones/texstudio.png" }, - { "gEdit", "gedit" , "$HOME/.config/awesome/icones/gedit.png" }, - { "Sublime Text", "subl" , "$HOME/.config/awesome/icones/sublimetext.png" }, - { "LibreOffice", "libreoffice" , "$HOME/.config/awesome/icones/libreoffice.png" }, - { "CherryTree", "cherrytree", "$HOME/.config/awesome/icones/cherrytree.png" }, - { "PCManFM", "pcmanfm" , "$HOME/.config/awesome/icones/pcmanfm.png" }, - { "Dropbox", "dropbox" , "$HOME/.config/awesome/icones/dropbox.png" }, - { "irssi", terminal .. " -e irssi" , "$HOME/.config/awesome/icones/irssi.png" }, - { "weechat", terminal .. " -e weechat" , "$HOME/.config/awesome/icones/weechat.png" }, - { "HexChat", "hexchat" , "$HOME/.config/awesome/icones/hexchat.png" } + { "Firefox", "firefox", "/home/victor/.config/awesome/icones/firefox.png" }, + { "Emacs", "emacs", "/home/victor/.config/awesome/icones/emacs.png" }, + { "gVim", "gvim" , "/home/victor/.config/awesome/icones/gvim.png" }, + { "Eclipse", "eclipse" , "/home/victor/.config/awesome/icones/eclipse.png" }, + { "TexStudio", "texstudio" , "/home/victor/.config/awesome/icones/texstudio.png" }, + { "gEdit", "gedit" , "/home/victor/.config/awesome/icones/gedit.png" }, + { "Sublime Text", "subl" , "/home/victor/.config/awesome/icones/sublimetext.png" }, + { "LibreOffice", "libreoffice" , "/home/victor/.config/awesome/icones/libreoffice.png" }, + { "CherryTree", "cherrytree", "/home/victor/.config/awesome/icones/cherrytree.png" }, + { "PCManFM", "pcmanfm" , "/home/victor/.config/awesome/icones/pcmanfm.png" }, + { "Dropbox", "dropbox" , "/home/victor/.config/awesome/icones/dropbox.png" }, + { "irssi", terminal .. " -e irssi" , "/home/victor/.config/awesome/icones/irssi.png" }, + { "weechat", terminal .. " -e weechat" , "/home/victor/.config/awesome/icones/weechat.png" }, + { "HexChat", "hexchat" , "/home/victor/.config/awesome/icones/hexchat.png" } } +menujeux = { + { "GLTron", "gltron" }, + { "TeeWorlds", "teeworlds", "/home/victor/.config/awesome/icones/teeworlds.png" } +} + mymainmenu = awful.menu({ items = { { "Awesome", myawesomemenu }, - { "Applications", menuapplications, beautiful.awesome_icon }, - { "Terminal", terminal , "$HOME/.config/awesome/icones/term_logo.png" }, - { "Lock", "$HOME/.lock_screen/lock", "$HOME/.config/awesome/icones/lock.png" }, + { "Applications", menuapplications, beautiful.awesome_icon }, + { "Jeux", menujeux, "/home/victor/.config/awesome/icones/menujeux.png" }, + { "Terminal", terminal , "/home/victor/.config/awesome/icones/term_logo.png" }, + { "Lock", "/home/victor/.lock_screen/lock", "/home/victor/.config/awesome/icones/lock.png" }, { "Reboot", terminal .. " -e reboot" }, - { "Shutdown", terminal .. " -e shutdown -f now" , "$HOME/.config/awesome/icones/shutdown.png" } + { "Shutdown", terminal .. " -e poweroff" , "/home/victor/.config/awesome/icones/shutdown.png" } } }) @@ -404,11 +401,11 @@ awful.key({}, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Images/ 2>/dev/null'") end), awful.key({}, "XF86MyComputer", function() awful.util.spawn("pcmanfm") end), awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("amixer set Master 5+ unmute; amixer set Headphone unmute; amixer set Speaker unmute") end), - awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5- unmute") end), + awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5- unmute; amixer set Headphone unmute; amixer set Speaker unmute") end), awful.key({}, "XF86AudioMute", function() awful.util.spawn("amixer set Master toggle") end), awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn("xbacklight +5") end), awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn("xbacklight -5") end), - awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("$HOME/.lock_screen/lock") end), + awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("/home/victor/.lock_screen/lock") end), awful.key({ modkey, "Shift" }, "Return", function () awful.util.spawn("firefox") end), diff --git a/awesome/rc.lua.save b/awesome/rc.lua.save new file mode 100755 index 0000000..6d91b32 --- /dev/null +++ b/awesome/rc.lua.save @@ -0,0 +1,606 @@ +-------------------------- +----- awesome/rc.lua ----- +-------------------------- + + +-- Standard awesome library +gears = require("gears") +awful = require("awful") +awful.rules = require("awful.rules") +require("awful.autofocus") +-- Widget and layout library +wibox = require("wibox") +-- Theme handling library +beautiful = require("beautiful") +-- Notification library +naughty = require("naughty") +menubar = require("menubar") +vicious = require("vicious") + +-- assault -> batterie +local assault = require('assault') + +--lancer nm-applet +os.execute("nm-applet &") + +--lancer xautolock +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' &") +os.execute("notify-send \"Bienvenue\" \"Bonjour seigneur, comment allez-vous ?\" -t 10000 -i &") + +-- Mettre en français les langues +os.setlocale("fr_FR.UTF-8", "time") + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = err }) + in_error = false + end) +end +-- }}} + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init("/usr/share/awesome/themes/vicious/theme.lua") + +-- SET WALLPAPER +theme.wallpaper = "/home/victor/Wallpaper/wp_darktosun.png" + +-- This is used later as the default terminal and editor to run. +terminal = "urxvtc" +editor = os.getenv("EDITOR") or "nano" +editor_cmd = terminal .. " -e " .. editor + +-- Default modkey. +-- Usually, Mod4 is the key with a logo between Control and Alt. +-- If you do not like this or do not have such a key, +-- I suggest you to remap Mod4 to another key using xmodmap or other tools. +-- However, you can use another modifier like Mod1, but it may interact with others. +modkey = "Mod4" + +-- Table of layouts to cover with awful.layout.inc, order matters. +local layouts = +{ + awful.layout.suit.tile, + awful.layout.suit.tile.left, + awful.layout.suit.tile.bottom, + awful.layout.suit.tile.top, + awful.layout.suit.fair, + awful.layout.suit.fair.horizontal, + awful.layout.suit.spiral, + awful.layout.suit.floating, + -- awful.layout.suit.spiral.dwindle, + -- awful.layout.suit.max, + -- awful.layout.suit.max.fullscreen, + -- awful.layout.suit.magnifier +} +-- }}} + +-- {{{ Wallpaper +if beautiful.wallpaper then + for s = 1, screen.count() do + gears.wallpaper.maximized(beautiful.wallpaper, s, true) + end +end +-- }}} + + -- {{{ Tags + -- Define a tag table which will hold all screen tags. + tags = { + names = { "α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι" }, + layout = { layouts[1], layouts[1], layouts[1], layouts[1], layouts[1], + layouts[1], layouts[1], layouts[1], layouts[1] + }} + for s = 1, screen.count() do + -- Each screen has its own tag table. + tags[s] = awful.tag(tags.names, s, tags.layout) + end + -- }}} + +-- {{{ Menu +-- Create a laucher widget and a main menu +myawesomemenu = { + { "Manual", terminal .. " -e man awesome" , "/home/victor/.config/awesome/icones/man.png" }, + { "Edit config", terminal .. " -e nano /home/victor/.config/awesome/rc.lua" }, + { "Restart", awesome.restart, "/home/victor/.config/awesome/icones/restart.png" }, + { "Quit", awesome.quit , "/home/victor/.config/awesome/icones/shutdown.png" } + +} + +menuapplications = { + { "Firefox", "firefox", "/home/victor/.config/awesome/icones/firefox.png" }, + { "Emacs", "emacs", "/home/victor/.config/awesome/icones/emacs.png" }, + { "gVim", "gvim" , "/home/victor/.config/awesome/icones/gvim.png" }, + { "Eclipse", "eclipse" , "/home/victor/.config/awesome/icones/eclipse.png" }, + { "TexStudio", "texstudio" , "/home/victor/.config/awesome/icones/texstudio.png" }, + { "gEdit", "gedit" , "/home/victor/.config/awesome/icones/gedit.png" }, + { "Sublime Text", "subl" , "/home/victor/.config/awesome/icones/sublimetext.png" }, + { "LibreOffice", "libreoffice" , "/home/victor/.config/awesome/icones/libreoffice.png" }, + { "CherryTree", "cherrytree", "/home/victor/.config/awesome/icones/cherrytree.png" }, + { "PCManFM", "pcmanfm" , "/home/victor/.config/awesome/icones/pcmanfm.png" }, + { "irssi", terminal .. " -e irssi" , "/home/victor/.config/awesome/icones/irssi.png" }, + { "weechat", terminal .. " -e weechat" , "/home/victor/.config/awesome/icones/weechat.png" } +} + +mymainmenu = awful.menu({ items = { { "Awesome", myawesomemenu }, + { "Applications", menuapplications, beautiful.awesome_icon }, + { "Terminal", terminal , "/home/victor/.config/awesome/icones/term_logo.png" }, + { "Lock", "/home/victor/.lock_screen/lock", "/home/victor/.config/awesome/icones/lock.png" }, + { "Reboot", terminal .. " -e reboot" }, + { "Shutdown", terminal .. " -e shutdown -f now" , "/home/victor/.config/awesome/icones/shutdown.png" } + } + }) + +mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, + menu = mymainmenu }) + +-- Menubar configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it +-- }}} + +-- {{{ Wibox +-- Create a textclock widget +mytextclock = awful.widget.textclock() + +------------------------------------------------------ + +-- {{{ Battery State + +myassault = assault({ + battery = "BAT0", + adapter = "AC", + width = 36, + height = 14, + stroke_width = 1, + font = sans, + critical_level = 0.15, + normal_color = "AECF96", + critical_color = "#FF5656", + charging_color = "#00bfff" +}) + + + +-- {{{ Volume state +local alsawidget = +{ + channel = "Master", + step = "5%", + colors = + { + unmute = "#AECF96", + mute = "#FF5656" + }, + mixer = terminal .. " -e alsamixer", -- or whatever your preferred sound mixer is + +} +-- widget +alsawidget.bar = awful.widget.progressbar () +alsawidget.bar:set_width (8) +alsawidget.bar:set_height(14) +alsawidget.bar:set_vertical (true) +alsawidget.bar:set_background_color ("#787878") +alsawidget.bar:set_color (alsawidget.colors.unmute) +alsawidget.bar:buttons (awful.util.table.join ( + awful.button ({}, 1, function() + awful.util.spawn (alsawidget.mixer) + end), + awful.button ({}, 3, function() + awful.util.spawn ("amixer sset " .. alsawidget.channel .. " toggle") + vicious.force ({ alsawidget.bar }) + end), + awful.button ({}, 4, function() + awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "+") + vicious.force ({ alsawidget.bar }) + end), + awful.button ({}, 5, function() + awful.util.spawn ("amixer sset " .. alsawidget.channel .. " " .. alsawidget.step .. "-") + vicious.force ({ alsawidget.bar }) + end) +)) +-- tooltip +alsawidget.tooltip = awful.tooltip ({ objects = { alsawidget.bar } }) + +-- register the widget through vicious +vicious.register (alsawidget.bar, vicious.widgets.volume, function (widget, args) + alsawidget._current_level = args[1] + if args[2] == "♩" + then + alsawidget._muted = true + alsawidget.tooltip:set_text (" [Muted] ") + widget:set_color (alsawidget.colors.mute) + return 100 + end + alsawidget._muted = false + alsawidget.tooltip:set_text (" " .. alsawidget.channel .. ": " .. args[1] .. "% ") + widget:set_color (alsawidget.colors.unmute) + return args[1] +end, 5, alsawidget.channel) + + +----------------------------------------------------- +----------------------------------------------------- + +-- Create a wibox for each screen and add it +wiboxtop = {} +wiboxbottom = {} +mypromptbox = {} +mylayoutbox = {} +mytaglist = {} +mytaglist.buttons = awful.util.table.join( + awful.button({ }, 1, awful.tag.viewonly), + awful.button({ modkey }, 1, awful.client.movetotag), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, awful.client.toggletag), + awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end) + ) +mytasklist = {} +mytasklist.buttons = awful.util.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + -- Without this, the following + -- :isvisible() makes no sense + c.minimized = false + if not c:isvisible() then + awful.tag.viewonly(c:tags()[1]) + end + -- This will also un-minimize + -- the client, if needed + client.focus = c + c:raise() + end + end), + awful.button({ }, 3, function () + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ + theme = { width = 250 } + }) + end + end), + awful.button({ }, 4, function () + awful.client.focus.byidx(1) + if client.focus then client.focus:raise() end + end), + awful.button({ }, 5, function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end)) + +for s = 1, screen.count() do + -- Create a promptbox for each screen + mypromptbox[s] = awful.widget.prompt() + -- Create an imagebox widget which will contains an icon indicating which layout we're using. + -- We need one layoutbox per screen. + mylayoutbox[s] = awful.widget.layoutbox(s) + mylayoutbox[s]:buttons(awful.util.table.join( + awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 3, function () awful.layout.inc(layouts, -1) end), + awful.button({ }, 4, function () awful.layout.inc(layouts, 1) end), + awful.button({ }, 5, function () awful.layout.inc(layouts, -1) end))) + -- Create a taglist widget + mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.all, mytaglist.buttons) + + -- Create a tasklist widget + mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons) + + -- Create the wibox + wiboxtop[s] = awful.wibox({ position = "top", screen = s }) + + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(mylauncher) + left_layout:add(mytaglist[s]) + left_layout:add(mypromptbox[s]) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + if s == 1 then right_layout:add(wibox.widget.systray()) end + right_layout:add(myassault) + right_layout:add(alsawidget.bar) + right_layout:add(mytextclock) + --right_layout:add(mylayoutbox[s]) + + -- Now bring it all together (with the tasklist in the middle) + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + --layout:set_middle(mytasklist[s]) + layout:set_right(right_layout) + + wiboxtop[s]:set_widget(layout) + + -- Create the bottom wibox + wiboxbottom[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 20 }) + + -- Widgets that are aligned to the bottom left + bottom_left_layout = wibox.layout.fixed.horizontal() + + -- Widgets that are aligned to the bottom right + bottom_right_layout = wibox.layout.fixed.horizontal() + bottom_right_layout:add(mylayoutbox[s]) + + -- Now bring it all together (with the tasklist in the middle) + bottom_layout = wibox.layout.align.horizontal() + bottom_layout:set_left(bottom_left_layout) + bottom_layout:set_middle(mytasklist[s]) + bottom_layout:set_right(bottom_right_layout) + wiboxbottom[s]:set_widget(bottom_layout) + + +end +-- }}} + +-- {{{ Mouse bindings +root.buttons(awful.util.table.join( + awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = awful.util.table.join( + awful.key({ modkey, }, "Left", awful.tag.viewprev ), + awful.key({ modkey, }, "Right", awful.tag.viewnext ), + awful.key({ modkey, }, "Escape", awful.tag.history.restore), + + awful.key({ modkey, }, "j", + function () + awful.client.focus.byidx( 1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "k", + function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "w", function () mymainmenu:show() end), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end), + + + -- TOUCHES FN, PRINT ECRAN ET LE BORDEL + + + awful.key({}, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Images/ 2>/dev/null'") end), + awful.key({}, "XF86AudioRaiseVolume", function() awful.util.spawn("amixer set Master 5%+ unmute") end), + awful.key({}, "XF86AudioLowerVolume", function() awful.util.spawn("amixer set Master 5%- unmute") end), + awful.key({}, "XF86AudioMute", function() awful.util.spawn("amixer set Master toggle") end), + awful.key({}, "XF86MonBrightnessUp", function() awful.util.spawn("xbacklight +10") end), + awful.key({}, "XF86MonBrightnessDown", function() awful.util.spawn("xbacklight -10") end), + awful.key({ "Control", "Shift" }, "l", function() awful.util.spawn("/home/victor/.lock_screen/lock") end), + + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, }, "q", awesome.restart), + awful.key({ modkey, "Shift" }, "q", awesome.quit), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1) end), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1) end), + awful.key({ modkey, }, "space", function () awful.layout.inc(layouts, 1) end), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(layouts, -1) end), + + awful.key({ modkey, "Control" }, "n", awful.client.restore), + + -- Prompt + awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end), + + awful.key({ modkey }, "x", + function () + awful.prompt.run({ prompt = "Run Lua code: " }, + mypromptbox[mouse.screen].widget, + awful.util.eval, nil, + awful.util.getdir("cache") .. "/history_eval") + end), + -- Menubar + awful.key({ modkey }, "p", function() menubar.show() end) +) + +clientkeys = awful.util.table.join( + awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end), + awful.key({ modkey, }, "o", awful.client.movetoscreen ), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end), + awful.key({ modkey, }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c.maximized_vertical = not c.maximized_vertical + end) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it works on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = awful.util.table.join(globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewonly(tag) + end + end), + -- Toggle tag. + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = mouse.screen + local tag = awful.tag.gettags(screen)[i] + if tag then + awful.tag.viewtoggle(tag) + end + end), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = awful.tag.gettags(client.focus.screen)[i] + if tag then + awful.client.movetotag(tag) + end + end + end), + -- Toggle tag. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = awful.tag.gettags(client.focus.screen)[i] + if tag then + awful.client.toggletag(tag) + end + end + end)) +end + +clientbuttons = awful.util.table.join( + awful.button({ }, 1, function (c) client.focus = c; c:raise() end), + awful.button({ modkey }, 1, awful.mouse.client.move), + awful.button({ modkey }, 3, awful.mouse.client.resize)) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + size_hints_honor = false, + buttons = clientbuttons } }, + { rule = { class = "MPlayer" }, + properties = { floating = true } }, + { rule = { class = "pinentry" }, + properties = { floating = true } }, + { rule = { class = "gimp" }, + properties = { floating = true } }, + -- Set Firefox to always map on tags number 2 of screen 1. + -- { rule = { class = "Firefox" }, + -- properties = { tag = tags[1][2] } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c, startup) + -- Enable sloppy focus + c:connect_signal("mouse::enter", function(c) + if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier + and awful.client.focus.filter(c) then + client.focus = c + end + end) + + if not startup then + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- awful.client.setslave(c) + + -- Put windows in a smart way, only if they does not set an initial position. + if not c.size_hints.user_position and not c.size_hints.program_position then + awful.placement.no_overlap(c) + awful.placement.no_offscreen(c) + end + end + + local titlebars_enabled = false + if titlebars_enabled and (c.type == "normal" or c.type == "dialog") then + -- buttons for the titlebar + local buttons = awful.util.table.join( + awful.button({ }, 1, function() + client.focus = c + c:raise() + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + client.focus = c + c:raise() + awful.mouse.client.resize(c) + end) + ) + + -- Widgets that are aligned to the left + local left_layout = wibox.layout.fixed.horizontal() + left_layout:add(awful.titlebar.widget.iconwidget(c)) + left_layout:buttons(buttons) + + -- Widgets that are aligned to the right + local right_layout = wibox.layout.fixed.horizontal() + right_layout:add(awful.titlebar.widget.floatingbutton(c)) + right_layout:add(awful.titlebar.widget.maximizedbutton(c)) + right_layout:add(awful.titlebar.widget.stickybutton(c)) + right_layout:add(awful.titlebar.widget.ontopbutton(c)) + right_layout:add(awful.titlebar.widget.closebutton(c)) + + -- The title goes in the middle + local middle_layout = wibox.layout.flex.horizontal() + local title = awful.titlebar.widget.titlewidget(c) + title:set_align("center") + middle_layout:buttons(buttons) + middle_layout:buttons(buttons) + + -- Now bring it all together + local layout = wibox.layout.align.horizontal() + layout:set_left(left_layout) + layout:set_right(right_layout) + layout:set_middle(middle_layout) + + awful.titlebar(c):set_widget(layout) + end +end) + +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} diff --git a/awesome/themes/gladious/.theme.lua.swp b/awesome/themes/gladious/.theme.lua.swp deleted file mode 100644 index 6ea9f69..0000000 Binary files a/awesome/themes/gladious/.theme.lua.swp and /dev/null differ diff --git a/awesome/themes/gladious/awesome-icon.png b/awesome/themes/gladious/awesome-icon.png deleted file mode 100644 index 9272374..0000000 Binary files a/awesome/themes/gladious/awesome-icon.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/dwindle.png b/awesome/themes/gladious/layouts/dwindle.png deleted file mode 100644 index 1aa4bf2..0000000 Binary files a/awesome/themes/gladious/layouts/dwindle.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/fairh.png b/awesome/themes/gladious/layouts/fairh.png deleted file mode 100644 index e176bb3..0000000 Binary files a/awesome/themes/gladious/layouts/fairh.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/fairv.png b/awesome/themes/gladious/layouts/fairv.png deleted file mode 100644 index 7c0a92c..0000000 Binary files a/awesome/themes/gladious/layouts/fairv.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/floating.png b/awesome/themes/gladious/layouts/floating.png deleted file mode 100644 index a399092..0000000 Binary files a/awesome/themes/gladious/layouts/floating.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/fullscreen.png b/awesome/themes/gladious/layouts/fullscreen.png deleted file mode 100644 index a0c795c..0000000 Binary files a/awesome/themes/gladious/layouts/fullscreen.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/magnifier.png b/awesome/themes/gladious/layouts/magnifier.png deleted file mode 100644 index bca6db9..0000000 Binary files a/awesome/themes/gladious/layouts/magnifier.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/max.png b/awesome/themes/gladious/layouts/max.png deleted file mode 100644 index 96a237a..0000000 Binary files a/awesome/themes/gladious/layouts/max.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/spiral.png b/awesome/themes/gladious/layouts/spiral.png deleted file mode 100644 index 8f5aeed..0000000 Binary files a/awesome/themes/gladious/layouts/spiral.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/tile.png b/awesome/themes/gladious/layouts/tile.png deleted file mode 100644 index 3fcc904..0000000 Binary files a/awesome/themes/gladious/layouts/tile.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/tilebottom.png b/awesome/themes/gladious/layouts/tilebottom.png deleted file mode 100644 index dfe7832..0000000 Binary files a/awesome/themes/gladious/layouts/tilebottom.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/tileleft.png b/awesome/themes/gladious/layouts/tileleft.png deleted file mode 100644 index c5decfd..0000000 Binary files a/awesome/themes/gladious/layouts/tileleft.png and /dev/null differ diff --git a/awesome/themes/gladious/layouts/tiletop.png b/awesome/themes/gladious/layouts/tiletop.png deleted file mode 100644 index b251661..0000000 Binary files a/awesome/themes/gladious/layouts/tiletop.png and /dev/null differ diff --git a/awesome/themes/gladious/submenu.png b/awesome/themes/gladious/submenu.png deleted file mode 100644 index b2778e2..0000000 Binary files a/awesome/themes/gladious/submenu.png and /dev/null differ diff --git a/awesome/themes/gladious/taglist/squarefz.png b/awesome/themes/gladious/taglist/squarefz.png deleted file mode 100644 index 3ddb9ee..0000000 Binary files a/awesome/themes/gladious/taglist/squarefz.png and /dev/null differ diff --git a/awesome/themes/gladious/taglist/squarez.png b/awesome/themes/gladious/taglist/squarez.png deleted file mode 100644 index e3867c5..0000000 Binary files a/awesome/themes/gladious/taglist/squarez.png and /dev/null differ diff --git a/awesome/themes/gladious/test-background.png b/awesome/themes/gladious/test-background.png deleted file mode 100644 index 1eb9437..0000000 Binary files a/awesome/themes/gladious/test-background.png and /dev/null differ diff --git a/awesome/themes/gladious/theme.lua b/awesome/themes/gladious/theme.lua deleted file mode 100644 index 98fda69..0000000 --- a/awesome/themes/gladious/theme.lua +++ /dev/null @@ -1,128 +0,0 @@ --------------------------------- --- "Gladious" awesome theme -- --- By Piczel -- --------------------------------- - --- Alternative icon sets and widget icons: --- * http://awesome.naquadah.org/wiki/Nice_Icons - --- {{{ Main -theme = {} -theme.wallpaper = "/usr/share/awesome/themes/gladious/gladious-background.png" --- }}} - --- {{{ Styles -theme.font = "sans 8" - --- {{{ Colors -theme.fg_normal = "#DCDCCC" -theme.fg_focus = "#F0DFAF" -theme.fg_urgent = "#CC9393" -theme.bg_normal = "#3F3F3F" -theme.bg_focus = "#1E2320" -theme.bg_urgent = "#3F3F3F" -theme.bg_systray = theme.bg_normal --- }}} - --- {{{ Borders -theme.border_width = 1 -theme.border_normal = "#3F3F3F" -theme.border_focus = "#6F6F6F" -theme.border_marked = "#CC9393" --- }}} - --- {{{ Titlebars -theme.titlebar_bg_focus = "#254090" -theme.titlebar_bg_normal = "#3F3F3F" --- }}} - --- There are other variable sets --- overriding the default one when --- defined, the sets are: --- [taglist|tasklist]_[bg|fg]_[focus|urgent] --- titlebar_[normal|focus] --- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- Example: -theme.taglist_bg_focus = "#2A2A2A" -theme.taglist_fg_focus = "#6C94A6" --- }}} - --- {{{ Widgets --- You can add as many variables as --- you wish and access them by using --- beautiful.variable in your rc.lua ---theme.fg_widget = "#AECF96" ---theme.fg_center_widget = "#88A175" ---theme.fg_end_widget = "#FF5656" ---theme.bg_widget = "#494B4F" ---theme.border_widget = "#3F3F3F" --- }}} - --- {{{ Mouse finder -theme.mouse_finder_color = "#CC9393" --- mouse_finder_[timeout|animate_timeout|radius|factor] --- }}} - --- {{{ Menu --- Variables set for theming the menu: --- menu_[bg|fg]_[normal|focus] --- menu_[border_color|border_width] -theme.menu_height = 18 -theme.menu_width = 120 -theme.menu_border_color = "#6F6F6F" --- }}} - --- {{{ Icons --- {{{ Taglist -theme.taglist_squares_sel = "/usr/share/awesome/themes/gladious/taglist/squarefz.png" -theme.taglist_squares_unsel = "/usr/share/awesome/themes/gladious/taglist/squarez.png" ---theme.taglist_squares_resize = "false" --- }}} - --- {{{ Misc -theme.awesome_icon = "/usr/share/awesome/themes/gladious/awesome-icon.png" -theme.menu_submenu_icon = "/usr/share/awesome/themes/gladious/submenu.png" --- }}} - --- {{{ Layout -theme.layout_tile = "/usr/share/awesome/themes/gladious/layouts/tile.png" -theme.layout_tileleft = "/usr/share/awesome/themes/gladious/layouts/tileleft.png" -theme.layout_tilebottom = "/usr/share/awesome/themes/gladious/layouts/tilebottom.png" -theme.layout_tiletop = "/usr/share/awesome/themes/gladious/layouts/tiletop.png" -theme.layout_fairv = "/usr/share/awesome/themes/gladious/layouts/fairv.png" -theme.layout_fairh = "/usr/share/awesome/themes/gladious/layouts/fairh.png" -theme.layout_spiral = "/usr/share/awesome/themes/gladious/layouts/spiral.png" -theme.layout_dwindle = "/usr/share/awesome/themes/gladious/layouts/dwindle.png" -theme.layout_max = "/usr/share/awesome/themes/gladious/layouts/max.png" -theme.layout_fullscreen = "/usr/share/awesome/themes/gladious/layouts/fullscreen.png" -theme.layout_magnifier = "/usr/share/awesome/themes/gladious/layouts/magnifier.png" -theme.layout_floating = "/usr/share/awesome/themes/gladious/layouts/floating.png" --- }}} - --- {{{ Titlebar -theme.titlebar_close_button_focus = "/usr/share/awesome/themes/gladious/titlebar/close_focus.png" -theme.titlebar_close_button_normal = "/usr/share/awesome/themes/gladious/titlebar/close_normal.png" - -theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/ontop_focus_active.png" -theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/ontop_normal_inactive.png" - -theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/sticky_focus_active.png" -theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/sticky_normal_inactive.png" - -theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/floating_focus_active.png" -theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/floating_normal_inactive.png" - -theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/gladious/titlebar/maximized_focus_active.png" -theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/gladious/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/gladious/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/gladious/titlebar/maximized_normal_inactive.png" --- }}} --- }}} - -return theme diff --git a/awesome/themes/gladious/titlebar/close_focus.png b/awesome/themes/gladious/titlebar/close_focus.png deleted file mode 100644 index e9b4179..0000000 Binary files a/awesome/themes/gladious/titlebar/close_focus.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/close_normal.png b/awesome/themes/gladious/titlebar/close_normal.png deleted file mode 100644 index 2cd46ef..0000000 Binary files a/awesome/themes/gladious/titlebar/close_normal.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/floating_focus_active.png b/awesome/themes/gladious/titlebar/floating_focus_active.png deleted file mode 100644 index 0f9ee0d..0000000 Binary files a/awesome/themes/gladious/titlebar/floating_focus_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/floating_focus_inactive.png b/awesome/themes/gladious/titlebar/floating_focus_inactive.png deleted file mode 100644 index 7180e49..0000000 Binary files a/awesome/themes/gladious/titlebar/floating_focus_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/floating_normal_active.png b/awesome/themes/gladious/titlebar/floating_normal_active.png deleted file mode 100644 index ca4d769..0000000 Binary files a/awesome/themes/gladious/titlebar/floating_normal_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/floating_normal_inactive.png b/awesome/themes/gladious/titlebar/floating_normal_inactive.png deleted file mode 100644 index c1f59d3..0000000 Binary files a/awesome/themes/gladious/titlebar/floating_normal_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/maximized_focus_active.png b/awesome/themes/gladious/titlebar/maximized_focus_active.png deleted file mode 100644 index 7e8498a..0000000 Binary files a/awesome/themes/gladious/titlebar/maximized_focus_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/maximized_focus_inactive.png b/awesome/themes/gladious/titlebar/maximized_focus_inactive.png deleted file mode 100644 index 1f825db..0000000 Binary files a/awesome/themes/gladious/titlebar/maximized_focus_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/maximized_normal_active.png b/awesome/themes/gladious/titlebar/maximized_normal_active.png deleted file mode 100644 index 6952503..0000000 Binary files a/awesome/themes/gladious/titlebar/maximized_normal_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/maximized_normal_inactive.png b/awesome/themes/gladious/titlebar/maximized_normal_inactive.png deleted file mode 100644 index f7db725..0000000 Binary files a/awesome/themes/gladious/titlebar/maximized_normal_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/ontop_focus_active.png b/awesome/themes/gladious/titlebar/ontop_focus_active.png deleted file mode 100644 index 86e61b7..0000000 Binary files a/awesome/themes/gladious/titlebar/ontop_focus_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/ontop_focus_inactive.png b/awesome/themes/gladious/titlebar/ontop_focus_inactive.png deleted file mode 100644 index bc15970..0000000 Binary files a/awesome/themes/gladious/titlebar/ontop_focus_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/ontop_normal_active.png b/awesome/themes/gladious/titlebar/ontop_normal_active.png deleted file mode 100644 index ad32bb9..0000000 Binary files a/awesome/themes/gladious/titlebar/ontop_normal_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/ontop_normal_inactive.png b/awesome/themes/gladious/titlebar/ontop_normal_inactive.png deleted file mode 100644 index e32281a..0000000 Binary files a/awesome/themes/gladious/titlebar/ontop_normal_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/sticky_focus_active.png b/awesome/themes/gladious/titlebar/sticky_focus_active.png deleted file mode 100644 index b10e604..0000000 Binary files a/awesome/themes/gladious/titlebar/sticky_focus_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/sticky_focus_inactive.png b/awesome/themes/gladious/titlebar/sticky_focus_inactive.png deleted file mode 100644 index 106f9ac..0000000 Binary files a/awesome/themes/gladious/titlebar/sticky_focus_inactive.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/sticky_normal_active.png b/awesome/themes/gladious/titlebar/sticky_normal_active.png deleted file mode 100644 index 50c19c4..0000000 Binary files a/awesome/themes/gladious/titlebar/sticky_normal_active.png and /dev/null differ diff --git a/awesome/themes/gladious/titlebar/sticky_normal_inactive.png b/awesome/themes/gladious/titlebar/sticky_normal_inactive.png deleted file mode 100644 index 906ca16..0000000 Binary files a/awesome/themes/gladious/titlebar/sticky_normal_inactive.png and /dev/null differ diff --git a/bin/bat.sh b/bin/bat.sh new file mode 100755 index 0000000..41b5d02 --- /dev/null +++ b/bin/bat.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +actual="$(cat /sys/class/power_supply/BAT0/capacity)" + +if [ $actual -eq "100" ] # && cat /sys/class/power_supply/BAT0/status -eq "Charging" ] +then + notify-send --urgency=critical 'Batterie pleine' 'Retirez le chargeur' +fi + +if [ $actual -le "15" ] # && cat /sys/class/power_supply/BAT0/status -eq "Discharging" ] +then + notify-send --urgency=critical 'Batterie faible !' 'Branchez le chargeur' +fi + diff --git a/bin/i3-get-window-criteria b/bin/i3-get-window-criteria new file mode 100755 index 0000000..f46f65e --- /dev/null +++ b/bin/i3-get-window-criteria @@ -0,0 +1,40 @@ +#!/bin/sh + +# i3-get-window-criteria - Get criteria for use with i3 config commands + +# To use, run this script, then click on a window. +# Output is in the format: [<name>=<value> <name>=<value> ...] + +# Known problem: when WM_NAME is used as fallback for the 'title="<string>"' criterion, +# quotes in "<string>" are not escaped properly. This is a problem with the output of `xprop`, +# reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807 + +PROGNAME=`basename "$0"` + +# Check for xwininfo and xprop +for cmd in xwininfo xprop; do + if ! which $cmd > /dev/null 2>&1; then + echo "$PROGNAME: $cmd: command not found" >&2 + exit 1 + fi +done + +match_int='[0-9][0-9]*' +match_string='".*"' +match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference + +{ + # Run xwininfo, get window id + window_id=`xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p"` + echo "id=$window_id" + + # Run xprop, transform its output into i3 criteria. Handle fallback to + # WM_NAME when _NET_WM_NAME isn't set + xprop -id $window_id | + sed -nr \ + -e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \ + -e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \ + -e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \ + -e "/^_NET_WM_NAME\(UTF8_STRING\) = ($match_qstring)$/{s//title=\1/; h}" \ + -e '${g; p}' +} | sort | tr "\n" " " | sed -r 's/^(.*) $/[\1]\n/' diff --git a/bin/imgur b/bin/imgur index c7e872b..fed8ef0 100755 --- a/bin/imgur +++ b/bin/imgur @@ -4,7 +4,7 @@ } uploadImage "$@" | xclip -selection c -notify-send "Done" +notify-send "Done" -t 5000 exit diff --git a/bin/kill_x.sh b/bin/kill_x.sh new file mode 100755 index 0000000..68f3691 --- /dev/null +++ b/bin/kill_x.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +zenity --question --text="Etes vous sûr de vouloir quitter i3 ?" +if [ $? = 0 ]; then + kill $(pidof Xorg) +else + exit +fi diff --git a/bin/pipes.sh b/bin/pipes.sh new file mode 100755 index 0000000..b176e17 --- /dev/null +++ b/bin/pipes.sh @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# pipes.sh: Animated pipes terminal screensaver. +# +# This modified version is maintained at: +# +# https://github.com/livibetter/pipes.sh + +# options: +# s = straight [5-15] +# f = rate [20-100] +# t = style [0-5] +# r = ttl + +VERSION=0.1.0 + +M=32768 +p=1 +f=75 s=13 r=2000 t=0 +w=$(tput cols) h=$(tput lines) +# ab -> idx = a*4 + b +# 0: up, 1: right, 2: down, 3: left +# 00 means going up , then going up -> ┃ +# 12 means going right, then going down -> ┓ +sets=( + "┃┏ ┓┛━┓ ┗┃┛┗ ┏━" + "│╭ ╮╯─╮ ╰│╯╰ ╭─" + "│┌ ┐┘─┐ └│┘└ ┌─" + "║╔ ╗╝═╗ ╚║╝╚ ╔═" + "|+ ++-+ +|++ +-" + "|/ \/-\ \|/\ /-" +) +v=() +RNDSTART=0 +NOCOLOR=0 + +OPTIND=1 +while getopts "p:t:f:s:r:RChv" arg; do +case $arg in + p) ((p=(OPTARG>0)?OPTARG:p));; + t) ((OPTARG>=0 && OPTARG<${#sets[@]})) && V+=($OPTARG);; + f) ((f=(OPTARG>19 && OPTARG<101)?OPTARG:f));; + s) ((s=(OPTARG>4 && OPTARG<16 )?OPTARG:s));; + r) ((r=(OPTARG>=0)?OPTARG:r));; + R) RNDSTART=1;; + C) NOCOLOR=1;; + h) echo -e "Usage: $(basename $0) [OPTION]..." + echo -e "Animated pipes terminal screensaver.\n" + echo -e " -p [1-]\tnumber of pipes (D=1)." + echo -e " -t [0-$((${#sets[@]} - 1))]\ttype of pipes, can be used more than once (D=0)." + echo -e " -f [20-100]\tframerate (D=75)." + echo -e " -s [5-15]\tprobability of a straight fitting (D=13)." + echo -e " -r LIMIT\treset after x characters, 0 if no limit (D=2000)." + echo -e " -R \t\trandom starting point." + echo -e " -C \t\tno color." + echo -e " -h\t\thelp (this screen)." + echo -e " -v\t\tprint version number.\n" + exit 0;; + v) echo "$(basename -- "$0") $VERSION" + exit 0 + esac +done + +# set default values if not by options +((${#V[@]})) || V=(0) + +# Attempt to workaround for Bash versions < 4, such as 3.2 on Mac: +# https://gist.github.com/livibetter/4689307/#comment-892368 +# Untested--in conduction of using shebang `env bash`--should fall back to +# `sleep` +printf -v SLEEP "read -t0.0$((1000/f)) -n 1" +if $SLEEP &>/dev/null; (($? != 142)); then + printf -v SLEEP "sleep 0.0$((1000/f))" +fi + +cleanup() { + # clear up standard input + read -t 0 && cat </dev/stdin>/dev/null + + tput rmcup + tput cnorm + stty echo + exit 0 +} +trap cleanup SIGHUP SIGINT SIGTERM + +for (( i=1; i<=p; i++ )); do + c[i]=$((i%8)) n[i]=0 l[i]=0 + ((x[i]=RNDSTART==1?RANDOM*w/32768:w/2)) + ((y[i]=RNDSTART==1?RANDOM*h/32768:h/2)) + v[i]=${V[${#V[@]} * RANDOM / M]} +done + +stty -echo +tput smcup +tput reset +tput civis +# any key press exits the loop and this script +while $SLEEP; (($? > 128)) || [[ $SLEEP = sleep* ]] && (($? == 0)); do + for (( i=1; i<=p; i++ )); do + # New position: + ((${l[i]}%2)) && ((x[i]+=-${l[i]}+2,1)) || ((y[i]+=${l[i]}-1)) + + # Loop on edges (change color on loop): + ((${x[i]}>w||${x[i]}<0||${y[i]}>h||${y[i]}<0)) && ((c[i]=RANDOM%8, v[i]=V[${#V[@]}*RANDOM/M])) + ((x[i]=(x[i]+w)%w)) + ((y[i]=(y[i]+h)%h)) + + # New random direction: + ((n[i]=RANDOM%s-1)) + ((n[i]=(${n[i]}>1||${n[i]}==0)?${l[i]}:${l[i]}+${n[i]})) + ((n[i]=(${n[i]}<0)?3:${n[i]}%4)) + + # Print: + tput cup ${y[i]} ${x[i]} + [[ $NOCOLOR == 0 ]] && echo -ne "\033[1;3${c[i]}m" + echo -n "${sets[v[i]]:l[i]*4+n[i]:1}" + l[i]=${n[i]} + done + ((r>0 && t*p>=r)) && tput reset && tput civis && t=0 || ((t++)) +done + +cleanup diff --git a/bin/todo b/bin/todo index 60f8f6a..706c88e 100755 --- a/bin/todo +++ b/bin/todo @@ -12,8 +12,11 @@ file="$HOME/.todo" ( [ -e "$file" ] || touch "$file" ) && [ ! -w "$file" ] && echo cannot write to $file && exit 1 + + + if [[ -z $1 || $1 == "--help" || $1 == "-h" || $1 == "help" ]]; then - echo "┌──────[ todo ]──[ version 0.0.1 ]─────── ─ ─" + echo "┌──────[ todo ]──[ version 0.0.2 ]─────── ─ ─" echo "│ usage: todo <options>" echo "│ author: xero harrison - http://xero.nu" echo "├────────────────[ options ]"───────────── ─ ─ diff --git a/i3/bat.sh b/i3/bat.sh index d36894a..9f1ec1d 100755 --- a/i3/bat.sh +++ b/i3/bat.sh @@ -3,16 +3,16 @@ bat_n="$(cat /sys/class/power_supply/BAT0/energy_now)" bat_f="$(cat /sys/class/power_supply/BAT0/energy_full)" -#let "percent=$bat_n/$bat_f*100" - percent=$(echo "$bat_n/$bat_f*100" | bc -l | cut -d"." -f1) -if [ $percent -eq "100" ] +actual="$(cat /sys/class/power_supply/BAT0/capacity)" + +if [ $actual -eq "100" ] # && cat /sys/class/power_supply/BAT0/status -eq "Charging" ] then notify-send --urgency=critical 'Batterie pleine' 'Retirez le chargeur' fi -if [ $percent -le "15" ] +if [ $actual -le "15" ] # && cat /sys/class/power_supply/BAT0/status -eq "Discharging" ] then notify-send --urgency=critical 'Batterie faible !' 'Branchez le chargeur' fi diff --git a/i3/compton.conf b/i3/compton.conf deleted file mode 100644 index a97b5ef..0000000 --- a/i3/compton.conf +++ /dev/null @@ -1,89 +0,0 @@ -# Shadow -shadow = true; -no-dnd-shadow = true; -no-dock-shadow = true; -clear-shadow = true; -shadow-radius = 7; -shadow-offset-x = -7; -shadow-offset-y = -7; -# shadow-opacity = 0.7; -# shadow-red = 0.0; -# shadow-green = 0.0; -# shadow-blue = 0.0; -shadow-exclude = [ - "name = 'Notification'", - "class_g = 'Conky'", - "class_g ?= 'Notify-osd'", - "class_g = 'Cairo-clock'", - "_GTK_FRAME_EXTENTS@:c" -]; -# shadow-exclude = "n:e:Notification"; -# shadow-exclude-reg = "x10+0+0"; -# xinerama-shadow-crop = true; - -# Opacity -menu-opacity = 0.8; -#inactive-opacity = 0.8; -# active-opacity = 0.8; -frame-opacity = 0.7; -inactive-opacity-override = false; -alpha-step = 0.06; -# inactive-dim = 0.2; -# inactive-dim-fixed = true; -# blur-background = true; -# blur-background-frame = true; -blur-kern = "3x3box" -# 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" -# blur-background-fixed = true; -blur-background-exclude = [ - "window_type = 'dock'", - "window_type = 'desktop'", - "_GTK_FRAME_EXTENTS@:c" -]; -# opacity-rule = [ "80:class_g = 'URxvt'" ]; - -# Fading -fading = true; -# fade-delta = 30; -fade-in-step = 0.1; -fade-out-step = 0.1; -# no-fading-openclose = true; -# no-fading-destroyed-argb = true; -fade-exclude = [ ]; - -# Other -backend = "xrender" -mark-wmwin-focused = true; -mark-ovredir-focused = true; -# use-ewmh-active-win = true; -detect-rounded-corners = true; -detect-client-opacity = true; -refresh-rate = 0; -vsync = "none"; -dbe = false; -paint-on-overlay = true; -# sw-opti = true; -# unredir-if-possible = true; -# unredir-if-possible-delay = 5000; -# unredir-if-possible-exclude = [ ]; -focus-exclude = [ "class_g = 'Cairo-clock'" ]; -detect-transient = true; -detect-client-leader = true; -invert-color-include = [ ]; -# resize-damage = 1; - -# GLX backend -# glx-no-stencil = true; -glx-copy-from-front = false; -# glx-use-copysubbuffermesa = true; -# glx-no-rebind-pixmap = true; -glx-swap-method = "undefined"; -# glx-use-gpushader4 = true; -# xrender-sync = true; -# xrender-sync-fence = true; - -# Window type settings -wintypes: -{ - tooltip = { fade = true; shadow = true; opacity = 0.75; focus = true; }; -}; diff --git a/i3/config b/i3/config index c605852..138f64b 100644 --- a/i3/config +++ b/i3/config @@ -16,16 +16,11 @@ # Font for window titles. Will also be used by the bar unless a different font # is used in the bar {} block below. #font pango: Ubuntu Mono, Icons 10 -font pango: Roboto Medium 10 +font pango: Roboto Medium 9 # resolv i3 transparancy bug new_window pixel - - -# This font is widely installed, provides lots of unicode glyphs, right-to-left -# text rendering and scalability on retina/hidpi displays (thanks to pango). -#font pango:DejaVu Sans Mono 8 @@ -120,6 +115,11 @@ # toggle tiling / floating bindsym $mod+Shift+space floating toggle +# specifics floating windows +for_window[class="Transmission"] floating enable +for_window[class="GParted"] floating enable +for_window[class="System-config-lvm"] floating enable + # change focus between tiling / floating windows @@ -143,7 +143,7 @@ set $tag3 "3:" set $tag4 "4:" set $tag5 "5:" -set $tag6 "6:6" +set $tag6 "6:" set $tag7 "7:7" set $tag8 "8:8" set $tag9 "9:9" @@ -265,5 +265,7 @@ bindsym XF86AudioRaiseVolume exec "amixer set Master 5+ unmute" bindsym XF86AudioLowerVolume exec "amixer set Master 5- unmute" -bindsym XF86AudioMute exec "amixer set Master toggle; amixet set Headphone unmute; amixer set Speaker unmute" - +bindsym XF86AudioMute exec "amixer set Master toggle; amixer set Headphone unmute; amixer set Speaker unmute" + + +bindsym $mod+c exec --no-startup-id j4-dmenu-desktop --dmenu="rofi -i -dmenu -p ''" diff --git a/i3/screen.png b/i3/screen.png deleted file mode 100644 index d593239..0000000 Binary files a/i3/screen.png and /dev/null differ diff --git a/i3/screenshot.png b/i3/screenshot.png deleted file mode 100644 index 697646d..0000000 Binary files a/i3/screenshot.png and /dev/null differ diff --git a/i3/weather.sh b/i3/weather.sh index c0c4cf6..3ed8f1e 100755 --- a/i3/weather.sh +++ b/i3/weather.sh @@ -1,6 +1,6 @@ #!/bin/bash -loc="34090" +loc="75013" mph=$(cliweather $loc| grep 'Wind:' | cut -d' ' -f2) kmh=$(echo "$(($mph*(8/5)))" | cut -d'.' -f1) diff --git a/locker/LICENSE b/locker/LICENSE new file mode 100644 index 0000000..6ad7ab3 --- /dev/null +++ b/locker/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Dolores Portalatin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/locker/lock b/locker/lock index 15ee91a..8ca9955 100755 --- a/locker/lock +++ b/locker/lock @@ -29,11 +29,11 @@ fi # try to use a forked version of i3lock with prepared parameters -i3lock $PARAM -i $IMAGE > /dev/null 2>&1 +i3lock-color $PARAM -i $IMAGE > /dev/null 2>&1 if [ $? -ne 0 ]; then # We have failed, lets get back to stock one - i3lock -i $IMAGE + i3lock-color -i $IMAGE fi rm $IMAGE