Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------------------------------------------
- ---Larry's Custom AWM+Blue Awesome
- ------------------------------------------------
- -- Standard awesome library
- require("awful")
- require("awful.autofocus")
- require("awful.rules")
- -- Theme handling library
- require("beautiful")
- require("revelation")
- -- Notification library
- require("naughty")
- local vicious = require("vicious")
- -- require('weather') -- http://github.com/jesseadams/weather
- --}}}
- -- {{{ 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.add_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
- -- }}}
- -- weather_zipcode = '20112' -- USA/Canada postal code
- -- {{{ Variable Definitions
- -- Themes define colours, icons, and wallpapers
- beautiful.init("/home/larry/.config/awesome/themes/blue/theme.lua")
- -- This is used later as the default terminal and editor to run.
- terminal = "urxvt"
- editor = os.getenv("EDITOR") or "nano"
- editor_cmd = terminal .. " -e " .. editor
- gui_editor = "scite"
- browser = "opera"
- fileman = "pcmanfm /home/larry/"
- cli_fileman = terminal .. " -e ranger "
- music = terminal .. " -e ncmpcpp "
- chat = terminal .. " -e weechat-curses "
- tasks = terminal .. " -e sudo htop "
- -- 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"
- altkey = "Mod1"
- -- Table of layouts to cover with awful.layout.inc, order matters.
- layouts = {
- awful.layout.suit.floating, -- 1
- awful.layout.suit.tile, -- 2
- awful.layout.suit.tile.left, -- 3
- awful.layout.suit.tile.bottom, -- 4
- awful.layout.suit.tile.top, -- 5
- awful.layout.suit.fair, -- 6
- awful.layout.suit.fair.horizontal, -- 7
- awful.layout.suit.spiral, -- 8
- awful.layout.suit.spiral.dwindle, -- 9
- awful.layout.suit.max, -- 10
- --awful.layout.suit.max.fullscreen, -- 11
- --awful.layout.suit.magnifier -- 12
- }
- -- }}}
- -- {{{ Tags
- -- Define a tag table which hold all screen tags.
- -- tags = {}
- -- for s = 1, screen.count() do
- -- Each screen has its own tag table.
- -- tags[s] = awful.tag({ 1, 2, 3, 4, 5, 6, 7, 8, 9 }, s, layouts[6])
- -- end
- tags = {
- names = {
- '1 term',
- '2 web',
- '3 files',
- '4 chat',
- '5 media',
- '6 work',
- '7 vbox',
- '8 games',
- '9 pics'
- },
- layout = {
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6],
- layouts[6]
- }
- }
- 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
- myfilemanagers = {
- { "pcmanfm" , "pcmanfm" },
- { "pcmanfm" , "pcmanfm" }
- }
- myaccessories = {
- { "7-Zip", "7zFM" },
- -- { "Charmap", "gucharmap" },
- -- { "Convertall", "convertall" },
- -- { "Converter", "cute-converter" },
- { "Scite", "scite" },
- -- { "Gvim", "gvim" },
- { "Nano", editor_cmd }
- }
- myinternet = {
- -- { "Aircrack", "sudo wepcrack" },
- -- { "Amule", "amule" },
- { "Mumble", "mumble" },
- { "Dropbox", "dropboxd" },
- { "Firefox" , browser },
- { "RSS Feed" , "Lightread"},
- { "IRC Client" , chat },
- { "Chrome" , "iron" },
- { "Mail" , "thunderbird" },
- { "Skype" , "skype" },
- { "Teamviewer" , "teamviewer7" },
- -- { "Torrent" , "qbittorrent" },
- -- { "Torrent Search" , "torrent-search" },
- }
- mymedia = {
- -- { "Avidemux" , "avidemux2_gtk" },
- -- { "Burn Tool" , "k3b" },
- { "Mplayer" , "gnome-mplayer" },
- -- { "vlc" , music },
- --{ "Pandora" , "pithos" },
- -- { "Record Desktop" , "gtk-recordMyDesktop --no-frame" },
- -- { "UNetBootin" , "sudo unetbootin" },
- { "Vlc" , "vlc" },
- --{ "Webcam" , "mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -fps 25 -vf screenshot" }
- -- { "Webcam" , "wxcam" }
- }
- mygraphics = {
- --{ "Pinta" , "pinta" },
- -- { "Colors" , "kcolorchooser" },
- { "Gimp" , "gimp" },
- -- { "Gpicview" , "gpicview" },
- -- { "Scanner" , "iscan" },
- -- { "Xournal" , "xournal" }
- }
- --myoffice = {
- -- { "Formula" , "lomath" },
- -- { "Impress" , "loimpress" },
- -- { "Okular" , "okular" },
- -- { "Spreadsheet" , "localc" },
- -- { "Writer" , "lowriter" }
- --}
- mysystem = {
- { "Appearance" , "lxappearance" },
- { "Cleaning" , "bleachbit" },
- { "Virtualbox" , "VirtualBox" },
- -- { "HardInfo" , "hardinfo" },
- -- { "KDE Setting" , "systemsettings" },
- -- { "Powertop" , terminal .. " -e sudo powertop " },
- -- { "Qtconfig" , "qtconfig" },
- { "Task Manager" , "tasks" }
- }
- mysystemroot = {
- -- { "Appearance" , "sudo lxappearance" },
- { "Catalyst" , "sudo amdcccle" },
- --{ "Cleaning" , "sudo bleachbit" },
- --{ "Disk Utility" , "sudo palimpsest" },
- -- { "KDE Settings" , "sudo systemsettings" },
- --{ "Partitions" , "sudo /usr/sbin/gparted" },
- -- { "Qtconfig" , "sudo qtconfig" }
- }
- myfolders = {
- { "Apps" , "sudo pcmanfm /usr/share/applications" },
- { "Arch" , "sudo pcmanfm /" },
- { "Boot" , "sudo pcmanfm /boot" },
- { "Configs" , "pcmanfm /home/larry/.config/awesome/" },
- { "Etc" , "sudo pcmanfm /etc" },
- { "Documents" , "pcmanfm /media/Data/Documents" },
- { "Downloads" , "pcmanfm /home/larry/Documents/" },
- { "Dropbox" , "pcmanfm /home/larry/Dropbox/" },
- { "Home" , "pcmanfm /home/larry" },
- { "Icons" , "sudo pcmanfm /usr/share/icons" },
- { "Media" , "pcmanfm /media" },
- -- { "Motion" , "pcmanfm /home/larry/.motion/files" },
- { "Music" , "pcmanfm /home/larry/Music/" },
- { "Pictures" , "pcmanfm /home/larry/Pictures/" },
- --{ "Pixmaps" , "sudo pcmanfm /usr/share/pixmaps" },
- { "Root" , "sudo pcmanfm /root" },
- { "Themes" , "sudo pcmanfm /usr/share/themes" },
- { "Var" , "sudo pcmanfm /var" },
- { "Videos" , "pcmanfm /home/larry/Videos/" }
- }
- --mystudy = {
- -- { "Calculator" , "qalculate-gtk" },
- --{ "Chemistry" , "gelemental" },
- --{ "Circuits" , "sudo ktechlab" },
- --{ "Esse3" , "firefox https://poliba.esse3.cineca.it/Home.do;jsessionid=39B376CBEAB698B9BD68256B07C36505.jvm_poliba_esse3web05" };
- --{ "Fataing" , "firefox http://www.fataing.poliba.it/login.php" },
- --{ "Graphs" , "kmplot" },
- --{ "Lectures" , "pcmanfm /media/Data/University" },
- --{ "Notes" , "pcmanfm /media/Winzoz/Users/larry/Dropbox/Università " }
- --}
- --mygames = {
- -- { "Blocks" , "gnotski" },
- -- { "Bovo" , "bovo" },
- -- { "Brainy" , "gbrainy" },
- -- { "Breakout" , "kbreakout" },
- -- { "Chess" , "pychess" },
- -- { "Four In Line" , "kfourinline" },
- --{ "Granatier" , "granatier" },
- --{ "Katomic" , "katomic" },
- --{ "Kmahjongg" , "kmahjongg" },
- --{ "Mahjongg" , "mahjongg" },
- --{ "Mines" , "kmines" },
- -- { "Puzzles" , "palapeli" },
- -- { "Reversi" , "kreversi" },
- -- { "Sudoku" , "ksudoku" },
- --{ "Sudoku 2" , "gnome-sudoku" },
- -- { "Tetravex" , "gnotravex" },
- -- { "Tetris" , "kblocks" },
- -- { "Tetris 2" , "quadrapassel" },
- -- { "Urban Terror" , "urbanterror" }
- --{ "WoW" , "wow" }
- --}
- myexit = {
- { "Hibernate" , "sudo pm-hibernate" },
- { "Shutdown" , "sudo halt" },
- { "Reboot" , "sudo reboot" },
- { "Quit" , "awesome.quit" }
- }
- mymainmenu = awful.menu({ items = {
- { "File Manager", fileman },
- { "urxvt", terminal },
- --{ "Opera" , browser },
- { "Firefox" , "firefox" },
- -- { "chrome" , "iron" },
- { " ", nil, nil}, -- separator
- { "Edit Lua" , "scite /home/larry/.config/awesome/rc.lua" },
- { "Edit Tmux" , "scite /home/larry/.tmux.conf" },
- { "Edit Xinit" , "scite /home/larry/.xinitrc" },
- { "Edit Bashrc" , "scite /home/larry/.bashrc" },
- { "Edit Xres" , "scite /home/larry/.Xresources" },
- { "Folders" , myfolders },
- { " ", nil, nil}, -- separator
- { "Accessories" , myaccessories },
- --{ "Games" , mygames },
- --{ "Graphics" , mygraphics },
- { "Internet" , myinternet },
- { "Multimedia" , mymedia },
- --{ "Office" , myoffice },
- { "System" , mysystem },
- { "System Root" , mysystemroot },
- -- { "University" , mystudy },
- { " ", nil, nil}, -- separator
- { "Search" , "sudo kfind" },
- { "Exit", myexit },
- }
- })
- mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
- menu = mymainmenu })
- -- }}}
- -- {{{ Wibox
- -- Weather widget
- -- forecast = widget({ type = 'textbox', name = 'weather' })
- -- forecast.bg = bottom_panel_color
- -- forecast.width = 70
- -- weather.register(forecast, weather_zipcode)
- -- Weather Icon
- weathericon = widget({ type = 'imagebox' })
- weathericon.image = image("/home/larry/.config/awesome/themes/blue/widgets/dish.png")
- --- Weather widget
- weatherwidget = widget({ type = "textbox" })
- weather_t = awful.tooltip({ objects = { weatherwidget },})
- vicious.register(weatherwidget, vicious.widgets.weather,
- function (widget, args)
- weather_t:set_text("City: " .. args["{city}"] .. "\nTemperature: " .. args["{tempc}"] .. " °C\t" .. args["{tempf}"] .. " °F " .. "\nWind Condition: " .. args["{wind}"] .. "\nWind Speed: " .. args["{windkmh}"] .. " km/h\t" .. args["{windmph}"] .. " mph\t" .. "\nSky: " .. args["{sky}"] .. "\nHumidity: " .. args["{humid}"] .. "%\n" .. "Pressure: " .. args["{press}"] .. " hPa") return args["{tempf}"] .. "F"
- end, 600, "KHEF")
- --'600': check every 10 minutes.
- --'KHEF': the Virginia ICAO code.
- -- Create a textclock widget
- clockicon = widget({ type = "imagebox"})
- clockicon.image = image(beautiful.widget_clock)
- mytextclock = awful.widget.textclock({ align = "right" })
- mytextclock = awful.widget.textclock({
- align = "right",
- }, "%a %b %d %l:%M%P", 1)
- awful.widget.layout.margins[mytextclock] = { top = -1 }
- -- Calendar widget to attach to the textclock
- require('calendar2')
- calendar2.addCalendarToWidget(mytextclock)
- -- System
- sysicon = widget({ type = "imagebox" })
- sysicon.image = image(beautiful.widget_sys)
- sysicon.align = "middle"
- syswidget = widget({ type = "textbox" })
- vicious.register( syswidget, vicious.widgets.os, "$2")
- awful.widget.layout.margins[sysicon] = { top = 0 }
- -- Uptime
- exitmenu = awful.menu({items = {
- { "Hibernate" , function () awful.util.spawn("sudo pm-hibernate", false) end },
- { "Shutdown" , function () awful.util.spawn("sudo halt", false) end },
- { "Restart" , awesome.restart },
- { "Reboot" , function () awful.util.spawn("sudo reboot", false) end },
- { "Quit" , awesome.quit }
- }
- })
- uptimeicon = widget({ type = "imagebox" })
- uptimeicon.image = image(beautiful.widget_uptime)
- uptimewidget = widget({ type = "textbox" })
- vicious.register( uptimewidget, vicious.widgets.uptime, "$1d$2h$3m")
- uptimeicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () exitmenu:toggle() end )
- ))
- uptimewidget:buttons(awful.util.table.join(
- awful.button({ }, 1, function () exitmenu:toggle() end )
- ))
- -- Temp Icon
- tempicon = widget({ type = "imagebox" })
- tempicon.image = image(beautiful.widget_temp)
- -- Temp Widget
- tempwidget = widget({ type = "textbox" })
- vicious.register(tempwidget, vicious.widgets.thermal, "$1°C", 9, "thermal_zone0")
- tempicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("urxvtc -e sudo powertop", false) end)
- ))
- -- gmail widget and tooltip
- mygmail = widget({ type = "textbox" })
- gmail_t = awful.tooltip({ objects = { mygmail },})
- mygmailimg = widget({ type = "imagebox" })
- mygmailimg.image = image(beautiful.widget_gmail)
- vicious.register(mygmail, vicious.widgets.gmail,
- function (widget, args)
- gmail_t:set_text(args["{subject}"])
- gmail_t:add_to_object(mygmailimg)
- return args["{count}"]
- end, 120)
- --the '120' here means check every 2 minutes.
- mygmailimg:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("thunderbird", false) end)
- ))
- -- Disk usage widget
- diskwidget = widget({ type = 'imagebox' })
- diskwidget.image = image("/home/larry/.config/awesome/themes/blue/widgets/mem.png")
- disk = require("diskusage")
- -- the first argument is the widget to trigger the diskusage
- -- the second/third is the percentage at which a line gets orange/red
- -- true = show only local filesystems
- disk.addToWidget(diskwidget, 75, 90, false)
- -- Pacman Icon
- pacicon = widget({type = "imagebox" })
- pacicon.image = image(beautiful.widget_pac)
- -- Pacman Widget
- pacwidget = widget({type = "textbox"})
- pacwidget_t = awful.tooltip({ objects = { pacwidget},})
- vicious.register(pacwidget, vicious.widgets.pkg,
- function(widget,args)
- local io = { popen = io.popen }
- local s = io.popen("yaourt -Qu")
- local str = ''
- for line in s:lines() do
- str = str .. line .. "\n"
- end
- pacwidget_t:set_text(str)
- s:close()
- return " " .. args[1]
- end, 10, "Arch")
- --'60' means check every 10 minutes
- pacicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("urxvtc -e yaourt -Syua", false) end)
- ))
- -- CPU Icon
- cpuicon = widget({ type = "imagebox" })
- cpuicon.image = image(beautiful.widget_cpu)
- -- CPU Widget
- cpubar = awful.widget.progressbar()
- cpubar:set_width(50)
- cpubar:set_height(6)
- cpubar:set_vertical(false)
- cpubar:set_background_color("#434343")
- cpubar:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
- vicious.register(cpubar, vicious.widgets.cpu, "$1", 3)
- awful.widget.layout.margins[cpubar.widget] = { top = 5 }
- -- Cpu usage
- cpuwidget = widget({ type = "textbox" })
- vicious.register( cpuwidget, vicious.widgets.cpu, "$2% $3% $4% $5%", 3)
- cpuicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("urxvtc -e htop", false) end)
- ))
- -- BATT Icon
- baticon = widget ({type = "imagebox" })
- baticon.image = image(beautiful.widget_batt)
- -- Battery usage
- powermenu = awful.menu({items = {
- { "Auto" , function () awful.util.spawn("sudo cpufreq-set -r -g ondemand", false) end },
- { "Ondemand" , function () awful.util.spawn("sudo cpufreq-set -r -g ondemand", false) end },
- { "Powersave" , function () awful.util.spawn("sudo cpufreq-set -r -g powersave", false) end },
- { "Performance" , function () awful.util.spawn("sudo cpufreq-set -r -g performance", false) end }
- }
- })
- -- Initialize BATT widget progressbar
- batbar = awful.widget.progressbar()
- batbar:set_width(50)
- batbar:set_height(6)
- batbar:set_vertical(false)
- batbar:set_background_color("#434343")
- batbar:set_border_color(nil)
- batbar:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
- awful.widget.layout.margins[batbar.widget] = { top = 5 }
- vicious.register( batbar, vicious.widgets.bat, "$2", 1, "BAT0" )
- batwidget = widget({ type = "textbox" })
- vicious.register( batwidget, vicious.widgets.bat, "$2", 1, "BAT0" )
- baticon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () powermenu:toggle() end )
- ))
- batwidget:buttons(awful.util.table.join(
- awful.button({ }, 1, function () powermenu:toggle() end )
- ))
- -- Vol Icon
- volicon = widget ({type = "imagebox" })
- volicon.image = image(beautiful.widget_vol)
- -- Vol bar Widget
- volbar = awful.widget.progressbar()
- volbar:set_width(50)
- volbar:set_height(6)
- volbar:set_vertical(false)
- volbar:set_background_color("#434343")
- volbar:set_border_color(nil)
- volbar:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
- awful.widget.layout.margins[volbar.widget] = { top = 5 }
- vicious.register(volbar, vicious.widgets.volume, "$1", 1, "Master")
- -- Sound volume
- volumewidget = widget ({ type = "textbox" })
- vicious.register( volumewidget, vicious.widgets.volume, "$1", 1, "Master" )
- volicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("amixer -q sset Master toggle", false) end),
- awful.button({ }, 3, function () awful.util.spawn("urxvtc -e alsamixer", true) end),
- awful.button({ }, 4, function () awful.util.spawn("amixer -q sset Master 1dB+", false) end),
- awful.button({ }, 5, function () awful.util.spawn("amixer -q sset Master 1dB-", false) end)
- ))
- volumewidget:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("amixer -q sset Master toggle", false) end),
- awful.button({ }, 3, function () awful.util.spawn("urxvtc -e alsamixer", true) end),
- awful.button({ }, 4, function () awful.util.spawn("amixer -q sset Master 1dB+", false) end),
- awful.button({ }, 5, function () awful.util.spawn("amixer -q sset Master 1dB-", false) end)
- ))
- -- Net Widget
- netdownicon = widget ({ type = "imagebox" })
- netdownicon.image = image(beautiful.widget_netdown)
- netdownicon.align = "middle"
- netdowninfo = widget({ type = "textbox" })
- vicious.register(netdowninfo, vicious.widgets.net, "${eth0 down_kb}", 1)
- -- netdowninfo:buttons(awful.util.table.join(
- -- awful.button({ }, 1, function () awful.util.spawn("sudo netcfg home-wireless-wpa", false) end),
- -- awful.button({ }, 3, function () awful.util.spawn("sudo netcfg down home-wireless-wpa", false) end)
- -- ))
- netupicon = widget ({ type = "imagebox" })
- netupicon.image = image(beautiful.widget_netup)
- netupicon.align = "middle"
- netupinfo = widget({ type = "textbox" })
- vicious.register(netupinfo, vicious.widgets.net, "${eth0 up_kb}", 1)
- -- netupinfo:buttons(awful.util.table.join(
- -- awful.button({ }, 1, function () awful.util.spawn("sudo netcfg home-ethernet", false) end),
- -- awful.button({ }, 3, function () awful.util.spawn("sudo netcfg down home-ethernet", false) end)
- -- ))
- netmenu = awful.menu({items = {
- { "Change ip" , function () awful.util.spawn("sh ./.scripts/restartwifi", false) end },
- { "Connect Lan" , function () awful.util.spawn("urxvtc -hold -e sudo netcfg home-ethernet", false) end },
- { "Connect Wifi" , function () awful.util.spawn("urxvtc -hold -e sudo netcfg home-wireless-wpa", false) end },
- { "Disconnect Lan" , function () awful.util.spawn("urxvtc -hold -e sudo netcfg down home-ethernet", false) end },
- { "Disconnect Wifi" , function () awful.util.spawn("urxvtc -hold -e sudo netcfg down home-wireless-wpa", false) end }
- }
- })
- netdownicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () netmenu:toggle() end )
- ))
- netdowninfo:buttons(awful.util.table.join(
- awful.button({ }, 1, function () netmenu:toggle() end )
- ))
- netupicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () netmenu:toggle() end )
- ))
- netupinfo:buttons(awful.util.table.join(
- awful.button({ }, 1, function () netmenu:toggle() end )
- ))
- -- MEM icon
- memicon = widget ({type = "imagebox" })
- memicon.image = image(beautiful.widget_mem)
- -- Initialize MEMBar widget
- membar = awful.widget.progressbar()
- membar:set_width(50)
- membar:set_height(6)
- membar:set_vertical(false)
- membar:set_background_color("#434343")
- membar:set_border_color(nil)
- membar:set_gradient_colors({ beautiful.fg_normal, beautiful.fg_normal, beautiful.fg_normal, beautiful.bar })
- awful.widget.layout.margins[membar.widget] = { top = 5 }
- vicious.register(membar, vicious.widgets.mem, "$1", 1)
- -- Memory usage
- memwidget = widget({ type = "textbox" })
- vicious.register(memwidget, vicious.widgets.mem, "$2M", 1)
- memicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("urxvtc -e saidar -c", false) end)
- ))
- -- MPD Icon
- mpdicon = widget({ type = "imagebox" })
- mpdicon.image = image(beautiful.widget_mpd)
- -- Initialize MPD Widget
- mpdwidget = widget({ type = "textbox" })
- vicious.register(mpdwidget, vicious.widgets.mpd,
- function (widget, args)
- if args["{state}"] == "Stop" then
- return "Stopped"
- elseif args["{state}"] == "Pause" then
- return "Paused"
- else
- return args["{Title}"]..' - '.. args["{Artist}"]
- end
- end, 0.5)
- mpdicon:buttons(awful.util.table.join(
- awful.button({ }, 1, function () awful.util.spawn("urxvt -e ncmpcpp", false) end)
- ))
- -- Spacers
- rbracket = widget({type = "textbox" })
- rbracket.text = "]"
- lbracket = widget({type = "textbox" })
- lbracket.text = "["
- line = widget({type = "textbox" })
- line.text = "|"
- -- Space
- space = widget({ type = "textbox" })
- space.text = " "
- -- MPD controls
- music_play = awful.widget.launcher({
- image = beautiful.widget_play,
- command = "ncmpcpp toggle && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
- })
- music_pause = awful.widget.launcher({
- image = beautiful.widget_pause,
- command = "ncmpcpp toggle && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
- })
- music_pause.visible = false
- music_stop = awful.widget.launcher({
- image = beautiful.widget_stop,
- command = "ncmpcpp stop && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
- })
- music_prev = awful.widget.launcher({
- image = beautiful.widget_prev,
- command = "ncmpcpp prev && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
- })
- music_next = awful.widget.launcher({
- image = beautiful.widget_next,
- command = "ncmpcpp next && echo -e 'vicious.force({ mpdwidget, })' | awesome-client"
- })
- -- Pianobar Icon
- -- pandoraicon = widget({ type = "imagebox" })
- --pandoraicon.image = image(beautiful.widget_pandora)
- --pandoraicon:buttons(awful.util.table.join(
- -- awful.button({ }, 1, function () awful.util.spawn("terminal -e tmux -c pianobar", false) end),
- -- awful.button({ }, 2, function () awful.util.spawn("terminal -e tmux attach", false) end)
- -- ))
- -- Create a systray
- mysystray = widget({ type = "systray" })
- -- Create a wibox for each screen and add it
- mywibox = {}
- mybottomwibox = {}
- mystatusbar = {}
- 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, awful.tag.viewnext),
- awful.button({ }, 5, awful.tag.viewprev)
- )
- mytasklist = {}
- mytasklist.buttons = awful.util.table.join(
- awful.button({ }, 1, function (c)
- if c == client.focus then
- c.minimized = true
- else
- 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({ }, 2, function ()
- if instance then
- instance:hide()
- instance = nil
- else
- instance = awful.menu.clients({ width=250 })
- end
- end),
- awful.button({ }, 3, function ()
- awful.client.focus.byidx(1)
- if client.focus then client.focus:kill() 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({ layout = awful.widget.layout.horizontal.leftright })
- -- 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.label.all, mytaglist.buttons)
- -- Create a tasklist widget
- mytasklist[s] = awful.widget.tasklist(function(c)
- return awful.widget.tasklist.label.currenttags(c, s)
- end, mytasklist.buttons)
- -- Create the upper wibox
- mywibox[s] = awful.wibox({ position = "top", screen = s, border_width = 0, height = 16 })
- -- Add widgets to the wibox - order matters
- mywibox[s].widgets = {
- {
- mylauncher,
- space,
- mytaglist[s],
- space,
- mypromptbox[s],
- layout = awful.widget.layout.horizontal.leftright
- },
- mylayoutbox[s],
- space,
- mytextclock,
- clockicon,
- space,
- space,
- syswidget,
- -- space,
- -- sysicon,
- space,
- space,
- s == 1 and mysystray or nil,
- mytasklist[s],
- layout = awful.widget.layout.horizontal.rightleft
- }
- mybottomwibox[s] = awful.wibox({ position = "bottom", screen = s, border_width = 0, height = 16 })
- mybottomwibox[s].widgets = {
- {
- space, lbracket, volicon, space, volbar, space, volumewidget, space, rbracket, space, space, lbracket, baticon, space, batbar, space, batwidget, space, rbracket, space, space, lbracket, diskwidget, space, membar, space, memwidget, space, rbracket, space, space, lbracket, cpuicon, space, cpubar, space, cpuwidget, space, rbracket, space, lbracket, weathericon, weatherwidget, rbracket, volume_widget,
- layout = awful.widget.layout.horizontal.leftright
- },
- space, rbracket, uptimewidget, space, uptimeicon, lbracket, space, space, rbracket, space, tempwidget, space, tempicon, lbracket, space, space, rbracket, space, netupinfo, netupicon, space, netdowninfo, netdownicon, lbracket, space, space, rbracket, space, pacwidget, pacicon, lbracket, space, space, rbracket, space, mygmail, space, mygmailimg, lbracket, space, space, rbracket, space, music_next, music_play, music_pause, music_stop, music_prev, space, mpdwidget, space, mpdicon, space, lbracket,
- layout = awful.widget.layout.horizontal.rightleft
- }
- 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, "Control" }, "Left", awful.tag.viewprev ),
- awful.key({ modkey, "Control" }, "Right", awful.tag.viewnext ),
- awful.key({ modkey, "" }, "`", awful.tag.history.restore),
- awful.key({modkey}, "g", revelation),
- awful.key({ modkey, }, "Left",
- function ()
- awful.client.focus.byidx( 1)
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey, }, "Right",
- function ()
- awful.client.focus.byidx(-1)
- if client.focus then client.focus:raise() end
- end),
- awful.key({ modkey, }, "Escape", function () mymainmenu:show({keygrabber=true}) end),
- -- Show/Hide Wibox
- awful.key({ modkey }, "b", function ()
- mywibox[mouse.screen].visible = not mywibox[mouse.screen].visible
- mybottomwibox[mouse.screen].visible = not mybottomwibox[mouse.screen].visible 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),
- -- Standard program
- awful.key({ modkey, }, "t", function () awful.util.spawn("urxvt") end),
- awful.key({ modkey, altkey }, "t", function () awful.util.spawn( "sudo urxvt" ) end),
- 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),
- -- Volume control
- awful.key({ altkey }, "plus", function () awful.util.spawn("amixer -q sset Master 1dB+", false) end),
- awful.key({ altkey }, "minus", function () awful.util.spawn("amixer -q sset Master 1dB-", false) end),
- --Music control
- awful.key({ altkey, }, "Up", function () awful.util.spawn( "ncmpcpp toggle", false ) end),
- awful.key({ altkey, }, "Down", function () awful.util.spawn( "ncmpcpp stop", false ) end ),
- awful.key({ altkey, }, "Left", function () awful.util.spawn( "ncmpcpp prev", false ) end ),
- awful.key({ altkey, }, "Right", function () awful.util.spawn( "ncmpcpp next", false ) end ),
- -- Applications
- awful.key({ modkey, }, "w", function () awful.util.spawn( "firefox", false ) end),
- awful.key({ modkey, }, "n", function () awful.util.spawn(music) end),
- awful.key({ modkey, altkey }, "c", function () awful.util.spawn(chat) end),
- awful.key({ modkey, }, "h", function () awful.util.spawn(tasks) end),
- awful.key({ modkey, "Control" }, "t", function () awful.util.spawn( "thunderbird", false ) end),
- awful.key({ modkey, altkey }, "t", function () awful.util.spawn( "thunderbird -compose", false ) end),
- --awful.key({ modkey, }, "j", function () awful.util.spawn( "jdownloader", false ) end),
- --awful.key({ modkey, }, "m", function () awful.util.spawn( "motion", false ) end),
- --awful.key({ modkey, altkey }, "m", function () awful.util.spawn( "sh ./.scripts/stop-motion", false ) end),
- awful.key({ altkey, }, "s", function () awful.util.spawn( "scrot -c", false ) end),
- --awful.key({ modkey, }, "p", function () awful.util.spawn( "thunar", false ) end),
- awful.key({ modkey, }, "d", function () awful.util.spawn( "pcmanfm", false ) end),
- --awful.key({ modkey, altkey }, "p", function () awful.util.spawn( "sudo thunar /root", false ) end),
- awful.key({ modkey, altkey }, "d", function () awful.util.spawn( "sudo pcmanfm /root", false ) end),
- --awful.key({ modkey, }, "i", function () awful.util.spawn( "sh ./.scripts/restartwifi", false ) end),
- awful.key({ modkey, }, "u", function () awful.util.spawn( "mplayer tv:// -tv driver=v4l2:width=640:height=480:device=/dev/video0 -title Webcam -fps 25 -vf screenshot", false ) end),
- --awful.key({ modkey, altkey }, "u", function () awful.util.spawn( "wxcam", false ) end),
- awful.key({ modkey, }, "p", function () awful.util.spawn( "pithos", false ) end),
- awful.key({ altkey, }, "p", function () awful.util.spawn( "pavucontrol", false ) end),
- awful.key({ altkey, }, "m", function () awful.util.spawn( "mumble", false ) end),
- awful.key({ modkey, }, "s", function () awful.util.spawn( "skype", false ) end),
- awful.key({ modkey, }, "e", function () awful.util.spawn(gui_editor) end),
- awful.key({ modkey, altkey }, "e", function () awful.util.spawn(editor_cmd) end),
- awful.key({ modkey, }, "f", function () awful.util.spawn(cli_fileman) end),
- -- Shutdown
- awful.key({ }, "XF86PowerOff", function () awful.util.spawn( "sudo halt", false ) end),
- awful.key({ }, "Help", function () awful.util.spawn( "sudo reboot", false ) end),
- awful.key({ modkey, }, "x", function () awful.util.spawn("xscreensaver-command -lock") end),
- -- awful.key({ modkey, }, "x", function () awful.util.spawn( "xkill", false ) end),
- awful.key({ modkey, "Control" }, "r", awesome.restart),
- awful.key({ }, "XF86HomePage", awesome.quit),
- -- change background
- awful.key({ modkey, altkey }, "b", function () awful.util.spawn("awsetbg -t -f -r " .. awful.util.getdir("config") .. "/wallpapers/") end),
- -- Print Screen Key
- awful.key({ }, "Print", function () awful.util.spawn("scrot -e 'mv $f ~/Screenshots/ 2>/dev/null'") end),
- -- Multimedia keys
- -- awful.key({ }, "XF86AudioMute", function () awful.util.spawn("sh -c 'amixer -q sset Master toggle'") end),
- -- awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("sh -c 'amixer -q sset Master 2%+'") end),
- -- awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("sh -c 'amixer -q sset Master 2%-'") end),
- -- awful.key({ }, "XF86AudioMute", function () awful.util.spawn("sh -c '" .. home_path .. ".config/awesome/volumechanger.sh mute'") end),
- -- awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("sh -c '" .. home_path .. ".config/awesome/volumechanger.sh increase'") end),
- -- awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("sh -c '" .. home_path .. ".config/awesome/volumechanger.sh decrease'") end),
- -- awful.key({ }, "XF86AudioMedia", function () awful.util.spawn("gmpc") end),
- -- F-key shortcut bindings
- -- awful.key({modkey, }, "F1", function () awful.util.spawn_with_shell("spacefm > /dev/null 1>&2") end),
- -- awful.key({modkey, }, "F2", function () awful.util.spawn("sh -c 'firefox -P Tor > /dev/null 2>&1'") end),
- awful.key({modkey, }, "F4", function () awful.util.spawn_with_shell("pidgin > /dev/null 2>&1") end),
- --awful.key({modkey, }, "F4", function () awful.util.spawn("skype") end),
- -- awful.key({modkey, }, "F5", function () awful.util.spawn("pavucontrol") end),
- -- awful.key({modkey, }, "F8", function () awful.util.spawn("sh -c 'firefox -P Normal -no-remote > /dev/null 2>&1'") end),
- -- awful.key({modkey, }, "F9", function () awful.util.spawn("claws-mail") end),
- -- Prompt
- awful.key({ modkey }, "r", function () mypromptbox[mouse.screen]:run() end),
- awful.key({ modkey }, "q",
- function ()
- awful.prompt.run({ prompt = "Run in urxvt: " },
- mypromptbox[mouse.screen].widget,
- function (...) awful.util.spawn(terminal .. " -hold -e " .. ...) end,
- awful.completion.shell,
- -- awful.util.eval, nil,
- awful.util.getdir("cache") .. "/history")
- end)
- )
- clientkeys = awful.util.table.join(
- awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end),
- awful.key({ modkey, }, "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, "Shift" }, "r", function (c) c:redraw() end),
- awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end),
- awful.key({ modkey, }, "n", function (c) c.minimized = not c.minimized end),
- awful.key({ modkey, }, "m",
- function (c)
- c.maximized_horizontal = not c.maximized_horizontal
- c.maximized_vertical = not c.maximized_vertical
- end)
- )
- -- Compute the maximum number of digit we need, limited to 9
- keynumber = 0
- for s = 1, screen.count() do
- keynumber = math.min(9, math.max(#tags[s], keynumber));
- 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, keynumber do
- globalkeys = awful.util.table.join(globalkeys,
- awful.key({ modkey }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewonly(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Control" }, "#" .. i + 9,
- function ()
- local screen = mouse.screen
- if tags[screen][i] then
- awful.tag.viewtoggle(tags[screen][i])
- end
- end),
- awful.key({ modkey, "Shift" }, "#" .. i + 9,
- function ()
- if client.focus and tags[client.focus.screen][i] then
- awful.client.movetotag(tags[client.focus.screen][i])
- end
- end),
- awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
- function ()
- if client.focus and tags[client.focus.screen][i] then
- awful.client.toggletag(tags[client.focus.screen][i])
- 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
- awful.rules.rules = {
- -- All clients will match this rule.
- { rule = { },
- properties = { border_width = beautiful.border_width,
- border_color = beautiful.border_normal,
- focus = true,
- keys = clientkeys,
- maximized_vertical = false,
- maximized_horizontal = false,
- buttons = clientbuttons,
- size_hints_honor = false
- }
- },
- { rule = { class = "Vlc" },
- properties = { tag = tags[2][5], switchtotag = true } },
- { rule = { class = "Urxvt" },
- properties = { tag = tags[1][1], switchtotag = true } },
- { rule = { class = "urxvt" },
- properties = { tag = tags[1][1], switchtotag = true } },
- { rule = { class = "Gimp" },
- properties = { tag = tags[1][6] } },
- { rule = { class = "Lightread" },
- properties = { tag = tags[1][6] } },
- { rule = { instance = "Blender" },
- properties = { tag = tags[1][6] } },
- { rule = { instance = "plugin-container" },
- properties = { floating = true } },
- { rule = { class = "Firefox" },
- properties = { tag = tags[1][2], switchtotag = true } },
- { rule = { class = "iron" },
- properties = { tag = tags[2][2], switchtotag = true } },
- { rule = { class = "Firefox", instance = "Download" },
- properties = { tag = tags[1][2], floating = true } },
- { rule = { class = "Qbittorrent" },
- properties = { tag = tags[1][2], switchtotag = true } },
- { rule = { class = "Rxvt" },
- properties = { tag = tags[2][1], switchtotag = true } },
- { rule = { class = "Thunderbird" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Skype" },
- properties = { tag = tags[2][4], floating = false, switchtotag = true } },
- { rule = { class = "Mumble" },
- properties = { tag = tags[2][4], floating = false, switchtotag = true } },
- { rule = { class = "Gajim" },
- properties = { tag = tags[1][4], floating = true, switchtotag = true } },
- { rule = { class = "eog" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "Qalculate-gtk" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Convertall.py" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "QtConverter.pyw" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Kmplot" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Gelemental" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Ktechlab" },
- properties = { tag = tags[1][6] } },
- { rule = { class = "Gucharmap" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "Thunar" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "Pcmanfm" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "Pcmanfm", name = "Moving*" },
- properties = { tag = tags[1][3], floating = true } },
- { rule = { class = "Pcmanfm", name = "Copying*" },
- properties = { tag = tags[1][3], floating = true } },
- { rule = { class = "Pcmanfm", name = "File Already Exists" },
- properties = { tag = tags[1][3], floating = true } },
- { rule = { class = "Pcmanfm", name = "Progress Dialog" },
- properties = { tag = tags[1][3], floating = true } },
- { rule = { class = "scite" },
- properties = { tag = tags[2][6], switchtotag = true } },
- { rule = { class = "Gvim" },
- properties = { tag = tags[1][1], switchtotag = true } },
- { rule = { class = "Kcolorchooser" },
- properties = { tag = tags[1][6], switchtotag = true } },
- { rule = { class = "Xournal" },
- properties = { tag = tags[1][3] } },
- { rule = { class = "Okular" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "GWepCrackGui" },
- properties = { tag = tags[1][2], floating = true } },
- { rule = { class = "Amule" },
- properties = { tag = tags[1][2] } },
- { rule = { class = "Zenity", name = "filmlimitless" },
- properties = { tag = tags[1][5] } },
- { rule = { class = "Torrent-search" },
- properties = { tag = tags[1][2], switchtotag = true } },
- { rule = { class = "K3b" },
- properties = { tag = tags[1][5], switchtotag = true } },
- { rule = { class = "SciTE" },
- properties = { tag = tags[2][6] } },
- { rule = { class = "Gnome-mplayer" },
- properties = { tag = tags[1][5], switchtotag = true } },
- { rule = { class = "MPlayer" },
- properties = { tag = tags[2][9], switchtotag = true } },
- { rule = { class = "Pithos" },
- properties = { tag = tags[2][5], switchtotag = true } },
- { rule = { class = "Wine" },
- properties = { tag = tags[1][8], switchtotag = true } },
- { rule = { class = "Gthumb" },
- properties = { tag = tags[1][9], switchtotag = true } },
- { rule = { class = "Pavucontrol" },
- properties = { tag = tags[2][5], switchtotag = true } },
- { rule = { class = "Gtk-recordMyDesktop" },
- properties = { tag = tags[1][5], switchtotag = true } },
- { rule = { class = "Unetbootin.elf" },
- properties = { tag = tags[1][5], switchtotag = true } },
- { rule = { class = "Weechat" },
- properties = { tag = tags[1][4], switchtotag = true } },
- { rule = { class = "Bleachbit" },
- properties = { tag = tags[1][3], switchtotag = true } },
- { rule = { class = "VirtualBox" },
- properties = { tag = tags[1][7] } },
- { rule = { class = "Pidgin" },
- properties = { tag = tags[2][4], switchtotag = true } },
- { rule = { class = "Hardinfo" },
- properties = { tag = tags[1][3] } },
- { rule = { class = "Gpartedbin" },
- properties = { tag = tags[1][3], switchtotag = true } },
- -- { rule = { class = "Lxappearance" },
- -- properties = { tag = tags[1][6] } },
- }
- -- }}}
- -- {{{ Signals
- -- Signal function to execute when a new client appears.
- client.add_signal("manage", function (c, startup)
- -- Add a titlebar
- --awful.titlebar.add(c, { modkey = modkey })
- -- Enable sloppy focus
- c:add_signal("mouse::enter", function(c)
- if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
- and awful.client.focus.filter(c) then
- client.focus = c
- end
- end)
- 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
- end)
- client.add_signal("focus", function(c) c.border_color = beautiful.border_focus end)
- client.add_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
- -- menu.add_signal("focus", function(c)
- -- c.border_color = beautiful.border_focus
- -- c.opacity = 1
- -- end)
- -- menu.add_signal("unfocus", function(c)
- -- c.border_color = beautiful.border_normal
- -- c.opacity = 1
- -- end)
- -- }}}
- -- {{{ Functions to help launch run commands in a terminal using ":" keyword
- function check_for_terminal (command)
- if command:sub(1,1) == ":" then
- command = terminal .. ' -e "' .. command:sub(2) .. '"'
- end
- awful.util.spawn(command)
- end
- function clean_for_completion (command, cur_pos, ncomp, shell)
- local term = false
- if command:sub(1,1) == ":" then
- term = true
- command = command:sub(2)
- cur_pos = cur_pos - 1
- end
- command, cur_pos = awful.completion.shell(command, cur_pos,ncomp,shell)
- if term == true then
- command = ':' .. command
- cur_pos = cur_pos + 1
- end
- return command, cur_pos
- end
- -- }}}
- -- {{{ Autostart
- function run_once(cmd)
- findme = cmd
- firstspace = cmd:find(" ")
- if firstspace then
- findme = cmd:sub(0, firstspace-1)
- end
- awful.util.spawn_with_shell("pgrep -u $USER -x " .. findme .. " > /dev/null || (" .. cmd .. ")")
- end
- --os.execute"dex -a -e Awesome ~/.screenlayout/ds.sh"
- --run_once os.execute('arandr --options /home/larry/.screenlayout/ds.sh &')
- --run_once("xsetroot -cursor_name Adwaita")
- --run_once("compton -cCGfF -o 0.38 -O 200 -I 200 -t 0.02 -l 0.02 -r 3.2 -D2")
- --run_once("devilspie")
- run_once('xrdb ~/.Xresources')
- --run_once('urxvt')
- -- run_once('ranger')
- --run_once('weechat-curses')
- --run_once("terminal -q -f -o")
- -- run_once("wicd-client")
- --run_once("sudo netcfg home-wireless-wpa")
- -- run_once("klipper")
- --run_once('firefox')
- -- run_once('thunderbird')
- -- run_once('vlc')
- -- run_once("dropboxd")
- --run_once('mumble')
- -- run_once('pidgin')
- --run_once('skype')
- --run_once('pithos')
- --run_once('pavucontrol')
- --run_once('numlockx')
- --run_once('mutt')
- --run_once("/home/larry/.screenlayout/ds.sh")
- --run_once('feh --no-xinerama --bg-scale ~/Gimp/swirl\ archlinux.png')
- --run_once('tmux attach')
- -- }}}
- -- {{{ Disable startup-notification globally
- local oldspawn = awful.util.spawn
- awful.util.spawn = function (s)
- oldspawn(s, false)
- end
- -- }}}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement