From d2da4e5d2866083b8159f57eb04da01662b0dc17 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 10 Dec 2017 14:34:27 +0100 Subject: Make dotfiles stow compatible --- aptitude/.aptitude/config | 45 +++ aptitude/config | 45 --- awesome/.config/awesome/rc.lua | 459 ++++++++++++++++++++++++++++++ awesome/.config/awesome/theme/icon.png | Bin 0 -> 223 bytes awesome/.config/awesome/theme/submenu.png | Bin 0 -> 367 bytes awesome/.config/awesome/theme/theme.lua | 95 +++++++ awesome/rc.lua | 459 ------------------------------ awesome/theme/icon.png | Bin 223 -> 0 bytes awesome/theme/submenu.png | Bin 367 -> 0 bytes awesome/theme/theme.lua | 95 ------- bash/.bashrc | 101 +++++++ bashrc | 101 ------- bspwm/.config/bspwm/bspwmrc | 31 ++ bspwm/.config/bspwm/panel | 100 +++++++ bspwm/.config/bspwm/panel_bar | 96 +++++++ bspwm/bspwmrc | 31 -- bspwm/panel | 100 ------- bspwm/panel_bar | 96 ------- conky/.conkyrc | 77 +++++ conkyrc | 77 ----- deploy.sh | 13 +- emacs.d/drobillized-theme.el | 235 --------------- emacs.d/init.el | 428 ---------------------------- emacs.d/site-lisp/n3-mode.el | 44 --- emacs.d/site-lisp/ppindent.el | 138 --------- emacs.d/site-lisp/ttl-mode.el | 209 -------------- emacs/.emacs.d/drobillized-theme.el | 235 +++++++++++++++ emacs/.emacs.d/init.el | 428 ++++++++++++++++++++++++++++ emacs/.emacs.d/site-lisp/n3-mode.el | 44 +++ emacs/.emacs.d/site-lisp/ppindent.el | 138 +++++++++ emacs/.emacs.d/site-lisp/ttl-mode.el | 209 ++++++++++++++ sxhkd/.config/sxhkd/sxhkdrc | 153 ++++++++++ sxhkd/sxhkdrc | 153 ---------- tmux.conf | 8 - tmux/.tmux.conf | 8 + vim/.vimrc | 22 ++ vimrc | 22 -- 37 files changed, 2250 insertions(+), 2245 deletions(-) create mode 100644 aptitude/.aptitude/config delete mode 100644 aptitude/config create mode 100644 awesome/.config/awesome/rc.lua create mode 100644 awesome/.config/awesome/theme/icon.png create mode 100644 awesome/.config/awesome/theme/submenu.png create mode 100644 awesome/.config/awesome/theme/theme.lua delete mode 100644 awesome/rc.lua delete mode 100644 awesome/theme/icon.png delete mode 100644 awesome/theme/submenu.png delete mode 100644 awesome/theme/theme.lua create mode 100644 bash/.bashrc delete mode 100644 bashrc create mode 100755 bspwm/.config/bspwm/bspwmrc create mode 100755 bspwm/.config/bspwm/panel create mode 100755 bspwm/.config/bspwm/panel_bar delete mode 100755 bspwm/bspwmrc delete mode 100755 bspwm/panel delete mode 100755 bspwm/panel_bar create mode 100644 conky/.conkyrc delete mode 100644 conkyrc delete mode 100644 emacs.d/drobillized-theme.el delete mode 100644 emacs.d/init.el delete mode 100644 emacs.d/site-lisp/n3-mode.el delete mode 100644 emacs.d/site-lisp/ppindent.el delete mode 100644 emacs.d/site-lisp/ttl-mode.el create mode 100644 emacs/.emacs.d/drobillized-theme.el create mode 100644 emacs/.emacs.d/init.el create mode 100644 emacs/.emacs.d/site-lisp/n3-mode.el create mode 100644 emacs/.emacs.d/site-lisp/ppindent.el create mode 100644 emacs/.emacs.d/site-lisp/ttl-mode.el create mode 100644 sxhkd/.config/sxhkd/sxhkdrc delete mode 100644 sxhkd/sxhkdrc delete mode 100644 tmux.conf create mode 100644 tmux/.tmux.conf create mode 100644 vim/.vimrc delete mode 100644 vimrc diff --git a/aptitude/.aptitude/config b/aptitude/.aptitude/config new file mode 100644 index 0000000..5d61561 --- /dev/null +++ b/aptitude/.aptitude/config @@ -0,0 +1,45 @@ +aptitude ""; +aptitude::Keep-Unused-Pattern ""; +aptitude::Delete-Unused-Pattern ""; +aptitude::UI ""; +aptitude::UI::Styles ""; +aptitude::UI::Styles::Default ""; +aptitude::UI::Styles::Default::fg "white"; +aptitude::UI::Styles::Default::bg "default"; +aptitude::UI::Styles::DepBroken ""; +aptitude::UI::Styles::DepBroken::fg "white"; +aptitude::UI::Styles::DepBroken::bg "red"; +aptitude::UI::Styles::MenuBorder ""; +aptitude::UI::Styles::MenuBorder::fg "black"; +aptitude::UI::Styles::MenuBorder::bg "green"; +aptitude::UI::Styles::MenuBorder::set "bold"; +aptitude::UI::Styles::MenuBar ""; +aptitude::UI::Styles::MenuBar::fg "black"; +aptitude::UI::Styles::MenuBar::bg "green"; +aptitude::UI::Styles::MenuBar::set "bold"; +aptitude::UI::Styles::MenuEntry ""; +aptitude::UI::Styles::MenuEntry::fg "black"; +aptitude::UI::Styles::MenuEntry::bg "green"; +aptitude::UI::Styles::Header ""; +aptitude::UI::Styles::Header::fg "black"; +aptitude::UI::Styles::Header::bg "green"; +aptitude::UI::Styles::MultiplexTab ""; +aptitude::UI::Styles::MultiplexTab::fg "black"; +aptitude::UI::Styles::MultiplexTab::bg "green"; +aptitude::UI::Styles::MultiplexTabHighlighted ""; +aptitude::UI::Styles::MultiplexTabHighlighted::fg "black"; +aptitude::UI::Styles::MultiplexTabHighlighted::bg "green"; +aptitude::UI::Styles::MultiplexTabHighlighted::set "bold"; +aptitude::UI::Styles::Status ""; +aptitude::UI::Styles::Status::fg "black"; +aptitude::UI::Styles::Status::bg "green"; +aptitude::UI::Styles::DownloadHit ""; +aptitude::UI::Styles::DownloadHit::fg "green"; +aptitude::UI::Styles::DownloadHit::bg "default"; +aptitude::UI::Styles::DownloadHit::set "bold"; +aptitude::UI::Styles::DownloadProgress ""; +aptitude::UI::Styles::DownloadProgress::fg "green"; +aptitude::UI::Styles::DownloadProgress::bg "default"; +aptitude::UI::Styles::PkgToRemove ""; +aptitude::UI::Styles::PkgToRemove::fg "red"; +aptitude::UI::Styles::PkgToRemove::bg "default"; diff --git a/aptitude/config b/aptitude/config deleted file mode 100644 index 5d61561..0000000 --- a/aptitude/config +++ /dev/null @@ -1,45 +0,0 @@ -aptitude ""; -aptitude::Keep-Unused-Pattern ""; -aptitude::Delete-Unused-Pattern ""; -aptitude::UI ""; -aptitude::UI::Styles ""; -aptitude::UI::Styles::Default ""; -aptitude::UI::Styles::Default::fg "white"; -aptitude::UI::Styles::Default::bg "default"; -aptitude::UI::Styles::DepBroken ""; -aptitude::UI::Styles::DepBroken::fg "white"; -aptitude::UI::Styles::DepBroken::bg "red"; -aptitude::UI::Styles::MenuBorder ""; -aptitude::UI::Styles::MenuBorder::fg "black"; -aptitude::UI::Styles::MenuBorder::bg "green"; -aptitude::UI::Styles::MenuBorder::set "bold"; -aptitude::UI::Styles::MenuBar ""; -aptitude::UI::Styles::MenuBar::fg "black"; -aptitude::UI::Styles::MenuBar::bg "green"; -aptitude::UI::Styles::MenuBar::set "bold"; -aptitude::UI::Styles::MenuEntry ""; -aptitude::UI::Styles::MenuEntry::fg "black"; -aptitude::UI::Styles::MenuEntry::bg "green"; -aptitude::UI::Styles::Header ""; -aptitude::UI::Styles::Header::fg "black"; -aptitude::UI::Styles::Header::bg "green"; -aptitude::UI::Styles::MultiplexTab ""; -aptitude::UI::Styles::MultiplexTab::fg "black"; -aptitude::UI::Styles::MultiplexTab::bg "green"; -aptitude::UI::Styles::MultiplexTabHighlighted ""; -aptitude::UI::Styles::MultiplexTabHighlighted::fg "black"; -aptitude::UI::Styles::MultiplexTabHighlighted::bg "green"; -aptitude::UI::Styles::MultiplexTabHighlighted::set "bold"; -aptitude::UI::Styles::Status ""; -aptitude::UI::Styles::Status::fg "black"; -aptitude::UI::Styles::Status::bg "green"; -aptitude::UI::Styles::DownloadHit ""; -aptitude::UI::Styles::DownloadHit::fg "green"; -aptitude::UI::Styles::DownloadHit::bg "default"; -aptitude::UI::Styles::DownloadHit::set "bold"; -aptitude::UI::Styles::DownloadProgress ""; -aptitude::UI::Styles::DownloadProgress::fg "green"; -aptitude::UI::Styles::DownloadProgress::bg "default"; -aptitude::UI::Styles::PkgToRemove ""; -aptitude::UI::Styles::PkgToRemove::fg "red"; -aptitude::UI::Styles::PkgToRemove::bg "default"; diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua new file mode 100644 index 0000000..9f9888a --- /dev/null +++ b/awesome/.config/awesome/rc.lua @@ -0,0 +1,459 @@ +-- David Robillard's Awesome Awesome Configuration + +-- Standard awesome library +require("awful") +require("awful.autofocus") +require("awful.rules") +-- Theme handling library +require("beautiful") +-- Notification library +require("naughty") + +-- Widgets library +require("wicked") +require("vicious") + +-- Load Debian menu entries +require("debian.menu") + +-- {{{ 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 +-- }}} + +-- {{{ Variable definitions +-- Themes define colours, icons, and wallpapers +beautiful.init("/home/drobilla/.config/awesome/theme/theme.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "x-terminal-emulator" +editor = os.getenv("EDITOR") or "editor" +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. +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.spiral.dwindle, + awful.layout.suit.max, +-- awful.layout.suit.max.fullscreen, +-- awful.layout.suit.magnifier, + awful.layout.suit.floating +} +-- }}} + +-- {{{ 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[1]) +end +-- }}} + +-- {{{ Menu +-- Create a laucher widget and a main menu +myawesomemenu = { + { "Manual", terminal .. " -e man awesome" }, + { "Configure", editor_cmd .. " " .. awesome.conffile }, + { "Restart", awesome.restart }, + { "Quit", awesome.quit } +} + +mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "Debian", debian.menu.Debian_menu.Debian }, + { "open terminal", terminal } + } + }) + +mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), + menu = mymainmenu }) + +-- }}} + +-- {{{ Wibox + +-- Text clock +mytextclock = awful.widget.textclock({ align = "right"}, + "%a %d %b %H:%M", + 10) + +-- {{{ Reusable separator (space) +separator = widget({ type = "textbox" }) +separator.text = " " +-- }}} + +-- {{{ Reusable separator (bar) +bar = widget({ type = "textbox" }) +bar.text = " : " +-- }}} + +-- Temperature +function get_temps() + local fh = io.popen("/home/drobilla/bin/temps") + local str = "" + for i in fh:lines() do + str = str .. i + end + io.close(fh) + return {str} +end +tempwidget = widget({ type = "textbox", name="tempwidget" }) +--tempwidget.text = " " .. get_temps()[0] .. " " +vicious.register(tempwidget, get_temps, '$1', 4) + +--vicious.register(tempwidget, vicious.widgets.thermal, "$1?C", 20, "thermal_zone0", "proc") +--vicious.register(tempwidget, vicious.widgets.thermal, "$1°", 20, { "coretemp.0", "core" }) +--cputempwidget = widget({ type = "textbox", name = "cputempwidget" }) +--vicious.register(cputempwidget, vicious.widgets.thermal, "$1°C", 20, { "coretemp.0", "core" }) +--hddtempwidget = widget({ type = 'textbox' }) +--vicious.register(hddtempwidget, vicious.widgets.hddtemp, "${/dev/sda} °C", refresh_delay) + +-- Network +-- ethwidget = widget({ type = "textbox" }) +-- vicious.register(ethwidget, vicious.widgets.net, +-- 'Eth ${eth0 down_kb}' .. +-- '/${eth0 up_kb}', 4) +wlanwidget = widget({ type = "textbox" }) +vicious.register(wlanwidget, vicious.widgets.net, +'Wifi ${wlan0 down_kb}' .. +'/${wlan0 up_kb}', 4) + +-- Systray +mysystray = widget({ type = "systray" }) + +-- Create a wibox for each screen and add it +mywibox = {} +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({ }, 3, function () + if instance then + instance:hide() + instance = nil + else + instance = awful.menu.clients({ 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 + -- CPU usage graph + cpuwidget = awful.widget.graph() + cpuwidget:set_width(48) + cpuwidget:set_height(32) + cpuwidget:set_background_color("#494B52") + cpuwidget:set_color("#0092E6") + vicious.cache(vicious.widgets.cpu) + vicious.register(cpuwidget, vicious.widgets.cpu, "$1", 1) + + -- Memory usage graph + memwidget = awful.widget.graph() + memwidget:set_width(48) + memwidget:set_height(32) + memwidget:set_background_color("#49524B") + memwidget:set_color("#AAF5D0") + vicious.cache(vicious.widgets.mem) + vicious.register(memwidget, vicious.widgets.mem, "$1", 1) + + -- 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 wibox + mywibox[s] = awful.wibox({ position = "top", screen = s }) + -- Add widgets to the wibox - order matters + mywibox[s].widgets = { + { + mylauncher, separator, + mytaglist[s], separator, + cpuwidget, separator, + memwidget, separator, bar, + tempwidget, bar, + -- ethwidget, bar, + wlanwidget, bar, + mypromptbox[s], separator, + layout = awful.widget.layout.horizontal.leftright + }, + mylayoutbox[s], separator, + mytextclock, separator, + s == 1 and mysystray or nil, separator, + mytasklist[s], separator, + 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, }, "Left", awful.tag.viewprev ), + --awful.key({ modkey, }, "Right", awful.tag.viewnext ), + awful.key({ modkey, }, "Escape", awful.tag.history.restore), + + awful.key({ modkey, }, "Page_Down", + function () + awful.client.focus.byidx(1) + if client.focus then client.focus:raise() end + end), + awful.key({ modkey, }, "Page_Up", + function () + awful.client.focus.byidx(-1) + if client.focus then client.focus:raise() end + 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, }, "1", function () awful.screen.focus(2) end), + awful.key({ modkey, }, "2", function () awful.screen.focus(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), + + -- Special keys + awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 15") end), + awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 15") end), + awful.key({ }, "XF86KbdBrightnessDown", function () awful.util.spawn("/home/drobilla/bin/kbdled.sh down") end), + awful.key({ }, "XF86KbdBrightnessUp", function () awful.util.spawn("/home/drobilla/bin/kbdled.sh up") end), + awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer sset Master 5%+") end), + awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer sset Master 5%-") end), + awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer sset Master 0%") end), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), + awful.key({ modkey, }, "\\", function () awful.util.spawn("nautilus -n --no-desktop") end), + awful.key({ modkey, "Shift" }, "r", 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, }, "Up", function () awful.tag.incnmaster( 1) end), + awful.key({ modkey, }, "Down", function () awful.tag.incnmaster(-1) end), + awful.key({ modkey, }, "Right", function () awful.tag.incncol( 1) end), + awful.key({ modkey, }, "Left", 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), + + -- Run browser + awful.key({ modkey, "Control" }, "b", function () awful.util.spawn("sensible-browser") end), + + -- Prompt + awful.key({ modkey, "Control" }, "r", function () mypromptbox[mouse.screen]:run() end), + + -- Toggle bar + awful.key({ modkey }, "b", + function () + if mywibox[mouse.screen].screen == nil then + mywibox[mouse.screen].screen = mouse.screen + else + mywibox[mouse.screen].screen = nil + end + end) +) + +-- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them +clientkeys = awful.util.table.join( + awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), + awful.key({ modkey, "Control" }, "c", function (c) c:kill() end), + awful.key({ modkey, "Control" }, "l", awful.client.floating.toggle ), + awful.key({ modkey, "Control" }, "m", 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", awful.client.togglemarked), + 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, + 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.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) +-- }}} diff --git a/awesome/.config/awesome/theme/icon.png b/awesome/.config/awesome/theme/icon.png new file mode 100644 index 0000000..8f2dd73 Binary files /dev/null and b/awesome/.config/awesome/theme/icon.png differ diff --git a/awesome/.config/awesome/theme/submenu.png b/awesome/.config/awesome/theme/submenu.png new file mode 100644 index 0000000..2b60e74 Binary files /dev/null and b/awesome/.config/awesome/theme/submenu.png differ diff --git a/awesome/.config/awesome/theme/theme.lua b/awesome/.config/awesome/theme/theme.lua new file mode 100644 index 0000000..860110e --- /dev/null +++ b/awesome/.config/awesome/theme/theme.lua @@ -0,0 +1,95 @@ +--------------------------------------------- +-- David Robillard's Awesome Awesome Theme -- +--------------------------------------------- + +theme = {} + +theme.font = "Sans 16" + +theme.bg_focus = "#3F3F3F" +theme.bg_minimize = "#444444" +theme.bg_normal = "#202020" +theme.bg_urgent = "#DFFF00" +theme.fg_focus = "#F0F0F0" +theme.fg_minimize = "#ffffff" +theme.fg_normal = "#CCCCCC" +theme.fg_urgent = "#FFFFFF" + +theme.border_focus = "#3F3F3F" +theme.border_marked = "#DFFF00" +theme.border_normal = "#202020" +theme.border_width = "2" + +-- There are other variable sets +-- overriding the default one when +-- defined, the sets are: +-- [taglist|tasklist]_[bg|fg]_[focus|urgent] +-- titlebar_[bg|fg]_[normal|focus] +-- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] +-- mouse_finder_[color|timeout|animate_timeout|radius|factor] +-- Example: +--theme.taglist_bg_focus = "#ff0000" + +-- Display the taglist squares +theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png" +theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png" + +theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" + +-- Variables set for theming the menu: +-- menu_[bg|fg]_[normal|focus] +-- menu_[border_color|border_width] +theme.menu_submenu_icon = "/home/drobilla/.config/awesome/theme/submenu.png" +theme.menu_height = "24" +theme.menu_width = "256" + +-- You can add as many variables as +-- you wish and access them by using +-- beautiful.variable in your rc.lua +--theme.bg_widget = "#cc0000" + +-- Define the image to load +theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png" +theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png" + +theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png" +theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png" +theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png" +theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png" + +theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png" +theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png" +theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png" +theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png" + +theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png" +theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png" +theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png" +theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png" + +theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png" +theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png" +theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png" +theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png" + +-- You can use your own command to set your wallpaper +theme.wallpaper_cmd = { "xsetroot -solid '#202020'" } + +-- You can use your own layout icons like this: +theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png" +theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png" +theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png" +theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png" +theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png" +theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png" +theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png" +theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png" +theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png" +theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png" +theme.layout_spiral = "/usr/share/awesome/themes/default/layouts/spiralw.png" +theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png" + +theme.awesome_icon = "/home/drobilla/.config/awesome/theme/icon.png" + +return theme +-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/awesome/rc.lua b/awesome/rc.lua deleted file mode 100644 index 9f9888a..0000000 --- a/awesome/rc.lua +++ /dev/null @@ -1,459 +0,0 @@ --- David Robillard's Awesome Awesome Configuration - --- Standard awesome library -require("awful") -require("awful.autofocus") -require("awful.rules") --- Theme handling library -require("beautiful") --- Notification library -require("naughty") - --- Widgets library -require("wicked") -require("vicious") - --- Load Debian menu entries -require("debian.menu") - --- {{{ 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 --- }}} - --- {{{ Variable definitions --- Themes define colours, icons, and wallpapers -beautiful.init("/home/drobilla/.config/awesome/theme/theme.lua") - --- This is used later as the default terminal and editor to run. -terminal = "x-terminal-emulator" -editor = os.getenv("EDITOR") or "editor" -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. -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.spiral.dwindle, - awful.layout.suit.max, --- awful.layout.suit.max.fullscreen, --- awful.layout.suit.magnifier, - awful.layout.suit.floating -} --- }}} - --- {{{ 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[1]) -end --- }}} - --- {{{ Menu --- Create a laucher widget and a main menu -myawesomemenu = { - { "Manual", terminal .. " -e man awesome" }, - { "Configure", editor_cmd .. " " .. awesome.conffile }, - { "Restart", awesome.restart }, - { "Quit", awesome.quit } -} - -mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, - { "Debian", debian.menu.Debian_menu.Debian }, - { "open terminal", terminal } - } - }) - -mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon), - menu = mymainmenu }) - --- }}} - --- {{{ Wibox - --- Text clock -mytextclock = awful.widget.textclock({ align = "right"}, - "%a %d %b %H:%M", - 10) - --- {{{ Reusable separator (space) -separator = widget({ type = "textbox" }) -separator.text = " " --- }}} - --- {{{ Reusable separator (bar) -bar = widget({ type = "textbox" }) -bar.text = " : " --- }}} - --- Temperature -function get_temps() - local fh = io.popen("/home/drobilla/bin/temps") - local str = "" - for i in fh:lines() do - str = str .. i - end - io.close(fh) - return {str} -end -tempwidget = widget({ type = "textbox", name="tempwidget" }) ---tempwidget.text = " " .. get_temps()[0] .. " " -vicious.register(tempwidget, get_temps, '$1', 4) - ---vicious.register(tempwidget, vicious.widgets.thermal, "$1?C", 20, "thermal_zone0", "proc") ---vicious.register(tempwidget, vicious.widgets.thermal, "$1°", 20, { "coretemp.0", "core" }) ---cputempwidget = widget({ type = "textbox", name = "cputempwidget" }) ---vicious.register(cputempwidget, vicious.widgets.thermal, "$1°C", 20, { "coretemp.0", "core" }) ---hddtempwidget = widget({ type = 'textbox' }) ---vicious.register(hddtempwidget, vicious.widgets.hddtemp, "${/dev/sda} °C", refresh_delay) - --- Network --- ethwidget = widget({ type = "textbox" }) --- vicious.register(ethwidget, vicious.widgets.net, --- 'Eth ${eth0 down_kb}' .. --- '/${eth0 up_kb}', 4) -wlanwidget = widget({ type = "textbox" }) -vicious.register(wlanwidget, vicious.widgets.net, -'Wifi ${wlan0 down_kb}' .. -'/${wlan0 up_kb}', 4) - --- Systray -mysystray = widget({ type = "systray" }) - --- Create a wibox for each screen and add it -mywibox = {} -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({ }, 3, function () - if instance then - instance:hide() - instance = nil - else - instance = awful.menu.clients({ 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 - -- CPU usage graph - cpuwidget = awful.widget.graph() - cpuwidget:set_width(48) - cpuwidget:set_height(32) - cpuwidget:set_background_color("#494B52") - cpuwidget:set_color("#0092E6") - vicious.cache(vicious.widgets.cpu) - vicious.register(cpuwidget, vicious.widgets.cpu, "$1", 1) - - -- Memory usage graph - memwidget = awful.widget.graph() - memwidget:set_width(48) - memwidget:set_height(32) - memwidget:set_background_color("#49524B") - memwidget:set_color("#AAF5D0") - vicious.cache(vicious.widgets.mem) - vicious.register(memwidget, vicious.widgets.mem, "$1", 1) - - -- 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 wibox - mywibox[s] = awful.wibox({ position = "top", screen = s }) - -- Add widgets to the wibox - order matters - mywibox[s].widgets = { - { - mylauncher, separator, - mytaglist[s], separator, - cpuwidget, separator, - memwidget, separator, bar, - tempwidget, bar, - -- ethwidget, bar, - wlanwidget, bar, - mypromptbox[s], separator, - layout = awful.widget.layout.horizontal.leftright - }, - mylayoutbox[s], separator, - mytextclock, separator, - s == 1 and mysystray or nil, separator, - mytasklist[s], separator, - 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, }, "Left", awful.tag.viewprev ), - --awful.key({ modkey, }, "Right", awful.tag.viewnext ), - awful.key({ modkey, }, "Escape", awful.tag.history.restore), - - awful.key({ modkey, }, "Page_Down", - function () - awful.client.focus.byidx(1) - if client.focus then client.focus:raise() end - end), - awful.key({ modkey, }, "Page_Up", - function () - awful.client.focus.byidx(-1) - if client.focus then client.focus:raise() end - 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, }, "1", function () awful.screen.focus(2) end), - awful.key({ modkey, }, "2", function () awful.screen.focus(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), - - -- Special keys - awful.key({ }, "XF86MonBrightnessDown", function () awful.util.spawn("xbacklight -dec 15") end), - awful.key({ }, "XF86MonBrightnessUp", function () awful.util.spawn("xbacklight -inc 15") end), - awful.key({ }, "XF86KbdBrightnessDown", function () awful.util.spawn("/home/drobilla/bin/kbdled.sh down") end), - awful.key({ }, "XF86KbdBrightnessUp", function () awful.util.spawn("/home/drobilla/bin/kbdled.sh up") end), - awful.key({ }, "XF86AudioRaiseVolume", function () awful.util.spawn("amixer sset Master 5%+") end), - awful.key({ }, "XF86AudioLowerVolume", function () awful.util.spawn("amixer sset Master 5%-") end), - awful.key({ }, "XF86AudioMute", function () awful.util.spawn("amixer sset Master 0%") end), - - -- Standard program - awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end), - awful.key({ modkey, }, "\\", function () awful.util.spawn("nautilus -n --no-desktop") end), - awful.key({ modkey, "Shift" }, "r", 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, }, "Up", function () awful.tag.incnmaster( 1) end), - awful.key({ modkey, }, "Down", function () awful.tag.incnmaster(-1) end), - awful.key({ modkey, }, "Right", function () awful.tag.incncol( 1) end), - awful.key({ modkey, }, "Left", 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), - - -- Run browser - awful.key({ modkey, "Control" }, "b", function () awful.util.spawn("sensible-browser") end), - - -- Prompt - awful.key({ modkey, "Control" }, "r", function () mypromptbox[mouse.screen]:run() end), - - -- Toggle bar - awful.key({ modkey }, "b", - function () - if mywibox[mouse.screen].screen == nil then - mywibox[mouse.screen].screen = mouse.screen - else - mywibox[mouse.screen].screen = nil - end - end) -) - --- Client awful tagging: this is useful to tag some clients and then do stuff like move to tag on them -clientkeys = awful.util.table.join( - awful.key({ modkey, }, "f", function (c) c.fullscreen = not c.fullscreen end), - awful.key({ modkey, "Control" }, "c", function (c) c:kill() end), - awful.key({ modkey, "Control" }, "l", awful.client.floating.toggle ), - awful.key({ modkey, "Control" }, "m", 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", awful.client.togglemarked), - 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, - 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.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) --- }}} diff --git a/awesome/theme/icon.png b/awesome/theme/icon.png deleted file mode 100644 index 8f2dd73..0000000 Binary files a/awesome/theme/icon.png and /dev/null differ diff --git a/awesome/theme/submenu.png b/awesome/theme/submenu.png deleted file mode 100644 index 2b60e74..0000000 Binary files a/awesome/theme/submenu.png and /dev/null differ diff --git a/awesome/theme/theme.lua b/awesome/theme/theme.lua deleted file mode 100644 index 860110e..0000000 --- a/awesome/theme/theme.lua +++ /dev/null @@ -1,95 +0,0 @@ ---------------------------------------------- --- David Robillard's Awesome Awesome Theme -- ---------------------------------------------- - -theme = {} - -theme.font = "Sans 16" - -theme.bg_focus = "#3F3F3F" -theme.bg_minimize = "#444444" -theme.bg_normal = "#202020" -theme.bg_urgent = "#DFFF00" -theme.fg_focus = "#F0F0F0" -theme.fg_minimize = "#ffffff" -theme.fg_normal = "#CCCCCC" -theme.fg_urgent = "#FFFFFF" - -theme.border_focus = "#3F3F3F" -theme.border_marked = "#DFFF00" -theme.border_normal = "#202020" -theme.border_width = "2" - --- There are other variable sets --- overriding the default one when --- defined, the sets are: --- [taglist|tasklist]_[bg|fg]_[focus|urgent] --- titlebar_[bg|fg]_[normal|focus] --- tooltip_[font|opacity|fg_color|bg_color|border_width|border_color] --- mouse_finder_[color|timeout|animate_timeout|radius|factor] --- Example: ---theme.taglist_bg_focus = "#ff0000" - --- Display the taglist squares -theme.taglist_squares_sel = "/usr/share/awesome/themes/default/taglist/squarefw.png" -theme.taglist_squares_unsel = "/usr/share/awesome/themes/default/taglist/squarew.png" - -theme.tasklist_floating_icon = "/usr/share/awesome/themes/default/tasklist/floatingw.png" - --- Variables set for theming the menu: --- menu_[bg|fg]_[normal|focus] --- menu_[border_color|border_width] -theme.menu_submenu_icon = "/home/drobilla/.config/awesome/theme/submenu.png" -theme.menu_height = "24" -theme.menu_width = "256" - --- You can add as many variables as --- you wish and access them by using --- beautiful.variable in your rc.lua ---theme.bg_widget = "#cc0000" - --- Define the image to load -theme.titlebar_close_button_normal = "/usr/share/awesome/themes/default/titlebar/close_normal.png" -theme.titlebar_close_button_focus = "/usr/share/awesome/themes/default/titlebar/close_focus.png" - -theme.titlebar_ontop_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_normal_inactive.png" -theme.titlebar_ontop_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/ontop_focus_inactive.png" -theme.titlebar_ontop_button_normal_active = "/usr/share/awesome/themes/default/titlebar/ontop_normal_active.png" -theme.titlebar_ontop_button_focus_active = "/usr/share/awesome/themes/default/titlebar/ontop_focus_active.png" - -theme.titlebar_sticky_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_normal_inactive.png" -theme.titlebar_sticky_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/sticky_focus_inactive.png" -theme.titlebar_sticky_button_normal_active = "/usr/share/awesome/themes/default/titlebar/sticky_normal_active.png" -theme.titlebar_sticky_button_focus_active = "/usr/share/awesome/themes/default/titlebar/sticky_focus_active.png" - -theme.titlebar_floating_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/floating_normal_inactive.png" -theme.titlebar_floating_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/floating_focus_inactive.png" -theme.titlebar_floating_button_normal_active = "/usr/share/awesome/themes/default/titlebar/floating_normal_active.png" -theme.titlebar_floating_button_focus_active = "/usr/share/awesome/themes/default/titlebar/floating_focus_active.png" - -theme.titlebar_maximized_button_normal_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_normal_inactive.png" -theme.titlebar_maximized_button_focus_inactive = "/usr/share/awesome/themes/default/titlebar/maximized_focus_inactive.png" -theme.titlebar_maximized_button_normal_active = "/usr/share/awesome/themes/default/titlebar/maximized_normal_active.png" -theme.titlebar_maximized_button_focus_active = "/usr/share/awesome/themes/default/titlebar/maximized_focus_active.png" - --- You can use your own command to set your wallpaper -theme.wallpaper_cmd = { "xsetroot -solid '#202020'" } - --- You can use your own layout icons like this: -theme.layout_fairh = "/usr/share/awesome/themes/default/layouts/fairhw.png" -theme.layout_fairv = "/usr/share/awesome/themes/default/layouts/fairvw.png" -theme.layout_floating = "/usr/share/awesome/themes/default/layouts/floatingw.png" -theme.layout_magnifier = "/usr/share/awesome/themes/default/layouts/magnifierw.png" -theme.layout_max = "/usr/share/awesome/themes/default/layouts/maxw.png" -theme.layout_fullscreen = "/usr/share/awesome/themes/default/layouts/fullscreenw.png" -theme.layout_tilebottom = "/usr/share/awesome/themes/default/layouts/tilebottomw.png" -theme.layout_tileleft = "/usr/share/awesome/themes/default/layouts/tileleftw.png" -theme.layout_tile = "/usr/share/awesome/themes/default/layouts/tilew.png" -theme.layout_tiletop = "/usr/share/awesome/themes/default/layouts/tiletopw.png" -theme.layout_spiral = "/usr/share/awesome/themes/default/layouts/spiralw.png" -theme.layout_dwindle = "/usr/share/awesome/themes/default/layouts/dwindlew.png" - -theme.awesome_icon = "/home/drobilla/.config/awesome/theme/icon.png" - -return theme --- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80 diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..79a718d --- /dev/null +++ b/bash/.bashrc @@ -0,0 +1,101 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. +HISTCONTROL=ignoreboth + +# append to the history file, don't overwrite it +shopt -s histappend + +# set big history +export HISTSIZE=100000 +export HISTFILESIZE=$HISTSIZE + +# append to history after each command finishes +export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set fancy prompt +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # color supported + #PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]╭─ \u@\h \w ─╼\n╰╼ \$\[\033[00m\] " + PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]\u@\h \w\n\$\[\033[00m\] " +else + # no color + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi + +# set xterm title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of various utilities +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# ever seen a monochrome xterm? I sure haven't +if [ "$TERM" = "xterm" ]; then + export TERM=xterm-256color +fi + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi + +# aliases +alias svn='colorsvn' + +# environment +export LC_MEASUREMENT="en_CA.UTF-8" +export LC_MONETARY="en_CA.UTF-8" +export LC_NUMERIC="en_CA.UTF-8" +export LC_PAPER="en_CA.UTF-8" +export LC_TIME="en_DK.UTF-8" +export WINDOW_MANAGER="/usr/bin/awesome" +export CFLAGS="-O2 -march=native -fomit-frame-pointer -DNDEBUG -ftree-vectorize" +export CXXFLAGS="$CFLAGS" +export GTK_IM_MODULE="xim" +export EDITOR="emacsclient" +export CXX=/usr/lib/ccache/g++-6 +export CC=/usr/lib/ccache/gcc-6 + +# colorize man +man() { + env \ + LESS_TERMCAP_mb=$(printf "\e[31m") \ + LESS_TERMCAP_md=$(printf "\e[1;32m") \ + LESS_TERMCAP_me=$(printf "\e[0m") \ + LESS_TERMCAP_se=$(printf "\e[0m") \ + LESS_TERMCAP_so=$(printf "\e[36m") \ + LESS_TERMCAP_ue=$(printf "\e[0m") \ + LESS_TERMCAP_us=$(printf "\e[33m") \ + man "$@" +} + +# set PATH so it includes user's private bin if it exists +if [ -d "$HOME/bin" ] ; then + PATH="$HOME/bin:$PATH" +fi diff --git a/bashrc b/bashrc deleted file mode 100644 index 79a718d..0000000 --- a/bashrc +++ /dev/null @@ -1,101 +0,0 @@ -# ~/.bashrc: executed by bash(1) for non-login shells. - -# If not running interactively, don't do anything -[ -z "$PS1" ] && return - -# don't put duplicate lines in the history. -HISTCONTROL=ignoreboth - -# append to the history file, don't overwrite it -shopt -s histappend - -# set big history -export HISTSIZE=100000 -export HISTFILESIZE=$HISTSIZE - -# append to history after each command finishes -export PROMPT_COMMAND="history -a; $PROMPT_COMMAND" - -# check the window size after each command and, if necessary, -# update the values of LINES and COLUMNS. -shopt -s checkwinsize - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# set fancy prompt -if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then - # color supported - #PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]╭─ \u@\h \w ─╼\n╰╼ \$\[\033[00m\] " - PS1="\[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[32m\]\u@\h \w\n\$\[\033[00m\] " -else - # no color - PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' -fi - -# set xterm title to user@host:dir -case "$TERM" in -xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; -*) - ;; -esac - -# enable color support of various utilities -if [ -x /usr/bin/dircolors ]; then - test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" - alias ls='ls --color=auto' - alias grep='grep --color=auto' - alias fgrep='fgrep --color=auto' - alias egrep='egrep --color=auto' -fi - -# ever seen a monochrome xterm? I sure haven't -if [ "$TERM" = "xterm" ]; then - export TERM=xterm-256color -fi - -# enable programmable completion features (you don't need to enable -# this, if it's already enabled in /etc/bash.bashrc and /etc/profile -# sources /etc/bash.bashrc). -if [ -f /etc/bash_completion ] && ! shopt -oq posix; then - . /etc/bash_completion -fi - -# aliases -alias svn='colorsvn' - -# environment -export LC_MEASUREMENT="en_CA.UTF-8" -export LC_MONETARY="en_CA.UTF-8" -export LC_NUMERIC="en_CA.UTF-8" -export LC_PAPER="en_CA.UTF-8" -export LC_TIME="en_DK.UTF-8" -export WINDOW_MANAGER="/usr/bin/awesome" -export CFLAGS="-O2 -march=native -fomit-frame-pointer -DNDEBUG -ftree-vectorize" -export CXXFLAGS="$CFLAGS" -export GTK_IM_MODULE="xim" -export EDITOR="emacsclient" -export CXX=/usr/lib/ccache/g++-6 -export CC=/usr/lib/ccache/gcc-6 - -# colorize man -man() { - env \ - LESS_TERMCAP_mb=$(printf "\e[31m") \ - LESS_TERMCAP_md=$(printf "\e[1;32m") \ - LESS_TERMCAP_me=$(printf "\e[0m") \ - LESS_TERMCAP_se=$(printf "\e[0m") \ - LESS_TERMCAP_so=$(printf "\e[36m") \ - LESS_TERMCAP_ue=$(printf "\e[0m") \ - LESS_TERMCAP_us=$(printf "\e[33m") \ - man "$@" -} - -# set PATH so it includes user's private bin if it exists -if [ -d "$HOME/bin" ] ; then - PATH="$HOME/bin:$PATH" -fi diff --git a/bspwm/.config/bspwm/bspwmrc b/bspwm/.config/bspwm/bspwmrc new file mode 100755 index 0000000..1485f63 --- /dev/null +++ b/bspwm/.config/bspwm/bspwmrc @@ -0,0 +1,31 @@ +#! /bin/sh + +export PANEL_FIFO=/home/drobilla/bspwmpanel.fifo +export PANEL_HEIGHT=48 +export PANEL_FONT="DejaVu Sans Mono-16" +export TRAY_HEIGHT=28 +export SCREEN_WIDTH="$(xrandr | grep '*' | sed 's/ *\([0-9]*\)x.*/\1/')" +export TRAY_X="$(echo "$SCREEN_WIDTH - 300" | bc)" +export TRAY_Y=4 + +bspc config border_width 2 +bspc config window_gap 12 + +bspc config split_ratio 0.50 +bspc config borderless_monocle true +bspc config gapless_monocle true +bspc config focus_by_distance true + +bspc config normal_border_color "#2D3232" +bspc config focused_border_color "#6F7372" +bspc config top_padding $PANEL_HEIGHT +bspc config focus_follows_pointer true + +bspc monitor -d 1 2 3 4 5 6 7 8 9 + +hsetroot -solid "#000" +xmodmap ~/.Xmodmap +sxhkd & +#~/.config/bspwm/panel & +#stalonetray -bg "#000" --geometry "1x1+$TRAY_X+$TRAY_Y" --grow-gravity E -i $TRAY_HEIGHT & +#xdotool search --classname stalonetray windowraise diff --git a/bspwm/.config/bspwm/panel b/bspwm/.config/bspwm/panel new file mode 100755 index 0000000..ca1ae02 --- /dev/null +++ b/bspwm/.config/bspwm/panel @@ -0,0 +1,100 @@ +#! /bin/sh + +export COLOR_FOREGROUND='#FFCCCCCC' +export COLOR_BACKGROUND='#FF000000' +export COLOR_ACTIVE_MONITOR_FG='#FF000000' +export COLOR_ACTIVE_MONITOR_BG='#FF000000' +export COLOR_INACTIVE_MONITOR_FG='#FF58C5F1' +export COLOR_INACTIVE_MONITOR_BG='#FF000000' +export COLOR_FOCUSED_OCCUPIED_FG='#FFF6F9FF' +export COLOR_FOCUSED_OCCUPIED_BG='#FF000000' +export COLOR_FOCUSED_FREE_FG='#FFF6F9FF' +export COLOR_FOCUSED_FREE_BG='#FF000000' +export COLOR_FOCUSED_URGENT_FG='#FF000000' +export COLOR_FOCUSED_URGENT_BG='#FFF9A299' +export COLOR_OCCUPIED_FG='#FFA3A6AB' +export COLOR_OCCUPIED_BG='#FF000000' +export COLOR_FREE_FG='#FF6F7277' +export COLOR_FREE_BG='#FF000000' +export COLOR_URGENT_FG='#FFF9A299' +export COLOR_URGENT_BG='#FF000000' +export COLOR_LAYOUT_FG='#FFA3A6AB' +export COLOR_LAYOUT_BG='#FF000000' +export COLOR_TITLE_FG='#FFDDDDDD' +export COLOR_TITLE_BG='#FF000000' +export COLOR_STATUS_FG='#FFCCCCCC' +export COLOR_STATUS_BG='#FF000000' +export COLOR_STATUS_READ="#859900" +export COLOR_STATUS_WRITE="#990A1B" + +if [ $(pgrep -cx panel) -gt 1 ] ; then + printf "%s\n" "The panel is already running." >&2 + exit 1 +fi + +trap 'trap - TERM; kill 0' INT TERM QUIT EXIT + +[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" +mkfifo "$PANEL_FIFO" + +bspc config top_padding $PANEL_HEIGHT +bspc control --subscribe > "$PANEL_FIFO" & +xtitle -sf 'T%s' > "$PANEL_FIFO" & +clock -sf 'S%a %Y-%m-%d %H:%M' > "$PANEL_FIFO" & +LC_TIME=en_DK.UTF-8 mpstat 1 | stdbuf -oL tail -n +4 | stdbuf -oL awk '$12 ~ /[0-9.]+/ { printf "L%3d\n", 100 - $12 }' > "$PANEL_FIFO" & +free -m -s 1 | stdbuf -oL awk '/^Mem:.*/ { printf "M%02d%%\n", $3 / $2 * 100 }' > "$PANEL_FIFO" & +iostat -y -d 1 | stdbuf -oL awk '/Device.*/ { printf("\nI"); next } /^[0-9a-z]* / { printf " %s %04.0f↓ %04.0f↑", $1, $3, $4 } END { printf "\n" }' > "$PANEL_FIFO" & + +# Battery +while :; do + acpi -b | sed 's/.*, /B/' > "$PANEL_FIFO" + sleep 5 +done & + +# Temperature +while :; do + cat /sys/devices/virtual/thermal/thermal_zone0/temp | sed 's/[0-9][0-9][0-9]$//' | sed 's/^/C/' > "$PANEL_FIFO" + sleep 2 +done & + +# Network throughput +while :; do + net_info=$( + ip -4 -o addr show | grep -v ' lo ' | + while read line; do + iface=$(echo $line | cut -d ' ' -f 2); + # addr=$(echo $line | cut -d ' ' -f 4 | sed 's/\/.*//'); + + if [ ! -d /sys/class/net/$iface ]; then + sleep 1; + continue; + fi + + rf=/sys/class/net/$iface/statistics/rx_bytes; + tf=/sys/class/net/$iface/statistics/tx_bytes; + + # Get RX and TX bytes then sleep for ~1 second + r1=`cat $rf`; + t1=`cat $tf`; + sleep 1 + + # Get RX and TX bytes and print rates in KBPS + r2=`cat $rf`; + t2=`cat $tf`; + rr="$(((r2-r1)/1024))"; + tr="$(((t2-t1)/1024))"; + # printf "$iface $addr %04.0f↓ %04.0f↑ " $rr $tr + printf "$iface %04.0f↓ %04.0f↑ " $rr $tr + done) + if [ -z "$net_info" ]; then + sleep 5; + else + echo "N$net_info" > "$PANEL_FIFO" + fi +done & + +#. ./panel_colors + +cat "$PANEL_FIFO" | ~/.config/bspwm/panel_bar | lemonbar -g x$PANEL_HEIGHT -f "$PANEL_FONT" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" & + +wait diff --git a/bspwm/.config/bspwm/panel_bar b/bspwm/.config/bspwm/panel_bar new file mode 100755 index 0000000..bf0fc6d --- /dev/null +++ b/bspwm/.config/bspwm/panel_bar @@ -0,0 +1,96 @@ +#! /bin/sh + +#. panel_colors + +n_monitors=$(bspc query -M | wc -l) + +while read -r line ; do + case $line in + S*) + # Clock + sys_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + T*) + # Title + title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}%{B-}%{F-}" + ;; + I*) + # IO + io_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + B*) + # Battery + bat_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + C*) + # CPU temperature + temp_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}°%{B-}%{F-}" + ;; + L*) + # CPU load + load_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%%{B-}%{F-}" + ;; + M*) + # Memory usage + mem_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + N*) + # Network throughput + net_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" + ;; + W*) + # Window manager state + wm_info="" + IFS=':' + set -- ${line#?} + while [ $# -gt 0 ] ; do + item=$1 + name=${item#?} + case $item in + M*) + # active monitor + if [ $n_monitors -gt 1 ] ; then + wm_info="$wm_info %{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_ACTIVE_MONITOR_BG}${name} %{B-}%{F-} " + fi + ;; + m*) + # inactive monitor + if [ $n_monitors -gt 1 ] ; then + wm_info="$wm_info %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG}${name}%{B-}%{F-} " + fi + ;; + O*) + # focused occupied desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + F*) + # focused free desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + U*) + # focused urgent desktop + wm_info="${wm_info}%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " + ;; + o*) + # occupied desktop + wm_info="${wm_info}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}%{B-}%{F-} " + ;; + f*) + # free desktop + wm_info="${wm_info}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}%{B-}%{F-} " + ;; + u*) + # urgent desktop + wm_info="${wm_info}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}%{B-}%{F-} " + ;; + L*) + # layout + wm_info="$wm_info%{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}${name}%{B-}%{F-}" + ;; + esac + shift + done + ;; + esac + printf "%s\n" "%{l}${wm_info} cpu ${load_info} ${temp_info} mem ${mem_info} ${io_info} ${net_info} bat ${bat_info} %{c} ${title} %{r} ${sys_info}" +done diff --git a/bspwm/bspwmrc b/bspwm/bspwmrc deleted file mode 100755 index 1485f63..0000000 --- a/bspwm/bspwmrc +++ /dev/null @@ -1,31 +0,0 @@ -#! /bin/sh - -export PANEL_FIFO=/home/drobilla/bspwmpanel.fifo -export PANEL_HEIGHT=48 -export PANEL_FONT="DejaVu Sans Mono-16" -export TRAY_HEIGHT=28 -export SCREEN_WIDTH="$(xrandr | grep '*' | sed 's/ *\([0-9]*\)x.*/\1/')" -export TRAY_X="$(echo "$SCREEN_WIDTH - 300" | bc)" -export TRAY_Y=4 - -bspc config border_width 2 -bspc config window_gap 12 - -bspc config split_ratio 0.50 -bspc config borderless_monocle true -bspc config gapless_monocle true -bspc config focus_by_distance true - -bspc config normal_border_color "#2D3232" -bspc config focused_border_color "#6F7372" -bspc config top_padding $PANEL_HEIGHT -bspc config focus_follows_pointer true - -bspc monitor -d 1 2 3 4 5 6 7 8 9 - -hsetroot -solid "#000" -xmodmap ~/.Xmodmap -sxhkd & -#~/.config/bspwm/panel & -#stalonetray -bg "#000" --geometry "1x1+$TRAY_X+$TRAY_Y" --grow-gravity E -i $TRAY_HEIGHT & -#xdotool search --classname stalonetray windowraise diff --git a/bspwm/panel b/bspwm/panel deleted file mode 100755 index ca1ae02..0000000 --- a/bspwm/panel +++ /dev/null @@ -1,100 +0,0 @@ -#! /bin/sh - -export COLOR_FOREGROUND='#FFCCCCCC' -export COLOR_BACKGROUND='#FF000000' -export COLOR_ACTIVE_MONITOR_FG='#FF000000' -export COLOR_ACTIVE_MONITOR_BG='#FF000000' -export COLOR_INACTIVE_MONITOR_FG='#FF58C5F1' -export COLOR_INACTIVE_MONITOR_BG='#FF000000' -export COLOR_FOCUSED_OCCUPIED_FG='#FFF6F9FF' -export COLOR_FOCUSED_OCCUPIED_BG='#FF000000' -export COLOR_FOCUSED_FREE_FG='#FFF6F9FF' -export COLOR_FOCUSED_FREE_BG='#FF000000' -export COLOR_FOCUSED_URGENT_FG='#FF000000' -export COLOR_FOCUSED_URGENT_BG='#FFF9A299' -export COLOR_OCCUPIED_FG='#FFA3A6AB' -export COLOR_OCCUPIED_BG='#FF000000' -export COLOR_FREE_FG='#FF6F7277' -export COLOR_FREE_BG='#FF000000' -export COLOR_URGENT_FG='#FFF9A299' -export COLOR_URGENT_BG='#FF000000' -export COLOR_LAYOUT_FG='#FFA3A6AB' -export COLOR_LAYOUT_BG='#FF000000' -export COLOR_TITLE_FG='#FFDDDDDD' -export COLOR_TITLE_BG='#FF000000' -export COLOR_STATUS_FG='#FFCCCCCC' -export COLOR_STATUS_BG='#FF000000' -export COLOR_STATUS_READ="#859900" -export COLOR_STATUS_WRITE="#990A1B" - -if [ $(pgrep -cx panel) -gt 1 ] ; then - printf "%s\n" "The panel is already running." >&2 - exit 1 -fi - -trap 'trap - TERM; kill 0' INT TERM QUIT EXIT - -[ -e "$PANEL_FIFO" ] && rm "$PANEL_FIFO" -mkfifo "$PANEL_FIFO" - -bspc config top_padding $PANEL_HEIGHT -bspc control --subscribe > "$PANEL_FIFO" & -xtitle -sf 'T%s' > "$PANEL_FIFO" & -clock -sf 'S%a %Y-%m-%d %H:%M' > "$PANEL_FIFO" & -LC_TIME=en_DK.UTF-8 mpstat 1 | stdbuf -oL tail -n +4 | stdbuf -oL awk '$12 ~ /[0-9.]+/ { printf "L%3d\n", 100 - $12 }' > "$PANEL_FIFO" & -free -m -s 1 | stdbuf -oL awk '/^Mem:.*/ { printf "M%02d%%\n", $3 / $2 * 100 }' > "$PANEL_FIFO" & -iostat -y -d 1 | stdbuf -oL awk '/Device.*/ { printf("\nI"); next } /^[0-9a-z]* / { printf " %s %04.0f↓ %04.0f↑", $1, $3, $4 } END { printf "\n" }' > "$PANEL_FIFO" & - -# Battery -while :; do - acpi -b | sed 's/.*, /B/' > "$PANEL_FIFO" - sleep 5 -done & - -# Temperature -while :; do - cat /sys/devices/virtual/thermal/thermal_zone0/temp | sed 's/[0-9][0-9][0-9]$//' | sed 's/^/C/' > "$PANEL_FIFO" - sleep 2 -done & - -# Network throughput -while :; do - net_info=$( - ip -4 -o addr show | grep -v ' lo ' | - while read line; do - iface=$(echo $line | cut -d ' ' -f 2); - # addr=$(echo $line | cut -d ' ' -f 4 | sed 's/\/.*//'); - - if [ ! -d /sys/class/net/$iface ]; then - sleep 1; - continue; - fi - - rf=/sys/class/net/$iface/statistics/rx_bytes; - tf=/sys/class/net/$iface/statistics/tx_bytes; - - # Get RX and TX bytes then sleep for ~1 second - r1=`cat $rf`; - t1=`cat $tf`; - sleep 1 - - # Get RX and TX bytes and print rates in KBPS - r2=`cat $rf`; - t2=`cat $tf`; - rr="$(((r2-r1)/1024))"; - tr="$(((t2-t1)/1024))"; - # printf "$iface $addr %04.0f↓ %04.0f↑ " $rr $tr - printf "$iface %04.0f↓ %04.0f↑ " $rr $tr - done) - if [ -z "$net_info" ]; then - sleep 5; - else - echo "N$net_info" > "$PANEL_FIFO" - fi -done & - -#. ./panel_colors - -cat "$PANEL_FIFO" | ~/.config/bspwm/panel_bar | lemonbar -g x$PANEL_HEIGHT -f "$PANEL_FONT" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND" & - -wait diff --git a/bspwm/panel_bar b/bspwm/panel_bar deleted file mode 100755 index bf0fc6d..0000000 --- a/bspwm/panel_bar +++ /dev/null @@ -1,96 +0,0 @@ -#! /bin/sh - -#. panel_colors - -n_monitors=$(bspc query -M | wc -l) - -while read -r line ; do - case $line in - S*) - # Clock - sys_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" - ;; - T*) - # Title - title="%{F$COLOR_TITLE_FG}%{B$COLOR_TITLE_BG}${line#?}%{B-}%{F-}" - ;; - I*) - # IO - io_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" - ;; - B*) - # Battery - bat_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" - ;; - C*) - # CPU temperature - temp_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}°%{B-}%{F-}" - ;; - L*) - # CPU load - load_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%%{B-}%{F-}" - ;; - M*) - # Memory usage - mem_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" - ;; - N*) - # Network throughput - net_info="%{F$COLOR_STATUS_FG}%{B$COLOR_STATUS_BG}${line#?}%{B-}%{F-}" - ;; - W*) - # Window manager state - wm_info="" - IFS=':' - set -- ${line#?} - while [ $# -gt 0 ] ; do - item=$1 - name=${item#?} - case $item in - M*) - # active monitor - if [ $n_monitors -gt 1 ] ; then - wm_info="$wm_info %{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_ACTIVE_MONITOR_BG}${name} %{B-}%{F-} " - fi - ;; - m*) - # inactive monitor - if [ $n_monitors -gt 1 ] ; then - wm_info="$wm_info %{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG}${name}%{B-}%{F-} " - fi - ;; - O*) - # focused occupied desktop - wm_info="${wm_info}%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " - ;; - F*) - # focused free desktop - wm_info="${wm_info}%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " - ;; - U*) - # focused urgent desktop - wm_info="${wm_info}%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_FOREGROUND}%{+u}${name}%{-u}%{B-}%{F-} " - ;; - o*) - # occupied desktop - wm_info="${wm_info}%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}${name}%{B-}%{F-} " - ;; - f*) - # free desktop - wm_info="${wm_info}%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}${name}%{B-}%{F-} " - ;; - u*) - # urgent desktop - wm_info="${wm_info}%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}${name}%{B-}%{F-} " - ;; - L*) - # layout - wm_info="$wm_info%{F$COLOR_LAYOUT_FG}%{B$COLOR_LAYOUT_BG}${name}%{B-}%{F-}" - ;; - esac - shift - done - ;; - esac - printf "%s\n" "%{l}${wm_info} cpu ${load_info} ${temp_info} mem ${mem_info} ${io_info} ${net_info} bat ${bat_info} %{c} ${title} %{r} ${sys_info}" -done diff --git a/conky/.conkyrc b/conky/.conkyrc new file mode 100644 index 0000000..c7dc5ba --- /dev/null +++ b/conky/.conkyrc @@ -0,0 +1,77 @@ +conky.config = { + -- conkyrc + + alignment = 'top_left', + border_inner_margin = 1, + border_outer_margin = 0, + border_width = 0, + + -- color of active workspace + color1 = '#4E9A40', + + -- inactive workspaces and divider color + color2 = '#808080', + + -- workspaces which have windows but aren't focused + color3 = '#808020', + + -- urgency hinting color + color4 = '#f9d72d', + + -- color of temps and percentages + color5 = '#8F8F00', + + -- Graph outlines + color6 = '#3F3B3B', + + default_color = '#3F3B3B', + double_buffer = true, + draw_borders = true, + draw_graph_borders = true, + draw_shades = false, + gap_x = 13, + gap_y = 6, + + -- adjust to the width of your screen + maximum_width = 2854, + minimum_width = 2854, + minimum_height = 0, + + own_window = true, + own_window_argb_visual = false, + + -- bar background color + own_window_colour = '#000', + + own_window_type = 'panel', + own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', + pad_percents = 2, + update_interval = 1, + use_spacer = 'right', + use_xft = true, + --xftalpha = .2, + + -- choose font and size + font = 'Monospace:size=16', + +}; + +conky.text = [[ +${execp bspc control --get-status | cut -d ":" -f 2 | xargs ~/bin/workspaces.sh}\ +\ +${color2}${alignc}CPU $color6${voffset 3}${cpugraph 20,34 859900 DC322F -t}${voffset -3}${offset 7}$color2\ +${execp echo $(cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon*/temp1_input) / 1000 | bc}°\ +\ + Mem $color6${voffset 2}${memgraph 22,34 859900 DC322F -t}${voffset -2}${offset 7}$color2${memperc}%\ +\ + Disk ↓${offset 2}${voffset 2}$color6${diskiograph_read /dev/sda 22,34 859900 DC322F -t}${offset 7}$color2${voffset -2}${diskio_read /dev/sda}\ + ↑${offset 2}${voffset 2}$color6${diskiograph_write /dev/sda 22,34 859900 DC322F -t}${offset 7}$color2${voffset -2}${diskio_write /dev/sda}\ + Net ↓${offset 2}${voffset 2}$color6${downspeedgraph wlan0 22,34 859900 DC322F -t}${voffset -2}${offset 7}$color2${downspeed wlan0}\ + ↑${offset 2}${voffset 2}$color6${upspeedgraph wlan0 22,34 859900 DC322F -t}${voffset -2}${offset 8}$color2${upspeed wlan0}\ +\ + ${execp if [ "$(cat /sys/bus/acpi/drivers/ac/ACPI0003\:00/power_supply/ADP1/online)" -eq "1" ]; then echo '+'; else echo '-'; fi}${battery_percent}%\ +\ +$alignr${time %a %Y-%m-%d %H:%M}\ +]]; + +--#${execp udisks --show-info /dev/sda | grep temperature | sed 's/.* \([0-9]*\)C.*/\1/'}°\ diff --git a/conkyrc b/conkyrc deleted file mode 100644 index c7dc5ba..0000000 --- a/conkyrc +++ /dev/null @@ -1,77 +0,0 @@ -conky.config = { - -- conkyrc - - alignment = 'top_left', - border_inner_margin = 1, - border_outer_margin = 0, - border_width = 0, - - -- color of active workspace - color1 = '#4E9A40', - - -- inactive workspaces and divider color - color2 = '#808080', - - -- workspaces which have windows but aren't focused - color3 = '#808020', - - -- urgency hinting color - color4 = '#f9d72d', - - -- color of temps and percentages - color5 = '#8F8F00', - - -- Graph outlines - color6 = '#3F3B3B', - - default_color = '#3F3B3B', - double_buffer = true, - draw_borders = true, - draw_graph_borders = true, - draw_shades = false, - gap_x = 13, - gap_y = 6, - - -- adjust to the width of your screen - maximum_width = 2854, - minimum_width = 2854, - minimum_height = 0, - - own_window = true, - own_window_argb_visual = false, - - -- bar background color - own_window_colour = '#000', - - own_window_type = 'panel', - own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager', - pad_percents = 2, - update_interval = 1, - use_spacer = 'right', - use_xft = true, - --xftalpha = .2, - - -- choose font and size - font = 'Monospace:size=16', - -}; - -conky.text = [[ -${execp bspc control --get-status | cut -d ":" -f 2 | xargs ~/bin/workspaces.sh}\ -\ -${color2}${alignc}CPU $color6${voffset 3}${cpugraph 20,34 859900 DC322F -t}${voffset -3}${offset 7}$color2\ -${execp echo $(cat /sys/bus/platform/devices/coretemp.0/hwmon/hwmon*/temp1_input) / 1000 | bc}°\ -\ - Mem $color6${voffset 2}${memgraph 22,34 859900 DC322F -t}${voffset -2}${offset 7}$color2${memperc}%\ -\ - Disk ↓${offset 2}${voffset 2}$color6${diskiograph_read /dev/sda 22,34 859900 DC322F -t}${offset 7}$color2${voffset -2}${diskio_read /dev/sda}\ - ↑${offset 2}${voffset 2}$color6${diskiograph_write /dev/sda 22,34 859900 DC322F -t}${offset 7}$color2${voffset -2}${diskio_write /dev/sda}\ - Net ↓${offset 2}${voffset 2}$color6${downspeedgraph wlan0 22,34 859900 DC322F -t}${voffset -2}${offset 7}$color2${downspeed wlan0}\ - ↑${offset 2}${voffset 2}$color6${upspeedgraph wlan0 22,34 859900 DC322F -t}${voffset -2}${offset 8}$color2${upspeed wlan0}\ -\ - ${execp if [ "$(cat /sys/bus/acpi/drivers/ac/ACPI0003\:00/power_supply/ADP1/online)" -eq "1" ]; then echo '+'; else echo '-'; fi}${battery_percent}%\ -\ -$alignr${time %a %Y-%m-%d %H:%M}\ -]]; - ---#${execp udisks --show-info /dev/sda | grep temperature | sed 's/.* \([0-9]*\)C.*/\1/'}°\ diff --git a/deploy.sh b/deploy.sh index 1e2dc39..86a0f21 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,6 +1,11 @@ #!/bin/sh -ln -is $(realpath bspwm) ~/.config/bspwm -ln -is $(realpath sxhkd) ~/.config/sxhkd -ln -is $(realpath conkyrc) ~/.conkyrc -ln -is $(realpath tmux.conf) ~/.tmux.conf +stow aptitude +stow awesome +stow bash +stow bspwm +stow conky +stow emacs +stow sxhkd +stow tmux +stow vim diff --git a/emacs.d/drobillized-theme.el b/emacs.d/drobillized-theme.el deleted file mode 100644 index 1a5b240..0000000 --- a/emacs.d/drobillized-theme.el +++ /dev/null @@ -1,235 +0,0 @@ -(deftheme drobillized - "Subdued theme based on Solarized palette.") - -(defgroup drobillized nil - "Drobillized theme options. -Reload the theme after changing anything in this group." - :group 'faces) - -;; Background (dark) -(defcustom base03 "#002B36" "Dark base 3" :group 'drobillized :type '(color)) -(defcustom base02 "#073642" "Dark base 2" :group 'drobillized :type '(color)) - -;; Content -(defcustom base01 "#586E75" "Dark content 1" :group 'drobillized :type '(color)) -(defcustom base00 "#657B83" "Dark content 0" :group 'drobillized :type '(color)) -(defcustom base0 "#839496" "Light content 0" :group 'drobillized :type '(color)) -(defcustom base1 "#93A1A1" "Light content 1" :group 'drobillized :type '(color)) - -;; Background (light) -(defcustom base2 "#EEE8D5" "Light base 2" :group 'drobillized :type '(color)) -(defcustom base3 "#FDF6E3" "Light base 3" :group 'drobillized :type '(color)) - -;; Basic colors -(defcustom yellow "#B58900" "Yellow" :group 'drobillized :type '(color)) -(defcustom orange "#CB4B16" "Orange" :group 'drobillized :type '(color)) -(defcustom red "#DC322F" "Red" :group 'drobillized :type '(color)) -(defcustom magenta "#D33682" "Magenta" :group 'drobillized :type '(color)) -(defcustom violet "#6C71C4" "Violet" :group 'drobillized :type '(color)) -(defcustom blue "#268BD2" "Blue" :group 'drobillized :type '(color)) -(defcustom cyan "#2AA198" "Cyan" :group 'drobillized :type '(color)) -(defcustom green "#859900" "Green" :group 'drobillized :type '(color)) - -;; Darker colors -(defcustom yellow-d "#7B6000" "Dark yellow" :group 'drobillized :type '(color)) -(defcustom orange-d "#8B2C02" "Dark orange" :group 'drobillized :type '(color)) -(defcustom red-d "#990A1B" "Dark red" :group 'drobillized :type '(color)) -(defcustom magenta-d "#93115C" "Dark magenta" :group 'drobillized :type '(color)) -(defcustom violet-d "#3F4D91" "Dark violet" :group 'drobillized :type '(color)) -(defcustom blue-d "#00629D" "Dark blue" :group 'drobillized :type '(color)) -(defcustom cyan-d "#00736F" "Dark cyan" :group 'drobillized :type '(color)) -(defcustom green-d "#546E00" "Dark green" :group 'drobillized :type '(color)) - -;; Lighter colors -(defcustom yellow-l "#DEB542" "Light yellow" :group 'drobillized :type '(color)) -(defcustom orange-l "#F2804F" "Light orange" :group 'drobillized :type '(color)) -(defcustom red-l "#FF6E64" "Light red" :group 'drobillized :type '(color)) -(defcustom magenta-l "#F771AC" "Light magenta" :group 'drobillized :type '(color)) -(defcustom violet-l "#9EA0E5" "Light violet" :group 'drobillized :type '(color)) -(defcustom blue-l "#69B7F0" "Light blue" :group 'drobillized :type '(color)) -(defcustom cyan-l "#69CABF" "Light cyan" :group 'drobillized :type '(color)) -(defcustom green-l "#B4C342" "Light green" :group 'drobillized :type '(color)) - -(custom-theme-set-variables - 'drobillized - ) - -(custom-theme-set-faces - 'drobillized - `(bold ((t (:weight bold)))) - `(compilation-column-number ((t (:foreground "grey40")))) - `(cursor ((t (:background "grey80")))) - `(custom-button ((t (:background "#2D3232" :foreground "#DDD" :box (:line-width 2 :style released-button))))) - `(custom-state ((t (:foreground ,green)))) - `(default ((t (:inherit nil :stipple nil :background "#141414" :foreground "#C3D1D1" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))) - `(diff-added ((t (:foreground ,green)))) - `(diff-file-header ((((class color) (min-colors 88) (background dark)) (:weight bold)))) - `(diff-header ((((class color) (min-colors 88) (background dark)) (:foreground ,violet)))) - `(diff-refine-added ((t (:inherit diff-refine-change :foreground "green")))) - `(diff-refine-change ((t (:background "grey15"))) t) - `(diff-refine-changed ((t (:background "grey15")))) - `(diff-refine-removed ((t (:inherit diff-refine-change :foreground "red")))) - `(diff-removed ((t (:foreground ,red-d)))) - `(dired-directory ((t (:foreground ,blue)))) - `(diredp-compressed-file-suffix ((t (:foreground "grey50")))) - `(diredp-date-time ((t (:foreground ,violet)))) - `(diredp-dir-heading ((t (:foreground ,green)))) - `(diredp-dir-name ((t (:foreground ,blue)))) - `(diredp-dir-priv ((t (:foreground ,blue-l)))) - `(diredp-exec-priv ((t (:foreground ,green)))) - `(diredp-file-name ((t (:inherit default)))) - `(diredp-file-suffix ((t (:foreground "grey70")))) - `(diredp-ignored-file-name ((t (:foreground ,base01)))) - `(diredp-no-priv ((t nil))) - `(diredp-number ((t (:foreground "grey50")))) - `(diredp-rare-priv ((t (:foreground ,cyan-l)))) - `(diredp-read-priv ((t (:foreground "grey70")))) - `(diredp-symlink ((t (:foreground ,cyan)))) - `(diredp-write-priv ((t (:foreground "grey90")))) - `(erc-action-face ((t (:slant italic)))) - `(erc-current-nick-face ((t (:foreground ,cyan :weight bold)))) - `(erc-input-face ((t (:foreground ,orange)))) - `(erc-my-nick-face ((t (:foreground ,orange :weight bold)))) - `(erc-nick-default-face ((t (:foreground "#A3B1B1")))) - `(erc-notice-face ((t (:foreground ,violet)))) - `(erc-prompt-face ((t (:foreground "white" :weight bold)))) - `(erc-timestamp-face ((t (:foreground ,green)))) - `(error ((t (:foreground ,red :weight bold)))) - `(escape-glyph ((((background dark)) (:foreground "cyan")))) - `(eshell-prompt ((t (:foreground ,green :weight bold)))) - `(font-latex-italic-face ((t (:inherit italic :foreground ,green)))) - `(font-latex-math-face ((t (:foreground ,red)))) - `(font-latex-sectioning-5-face ((t (:inherit nil :foreground ,yellow :weight bold)))) - `(font-latex-sedate-face ((t (:foreground ,cyan-d)))) - `(font-latex-string-face ((t (:foreground ,orange)))) - `(font-latex-warning-face ((t (:inherit bold :foreground ,red)))) - `(font-lock-builtin-face ((t (:foreground ,green)))) - `(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face)))) - `(font-lock-comment-face ((t (:foreground ,violet :slant normal)))) - `(font-lock-constant-face ((t (:foreground ,base1)))) - `(font-lock-doc-face ((t (:inherit font-lock-string-face :foreground ,violet)))) - `(font-lock-function-name-face ((t (:inherit default :foreground "#C3D1D1")))) - `(font-lock-keyword-face ((t (:foreground ,base00 :weight bold)))) - `(font-lock-preprocessor-face ((nil (:foreground ,magenta)))) - `(font-lock-string-face ((t (:foreground ,orange)))) - `(font-lock-type-face ((t (:foreground ,green :weight normal)))) - `(font-lock-variable-name-face ((t (:foreground "#E3F1F1" :weight normal)))) - `(font-lock-warning-face ((t (:foreground ,red)))) - `(fringe ((((class color) (background dark)) (:background "grey25")))) - `(ggtags-global-line ((t (:inherit secondary-selection)))) - `(header-line ((t (:inherit mode-line)))) - `(highlight-beyond-fill-column-face ((t (:background ,red-d)))) - `(ivy-confirm-face ((t (:inherit minibuffer-prompt :foreground ,green)))) - `(ivy-current-match ((t (:background ,green-d)))) - `(ivy-match-required-face ((t (:inherit minibuffer-prompt :foreground ,red)))) - `(ivy-minibuffer-match-face-1 ((t (:inherit minibuffer-prompt)))) - `(ivy-minibuffer-match-face-2 ((t (:inherit minibuffer-prompt)))) - `(ivy-minibuffer-match-face-3 ((t (:inherit minibuffer-prompt)))) - `(ivy-minibuffer-match-face-4 ((t (:inherit minibuffer-prompt)))) - `(swiper-line-face ((t (:background "#354900")))) - `(swiper-match-face-1 ((t (:background ,cyan-d)))) - `(swiper-match-face-2 ((t (:background ,green-d)))) - `(swiper-match-face-3 ((t (:background ,cyan-d)))) - `(swiper-match-face-4 ((t (:background ,green-d)))) - `(ivy-remote ((t (:foreground ,violet)))) - `(jabber-chat-prompt-foreign ((t (:foreground ,cyan-d :weight bold)))) - `(jabber-chat-prompt-local ((t (:foreground ,green :weight bold)))) - `(jabber-rare-time-face ((t (:foreground ,violet :weight bold)))) - `(jabber-roster-user-away ((t (:foreground ,green-d :slant italic :weight normal)))) - `(jabber-roster-user-online ((t (:foreground ,green-l :slant normal :weight bold)))) - `(jabber-title-large ((t (:foreground "white" :weight bold)))) - `(jabber-title-medium ((t (:weight bold :height 1.0 :width expanded)))) - `(link ((((class color) (min-colors 88) (background dark)) (:foreground ,blue :inverse-video nil :underline t)))) - `(link-visited ((default (:inherit link)) (((class color) (background dark)) (:foreground ,violet)))) - `(magit-bisect-bad ((t (:foreground ,red)))) - `(magit-bisect-good ((t (:foreground ,green)))) - `(magit-bisect-skip ((t (:foreground ,yellow)))) - `(magit-blame-heading ((t (:background "grey15" :foreground "grey80")))) - `(magit-branch-current ((t (:inherit magit-branch-local :box 1)))) - `(magit-branch-local ((t (:foreground ,cyan)))) - `(magit-branch-remote ((t (:foreground ,green)))) - `(magit-cherry-equivalent ((t (:foreground ,magenta-d)))) - `(magit-cherry-unmatched ((t (:foreground ,cyan-d)))) - `(magit-diff-added ((t (:foreground ,green)))) - `(magit-diff-added-highlight ((t (:foreground ,green)))) - `(magit-diff-base ((t (:background ,green-d :foreground "gray80")))) - `(magit-diff-base-highlight ((t (:background ,green-d :foreground "white")))) - `(magit-diff-context ((t (:foreground "grey70")))) - `(magit-diff-context-highlight ((t (:foreground "grey80")))) - `(magit-diff-file-heading-selection ((t (:inherit magit-diff-file-heading-highlight :foreground ,red)))) - `(magit-diff-hunk-heading ((t (:foreground ,violet)))) - `(magit-diff-hunk-heading-highlight ((t (:foreground ,violet :weight bold)))) - `(magit-diff-hunk-heading-selection ((t (:inherit magit-diff-hunk-heading-highlight :foreground ,red)))) - `(magit-diff-lines-heading ((t (:inherit magit-diff-hunk-heading-highlight :background ,red :foreground "grey80")))) - `(magit-diff-removed ((t (:foreground ,red)))) - `(magit-diff-removed-highlight ((t (:foreground "red")))) - `(magit-diffstat-added ((t (:inherit diff-added)))) - `(magit-diffstat-removed ((t (:inherit diff-removed)))) - `(magit-item-highlight ((t (:background "grey15")))) - `(magit-log-author ((t (:foreground ,red)))) - `(magit-process-ng ((t (:inherit magit-section-heading :foreground ,red)))) - `(magit-process-ok ((t (:inherit magit-section-heading :foreground ,green)))) - `(magit-reflog-amend ((t (:foreground ,magenta)))) - `(magit-reflog-checkout ((t (:foreground ,blue)))) - `(magit-reflog-cherry-pick ((t (:foreground ,green)))) - `(magit-reflog-commit ((t (:foreground ,green)))) - `(magit-reflog-merge ((t (:foreground ,green)))) - `(magit-reflog-other ((t (:foreground ,cyan)))) - `(magit-reflog-rebase ((t (:foreground ,magenta)))) - `(magit-reflog-remote ((t (:foreground ,cyan)))) - `(magit-reflog-reset ((t (:foreground ,red)))) - `(magit-section-heading ((t (:foreground ,green :weight bold)))) - `(magit-section-heading-selection ((t (:foreground ,red)))) - `(magit-sequence-drop ((t (:foreground ,red)))) - `(magit-sequence-head ((t (:foreground ,blue)))) - `(magit-sequence-part ((t (:foreground ,yellow)))) - `(magit-sequence-stop ((t (:foreground ,green)))) - `(magit-signature-bad ((t (:foreground ,red :weight bold)))) - `(magit-signature-error ((t (:foreground ,red)))) - `(magit-signature-expired ((t (:foreground ,orange)))) - `(magit-signature-good ((t (:foreground ,green)))) - `(magit-signature-revoked ((t (:foreground ,violet)))) - `(magit-signature-untrusted ((t (:foreground ,cyan)))) - `(magit-tag ((t (:foreground ,yellow)))) - `(magit-section-highlight ((t (:background "grey15")))) - `(minibuffer-prompt ((((background dark)) (:foreground "white")))) - `(mode-line ((t (:background "#2D3232" :foreground "#AFB3B2" :box nil)))) - `(mode-line-buffer-id ((t (:weight bold)))) - `(mode-line-buffer-id-inactive ((t (:inherit mode-line-buffer-id :foreground "gray30")))) - `(mode-line-inactive ((t (:inherit mode-line :background "#222727" :foreground "gray30")))) - `(nobreak-space ((((class color) (min-colors 88)) (:inherit escape-glyph :underline t)))) - `(powerline-active0 ((t (:inherit mode-line :background "#121717")))) - `(powerline-active1 ((t (:inherit mode-line :background "#222727")))) - `(powerline-active2 ((t (:inherit mode-line :background "#222727")))) - `(powerline-inactive0 ((t (:inherit mode-line-inactive :background "black")))) - `(powerline-inactive1 ((t (:inherit mode-line-inactive :background "#121717")))) - `(powerline-inactive2 ((t (:inherit mode-line-inactive :background "#121717")))) - `(rainbow-delimiters-depth-1-face ((t (:inherit rainbow-delimiters-base-face :foreground "#93A1A1")))) - `(rainbow-delimiters-depth-2-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8BA898")))) - `(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8391A1")))) - `(rainbow-delimiters-depth-4-face ((t (:inherit rainbow-delimiters-base-face :foreground "#7B9888")))) - `(rainbow-delimiters-depth-5-face ((t (:inherit rainbow-delimiters-base-face :foreground "#738191")))) - `(rainbow-delimiters-depth-6-face ((t (:inherit rainbow-delimiters-base-face :foreground "#6B8878")))) - `(rainbow-delimiters-depth-7-face ((t (:inherit rainbow-delimiters-base-face :foreground "#637181")))) - `(rainbow-delimiters-depth-8-face ((t (:inherit rainbow-delimiters-base-face :foreground "#5B7868")))) - `(rainbow-delimiters-depth-9-face ((t (:inherit rainbow-delimiters-base-face :foreground "#536171")))) - `(region ((t (:background "#354900")))) - `(secondary-selection ((t (:background "#344E00")))) - `(smerge-refined-change ((t (:background "grey20"))) t) - `(smerge-refined-changed ((t (:background "grey20")))) - `(spaceline-highlight-face ((t (:background "#272A2A" :foreground "#FFFFFF" :inherit (quote mode-line))))) - `(spaceline-modified ((t (:background "#A66" :foreground "#3E3D31" :inherit (quote mode-line))))) - `(spaceline-unmodified ((t (:background "#777" :foreground "#3E3D31" :inherit (quote mode-line))))) - `(success ((t (:foreground ,green :weight bold)))) - `(warning ((t (:foreground ,yellow :weight bold)))) - `(whitespace-indentation ((t (:foreground "grey20")))) - `(whitespace-newline ((t (:foreground "grey20" :weight normal)))) - `(whitespace-space ((t (:foreground "grey20")))) - `(whitespace-space-after-tab ((t (:foreground "grey20")))) - `(whitespace-tab ((t (:foreground "grey20")))) - `(widget-field ((t (:background "#222" :box (:line-width 2 :color "#555"))))) - `(woman-addition ((t (:inherit font-lock-builtin-face :foreground ,blue)))) - `(woman-bold ((t (:inherit bold :foreground ,green)))) - `(woman-italic ((t (:inherit italic :slant italic))))) - -(provide-theme 'drobillized) diff --git a/emacs.d/init.el b/emacs.d/init.el deleted file mode 100644 index aaa136f..0000000 --- a/emacs.d/init.el +++ /dev/null @@ -1,428 +0,0 @@ -;;; System - -(add-to-list 'load-path (expand-file-name "~/.emacs.d/site-lisp")) - -;; Platform specific configuration -(cond ((equal system-type 'darwin) - (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin")) - (setq exec-path (append exec-path '("/usr/local/bin"))) - (setq dired-listing-switches "-al") - (scroll-bar-mode nil) - (global-set-key [home] 'move-beginning-of-line) - (global-set-key [end] 'move-end-of-line)) - ((or (equal system-type 'gnu/linux) (equal system-type 'gnu/kfreebsd)) - (setq dired-listing-switches "-al --time-style=long-iso") - (scroll-bar-mode (quote right)))) - -(setq-default - gc-cons-threshold 10000000 - backup-by-copying t - backup-directory-alist `((".*" . ,temporary-file-directory)) - auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) - scheme-program-name "mzscheme" - browse-url-generic-program (executable-find "sensible-browser") - browse-url-browser-function 'browse-url-generic) - -;;; Packages - -(require 'package) -(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) -(package-initialize) -(unless (package-installed-p 'use-package) - (progn - (package-refresh-contents) - (package-install 'use-package))) - -(require 'use-package) - -(setq use-package-always-ensure t) -(use-package ace-window) -(use-package clang-format :commands (c-mode c++-mode)) -(use-package counsel :after (ivy) :config (counsel-mode)) -(use-package counsel-gtags :commands ggtags-mode) -(use-package counsel-projectile :after (counsel projectile)) -(use-package diminish) -(use-package dired+) -(use-package dired-rainbow :after (dired+)) -(use-package flyspell :commands flyspell-mode) -(use-package flyspell-correct-ivy :after (flyspell ivy) :commands flyspell-mode) -(use-package ggtags :commands ggtags-mode) -(use-package ivy :config (ivy-mode)) -(use-package llvm-mode :commands llvm-mode) -(use-package magit :commands magit-status :bind ("C-c m" . magit-status) :config (define-key magit-mode-map (kbd "C-") nil)) -(use-package markdown-mode :commands markdown-mode) -(use-package pdf-tools :magic ("%PDF" . pdf-view-mode) :config (pdf-tools-install)) -(use-package projectile :config (projectile-global-mode)) -(use-package rainbow-delimiters :commands prog-mode) -(use-package smart-tabs-mode :commands (c-mode c++-mode)) -(use-package spaceline) -(use-package swiper :commands swiper) -(use-package tramp) - -(require 'spaceline-config) - -;;; Basic editor configuration - -(defalias 'yes-or-no-p 'y-or-n-p) -(delete-selection-mode 1) -(winner-mode 1) -(setq-default tab-width 4) -(setq-default indent-tabs-mode nil) -(setq-default scroll-margin 3) -(spaceline-toggle-buffer-size-off) -(spaceline-toggle-hud-off) -(spaceline-toggle-buffer-encoding-abbrev-off) -(diminish 'abbrev-mode "") -(diminish 'auto-fill-function "↵") -(diminish 'auto-revert-mode "↻") -(diminish 'compilation-in-progress "⚙") -(diminish 'counsel-mode "") -(diminish 'flyspell-mode "✓") -(diminish 'ggtags-mode "☚") -(diminish 'ivy-mode "") -(setq spaceline-minor-modes-separator " ") - -(spaceline-define-segment version-control - "Version control information." - (when vc-mode - (powerline-raw - (s-trim (concat vc-mode - (when (buffer-file-name) - (pcase (vc-state (buffer-file-name)) - (`up-to-date " ") - (`edited " *") - (`added " +") - (`unregistered " ?") - (`removed " -") - (`needs-merge " !") - (`needs-update " ^") - (`ignored " I") - (_ " ?")))))))) - -(spaceline-define-segment buffer-position - "Buffer position in percent" - (format "%3d%%%%" (/ (* 100 (- (line-number-at-pos) 1)) - (max 1 (count-lines (point-min) (point-max)))))) - -;;; Variables - -(custom-set-variables - ;; custom-set-variables was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - '(auto-revert-interval 1) - '(backup-by-copying t) - '(backup-directory-alist (\` ((".*" \, temporary-file-directory)))) - '(browse-url-firefox-new-window-is-tab t) - '(column-number-mode t) - '(compilation-scroll-output t) - '(cursor-in-non-selected-windows (quote hollow)) - '(custom-enabled-themes (quote (drobillized))) - '(custom-safe-themes - (quote - ("c2616934f29a24eded08ab10db3615ba9fa6b91ce0427dd53700d43f94705f42" default))) - '(delete-old-versions t) - '(dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.\\|^\\..*$") - '(diredp-hide-details-initially-flag t) - '(diredp-wrap-around-flag nil) - '(erc-autojoin-channels-alist - (quote - ((".*\\.freenode.net" "#ardour" "#ardour-dev" "#ingen" "#lv2" "#moddevices" "#lad")))) - '(erc-autojoin-mode t) - '(erc-join-buffer (quote bury)) - '(erc-log-channels-directory "~/.erc/logs") - '(erc-log-insert-log-on-open t) - '(erc-log-mode t) - '(erc-mode-line-format "%t") - '(erc-prompt ">") - '(erc-track-exclude-server-buffer t) - '(erc-track-exclude-types - (quote - ("JOIN" "NICK" "PART" "QUIT" "MODE" "333" "353" "324" "329" "332" "477"))) - '(fill-column 79) - '(font-lock-maximum-decoration t) - '(frame-background-mode (quote dark)) - '(fringe-mode 0 nil (fringe)) - '(gc-cons-threshold 10000000) - '(grep-find-command - "find . -type f -not -name \"*.svn-base\" -print0 | xargs -0 grep -I -n -s -F ") - '(indicate-empty-lines t) - '(inhibit-startup-screen t) - '(ivy-magic-tilde nil) - '(jabber-account-list - (quote - (("david.e.robillard@gmail.com" - (:network-server . "talk.google.com") - (:port . 5223) - (:connection-type . ssl))))) - '(jabber-chat-buffer-show-avatar nil) - '(jabber-chat-header-line-format - (quote - ("" - (:eval - (jabber-jid-displayname jabber-chatting-with)) - " " - (:eval - (let - ((buddy - (jabber-jid-symbol jabber-chatting-with))) - (propertize - (or - (cdr - (assoc - (get buddy - (quote show)) - jabber-presence-strings)) - (get buddy - (quote show))) - (quote face) - (or - (cdr - (assoc - (get buddy - (quote show)) - jabber-presence-faces)) - (quote jabber-roster-user-online))))) - " " - (:eval - (jabber-fix-status - (get - (jabber-jid-symbol jabber-chatting-with) - (quote status)))) - " " jabber-events-message " " jabber-chatstates-message))) - '(jabber-roster-line-format " %c %-25n %u %-8s %S") - '(jshint-mode-node-program "nodejs") - '(magit-auto-revert-mode nil) - '(magit-diff-refine-hunk (quote all)) - '(menu-bar-mode nil) - '(ns-use-srgb-colorspace nil) - '(package-selected-packages - (quote - (rainbow-delimiters auctex clang-format counsel-gtags counsel-projectile dired+ dired-rainbow flyspell-correct-ivy ggtags ivy magit markdown-mode n3-mode pdf-tools projectile spaceline use-package))) - '(pdf-view-midnight-colors (quote ("#C3D1D1" . "#141414"))) - '(powerline-default-separator (quote arrow)) - '(projectile-completion-system (quote ivy)) - '(projectile-enable-caching t) - '(projectile-mode-line nil) - '(projectile-use-git-grep t) - '(quack-pretty-lambda-p t) - '(quack-run-scheme-always-prompts-p nil) - '(savehist-mode t) - '(scroll-conservatively 5) - '(send-mail-function (quote sendmail-send-it)) - '(show-paren-mode t) - '(speedbar-use-images nil) - '(split-window-preferred-function (quote split-window-horizontally)) - '(tool-bar-mode nil) - '(version-control t) - '(visible-bell nil)) - -(setq ring-bell-function - (lambda () - (let ((orig-fg (face-foreground 'mode-line))) - (set-face-foreground 'mode-line "#F2804F") - (run-with-idle-timer 0.1 nil - (lambda (fg) (set-face-foreground 'mode-line fg)) - orig-fg)))) - -;;; Colours - -(custom-set-faces - ;; custom-set-faces was added by Custom. - ;; If you edit it by hand, you could mess it up, so be careful. - ;; Your init file should contain only one such instance. - ;; If there is more than one, they won't work right. - ) - -;;; Windows - -(defun compile-autoclose (buffer string) - "Close compilation window on success" - (cond ((and (string-match "compilation" (buffer-name buffer)) - (string-match "finished" string)) - (bury-buffer "*compilation*") - (winner-undo) - (message "Build successful.")) - (t - (message "Compilation exited abnormally: %s" string)))) - -(defun rotate-windows () - "Rotate windows" - (interactive) - (if (> (count-windows) 1) - (let ((i 0) - (num-windows (count-windows))) - (while (< i (- num-windows 1)) - (let* ((w1 (elt (window-list) i)) - (w2 (elt (window-list) (% (+ i 1) num-windows))) - (b1 (window-buffer w1)) - (b2 (window-buffer w2)) - (s1 (window-start w1)) - (s2 (window-start w2))) - (set-window-buffer w1 b2) - (set-window-buffer w2 b1) - (set-window-start w1 s2) - (set-window-start w2 s1) - (setq i (+ i 1))))))) - -(setq split-height-threshold nil) -(setq split-width-threshold 0) -(setq compilation-finish-functions 'compile-autoclose) - -;; Remove slow Maven regexp that makes the compilation buffer clunky -(setq compilation-error-regexp-alist - (delete 'maven compilation-error-regexp-alist)) - -;;; Key bindings - -(global-set-key (kbd "C-") 'previous-buffer) -(global-set-key (kbd "C-") 'next-buffer) -(global-set-key (kbd "C-") 'ace-window) -(global-set-key (kbd "C-b") 'compile) -(global-set-key (kbd "C-m") 'newline-and-indent) -(global-set-key (kbd "C-n") 'next-error) -(global-set-key (kbd "C-p") 'previous-error) -(global-set-key (kbd "C-s") 'swiper) - -(global-set-key (kbd "C-c <") 'first-error) -(global-set-key (kbd "C-c =") 'set-variable) -(global-set-key (kbd "C-c I") 'clang-format-region) -(global-set-key (kbd "C-c R") 'replace-regexp) -(global-set-key (kbd "C-c a") 'align) -(global-set-key (kbd "C-c c") 'comment-region) -(global-set-key (kbd "C-c d") 'svn-status-show-svn-diff) -(global-set-key (kbd "C-c e") 'erc-track-switch-buffer) -(global-set-key (kbd "C-c f") 'ff-find-other-file) -(global-set-key (kbd "C-c g") 'grep-find) -(global-set-key (kbd "C-c i") 'clang-format-buffer) -(global-set-key (kbd "C-c m") 'magit-status) -(global-set-key (kbd "C-c r") 'replace-string) -(global-set-key (kbd "C-c s") 'sort-lines) -(global-set-key (kbd "C-c t") 'toggle-truncate-lines) -(global-set-key (kbd "C-c u") 'uncomment-region) -(global-set-key (kbd "C-c w") 'rotate-windows) - -;;; File modes - -(add-hook 'prog-mode-hook #'rainbow-delimiters-mode) - -;; C/C++ - -(defconst my-c-style - '((c-block-comment-prefix . " ") - (c-comment-only-line-offset . 0) - (c-auto-align-backslashes . nil) - (c-label-minimum-indentation . 0) - (c-hungry-delete-key . t) - (c-indent-comments-syntactically-p . nil) - (c-hanging-braces-alist . ((brace-list-open after) - (defun-open after) - (defun-close before after) - (class-open after) - (class-close before after) - (namespace-open after) - (inline-open after) - (inline-close before after) - (block-open after) - (block-close . c-snug-do-while) - (extern-lang-open after) - (extern-lang-close after) - (statement-case-open after) - (substatement-open after))) - (c-hanging-colons-alist . ((case-label) - (label after) - (access-label after) - (member-init-intro before) - (inher-intro))) - (c-hanging-semi&comma-criteria . (c-semi&comma-no-newlines-for-oneline-inliners - c-semi&comma-inside-parenlist - c-semi&comma-no-newlines-before-nonblanks)) - (c-cleanup-list . (brace-catch-brace - brace-else-brace - brace-elseif-brace - compact-empty-funcall - defun-close-semi - empty-defun-braces - list-close-comma - one-liner-defun - scope-operator)) - (c-offsets-alist . ((func-decl-cont . ++) - (member-init-intro . +) - (inher-intro . ++) - (comment-intro . 0) - (arglist-close . c-lineup-arglist) - (topmost-intro . 0) - (block-open . 0) - (inline-open . 0) - (substatement-open . 0) - (label . /) - (case-label . 0) - (statement-case-open . +) - (statement-case-intro . +) - (access-label . -) - (innamespace . 0) - (inextern-lang . 0) - (extern-lang-open . 0) - (label . -))))) - -(c-add-style "drobilla" my-c-style) - -(defun my-c-mode-common-hook () - "C mode for people with taste." - (require 'smarttabs) - (auto-fill-mode 1) - (abbrev-mode -1) - (set-fill-column 79) - (smart-tabs-mode-enable) - (setq tab-width 4) - (setq indent-tabs-mode t) - (setq truncate-lines t) - (setq show-trailing-whitespace t) - (smart-tabs-advice c-indent-line c-basic-offset) - (c-set-style "drobilla")) - -(add-hook 'c-mode-common-hook 'my-c-mode-common-hook) -(add-hook 'c++-mode-common-hook 'my-c-mode-common-hook) - -;; Python - -(add-hook 'python-mode-hook - (lambda () - (setq tab-width 4) - (setq indent-tabs-mode nil) - (setq show-trailing-whitespace))) - -;; PDF - -(defun my-doc-view-hook () - (auto-revert-mode) - (blink-cursor-mode -1)) - -(add-hook 'doc-view-mode-hook 'my-doc-view-hook) -(add-hook 'pdf-view-mode-hook 'my-doc-view-hook) - -(spaceline-define-segment line-column - "The current line and column numbers." - (if (eq major-mode 'pdf-view-mode) - ;; Show page number and count for PDF documents - (concat (number-to-string (pdf-view-current-page)) - "/" - (number-to-string (pdf-cache-number-of-pages))) - mode-line-position - "%l:%c")) - -;; Associations - -(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode)) -(add-to-list 'auto-mode-alist '("\\.n3" . n3-mode)) -(add-to-list 'auto-mode-alist '("\\.ttl" . n3-mode)) -(add-to-list 'auto-mode-alist '("\\.owl" . n3-mode)) -(add-to-list 'auto-mode-alist '("\\.ll" . llvm-mode)) -(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode)) -(add-to-list 'auto-mode-alist '("\\.pdf" . pdf-view-mode)) - -;;; Launch - -(spaceline-spacemacs-theme) -(server-start) diff --git a/emacs.d/site-lisp/n3-mode.el b/emacs.d/site-lisp/n3-mode.el deleted file mode 100644 index 8beced6..0000000 --- a/emacs.d/site-lisp/n3-mode.el +++ /dev/null @@ -1,44 +0,0 @@ -;;; n3-mode.el --- mode for Notation 3 -; $Id: n3-mode.el 4084 2007-12-15 17:10:13Z hugoh $ - -;; Copyright (c) 2003-2007 Hugo Haas - -;; For documentation on Notation 3, see: -;; http://www.w3.org/DesignIssues/Notation3.html - -;;; Comentary: - -;; Goals: -;; - sytax highlighting -;; - completion -;; - indentation - -;; What it does now: -;; - Syntax highlighting - -;;; Code: - -(require 'generic) - -(define-generic-mode 'n3-mode - ;; comment char - (list "# ") - ;; keywords - (list "this" "a") - ;; additional font-lock'ing - '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t) - ("\\(\\S-*?:\\)" 1 font-lock-type-face t) - (":\\(\\S-+?\\)\\>" 1 font-lock-constant-face t) - ("\\(<.*?>\\)" 1 font-lock-function-name-face t) - ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t) -; Bug: some trailing characters are highlighted; restricting comments regexp -; ("\\(#.*\\)" 1 font-lock-comment-face t) - ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t) - ) - ;; auto-mode - (list "\\.n3$") - ;; additional setup - nil - ;; description - "Mode for Notation 3 documents." - ) diff --git a/emacs.d/site-lisp/ppindent.el b/emacs.d/site-lisp/ppindent.el deleted file mode 100644 index 84c9702..0000000 --- a/emacs.d/site-lisp/ppindent.el +++ /dev/null @@ -1,138 +0,0 @@ -;;; ppindent.el --- Indents C preprocessor directives - -;; Copyright (C) 2007 Free Software Foundation, Inc. - -;; Author: Craig McDaniel -;; Keywords: languages, c -;; Maintainer: Craig McDaniel - -;; This file is free software; you can redistribute it and/or modify -;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) -;; any later version. - -;; This file is distributed in the hope that it will be useful, -;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;; GNU General Public License for more details. - -;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to -;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. - -;;; Commentary: - -;; PPINDENT indents C-preprocessor statements depending on the current -;; #if..., #el.., #endif level. It only modifies lines with "#" as the -;; first non-blank character and therefore does not conflict with the -;; normal C indentation. Unlike a true indent, it inserts the -;; requisite number of spaces after, rather than before the "#" -;; character. This type of preprocesor indent is commonly used to -;; provide the most compatibility with different C-compilers. -;; -;; Example: - -;; #ifdef WOO -;; .... -;; #if defined(X) && !defined(Y) -;; #ifdef Q8 -;; ... -;; #else -;; ... -;; .... -;; #elif defined (Z) -;; .... -;; #endif -;; #endif -;; #endif - -;; After "M-x ppindent-c" becomes: - -;; #ifdef WOO -;; .... -;; # if defined(X) && !defined(Y) -;; # ifdef Q8 -;; ... -;; # else -;; ... -;; .... -;; # elif defined (Z) -;; .... -;; # endif -;; # endif -;; #endif - -;; Two functions are provided: PPINDENT-C indents as described -;; above. PPINDENT-H does not indent the first level, assuming that -;; .h/.hpp files use an #ifdef guard around the entire file. - -;; You can customize PPINDENT-INCREMENT if you want to use something -;; other than 2 spaces for the indent. - -;;; History: - -;; 2007-01-19 WCM Initial version - -;;; Code: - -(provide 'ppindent) - -(defgroup pp-indent nil - "Indent C preproccessor directives." - :group 'c) - -(defcustom ppindent-increment 2 - "Number of spaces per indention level. - -Used in C pre-processor indent functions ppindent-c and ppindent-h" - :type 'number - :group 'pp-indent) - -(defun starts-withp (str prefix) - "str starts with prefix" - (eql (compare-strings prefix nil nil str nil (length prefix)) t)) - -(defun my-make-string (length init) - "just like make-string, but makes an empty string if length is negative" - (when (minusp length) - (setf length 0)) - (make-string length init)) - -(defun ppindent-aux (start) - (let ((cnt start)) - (goto-char (point-min)) - (while (re-search-forward "^[ \t]*#[ \t]*\\(.*\\)" nil t) - (cond ((starts-withp (match-string-no-properties 1) "if") - (replace-match (concat "#" (my-make-string cnt ?\s) "\\1")) - (incf cnt ppindent-increment)) - ((starts-withp (match-string-no-properties 1) "el") - (when (< (- cnt ppindent-increment) start) - (throw 'err `(,(line-number-at-pos) "Unmatched #else or #elif"))) - (replace-match (concat "#" (my-make-string - (- cnt ppindent-increment) - ?\s) "\\1"))) - ((starts-withp (match-string-no-properties 1) "endif") - (when (< (- cnt ppindent-increment) start) - (throw 'err `(,(line-number-at-pos) "Unmatched #endif"))) - (decf cnt ppindent-increment) - (replace-match (concat "#" (my-make-string cnt ?\s) "\\1"))) - (t - (replace-match (concat "#" (my-make-string cnt ?\s) "\\1"))))))) - -(defun ppindent-buffer (start) - (let ((result (catch 'err (save-excursion (ppindent-aux start))))) - (when result - (goto-line (car result)) - (error "Error: %s" (cadr result))))) - -(defun ppindent-c () - "Indent all C pre-processor statements" - (interactive) - (ppindent-buffer 0)) - -(defun ppindent-h () - "Indent C pre-processor statements, keeping first level #ifdef unindented" - (interactive) - (ppindent-buffer (- ppindent-increment))) - diff --git a/emacs.d/site-lisp/ttl-mode.el b/emacs.d/site-lisp/ttl-mode.el deleted file mode 100644 index ee147de..0000000 --- a/emacs.d/site-lisp/ttl-mode.el +++ /dev/null @@ -1,209 +0,0 @@ -;;; ttl-mode.el --- mode for Turtle(RDF) -;; Based on n3-mode.el --- mode for Notation 3, -;; at http://larve.net/people/hugo/2003/scratchpad/NotationThreeEmacsMode.html -;; Also draws on http://dishevelled.net/elisp/turtle-mode.el (which is for the _other_ turtle!) - -;; Copyright (c) 2003-2007 Hugo Haas -;; Extended 2011-2012, by Norman Gray -;; -;; See Hugo's commentary for original goals and further discussion. - -;; Project hosted at . See there for updates. - -;; To use: -;; -;; (autoload 'ttl-mode "ttl-mode" "Major mode for OWL or Turtle files" t) -;; (add-hook 'ttl-mode-hook ; Turn on font lock when in ttl mode -;; 'turn-on-font-lock) -;; (setq auto-mode-alist -;; (append -;; (list -;; '("\\.n3" . ttl-mode) -;; '("\\.ttl" . ttl-mode)) -;; auto-mode-alist)) - -;;; Code: - -(require 'generic) - -(define-generic-mode 'ttl - ;; comment char - (list "# ") - ;; keywords - (list "this" "a") - ;; additional font-lock'ing - '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t) ;keywords - ("\\^\\^[^,;.]+" 0 font-lock-preprocessor-face t) ;literal types - ("@[[:word:]_]+" 0 font-lock-preprocessor-face t) ;languages - ("\\(\\S-*?:\\)" 1 font-lock-type-face nil) ;prefix - (":\\([[:word:]_-]+\\)\\>" 1 font-lock-constant-face nil) ;suffix - ("\\(<.*?>\\)" 1 font-lock-function-name-face t) ;resources - ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t) ;strings - ("\\(\\\"\\\"\\\".*?\\\"\\\"\\\"\\)" 1 font-lock-string-face t) ;doesn't work over newlines? -; Bug: some trailing characters are highlighted; restricting comments regexp -; ("\\(#.*\\)" 1 font-lock-comment-face t) - ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t) ;comment - ) - ;; auto-mode - (list "\\.n3$" "\\.ttl") - ;; additional setup - nil - ;; description - "Mode for Turtle RDF documents." - ) - -(defun ttl-base () - (interactive) - (generic-mode "ttl")) - -(defun ttl-indent-line () - (interactive) - (indent-line-to - (or (ignore-errors (ttl-calculate-indentation)) - 0))) - -(defun ttl-calculate-indentation () - (save-excursion - (beginning-of-line) (skip-chars-forward "\t ") - (cond ((ttl-in-string-p) 8) - ((looking-at "$") - ;; empty line -- use same indentation as previous line - (save-excursion - (forward-line -1) - (skip-chars-forward "\t ") - (current-column))) - ((looking-at "@") 0) ;@prefix or @base - ((looking-at "#") 0) - ((looking-at "<");(looking-at "\\S-+\\s-*$") - ;;only a single expression on the line -- a subject - 0) - ((save-excursion - (forward-line -1) - (end-of-line) - (if (not (looking-back "\\[")) - nil - (beginning-of-line) - (skip-chars-forward "\t ") - (+ (current-column) 4)))) - (t 4)))) - -;; (defun turtle-indent-block () -;; (interactive) -;; (indent-region (point) -;; (save-excursion (forward-xxx) (point)))) - -(defvar ttl-mode-map (make-sparse-keymap)) -(define-derived-mode ttl-mode ttl-base - "Turtle RDF" - (setq indent-tabs-mode t) - (ttl-mode-variables) -; (define-key ttl-mode-map (kbd "C-M-q") -; 'turtle-indent-block) - (define-key ttl-mode-map (kbd "\;") 'ttl-electric-semi) - (define-key ttl-mode-map (kbd "\.") 'ttl-electric-dot) - (define-key ttl-mode-map (kbd "RET") 'newline-and-indent) - (define-key ttl-mode-map [backspace] 'ttl-hungry-delete-backwards) - (use-local-map ttl-mode-map)) - -(defcustom ttl-electric-semi-mode nil - "*If non-nil, `\;' will self insert, reindent the line, and do a newline. -If nil, just insert a `\;'. (To insert while t, do: \\[quoted-insert] \;)." - :group 'ttl - :type 'boolean) - -(defun beginning-of-stanza () - "Find the beginning of a stanza, indicated by non-whitespace at the beginning of a line." - (re-search-backward "^\\S-" (point-min) t)) - -(defun ttl-in-string-p () - "Is point inside a string or a long-string?" - (save-excursion - (let ((here (point)) - (in-p nil)) - (beginning-of-stanza) - (condition-case nil - (progn - (while (<= (point) here) - (if in-p - (progn - (search-forward in-p (point-max) nil) - (setq in-p nil)) - (re-search-forward "\"\\(\"\"\\)?" (point-max) nil) - (if (char-equal (char-before (- (point) 1)) ?\") - (setq in-p "\"\"\"") - (setq in-p "\"")))) - (not in-p)) - (search-failed ;reached EOF - (if in-p ;this indicates that we're inside a string - (message "Unbalanced quotes -- reached EOF inside string") - nil)))))) - -(defun *ttl-search-in-line-for-comment (limit) - "Search for a comment character from the current position, before point LIMIT; changes current position. Return location of comment, or nil if none can be found" - (let ((new-point (re-search-forward "[#<]" limit t))) - (cond ((not new-point) nil) - ((looking-back "#") new-point) ;found comment - (t ;looking-back "<" - (if (not (search-forward ">" limit t)) - nil ;starting point is within resource - (*ttl-search-in-line-for-comment limit)))))) ;recurse - -(defun ttl-in-comment-p () - "Is point inside a comment?" - (save-excursion - (let ((here (point))) - (beginning-of-line) - (*ttl-search-in-line-for-comment here)))) - -(defun ttl-in-resource-p () - "Is point within a resource, marked by <...>?" - (save-excursion - (and (re-search-backward "[<> ]" nil t) - (looking-at "<")))) - -(defun ttl-skip-ws-backwards () ;adapted from cc-mode - "Move backwards across whitespace." - (while (progn - (skip-chars-backward " \t\n\r\f\v") - (and (eolp) - (eq (char-before) ?\\))) - (backward-char))) - -(defun ttl-hungry-delete-backwards () - "Delete backwards, either all of the preceding whitespace, -or a single non-whitespace character if there is no whitespace before point." - (interactive) - (let ((here (point))) - (ttl-skip-ws-backwards) - (if (/= (point) here) - (delete-region (point) here) - (backward-delete-char-untabify 1)))) - -(defun ttl-insulate () - "Return true if this location should not be electrified" - (or (ttl-in-string-p) - (ttl-in-comment-p) - (ttl-in-resource-p))) - -(defun ttl-electric-semi () - "Insert a \;. -If variable `ttl-electric-semi-mode' is t, indent the current line, insert -a newline, and indent." - (interactive) - (insert "\;") - (if (and ttl-electric-semi-mode - (not (ttl-insulate))) - (reindent-then-newline-and-indent))) - -(defun ttl-electric-dot () - "Insert a \.. -If variable `ttl-electric-semi-mode' is t, indent the current line, insert -a newline, and indent." - (interactive) - (insert "\.") - (if (and ttl-electric-semi-mode - (not (ttl-insulate))) - (reindent-then-newline-and-indent))) - -(defun ttl-mode-variables () - (set (make-local-variable 'indent-line-function) 'ttl-indent-line)) diff --git a/emacs/.emacs.d/drobillized-theme.el b/emacs/.emacs.d/drobillized-theme.el new file mode 100644 index 0000000..1a5b240 --- /dev/null +++ b/emacs/.emacs.d/drobillized-theme.el @@ -0,0 +1,235 @@ +(deftheme drobillized + "Subdued theme based on Solarized palette.") + +(defgroup drobillized nil + "Drobillized theme options. +Reload the theme after changing anything in this group." + :group 'faces) + +;; Background (dark) +(defcustom base03 "#002B36" "Dark base 3" :group 'drobillized :type '(color)) +(defcustom base02 "#073642" "Dark base 2" :group 'drobillized :type '(color)) + +;; Content +(defcustom base01 "#586E75" "Dark content 1" :group 'drobillized :type '(color)) +(defcustom base00 "#657B83" "Dark content 0" :group 'drobillized :type '(color)) +(defcustom base0 "#839496" "Light content 0" :group 'drobillized :type '(color)) +(defcustom base1 "#93A1A1" "Light content 1" :group 'drobillized :type '(color)) + +;; Background (light) +(defcustom base2 "#EEE8D5" "Light base 2" :group 'drobillized :type '(color)) +(defcustom base3 "#FDF6E3" "Light base 3" :group 'drobillized :type '(color)) + +;; Basic colors +(defcustom yellow "#B58900" "Yellow" :group 'drobillized :type '(color)) +(defcustom orange "#CB4B16" "Orange" :group 'drobillized :type '(color)) +(defcustom red "#DC322F" "Red" :group 'drobillized :type '(color)) +(defcustom magenta "#D33682" "Magenta" :group 'drobillized :type '(color)) +(defcustom violet "#6C71C4" "Violet" :group 'drobillized :type '(color)) +(defcustom blue "#268BD2" "Blue" :group 'drobillized :type '(color)) +(defcustom cyan "#2AA198" "Cyan" :group 'drobillized :type '(color)) +(defcustom green "#859900" "Green" :group 'drobillized :type '(color)) + +;; Darker colors +(defcustom yellow-d "#7B6000" "Dark yellow" :group 'drobillized :type '(color)) +(defcustom orange-d "#8B2C02" "Dark orange" :group 'drobillized :type '(color)) +(defcustom red-d "#990A1B" "Dark red" :group 'drobillized :type '(color)) +(defcustom magenta-d "#93115C" "Dark magenta" :group 'drobillized :type '(color)) +(defcustom violet-d "#3F4D91" "Dark violet" :group 'drobillized :type '(color)) +(defcustom blue-d "#00629D" "Dark blue" :group 'drobillized :type '(color)) +(defcustom cyan-d "#00736F" "Dark cyan" :group 'drobillized :type '(color)) +(defcustom green-d "#546E00" "Dark green" :group 'drobillized :type '(color)) + +;; Lighter colors +(defcustom yellow-l "#DEB542" "Light yellow" :group 'drobillized :type '(color)) +(defcustom orange-l "#F2804F" "Light orange" :group 'drobillized :type '(color)) +(defcustom red-l "#FF6E64" "Light red" :group 'drobillized :type '(color)) +(defcustom magenta-l "#F771AC" "Light magenta" :group 'drobillized :type '(color)) +(defcustom violet-l "#9EA0E5" "Light violet" :group 'drobillized :type '(color)) +(defcustom blue-l "#69B7F0" "Light blue" :group 'drobillized :type '(color)) +(defcustom cyan-l "#69CABF" "Light cyan" :group 'drobillized :type '(color)) +(defcustom green-l "#B4C342" "Light green" :group 'drobillized :type '(color)) + +(custom-theme-set-variables + 'drobillized + ) + +(custom-theme-set-faces + 'drobillized + `(bold ((t (:weight bold)))) + `(compilation-column-number ((t (:foreground "grey40")))) + `(cursor ((t (:background "grey80")))) + `(custom-button ((t (:background "#2D3232" :foreground "#DDD" :box (:line-width 2 :style released-button))))) + `(custom-state ((t (:foreground ,green)))) + `(default ((t (:inherit nil :stipple nil :background "#141414" :foreground "#C3D1D1" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 90 :width normal :foundry "unknown" :family "DejaVu Sans Mono")))) + `(diff-added ((t (:foreground ,green)))) + `(diff-file-header ((((class color) (min-colors 88) (background dark)) (:weight bold)))) + `(diff-header ((((class color) (min-colors 88) (background dark)) (:foreground ,violet)))) + `(diff-refine-added ((t (:inherit diff-refine-change :foreground "green")))) + `(diff-refine-change ((t (:background "grey15"))) t) + `(diff-refine-changed ((t (:background "grey15")))) + `(diff-refine-removed ((t (:inherit diff-refine-change :foreground "red")))) + `(diff-removed ((t (:foreground ,red-d)))) + `(dired-directory ((t (:foreground ,blue)))) + `(diredp-compressed-file-suffix ((t (:foreground "grey50")))) + `(diredp-date-time ((t (:foreground ,violet)))) + `(diredp-dir-heading ((t (:foreground ,green)))) + `(diredp-dir-name ((t (:foreground ,blue)))) + `(diredp-dir-priv ((t (:foreground ,blue-l)))) + `(diredp-exec-priv ((t (:foreground ,green)))) + `(diredp-file-name ((t (:inherit default)))) + `(diredp-file-suffix ((t (:foreground "grey70")))) + `(diredp-ignored-file-name ((t (:foreground ,base01)))) + `(diredp-no-priv ((t nil))) + `(diredp-number ((t (:foreground "grey50")))) + `(diredp-rare-priv ((t (:foreground ,cyan-l)))) + `(diredp-read-priv ((t (:foreground "grey70")))) + `(diredp-symlink ((t (:foreground ,cyan)))) + `(diredp-write-priv ((t (:foreground "grey90")))) + `(erc-action-face ((t (:slant italic)))) + `(erc-current-nick-face ((t (:foreground ,cyan :weight bold)))) + `(erc-input-face ((t (:foreground ,orange)))) + `(erc-my-nick-face ((t (:foreground ,orange :weight bold)))) + `(erc-nick-default-face ((t (:foreground "#A3B1B1")))) + `(erc-notice-face ((t (:foreground ,violet)))) + `(erc-prompt-face ((t (:foreground "white" :weight bold)))) + `(erc-timestamp-face ((t (:foreground ,green)))) + `(error ((t (:foreground ,red :weight bold)))) + `(escape-glyph ((((background dark)) (:foreground "cyan")))) + `(eshell-prompt ((t (:foreground ,green :weight bold)))) + `(font-latex-italic-face ((t (:inherit italic :foreground ,green)))) + `(font-latex-math-face ((t (:foreground ,red)))) + `(font-latex-sectioning-5-face ((t (:inherit nil :foreground ,yellow :weight bold)))) + `(font-latex-sedate-face ((t (:foreground ,cyan-d)))) + `(font-latex-string-face ((t (:foreground ,orange)))) + `(font-latex-warning-face ((t (:inherit bold :foreground ,red)))) + `(font-lock-builtin-face ((t (:foreground ,green)))) + `(font-lock-comment-delimiter-face ((t (:inherit font-lock-comment-face)))) + `(font-lock-comment-face ((t (:foreground ,violet :slant normal)))) + `(font-lock-constant-face ((t (:foreground ,base1)))) + `(font-lock-doc-face ((t (:inherit font-lock-string-face :foreground ,violet)))) + `(font-lock-function-name-face ((t (:inherit default :foreground "#C3D1D1")))) + `(font-lock-keyword-face ((t (:foreground ,base00 :weight bold)))) + `(font-lock-preprocessor-face ((nil (:foreground ,magenta)))) + `(font-lock-string-face ((t (:foreground ,orange)))) + `(font-lock-type-face ((t (:foreground ,green :weight normal)))) + `(font-lock-variable-name-face ((t (:foreground "#E3F1F1" :weight normal)))) + `(font-lock-warning-face ((t (:foreground ,red)))) + `(fringe ((((class color) (background dark)) (:background "grey25")))) + `(ggtags-global-line ((t (:inherit secondary-selection)))) + `(header-line ((t (:inherit mode-line)))) + `(highlight-beyond-fill-column-face ((t (:background ,red-d)))) + `(ivy-confirm-face ((t (:inherit minibuffer-prompt :foreground ,green)))) + `(ivy-current-match ((t (:background ,green-d)))) + `(ivy-match-required-face ((t (:inherit minibuffer-prompt :foreground ,red)))) + `(ivy-minibuffer-match-face-1 ((t (:inherit minibuffer-prompt)))) + `(ivy-minibuffer-match-face-2 ((t (:inherit minibuffer-prompt)))) + `(ivy-minibuffer-match-face-3 ((t (:inherit minibuffer-prompt)))) + `(ivy-minibuffer-match-face-4 ((t (:inherit minibuffer-prompt)))) + `(swiper-line-face ((t (:background "#354900")))) + `(swiper-match-face-1 ((t (:background ,cyan-d)))) + `(swiper-match-face-2 ((t (:background ,green-d)))) + `(swiper-match-face-3 ((t (:background ,cyan-d)))) + `(swiper-match-face-4 ((t (:background ,green-d)))) + `(ivy-remote ((t (:foreground ,violet)))) + `(jabber-chat-prompt-foreign ((t (:foreground ,cyan-d :weight bold)))) + `(jabber-chat-prompt-local ((t (:foreground ,green :weight bold)))) + `(jabber-rare-time-face ((t (:foreground ,violet :weight bold)))) + `(jabber-roster-user-away ((t (:foreground ,green-d :slant italic :weight normal)))) + `(jabber-roster-user-online ((t (:foreground ,green-l :slant normal :weight bold)))) + `(jabber-title-large ((t (:foreground "white" :weight bold)))) + `(jabber-title-medium ((t (:weight bold :height 1.0 :width expanded)))) + `(link ((((class color) (min-colors 88) (background dark)) (:foreground ,blue :inverse-video nil :underline t)))) + `(link-visited ((default (:inherit link)) (((class color) (background dark)) (:foreground ,violet)))) + `(magit-bisect-bad ((t (:foreground ,red)))) + `(magit-bisect-good ((t (:foreground ,green)))) + `(magit-bisect-skip ((t (:foreground ,yellow)))) + `(magit-blame-heading ((t (:background "grey15" :foreground "grey80")))) + `(magit-branch-current ((t (:inherit magit-branch-local :box 1)))) + `(magit-branch-local ((t (:foreground ,cyan)))) + `(magit-branch-remote ((t (:foreground ,green)))) + `(magit-cherry-equivalent ((t (:foreground ,magenta-d)))) + `(magit-cherry-unmatched ((t (:foreground ,cyan-d)))) + `(magit-diff-added ((t (:foreground ,green)))) + `(magit-diff-added-highlight ((t (:foreground ,green)))) + `(magit-diff-base ((t (:background ,green-d :foreground "gray80")))) + `(magit-diff-base-highlight ((t (:background ,green-d :foreground "white")))) + `(magit-diff-context ((t (:foreground "grey70")))) + `(magit-diff-context-highlight ((t (:foreground "grey80")))) + `(magit-diff-file-heading-selection ((t (:inherit magit-diff-file-heading-highlight :foreground ,red)))) + `(magit-diff-hunk-heading ((t (:foreground ,violet)))) + `(magit-diff-hunk-heading-highlight ((t (:foreground ,violet :weight bold)))) + `(magit-diff-hunk-heading-selection ((t (:inherit magit-diff-hunk-heading-highlight :foreground ,red)))) + `(magit-diff-lines-heading ((t (:inherit magit-diff-hunk-heading-highlight :background ,red :foreground "grey80")))) + `(magit-diff-removed ((t (:foreground ,red)))) + `(magit-diff-removed-highlight ((t (:foreground "red")))) + `(magit-diffstat-added ((t (:inherit diff-added)))) + `(magit-diffstat-removed ((t (:inherit diff-removed)))) + `(magit-item-highlight ((t (:background "grey15")))) + `(magit-log-author ((t (:foreground ,red)))) + `(magit-process-ng ((t (:inherit magit-section-heading :foreground ,red)))) + `(magit-process-ok ((t (:inherit magit-section-heading :foreground ,green)))) + `(magit-reflog-amend ((t (:foreground ,magenta)))) + `(magit-reflog-checkout ((t (:foreground ,blue)))) + `(magit-reflog-cherry-pick ((t (:foreground ,green)))) + `(magit-reflog-commit ((t (:foreground ,green)))) + `(magit-reflog-merge ((t (:foreground ,green)))) + `(magit-reflog-other ((t (:foreground ,cyan)))) + `(magit-reflog-rebase ((t (:foreground ,magenta)))) + `(magit-reflog-remote ((t (:foreground ,cyan)))) + `(magit-reflog-reset ((t (:foreground ,red)))) + `(magit-section-heading ((t (:foreground ,green :weight bold)))) + `(magit-section-heading-selection ((t (:foreground ,red)))) + `(magit-sequence-drop ((t (:foreground ,red)))) + `(magit-sequence-head ((t (:foreground ,blue)))) + `(magit-sequence-part ((t (:foreground ,yellow)))) + `(magit-sequence-stop ((t (:foreground ,green)))) + `(magit-signature-bad ((t (:foreground ,red :weight bold)))) + `(magit-signature-error ((t (:foreground ,red)))) + `(magit-signature-expired ((t (:foreground ,orange)))) + `(magit-signature-good ((t (:foreground ,green)))) + `(magit-signature-revoked ((t (:foreground ,violet)))) + `(magit-signature-untrusted ((t (:foreground ,cyan)))) + `(magit-tag ((t (:foreground ,yellow)))) + `(magit-section-highlight ((t (:background "grey15")))) + `(minibuffer-prompt ((((background dark)) (:foreground "white")))) + `(mode-line ((t (:background "#2D3232" :foreground "#AFB3B2" :box nil)))) + `(mode-line-buffer-id ((t (:weight bold)))) + `(mode-line-buffer-id-inactive ((t (:inherit mode-line-buffer-id :foreground "gray30")))) + `(mode-line-inactive ((t (:inherit mode-line :background "#222727" :foreground "gray30")))) + `(nobreak-space ((((class color) (min-colors 88)) (:inherit escape-glyph :underline t)))) + `(powerline-active0 ((t (:inherit mode-line :background "#121717")))) + `(powerline-active1 ((t (:inherit mode-line :background "#222727")))) + `(powerline-active2 ((t (:inherit mode-line :background "#222727")))) + `(powerline-inactive0 ((t (:inherit mode-line-inactive :background "black")))) + `(powerline-inactive1 ((t (:inherit mode-line-inactive :background "#121717")))) + `(powerline-inactive2 ((t (:inherit mode-line-inactive :background "#121717")))) + `(rainbow-delimiters-depth-1-face ((t (:inherit rainbow-delimiters-base-face :foreground "#93A1A1")))) + `(rainbow-delimiters-depth-2-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8BA898")))) + `(rainbow-delimiters-depth-3-face ((t (:inherit rainbow-delimiters-base-face :foreground "#8391A1")))) + `(rainbow-delimiters-depth-4-face ((t (:inherit rainbow-delimiters-base-face :foreground "#7B9888")))) + `(rainbow-delimiters-depth-5-face ((t (:inherit rainbow-delimiters-base-face :foreground "#738191")))) + `(rainbow-delimiters-depth-6-face ((t (:inherit rainbow-delimiters-base-face :foreground "#6B8878")))) + `(rainbow-delimiters-depth-7-face ((t (:inherit rainbow-delimiters-base-face :foreground "#637181")))) + `(rainbow-delimiters-depth-8-face ((t (:inherit rainbow-delimiters-base-face :foreground "#5B7868")))) + `(rainbow-delimiters-depth-9-face ((t (:inherit rainbow-delimiters-base-face :foreground "#536171")))) + `(region ((t (:background "#354900")))) + `(secondary-selection ((t (:background "#344E00")))) + `(smerge-refined-change ((t (:background "grey20"))) t) + `(smerge-refined-changed ((t (:background "grey20")))) + `(spaceline-highlight-face ((t (:background "#272A2A" :foreground "#FFFFFF" :inherit (quote mode-line))))) + `(spaceline-modified ((t (:background "#A66" :foreground "#3E3D31" :inherit (quote mode-line))))) + `(spaceline-unmodified ((t (:background "#777" :foreground "#3E3D31" :inherit (quote mode-line))))) + `(success ((t (:foreground ,green :weight bold)))) + `(warning ((t (:foreground ,yellow :weight bold)))) + `(whitespace-indentation ((t (:foreground "grey20")))) + `(whitespace-newline ((t (:foreground "grey20" :weight normal)))) + `(whitespace-space ((t (:foreground "grey20")))) + `(whitespace-space-after-tab ((t (:foreground "grey20")))) + `(whitespace-tab ((t (:foreground "grey20")))) + `(widget-field ((t (:background "#222" :box (:line-width 2 :color "#555"))))) + `(woman-addition ((t (:inherit font-lock-builtin-face :foreground ,blue)))) + `(woman-bold ((t (:inherit bold :foreground ,green)))) + `(woman-italic ((t (:inherit italic :slant italic))))) + +(provide-theme 'drobillized) diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el new file mode 100644 index 0000000..aaa136f --- /dev/null +++ b/emacs/.emacs.d/init.el @@ -0,0 +1,428 @@ +;;; System + +(add-to-list 'load-path (expand-file-name "~/.emacs.d/site-lisp")) + +;; Platform specific configuration +(cond ((equal system-type 'darwin) + (setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin")) + (setq exec-path (append exec-path '("/usr/local/bin"))) + (setq dired-listing-switches "-al") + (scroll-bar-mode nil) + (global-set-key [home] 'move-beginning-of-line) + (global-set-key [end] 'move-end-of-line)) + ((or (equal system-type 'gnu/linux) (equal system-type 'gnu/kfreebsd)) + (setq dired-listing-switches "-al --time-style=long-iso") + (scroll-bar-mode (quote right)))) + +(setq-default + gc-cons-threshold 10000000 + backup-by-copying t + backup-directory-alist `((".*" . ,temporary-file-directory)) + auto-save-file-name-transforms `((".*" ,temporary-file-directory t)) + scheme-program-name "mzscheme" + browse-url-generic-program (executable-find "sensible-browser") + browse-url-browser-function 'browse-url-generic) + +;;; Packages + +(require 'package) +(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/")) +(package-initialize) +(unless (package-installed-p 'use-package) + (progn + (package-refresh-contents) + (package-install 'use-package))) + +(require 'use-package) + +(setq use-package-always-ensure t) +(use-package ace-window) +(use-package clang-format :commands (c-mode c++-mode)) +(use-package counsel :after (ivy) :config (counsel-mode)) +(use-package counsel-gtags :commands ggtags-mode) +(use-package counsel-projectile :after (counsel projectile)) +(use-package diminish) +(use-package dired+) +(use-package dired-rainbow :after (dired+)) +(use-package flyspell :commands flyspell-mode) +(use-package flyspell-correct-ivy :after (flyspell ivy) :commands flyspell-mode) +(use-package ggtags :commands ggtags-mode) +(use-package ivy :config (ivy-mode)) +(use-package llvm-mode :commands llvm-mode) +(use-package magit :commands magit-status :bind ("C-c m" . magit-status) :config (define-key magit-mode-map (kbd "C-") nil)) +(use-package markdown-mode :commands markdown-mode) +(use-package pdf-tools :magic ("%PDF" . pdf-view-mode) :config (pdf-tools-install)) +(use-package projectile :config (projectile-global-mode)) +(use-package rainbow-delimiters :commands prog-mode) +(use-package smart-tabs-mode :commands (c-mode c++-mode)) +(use-package spaceline) +(use-package swiper :commands swiper) +(use-package tramp) + +(require 'spaceline-config) + +;;; Basic editor configuration + +(defalias 'yes-or-no-p 'y-or-n-p) +(delete-selection-mode 1) +(winner-mode 1) +(setq-default tab-width 4) +(setq-default indent-tabs-mode nil) +(setq-default scroll-margin 3) +(spaceline-toggle-buffer-size-off) +(spaceline-toggle-hud-off) +(spaceline-toggle-buffer-encoding-abbrev-off) +(diminish 'abbrev-mode "") +(diminish 'auto-fill-function "↵") +(diminish 'auto-revert-mode "↻") +(diminish 'compilation-in-progress "⚙") +(diminish 'counsel-mode "") +(diminish 'flyspell-mode "✓") +(diminish 'ggtags-mode "☚") +(diminish 'ivy-mode "") +(setq spaceline-minor-modes-separator " ") + +(spaceline-define-segment version-control + "Version control information." + (when vc-mode + (powerline-raw + (s-trim (concat vc-mode + (when (buffer-file-name) + (pcase (vc-state (buffer-file-name)) + (`up-to-date " ") + (`edited " *") + (`added " +") + (`unregistered " ?") + (`removed " -") + (`needs-merge " !") + (`needs-update " ^") + (`ignored " I") + (_ " ?")))))))) + +(spaceline-define-segment buffer-position + "Buffer position in percent" + (format "%3d%%%%" (/ (* 100 (- (line-number-at-pos) 1)) + (max 1 (count-lines (point-min) (point-max)))))) + +;;; Variables + +(custom-set-variables + ;; custom-set-variables was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + '(auto-revert-interval 1) + '(backup-by-copying t) + '(backup-directory-alist (\` ((".*" \, temporary-file-directory)))) + '(browse-url-firefox-new-window-is-tab t) + '(column-number-mode t) + '(compilation-scroll-output t) + '(cursor-in-non-selected-windows (quote hollow)) + '(custom-enabled-themes (quote (drobillized))) + '(custom-safe-themes + (quote + ("c2616934f29a24eded08ab10db3615ba9fa6b91ce0427dd53700d43f94705f42" default))) + '(delete-old-versions t) + '(dired-omit-files "^\\.?#\\|^\\.$\\|^\\.\\.\\|^\\..*$") + '(diredp-hide-details-initially-flag t) + '(diredp-wrap-around-flag nil) + '(erc-autojoin-channels-alist + (quote + ((".*\\.freenode.net" "#ardour" "#ardour-dev" "#ingen" "#lv2" "#moddevices" "#lad")))) + '(erc-autojoin-mode t) + '(erc-join-buffer (quote bury)) + '(erc-log-channels-directory "~/.erc/logs") + '(erc-log-insert-log-on-open t) + '(erc-log-mode t) + '(erc-mode-line-format "%t") + '(erc-prompt ">") + '(erc-track-exclude-server-buffer t) + '(erc-track-exclude-types + (quote + ("JOIN" "NICK" "PART" "QUIT" "MODE" "333" "353" "324" "329" "332" "477"))) + '(fill-column 79) + '(font-lock-maximum-decoration t) + '(frame-background-mode (quote dark)) + '(fringe-mode 0 nil (fringe)) + '(gc-cons-threshold 10000000) + '(grep-find-command + "find . -type f -not -name \"*.svn-base\" -print0 | xargs -0 grep -I -n -s -F ") + '(indicate-empty-lines t) + '(inhibit-startup-screen t) + '(ivy-magic-tilde nil) + '(jabber-account-list + (quote + (("david.e.robillard@gmail.com" + (:network-server . "talk.google.com") + (:port . 5223) + (:connection-type . ssl))))) + '(jabber-chat-buffer-show-avatar nil) + '(jabber-chat-header-line-format + (quote + ("" + (:eval + (jabber-jid-displayname jabber-chatting-with)) + " " + (:eval + (let + ((buddy + (jabber-jid-symbol jabber-chatting-with))) + (propertize + (or + (cdr + (assoc + (get buddy + (quote show)) + jabber-presence-strings)) + (get buddy + (quote show))) + (quote face) + (or + (cdr + (assoc + (get buddy + (quote show)) + jabber-presence-faces)) + (quote jabber-roster-user-online))))) + " " + (:eval + (jabber-fix-status + (get + (jabber-jid-symbol jabber-chatting-with) + (quote status)))) + " " jabber-events-message " " jabber-chatstates-message))) + '(jabber-roster-line-format " %c %-25n %u %-8s %S") + '(jshint-mode-node-program "nodejs") + '(magit-auto-revert-mode nil) + '(magit-diff-refine-hunk (quote all)) + '(menu-bar-mode nil) + '(ns-use-srgb-colorspace nil) + '(package-selected-packages + (quote + (rainbow-delimiters auctex clang-format counsel-gtags counsel-projectile dired+ dired-rainbow flyspell-correct-ivy ggtags ivy magit markdown-mode n3-mode pdf-tools projectile spaceline use-package))) + '(pdf-view-midnight-colors (quote ("#C3D1D1" . "#141414"))) + '(powerline-default-separator (quote arrow)) + '(projectile-completion-system (quote ivy)) + '(projectile-enable-caching t) + '(projectile-mode-line nil) + '(projectile-use-git-grep t) + '(quack-pretty-lambda-p t) + '(quack-run-scheme-always-prompts-p nil) + '(savehist-mode t) + '(scroll-conservatively 5) + '(send-mail-function (quote sendmail-send-it)) + '(show-paren-mode t) + '(speedbar-use-images nil) + '(split-window-preferred-function (quote split-window-horizontally)) + '(tool-bar-mode nil) + '(version-control t) + '(visible-bell nil)) + +(setq ring-bell-function + (lambda () + (let ((orig-fg (face-foreground 'mode-line))) + (set-face-foreground 'mode-line "#F2804F") + (run-with-idle-timer 0.1 nil + (lambda (fg) (set-face-foreground 'mode-line fg)) + orig-fg)))) + +;;; Colours + +(custom-set-faces + ;; custom-set-faces was added by Custom. + ;; If you edit it by hand, you could mess it up, so be careful. + ;; Your init file should contain only one such instance. + ;; If there is more than one, they won't work right. + ) + +;;; Windows + +(defun compile-autoclose (buffer string) + "Close compilation window on success" + (cond ((and (string-match "compilation" (buffer-name buffer)) + (string-match "finished" string)) + (bury-buffer "*compilation*") + (winner-undo) + (message "Build successful.")) + (t + (message "Compilation exited abnormally: %s" string)))) + +(defun rotate-windows () + "Rotate windows" + (interactive) + (if (> (count-windows) 1) + (let ((i 0) + (num-windows (count-windows))) + (while (< i (- num-windows 1)) + (let* ((w1 (elt (window-list) i)) + (w2 (elt (window-list) (% (+ i 1) num-windows))) + (b1 (window-buffer w1)) + (b2 (window-buffer w2)) + (s1 (window-start w1)) + (s2 (window-start w2))) + (set-window-buffer w1 b2) + (set-window-buffer w2 b1) + (set-window-start w1 s2) + (set-window-start w2 s1) + (setq i (+ i 1))))))) + +(setq split-height-threshold nil) +(setq split-width-threshold 0) +(setq compilation-finish-functions 'compile-autoclose) + +;; Remove slow Maven regexp that makes the compilation buffer clunky +(setq compilation-error-regexp-alist + (delete 'maven compilation-error-regexp-alist)) + +;;; Key bindings + +(global-set-key (kbd "C-") 'previous-buffer) +(global-set-key (kbd "C-") 'next-buffer) +(global-set-key (kbd "C-") 'ace-window) +(global-set-key (kbd "C-b") 'compile) +(global-set-key (kbd "C-m") 'newline-and-indent) +(global-set-key (kbd "C-n") 'next-error) +(global-set-key (kbd "C-p") 'previous-error) +(global-set-key (kbd "C-s") 'swiper) + +(global-set-key (kbd "C-c <") 'first-error) +(global-set-key (kbd "C-c =") 'set-variable) +(global-set-key (kbd "C-c I") 'clang-format-region) +(global-set-key (kbd "C-c R") 'replace-regexp) +(global-set-key (kbd "C-c a") 'align) +(global-set-key (kbd "C-c c") 'comment-region) +(global-set-key (kbd "C-c d") 'svn-status-show-svn-diff) +(global-set-key (kbd "C-c e") 'erc-track-switch-buffer) +(global-set-key (kbd "C-c f") 'ff-find-other-file) +(global-set-key (kbd "C-c g") 'grep-find) +(global-set-key (kbd "C-c i") 'clang-format-buffer) +(global-set-key (kbd "C-c m") 'magit-status) +(global-set-key (kbd "C-c r") 'replace-string) +(global-set-key (kbd "C-c s") 'sort-lines) +(global-set-key (kbd "C-c t") 'toggle-truncate-lines) +(global-set-key (kbd "C-c u") 'uncomment-region) +(global-set-key (kbd "C-c w") 'rotate-windows) + +;;; File modes + +(add-hook 'prog-mode-hook #'rainbow-delimiters-mode) + +;; C/C++ + +(defconst my-c-style + '((c-block-comment-prefix . " ") + (c-comment-only-line-offset . 0) + (c-auto-align-backslashes . nil) + (c-label-minimum-indentation . 0) + (c-hungry-delete-key . t) + (c-indent-comments-syntactically-p . nil) + (c-hanging-braces-alist . ((brace-list-open after) + (defun-open after) + (defun-close before after) + (class-open after) + (class-close before after) + (namespace-open after) + (inline-open after) + (inline-close before after) + (block-open after) + (block-close . c-snug-do-while) + (extern-lang-open after) + (extern-lang-close after) + (statement-case-open after) + (substatement-open after))) + (c-hanging-colons-alist . ((case-label) + (label after) + (access-label after) + (member-init-intro before) + (inher-intro))) + (c-hanging-semi&comma-criteria . (c-semi&comma-no-newlines-for-oneline-inliners + c-semi&comma-inside-parenlist + c-semi&comma-no-newlines-before-nonblanks)) + (c-cleanup-list . (brace-catch-brace + brace-else-brace + brace-elseif-brace + compact-empty-funcall + defun-close-semi + empty-defun-braces + list-close-comma + one-liner-defun + scope-operator)) + (c-offsets-alist . ((func-decl-cont . ++) + (member-init-intro . +) + (inher-intro . ++) + (comment-intro . 0) + (arglist-close . c-lineup-arglist) + (topmost-intro . 0) + (block-open . 0) + (inline-open . 0) + (substatement-open . 0) + (label . /) + (case-label . 0) + (statement-case-open . +) + (statement-case-intro . +) + (access-label . -) + (innamespace . 0) + (inextern-lang . 0) + (extern-lang-open . 0) + (label . -))))) + +(c-add-style "drobilla" my-c-style) + +(defun my-c-mode-common-hook () + "C mode for people with taste." + (require 'smarttabs) + (auto-fill-mode 1) + (abbrev-mode -1) + (set-fill-column 79) + (smart-tabs-mode-enable) + (setq tab-width 4) + (setq indent-tabs-mode t) + (setq truncate-lines t) + (setq show-trailing-whitespace t) + (smart-tabs-advice c-indent-line c-basic-offset) + (c-set-style "drobilla")) + +(add-hook 'c-mode-common-hook 'my-c-mode-common-hook) +(add-hook 'c++-mode-common-hook 'my-c-mode-common-hook) + +;; Python + +(add-hook 'python-mode-hook + (lambda () + (setq tab-width 4) + (setq indent-tabs-mode nil) + (setq show-trailing-whitespace))) + +;; PDF + +(defun my-doc-view-hook () + (auto-revert-mode) + (blink-cursor-mode -1)) + +(add-hook 'doc-view-mode-hook 'my-doc-view-hook) +(add-hook 'pdf-view-mode-hook 'my-doc-view-hook) + +(spaceline-define-segment line-column + "The current line and column numbers." + (if (eq major-mode 'pdf-view-mode) + ;; Show page number and count for PDF documents + (concat (number-to-string (pdf-view-current-page)) + "/" + (number-to-string (pdf-cache-number-of-pages))) + mode-line-position + "%l:%c")) + +;; Associations + +(add-to-list 'auto-mode-alist '("\\.pl\\'" . prolog-mode)) +(add-to-list 'auto-mode-alist '("\\.n3" . n3-mode)) +(add-to-list 'auto-mode-alist '("\\.ttl" . n3-mode)) +(add-to-list 'auto-mode-alist '("\\.owl" . n3-mode)) +(add-to-list 'auto-mode-alist '("\\.ll" . llvm-mode)) +(add-to-list 'auto-mode-alist '("\\.md" . markdown-mode)) +(add-to-list 'auto-mode-alist '("\\.pdf" . pdf-view-mode)) + +;;; Launch + +(spaceline-spacemacs-theme) +(server-start) diff --git a/emacs/.emacs.d/site-lisp/n3-mode.el b/emacs/.emacs.d/site-lisp/n3-mode.el new file mode 100644 index 0000000..8beced6 --- /dev/null +++ b/emacs/.emacs.d/site-lisp/n3-mode.el @@ -0,0 +1,44 @@ +;;; n3-mode.el --- mode for Notation 3 +; $Id: n3-mode.el 4084 2007-12-15 17:10:13Z hugoh $ + +;; Copyright (c) 2003-2007 Hugo Haas + +;; For documentation on Notation 3, see: +;; http://www.w3.org/DesignIssues/Notation3.html + +;;; Comentary: + +;; Goals: +;; - sytax highlighting +;; - completion +;; - indentation + +;; What it does now: +;; - Syntax highlighting + +;;; Code: + +(require 'generic) + +(define-generic-mode 'n3-mode + ;; comment char + (list "# ") + ;; keywords + (list "this" "a") + ;; additional font-lock'ing + '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t) + ("\\(\\S-*?:\\)" 1 font-lock-type-face t) + (":\\(\\S-+?\\)\\>" 1 font-lock-constant-face t) + ("\\(<.*?>\\)" 1 font-lock-function-name-face t) + ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t) +; Bug: some trailing characters are highlighted; restricting comments regexp +; ("\\(#.*\\)" 1 font-lock-comment-face t) + ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t) + ) + ;; auto-mode + (list "\\.n3$") + ;; additional setup + nil + ;; description + "Mode for Notation 3 documents." + ) diff --git a/emacs/.emacs.d/site-lisp/ppindent.el b/emacs/.emacs.d/site-lisp/ppindent.el new file mode 100644 index 0000000..84c9702 --- /dev/null +++ b/emacs/.emacs.d/site-lisp/ppindent.el @@ -0,0 +1,138 @@ +;;; ppindent.el --- Indents C preprocessor directives + +;; Copyright (C) 2007 Free Software Foundation, Inc. + +;; Author: Craig McDaniel +;; Keywords: languages, c +;; Maintainer: Craig McDaniel + +;; This file is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 2, or (at your option) +;; any later version. + +;; This file is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +;; Boston, MA 02111-1307, USA. + +;;; Commentary: + +;; PPINDENT indents C-preprocessor statements depending on the current +;; #if..., #el.., #endif level. It only modifies lines with "#" as the +;; first non-blank character and therefore does not conflict with the +;; normal C indentation. Unlike a true indent, it inserts the +;; requisite number of spaces after, rather than before the "#" +;; character. This type of preprocesor indent is commonly used to +;; provide the most compatibility with different C-compilers. +;; +;; Example: + +;; #ifdef WOO +;; .... +;; #if defined(X) && !defined(Y) +;; #ifdef Q8 +;; ... +;; #else +;; ... +;; .... +;; #elif defined (Z) +;; .... +;; #endif +;; #endif +;; #endif + +;; After "M-x ppindent-c" becomes: + +;; #ifdef WOO +;; .... +;; # if defined(X) && !defined(Y) +;; # ifdef Q8 +;; ... +;; # else +;; ... +;; .... +;; # elif defined (Z) +;; .... +;; # endif +;; # endif +;; #endif + +;; Two functions are provided: PPINDENT-C indents as described +;; above. PPINDENT-H does not indent the first level, assuming that +;; .h/.hpp files use an #ifdef guard around the entire file. + +;; You can customize PPINDENT-INCREMENT if you want to use something +;; other than 2 spaces for the indent. + +;;; History: + +;; 2007-01-19 WCM Initial version + +;;; Code: + +(provide 'ppindent) + +(defgroup pp-indent nil + "Indent C preproccessor directives." + :group 'c) + +(defcustom ppindent-increment 2 + "Number of spaces per indention level. + +Used in C pre-processor indent functions ppindent-c and ppindent-h" + :type 'number + :group 'pp-indent) + +(defun starts-withp (str prefix) + "str starts with prefix" + (eql (compare-strings prefix nil nil str nil (length prefix)) t)) + +(defun my-make-string (length init) + "just like make-string, but makes an empty string if length is negative" + (when (minusp length) + (setf length 0)) + (make-string length init)) + +(defun ppindent-aux (start) + (let ((cnt start)) + (goto-char (point-min)) + (while (re-search-forward "^[ \t]*#[ \t]*\\(.*\\)" nil t) + (cond ((starts-withp (match-string-no-properties 1) "if") + (replace-match (concat "#" (my-make-string cnt ?\s) "\\1")) + (incf cnt ppindent-increment)) + ((starts-withp (match-string-no-properties 1) "el") + (when (< (- cnt ppindent-increment) start) + (throw 'err `(,(line-number-at-pos) "Unmatched #else or #elif"))) + (replace-match (concat "#" (my-make-string + (- cnt ppindent-increment) + ?\s) "\\1"))) + ((starts-withp (match-string-no-properties 1) "endif") + (when (< (- cnt ppindent-increment) start) + (throw 'err `(,(line-number-at-pos) "Unmatched #endif"))) + (decf cnt ppindent-increment) + (replace-match (concat "#" (my-make-string cnt ?\s) "\\1"))) + (t + (replace-match (concat "#" (my-make-string cnt ?\s) "\\1"))))))) + +(defun ppindent-buffer (start) + (let ((result (catch 'err (save-excursion (ppindent-aux start))))) + (when result + (goto-line (car result)) + (error "Error: %s" (cadr result))))) + +(defun ppindent-c () + "Indent all C pre-processor statements" + (interactive) + (ppindent-buffer 0)) + +(defun ppindent-h () + "Indent C pre-processor statements, keeping first level #ifdef unindented" + (interactive) + (ppindent-buffer (- ppindent-increment))) + diff --git a/emacs/.emacs.d/site-lisp/ttl-mode.el b/emacs/.emacs.d/site-lisp/ttl-mode.el new file mode 100644 index 0000000..ee147de --- /dev/null +++ b/emacs/.emacs.d/site-lisp/ttl-mode.el @@ -0,0 +1,209 @@ +;;; ttl-mode.el --- mode for Turtle(RDF) +;; Based on n3-mode.el --- mode for Notation 3, +;; at http://larve.net/people/hugo/2003/scratchpad/NotationThreeEmacsMode.html +;; Also draws on http://dishevelled.net/elisp/turtle-mode.el (which is for the _other_ turtle!) + +;; Copyright (c) 2003-2007 Hugo Haas +;; Extended 2011-2012, by Norman Gray +;; +;; See Hugo's commentary for original goals and further discussion. + +;; Project hosted at . See there for updates. + +;; To use: +;; +;; (autoload 'ttl-mode "ttl-mode" "Major mode for OWL or Turtle files" t) +;; (add-hook 'ttl-mode-hook ; Turn on font lock when in ttl mode +;; 'turn-on-font-lock) +;; (setq auto-mode-alist +;; (append +;; (list +;; '("\\.n3" . ttl-mode) +;; '("\\.ttl" . ttl-mode)) +;; auto-mode-alist)) + +;;; Code: + +(require 'generic) + +(define-generic-mode 'ttl + ;; comment char + (list "# ") + ;; keywords + (list "this" "a") + ;; additional font-lock'ing + '(("\\(@prefix\\)\\>" 1 font-lock-keyword-face t) ;keywords + ("\\^\\^[^,;.]+" 0 font-lock-preprocessor-face t) ;literal types + ("@[[:word:]_]+" 0 font-lock-preprocessor-face t) ;languages + ("\\(\\S-*?:\\)" 1 font-lock-type-face nil) ;prefix + (":\\([[:word:]_-]+\\)\\>" 1 font-lock-constant-face nil) ;suffix + ("\\(<.*?>\\)" 1 font-lock-function-name-face t) ;resources + ("\\(\\\".*?\\\"\\)" 1 font-lock-string-face t) ;strings + ("\\(\\\"\\\"\\\".*?\\\"\\\"\\\"\\)" 1 font-lock-string-face t) ;doesn't work over newlines? +; Bug: some trailing characters are highlighted; restricting comments regexp +; ("\\(#.*\\)" 1 font-lock-comment-face t) + ("^\\s-*\\(#.*\\)" 1 font-lock-comment-face t) ;comment + ) + ;; auto-mode + (list "\\.n3$" "\\.ttl") + ;; additional setup + nil + ;; description + "Mode for Turtle RDF documents." + ) + +(defun ttl-base () + (interactive) + (generic-mode "ttl")) + +(defun ttl-indent-line () + (interactive) + (indent-line-to + (or (ignore-errors (ttl-calculate-indentation)) + 0))) + +(defun ttl-calculate-indentation () + (save-excursion + (beginning-of-line) (skip-chars-forward "\t ") + (cond ((ttl-in-string-p) 8) + ((looking-at "$") + ;; empty line -- use same indentation as previous line + (save-excursion + (forward-line -1) + (skip-chars-forward "\t ") + (current-column))) + ((looking-at "@") 0) ;@prefix or @base + ((looking-at "#") 0) + ((looking-at "<");(looking-at "\\S-+\\s-*$") + ;;only a single expression on the line -- a subject + 0) + ((save-excursion + (forward-line -1) + (end-of-line) + (if (not (looking-back "\\[")) + nil + (beginning-of-line) + (skip-chars-forward "\t ") + (+ (current-column) 4)))) + (t 4)))) + +;; (defun turtle-indent-block () +;; (interactive) +;; (indent-region (point) +;; (save-excursion (forward-xxx) (point)))) + +(defvar ttl-mode-map (make-sparse-keymap)) +(define-derived-mode ttl-mode ttl-base + "Turtle RDF" + (setq indent-tabs-mode t) + (ttl-mode-variables) +; (define-key ttl-mode-map (kbd "C-M-q") +; 'turtle-indent-block) + (define-key ttl-mode-map (kbd "\;") 'ttl-electric-semi) + (define-key ttl-mode-map (kbd "\.") 'ttl-electric-dot) + (define-key ttl-mode-map (kbd "RET") 'newline-and-indent) + (define-key ttl-mode-map [backspace] 'ttl-hungry-delete-backwards) + (use-local-map ttl-mode-map)) + +(defcustom ttl-electric-semi-mode nil + "*If non-nil, `\;' will self insert, reindent the line, and do a newline. +If nil, just insert a `\;'. (To insert while t, do: \\[quoted-insert] \;)." + :group 'ttl + :type 'boolean) + +(defun beginning-of-stanza () + "Find the beginning of a stanza, indicated by non-whitespace at the beginning of a line." + (re-search-backward "^\\S-" (point-min) t)) + +(defun ttl-in-string-p () + "Is point inside a string or a long-string?" + (save-excursion + (let ((here (point)) + (in-p nil)) + (beginning-of-stanza) + (condition-case nil + (progn + (while (<= (point) here) + (if in-p + (progn + (search-forward in-p (point-max) nil) + (setq in-p nil)) + (re-search-forward "\"\\(\"\"\\)?" (point-max) nil) + (if (char-equal (char-before (- (point) 1)) ?\") + (setq in-p "\"\"\"") + (setq in-p "\"")))) + (not in-p)) + (search-failed ;reached EOF + (if in-p ;this indicates that we're inside a string + (message "Unbalanced quotes -- reached EOF inside string") + nil)))))) + +(defun *ttl-search-in-line-for-comment (limit) + "Search for a comment character from the current position, before point LIMIT; changes current position. Return location of comment, or nil if none can be found" + (let ((new-point (re-search-forward "[#<]" limit t))) + (cond ((not new-point) nil) + ((looking-back "#") new-point) ;found comment + (t ;looking-back "<" + (if (not (search-forward ">" limit t)) + nil ;starting point is within resource + (*ttl-search-in-line-for-comment limit)))))) ;recurse + +(defun ttl-in-comment-p () + "Is point inside a comment?" + (save-excursion + (let ((here (point))) + (beginning-of-line) + (*ttl-search-in-line-for-comment here)))) + +(defun ttl-in-resource-p () + "Is point within a resource, marked by <...>?" + (save-excursion + (and (re-search-backward "[<> ]" nil t) + (looking-at "<")))) + +(defun ttl-skip-ws-backwards () ;adapted from cc-mode + "Move backwards across whitespace." + (while (progn + (skip-chars-backward " \t\n\r\f\v") + (and (eolp) + (eq (char-before) ?\\))) + (backward-char))) + +(defun ttl-hungry-delete-backwards () + "Delete backwards, either all of the preceding whitespace, +or a single non-whitespace character if there is no whitespace before point." + (interactive) + (let ((here (point))) + (ttl-skip-ws-backwards) + (if (/= (point) here) + (delete-region (point) here) + (backward-delete-char-untabify 1)))) + +(defun ttl-insulate () + "Return true if this location should not be electrified" + (or (ttl-in-string-p) + (ttl-in-comment-p) + (ttl-in-resource-p))) + +(defun ttl-electric-semi () + "Insert a \;. +If variable `ttl-electric-semi-mode' is t, indent the current line, insert +a newline, and indent." + (interactive) + (insert "\;") + (if (and ttl-electric-semi-mode + (not (ttl-insulate))) + (reindent-then-newline-and-indent))) + +(defun ttl-electric-dot () + "Insert a \.. +If variable `ttl-electric-semi-mode' is t, indent the current line, insert +a newline, and indent." + (interactive) + (insert "\.") + (if (and ttl-electric-semi-mode + (not (ttl-insulate))) + (reindent-then-newline-and-indent))) + +(defun ttl-mode-variables () + (set (make-local-variable 'indent-line-function) 'ttl-indent-line)) diff --git a/sxhkd/.config/sxhkd/sxhkdrc b/sxhkd/.config/sxhkd/sxhkdrc new file mode 100644 index 0000000..3be442f --- /dev/null +++ b/sxhkd/.config/sxhkd/sxhkdrc @@ -0,0 +1,153 @@ +# +# wm independent hotkeys +# + +# terminal emulator +super + Return + gnome-terminal + +# program launcher +super + ctrl + r + rofi -fg "#92A850" -font "Monospace 14" -show run + +# make sxhkd reload its configuration files: +super + Escape + pkill -USR1 -x sxhkd + +# show panel +super + ctrl + p + bspc config top_padding $PANEL_HEIGHT; \ + xdotool search --name "Top Expanded Edge Panel" windowmap; \ + xdotool search --name "Top Expanded Edge Panel" windowraise; + +# hide panel +super + ctrl + shift + p + xdotool search --name "Top Expanded Edge Panel" windowunmap; \ + bspc config top_padding 0 + +# +# multimedia keys +# + +# XF86MonBrightnessDown +# xbacklight -dec 2 + +# XF86MonBrightnessUp +# xbacklight -inc 2 + +# XF86KbdBrightnessDown +# /home/drobilla/bin/kbdled.sh down + +# XF86KbdBrightnessUp +# /home/drobilla/bin/kbdled.sh up + +# XF86AudioRaiseVolume +# amixer sset Master 5%+ + +# XF86AudioLowerVolume +# amixer sset Master 5%- + +# XF86AudioMute +# amixer set Master toggle + +# +# bspwm hotkeys +# + +# quit bspwm normally +super + alt + Escape + bspc quit + +# close and kill +super + {_,shift + }w + bspc node -{c,k} + +# alternate between the tiled and monocle layout +super + space + bspc desktop -l next + +# if the current node is automatic, send it to the last manual, otherwise pull the last leaf +super + y + bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused + +# swap the current node and the biggest node +super + g + bspc node -s biggest + +# +# state/flags +# + +# set the window state +super + {t,shift + t,l,f} + bspc node -t {tiled,pseudo_tiled,floating,fullscreen} + +# set the node flags +super + ctrl + {x,y,z} + bspc node -g {locked,sticky,private} + +# +# focus/swap +# + +# focus the node in the given direction +super + {_,shift + }{Left,Down,Up,Right} + bspc node -{f,s} {west,south,north,east} + +# focus the node for the given path jump +# super + {p,b,comma,period} +# bspc node -f @{parent,brother,first,second} + +# focus the next/previous node in the active desktop +super + {n,p} + bspc node -f {next.active,prev.active} + +# focus the next/previous desktop +super + bracket{left,right} + bspc desktop -f {prev,next} + +# focus the last node/desktop +super + {grave,Tab} + bspc {node,desktop} -f last + +# focus the older or newer node in the focus history +super + {o,i} + bspc wm -h off; \ + bspc node {older,newer} -f; \ + bspc wm -h on + +# focus or send to the given desktop +super + {_,shift + }{1-9,0} + bspc {desktop -f,node -d} '^{1-9,10}' + +# +# preselect +# + +# preselect the direction +super + ctrl + {Left,Down,Up,Right} + bspc node -p {west,south,north,east} + +# preselect the ratio +super + ctrl + {1-9} + bspc node -o 0.{1-9} + +# cancel the preselection for the focused node or desktop +super + ctrl + {_,shift + }space + bspc node @{_,/} -p cancel + +# +# resize tiled/floating +# + +# expand the tiled space in the given direction +super + alt + {Left,Down,Up,Right} + bspc node {@west -r -10,@south -r +10,@north -r -10,@east -r +10} + +# contract the tiled space in the given direction +super + alt + shift + {Left,Down,Up,Right} + bspc node {@east -r -10,@north -r +10,@south -r -10,@west -r +10} + +# move a floating window +# super + {Left,Down,Up,Right} +# xdo move {-x -20,-y +20,-y -20,-x +20} diff --git a/sxhkd/sxhkdrc b/sxhkd/sxhkdrc deleted file mode 100644 index 3be442f..0000000 --- a/sxhkd/sxhkdrc +++ /dev/null @@ -1,153 +0,0 @@ -# -# wm independent hotkeys -# - -# terminal emulator -super + Return - gnome-terminal - -# program launcher -super + ctrl + r - rofi -fg "#92A850" -font "Monospace 14" -show run - -# make sxhkd reload its configuration files: -super + Escape - pkill -USR1 -x sxhkd - -# show panel -super + ctrl + p - bspc config top_padding $PANEL_HEIGHT; \ - xdotool search --name "Top Expanded Edge Panel" windowmap; \ - xdotool search --name "Top Expanded Edge Panel" windowraise; - -# hide panel -super + ctrl + shift + p - xdotool search --name "Top Expanded Edge Panel" windowunmap; \ - bspc config top_padding 0 - -# -# multimedia keys -# - -# XF86MonBrightnessDown -# xbacklight -dec 2 - -# XF86MonBrightnessUp -# xbacklight -inc 2 - -# XF86KbdBrightnessDown -# /home/drobilla/bin/kbdled.sh down - -# XF86KbdBrightnessUp -# /home/drobilla/bin/kbdled.sh up - -# XF86AudioRaiseVolume -# amixer sset Master 5%+ - -# XF86AudioLowerVolume -# amixer sset Master 5%- - -# XF86AudioMute -# amixer set Master toggle - -# -# bspwm hotkeys -# - -# quit bspwm normally -super + alt + Escape - bspc quit - -# close and kill -super + {_,shift + }w - bspc node -{c,k} - -# alternate between the tiled and monocle layout -super + space - bspc desktop -l next - -# if the current node is automatic, send it to the last manual, otherwise pull the last leaf -super + y - bspc query -N -n focused.automatic && bspc node -n last.!automatic || bspc node last.leaf -n focused - -# swap the current node and the biggest node -super + g - bspc node -s biggest - -# -# state/flags -# - -# set the window state -super + {t,shift + t,l,f} - bspc node -t {tiled,pseudo_tiled,floating,fullscreen} - -# set the node flags -super + ctrl + {x,y,z} - bspc node -g {locked,sticky,private} - -# -# focus/swap -# - -# focus the node in the given direction -super + {_,shift + }{Left,Down,Up,Right} - bspc node -{f,s} {west,south,north,east} - -# focus the node for the given path jump -# super + {p,b,comma,period} -# bspc node -f @{parent,brother,first,second} - -# focus the next/previous node in the active desktop -super + {n,p} - bspc node -f {next.active,prev.active} - -# focus the next/previous desktop -super + bracket{left,right} - bspc desktop -f {prev,next} - -# focus the last node/desktop -super + {grave,Tab} - bspc {node,desktop} -f last - -# focus the older or newer node in the focus history -super + {o,i} - bspc wm -h off; \ - bspc node {older,newer} -f; \ - bspc wm -h on - -# focus or send to the given desktop -super + {_,shift + }{1-9,0} - bspc {desktop -f,node -d} '^{1-9,10}' - -# -# preselect -# - -# preselect the direction -super + ctrl + {Left,Down,Up,Right} - bspc node -p {west,south,north,east} - -# preselect the ratio -super + ctrl + {1-9} - bspc node -o 0.{1-9} - -# cancel the preselection for the focused node or desktop -super + ctrl + {_,shift + }space - bspc node @{_,/} -p cancel - -# -# resize tiled/floating -# - -# expand the tiled space in the given direction -super + alt + {Left,Down,Up,Right} - bspc node {@west -r -10,@south -r +10,@north -r -10,@east -r +10} - -# contract the tiled space in the given direction -super + alt + shift + {Left,Down,Up,Right} - bspc node {@east -r -10,@north -r +10,@south -r -10,@west -r +10} - -# move a floating window -# super + {Left,Down,Up,Right} -# xdo move {-x -20,-y +20,-y -20,-x +20} diff --git a/tmux.conf b/tmux.conf deleted file mode 100644 index 2612405..0000000 --- a/tmux.conf +++ /dev/null @@ -1,8 +0,0 @@ -set -g status-utf8 on -set -g utf8 on - -set -g default-terminal "screen-256color" - -set -g status-bg colour235 -set -g status-fg colour251 -set -g status-right "#T" \ No newline at end of file diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf new file mode 100644 index 0000000..2612405 --- /dev/null +++ b/tmux/.tmux.conf @@ -0,0 +1,8 @@ +set -g status-utf8 on +set -g utf8 on + +set -g default-terminal "screen-256color" + +set -g status-bg colour235 +set -g status-fg colour251 +set -g status-right "#T" \ No newline at end of file diff --git a/vim/.vimrc b/vim/.vimrc new file mode 100644 index 0000000..b16c7c4 --- /dev/null +++ b/vim/.vimrc @@ -0,0 +1,22 @@ +set wildmode=longest,list +set wildmenu + +set ts=4 +set shiftwidth=4 +set bs=2 +set showmatch +set tags=./tags + +set hlsearch +set incsearch + +set laststatus=2 +set ruler + +set noexpandtab + +set showbreak=>>> + +set guioptions-=T + +:syntax on diff --git a/vimrc b/vimrc deleted file mode 100644 index b16c7c4..0000000 --- a/vimrc +++ /dev/null @@ -1,22 +0,0 @@ -set wildmode=longest,list -set wildmenu - -set ts=4 -set shiftwidth=4 -set bs=2 -set showmatch -set tags=./tags - -set hlsearch -set incsearch - -set laststatus=2 -set ruler - -set noexpandtab - -set showbreak=>>> - -set guioptions-=T - -:syntax on -- cgit v1.2.1