Commits

firefly  committed b74df08

Updates!

  • Participants
  • Parent commits 03eeaf5

Comments (0)

Files changed (10)

 urxvt*scrollBar: false
 
 ! Pseudo transparency
-urxvt*shading:     20
-urxvt*transparent: true
+!urxvt*shading:     20
+!urxvt*transparent: true
 
 !mplus-1mn-light
 !urxvt.font: xft:OCRB:pixelsize=10
 urxvt.perl-ext-common: default,url-select
 
 urxvt.keysym.A-n:     perl:url-select:select_next
-urxvt.urlLauncher:    firefox
+!urxvt.urlLauncher:    firefox
+urxvt.urlLauncher:    luakit
 urxvt.underlineURLs:  true
 
-! Colours
-urxvt.color1:  #E96060
-urxvt.color2:  #2A8C2A
-urxvt.color3:  #D9A641
-urxvt.color4:  #4E69BE
-urxvt.color5:  #B037B0
-urxvt.color6:  #66C3DE
+!-- Colours -------------------------------------
+
+!! FireFly's mix
+!urxvt.color1:  #CC2020
+!urxvt.color2:  #2A8C2A
+!urxvt.color3:  #D9A641
+!urxvt.color4:  #3E59BE
+!urxvt.color5:  #B037B0
+!urxvt.color6:  #66C3DE
+!! TODO: Figure out when 7,8,15,16 are used. black/white?
+!urxvt.color7:  #D3D7CF
+!urxvt.color8:  #555753
+!
+!urxvt.color9:  #E96060
+!urxvt.color10: #7ACA4A
+!urxvt.color11: #F9C64F
+!!urxvt.color11: #FCE94F
+!urxvt.color12: #5E79CC
+!urxvt.color13: #B037B0
+!urxvt.color14: #66E2E2
+!
+!urxvt.color15: #D4D4A4
+!urxvt.color16: #1E1EF8
+
+
+!! jellybeans colours -- https://github.com/nanotech/jellybeans.vim/blob/master/ansi-term-colors.txt
+urxvt.color0: #3b3b3b
+urxvt.color1: #cf6a4b
+urxvt.color2: #99ad6a
+urxvt.color3: #d8ad4c
+urxvt.color4: #597bc5
+urxvt.color5: #a037b0
+urxvt.color6: #71b9f8
+urxvt.color7: #adadad
 
 urxvt.color9:  #E96060
-urxvt.color10: #2A8C2A
-urxvt.color11: #D9A641
-urxvt.color12: #4E69BE
+urxvt.color10: #7ACA4A
+urxvt.color11: #F9C64F
+urxvt.color12: #5E79CC
 urxvt.color13: #B037B0
-urxvt.color14: #66C3DE
+urxvt.color14: #66E2E2
+
+
+!! Paul Rogret's colours: http://www.reddit.com/r/archlinux/comments/ozh5a/my_archlinux_desktop_followup/c3ldr7d
+!urxvt.color1:  #CC0000
+!urxvt.color2:  #4E9A06
+!urxvt.color3:  #C4A000
+!urxvt.color4:  #3465A4
+!urxvt.color5:  #75507B
+!urxvt.color6:  #06989A
+!urxvt.color7:  #D3D7CF
+!urxvt.color8:  #555753
+
+!urxvt.color9:  #E96060
+!urxvt.color10: #8AE234
+!urxvt.color11: #FCE94F
+!urxvt.color12: #729FCF
+!urxvt.color13: #AD7FA8
+!urxvt.color14: #34E2E2
+!urxvt.color15: #D4D4A4
+!urxvt.color16: #1E1EF8
+
 
 ! -- xft settings ---------------------------------------------------
 !Xft.dpi:       124
 Xft.dpi:       114
 !Xft.dpi:       96
-
 !Xft.autohint:  0
 !Xft.lcdfilter: lcddefault
 !Xft.hintstyle: hintfull
 !Xft.hinting:   1
 Xft.antialias: 1
 Xft.rgba:      rgb
+
+!Xft.antialias: true
+!Xft.rgba:      rgb
+!Xft.lcdfilter: lcddefault
+!Xft.hinting:   true
+!Xft.hintstyle: hintfull
+
-#
-# ~/.bashrc
-#
+# Check for an interactive session
+[ -z "$PS1" ] && return
 
-# If not running interactively, don't do anything
-[[ $- != *i* ]] && return
+source "${HOME}/.shellrc"
 
-alias ls='ls --color=auto'
-PS1='[\u@\h \W]\$ '
+#### Setup prompt ###################################################
+color() {
+	case $1 in
+		white   ) echo 30; return ;;
+		red     ) echo 31; return ;;
+		green   ) echo 32; return ;;
+		yellow  ) echo 33; return ;;
+		blue    ) echo 34; return ;;
+		magenta ) echo 35; return ;;
+		cyan    ) echo 36; return ;;
+		*       ) echo  1; return ;; # bold → "something's wrong"
+	esac
+}
 
-PATH="$PATH:$HOME/node_modules/.bin"
+prompt_format="\e[`color $prompt_color`m"
+
+PS1="[\[$prompt_format\]\u@\h\[\e[m\] \w]\$ "
+
+#### Setup autocompletion ###########################################
+man() {
+	env \
+		LESS_TERMCAP_mb=$(printf "\e[1;37m") \
+		LESS_TERMCAP_md=$(printf "\e[1;37m") \
+		LESS_TERMCAP_me=$(printf "\e[0m") \
+		LESS_TERMCAP_se=$(printf "\e[0m") \
+		LESS_TERMCAP_so=$(printf "\e[1;47;30m") \
+		LESS_TERMCAP_ue=$(printf "\e[0m") \
+		LESS_TERMCAP_us=$(printf "\e[0;36m") \
+			man "$@"
+}
+
+complete -cf man
+complete -cf sudo
+#source /usr/lib/node_modules/npm/lib/utils/completion.sh
+
+#export GTK_IM_MODULE=ibus
+#export XMODIFIERS=@im=ibus
+#export QT_IM_MODULE=ibus
+

File config/awesome/rc.lua

 -- Notification library
 require("naughty")
 
+-- XXX: Disable if necessary; used for extra widgets
 require("vicious")
 
 -- {{{ Variable definitions
 beautiful.init("/home/firefly/.config/awesome/themes/default-ff/theme.lua")
 
 -- This is used later as the default terminal and editor to run.
-terminal = "urxvt"
-editor = os.getenv("EDITOR") or "nano"
+--terminal = "urxvt"
+terminal = "pangoterm"
+editor = os.getenv("EDITOR") or "vim"
 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,
 end
 -- }}}
 
--- {{{ Menu
--- Create a laucher widget and a main menu
-myawesomemenu = {
-   { "manual", terminal .. " -e man awesome" },
-   { "edit config", editor_cmd .. " " .. awful.util.getdir("config") .. "/rc.lua" },
-   { "restart", awesome.restart },
-   { "quit", awesome.quit }
-}
-
-mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon },
-                                    { "open terminal", terminal }
-                                  }
-                        })
-
-mylauncher = awful.widget.launcher({ image = image(beautiful.awesome_icon),
-                                     menu = mymainmenu })
--- }}}
 
 -- {{{ Wibox
--- Network usage widget
-netwidget = widget({ type = "textbox" })
-vicious.register(netwidget, vicious.widgets.net, '<span color="#CC9393">${wlan0 down_kb}</span> <span color="#7F9F7F">${wlan0 up_kb}</span>', 3)
+---- Custom widgets -------------------------------------------------
+
+local chars =
+  { shade = "▨"
+  , mail  = "⌧"
+  , clock = "⌚"
+  , music = "♪"
+  , cpu   = "❖"
+  , heat  = "♨"
+
+  , battery = string.char(0xE2, 0x8C, 0xB8)
+  , power   = string.char(0xE2, 0x9A, 0xA1)
+--, music   = string.char(0xE2, 0x99, 0xAA)
+  }
+
+for k,v in pairs(chars) do
+  chars[k] = ('<span foreground="%s">%s</span>'):format(beautiful.fg_special, v)
+end
+
+-- Emphasizes a string, optionally if a condition is met (the default is
+-- `true` for condition, so that the string emphasized).
+local function emphasize(str, condition)
+  if condition == nil or condition then
+    return ('<span weight="bold" foreground="#c00" ' ..
+            'background="#f66">%s</span>'):format(str)
+  else
+    return str
+  end
+end
+
 
 -- CPU widget
 cpuwidget = widget({ type = "textbox" })
---vicious.register(cpuwidget, vicious.widgets.cpu, 'CPU: $1% ', 2)
 local blocks = {"▁", "▂", "▃", "▄", "▅", "▆", "▇", "█"}
----[[
+
 vicious.register(cpuwidget, vicious.widgets.cpu, function (widget, args)
   local res = ""
 
   for i,v in ipairs(args) do
     if i == 1 then
-      res = res .. "CPU: " .. tostring(v) .. "% "
+      res = chars.cpu .. " " .. res .. emphasize(tostring(v) .. "%", v > 70) .. " "
     else
       local idx = math.floor(v / (100 / 7) + 1)
-      res = res .. tostring(blocks[idx]) .. " "
+      res = res .. tostring(blocks[idx])
     end
   end
-  
-  return res .. "| "
+
+  return res
 end)
---]]
 
-ff_testwidget = awful.widget.progressbar()
-ff_testwidget:set_width(8)
-ff_testwidget:set_height(10)
-ff_testwidget:set_vertical(true)
-ff_testwidget:set_background_color('#494B4F')
-ff_testwidget:set_color('#FF5656')
-ff_testwidget:set_gradient_colors({ '#FF5656', '#88A175', '#AECF96' })
 
-ff_testwidget:set_value(0.8)
+-- Temperature widget
+termwidget = widget({ type = "textbox" })
+vicious.register(termwidget, vicious.widgets.thermal, function(widget, args)
+  return chars.heat .. " " .. emphasize(tostring(args[1] .. '°C'), args[1] >= 75)
+end , 2, 'thermal_zone0')
 
-ff_2 = widget({ type = "textbox" })
-ff_2.text = "Hello"
 
+-- Battery widget
+batwidget = widget({ type = "textbox" })
+vicious.register(batwidget, vicious.widgets.bat, function(widget, args)
+  local char = args[1] == "+" and chars.power or chars.battery
+  return ("%s %s [%s]"):format(char, emphasize(tostring(args[2]) .. "%",
+                                               args[2] < 20),
+                               args[3])
+end, 30, 'BAT1')
+
+
+-- Now playing widget
+local musicwidget = widget({ type = "textbox" })
+
+vicious.register(musicwidget, vicious.widgets.mpd,
+                 function (widget, args)
+                   if     args["{state}"] == "N/A" then
+                     return ("%s [MPD off]"):format(chars.music)
+
+                   elseif args["{state}"] == "Stop" then
+                     return ("%s [stopped]"):format(chars.music)
+
+                   else
+                     return ("%s  %s - %s"):format(chars.music, args["{Artist}"],
+                                                                args["{Title}"])
+                   end
+                 end)
+
+
+---- Default widgets ------------------------------------------------
 -- Create a textclock widget
-mytextclock = awful.widget.textclock({ align = "right" })
+mytextclock = awful.widget.textclock({ align = "right" },
+                                     chars.clock .. " %d %H:%M")
 
 -- Create a systray
 mysystray = widget({ type = "systray" })
     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] = awful.widget.layoutbox(s)
     mylayoutbox[s]:buttons(awful.util.table.join(
-                           awful.button({ }, 1, function () awful.layout.inc(layouts, 1) end),
+                           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({ }, 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)
             mypromptbox[s],
             layout = awful.widget.layout.horizontal.leftright
         },
-        mylayoutbox[s],
+        s == 1 and mysystray or nil,
+        s == 1 and pad(pw)   or nil,
+
         mytextclock,
-        netwidget,
+        pad(pw),
         cpuwidget,
---        ff_2,
---        ff_testwidget,
-        s == 1 and mysystray or nil,
+        pad(pw),
+        termwidget, -- laptop only
+        pad(pw),
+        batwidget,
+        pad(pw),
+        musicwidget,
+        pad(10),
         mytasklist[s],
         layout = awful.widget.layout.horizontal.rightleft
     }
 
 -- {{{ Mouse bindings
 root.buttons(awful.util.table.join(
-    awful.button({ }, 3, function () mymainmenu:toggle() end),
+--    awful.button({ }, 3, function () mymainmenu:toggle() end),
     awful.button({ }, 4, awful.tag.viewnext),
     awful.button({ }, 5, awful.tag.viewprev)
 ))
         local dropbox = "/home/firefly/Dropbox/Public"
         local dropurl = "http://dl.dropbox.com/u/24715905"
         local relname = "/screenshots/" .. os.date("%Y-%m-%d_%H-%M-%S.png")
-        
+
         local localname = dropbox .. relname
-        local webname = dropurl .. relname
-        
+        local webname   = dropurl .. relname
+
         awful.util.spawn("scrot " .. options .. " '" .. localname .. "' &")
-        awful.util.spawn("echo '" .. webname .. "' | xclip -i")
+        awful.util.spawn("echo -n '" .. webname .. "' | xclip -i")
     end
 end
-    
+
 -- {{{ Key bindings
 -- FireFly edits: svorakified keybindings
 globalkeys = awful.util.table.join(
     awful.key({ modkey,           }, "Right",  awful.tag.viewnext       ),
     awful.key({ modkey,           }, "Escape", awful.tag.history.restore),
 
-	-- Change focus
+    -- Change focus
     awful.key({ modkey,           }, "n",
         function ()
             awful.client.focus.byidx( 1)
         end),
     awful.key({ modkey,           }, "h", function () awful.screen.focus_relative( 1) end),
     awful.key({ modkey,           }, "s", function () awful.screen.focus_relative(-1) end),
-    
+
     awful.key({ modkey,           }, "w", function () mymainmenu:show({keygrabber=true}) end),
 
     -- Layout manipulation
 
     awful.key({ modkey, "Shift" }, "h",     function () awful.tag.incmwfact( 0.05)    end),
     awful.key({ modkey, "Shift" }, "s",     function () awful.tag.incmwfact(-0.05)    end),
-    
+
     awful.key({ modkey, "Control" }, "h",     function () awful.tag.incnmaster( 1)      end),
     awful.key({ modkey, "Control" }, "s",     function () awful.tag.incnmaster(-1)      end),
     awful.key({ modkey, "Control" }, "t",     function () awful.tag.incncol( 1)         end),
                   awful.util.eval, nil,
                   awful.util.getdir("cache") .. "/history_eval")
               end),
-    
+
     -- Screenshot
     awful.key({         }, "Print", function () awful.util.spawn("/usr/local/bin/dropscrot") end),
-    awful.key({ "Alt"   }, "Print", function () awful.util.spawn("/usr/local/bin/dropscrot -s") end)
+    awful.key({ "Mod1"  }, "Print", function () awful.util.spawn("/usr/local/bin/dropscrot -s") end)
 )
 
 clientkeys = awful.util.table.join(
     awful.key({ modkey,           }, "f",      function (c) c.fullscreen = not c.fullscreen  end),
+    awful.key({ modkey, "Shift"   }, "f",      awful.client.floating.toggle                     ),
     awful.key({ modkey, "Shift"   }, "c",      function (c) c:kill()                         end),
-    awful.key({ modkey, "Control" }, "space",  awful.client.floating.toggle                     ),
     awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end),
     awful.key({ modkey,           }, "o",      awful.client.movetoscreen                        ),
     awful.key({ modkey, "Shift"   }, "r",      function (c) c:redraw()                       end),
-    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
-    awful.key({ modkey,           }, "n",      function (c) c.minimized = not c.minimized    end),
+--    awful.key({ modkey,           }, "t",      function (c) c.ontop = not c.ontop            end),
+--    awful.key({ modkey,           }, "n",      function (c) c.minimized = not c.minimized    end),
     awful.key({ modkey,           }, "m",
         function (c)
             c.maximized_horizontal = not c.maximized_horizontal
       properties = { floating = true } },
     { rule = { class = "gimp" },
       properties = { floating = true } },
+    { rule = { class = "Screenkey" },
+      properties = { floating = true } },
     -- Set Firefox to always map on tags number 2 of screen 1.
     -- { rule = { class = "Firefox" },
     --   properties = { tag = tags[1][2] } },
+     { rule = { class = "Opera" },
+       properties = { tag = tags[1][2] } },
+
+     -- Fix problematic size of Notch's DCPU-16 emulator
+     { rule = { class = "computer-DCPU$1" },
+       properties = { width = 480, height = 386 } },
 }
+
+-- Use different setups depending on whether multiple monitors are
+-- available.
+if #tags >= 2 then
+  table.insert(awful.rules.rules,
+     { rule = { class = "Xchat" },
+       properties = { tag = tags[2][1] } })
+  table.insert(awful.rules.rules,
+     { rule = { class = "Firefox" },
+       except_any = { class = { "Firefox-aurora", "Firefox-nightly" } },
+       properties = { tag = tags[1][1] } })
+else
+  table.insert(awful.rules.rules,
+     { rule = { class = "Xchat" },
+       properties = { tag = tags[1][1] } })
+  table.insert(awful.rules.rules,
+     { rule = { class = "Firefox" },
+       except_any = { class = { "Firefox-aurora", "Firefox-nightly" } },
+       properties = { tag = tags[1][2] } })
+end
 -- }}}
 
 -- {{{ Signals
     end
 end)
 
-client.add_signal("focus", function(c) c.border_color = beautiful.border_focus 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)
 -- }}}

File config/herbstluftwm/panel.sh

 ####
 # true if we are using the svn version of dzen2
 dzen2_version=$(dzen2 -v 2>&1 | head -n 1 | cut -d , -f 1|cut -d - -f 2)
-if [ -z "$dzen2_version" ] ; then
-    dzen2_svn="true"
+if [ -z "$dzen2_version" ] ;then
+  dzen2_svn="true"
 else
-    dzen2_svn=""
+  dzen2_svn=""
 fi
 
 function uniq_linebuffered() {
   awk '$0 != l { print ; l=$0 ; fflush(); }' "$@"
 }
 
+function run_stalonetray {
+  stalonetray -bg "$bgcolor" --geometry '1x1-0+0' --grow-gravity E \
+              -i 16 --log-level info 2>&1                          \
+    | tee /tmp/bleh3 \
+    | grep '' \
+    | tee /tmp/bleh
+   #| sed -nr '/^geometry:/ {s/^geometry:/stalonetray_geometry/; s/[-+x]/ /g; p}' \
+}
+
 # Begin actual bar implementation
 herbstclient pad $monitor $panel_height
 {
   #### Emit events here
   # player (mpd)
-  (mpc idleloop player) &
+  mpc idleloop player &
   mpc_pid=$!
 
+# run_stalonetray &
+# stalonetray_pid=$(pidof stalonetray)
+
   # tick
   while true; do echo tick; sleep 20; done &
   tick_pid=$!
   herbstclient --idle
 
   # exiting; kill stray event-emitting processes
-  kill $date_pid
-  kill $mpc_pid
-  kill $tick_pid
+  kill $date_pid $mpc_pid $tick_pid $stalonetray_pid
 
 } 2>/dev/null | {
-  # Defaults for the bar-drawing part
+  # Default values for the panel-drawing part
   TAGS=( $(herbstclient tag_status $monitor) )
   visible=true
 
   batstatus="$Default"
   thermstatus="$Default"
   nowplaying="$Default"
+  wicdstatus="$Default"
+
+  traypadding=0
 
   while true; do
+    #### Draw panels here
     # First, draw tags to left panel
     for i in "${TAGS[@]}"; do
       case ${i:0:1} in
     echo -n "$sep"
     echo "^bg()^fg() ${windowtitle//^/^^}"
 
-    # Right panel is trickier...
-  # echo >&3 "$sep $date $sep "
-  # S="$sep"
-  # echo >&3 "$S^bg() $brightstatus $S $thermstatus $S $batstatus $S $date $S $nowplaying $S "
-
+    # Then, the right panel
     echo >&3 -n " $sep $brightstatus"
     echo >&3 -n " $sep $thermstatus"
     echo >&3 -n " $sep $batstatus"
     echo >&3 -n " $sep $nowplaying"
+    echo >&3 -n " $sep $wicdstatus"
     echo >&3 -n " $sep $date"
-    echo >&3    " $sep "
+    echo >&3 -n " $sep "
+    echo >&3
 
     # Wait for next event
     read line || break
         windowtitle="${cmd[@]:2}"
         ;;
 
-      focus_changed|window_title_changed)
-        windowtitle="${cmd[@]:2}"
-        ;;
-
       # ...then, custom events
       toggle_runner)
         dmenu_run -fn "$font" -nb "$bgcolor" -nf "#efefef" \
                       status=$(cat $t/status)
                       percent=$(printf '100 * %d / %d\n' $curr $full | bc)
 
-                      if [ $status == Full ]; then
-                        printf '^fg(#909090)%s' $status
-                      else
-                        printf '^fg(#909090)%s: ^fg()%d%%' $status $percent
-                      fi )"
+                      case $status in
+                        Full|Unknown)  printf '^fg(#909090)%s' $status ;;
+                        *)  printf '^fg(#909090)%s: ^fg()%d%%' $status $percent ;;
+                      esac )"
+                    # if [ $status == Full ]; then
+                    # else
+                    # fi )"
 
         thermstatus="$( t='/sys/class/thermal/thermal_zone0'
                         curr=$(cat $t/temp)
                         degrees=$(printf '%d / 1000\n' $curr | bc)
                         printf '^fg()%d^fg(#909090)°C' $degrees )"
+
+        wicdstatus="$( essid=$(wicd-cli -d --wireless \
+                             | grep Essid | cut -d' ' -f2-)
+                       [ -z "$essid" ] && essid='--'
+                       printf '^fg()%s' $essid )"
         ;;
 
       mpd_player|player)
-      # nowplaying="$(mpc current -f '^fg()[%artist% - ][%title%|%file%][ [%time%]]')"
-        nowplaying="$(mpc current -f '^fg()%artist% - %title%')"
+        nowplaying="$(mpc current -f '^fg()[%artist% - ][%title%|%file%]')"
+      # nowplaying="$(mpc current -f '^fg()%artist% - %title%')"
+        ;;
+
+      stalonetray_geometry)
+        traypadding="${cmd[@]:1}"
         ;;
     esac
   done

File other/symbols

     include "se(basic)"
 
   //key.type[group1]="EIGHT_LEVEL_ALPHABETIC";
-
-    key <AD01> { [     aring,      Aring,           at,           at ] };
-    key <AD02> { [ adiaeresis, Adiaeresis,          at,           at ] };
-    key <AD03> { [ odiaeresis, Odiaeresis,    EuroSign,           at ] };
+    key <AD01> { [     aring,      Aring,   logicaland,        U2200 ] }; // U+2200 FOR ALL
+    key <AD02> { [adiaeresis, Adiaeresis,    logicalor,        U2203 ] }; // U+2203 THERE EXISTS
+    key <AD03> { [odiaeresis, Odiaeresis,     EuroSign,           at ] };
     key <AD04> { [         p,          P,           at,           at ] };
     key <AD05> { [         y,          Y,           at,           at ] };
     key <AD06> { [         f,          F,           at,           at ] };
-    key <AD07> { [         g,          G,          jot,           at ] };
+    key <AD07> { [         g,          G,          jot,     infinity ] };
     key <AD08> { [         c,          C,           at,           at ] };
     key <AD09> { [         r,          R,           at,           at ] };
-    key <AD10> { [         l,          L,        Right               ] };
+    key <AD10> { [         l,          L,        Right,   rightarrow ] };
     key <AD11> { [     comma,  semicolon,      radical,  dead_ogonek ] };
-    key <AD12> { [ dead_diaeresis, dead_circumflex, asciitilde, asciicircum ] };
+    key <AD12> { [dead_diaeresis, dead_circumflex, asciitilde, asciicircum ] };
 
-  //key <AC01> { [         a,          A,           ae,           AE ] };
-    key <AC01> { [         a,          A,           ae,           AE, o,o,o,o ] };
+    key <AC01> { [         a,          A,           ae,           AE ] };
     key <AC02> { [         o,          O,       oslash,       Oslash ] };
-    key <AC03> { [         e,          E,          Tab,           at ] };
-    key <AC04> { [         u,          U, ISO_Left_Tab,           at ] };
-    key <AC05> { [         i,          I,     infinity,           at ] };
+    key <AC03> { [         e,          E,           at,           at ] };
+    key <AC04> { [         u,          U,           at,           at ] };
+    key <AC05> { [         i,          I,           at,           at ] };
     key <AC06> { [         d,          D,           at,           at ] };
     // TODO: make sure that e.g. altgr+shift+h gets interpreted as Shift+Left
-    key <AC07> { [         h,          H,         Left               ] };
-    key <AC08> { [         t,          T,         Down               ] };
-    key <AC09> { [         n,          N,           Up               ] };
-    key <AC10> { [         s,          S,        Right               ] };
+    // (or maybe just have them print as arrow characters instead)
+    key <AC07> { [         h,          H,         Left,    leftarrow ] };
+    key <AC08> { [         t,          T,         Down,    downarrow ] };
+    key <AC09> { [         n,          N,           Up,      uparrow ] };
+    key <AC10> { [         s,          S,        Right,   rightarrow ] };
  // key <AC07> { symbols[Group1] = [ h, H,  Left ] };
  // key <AC08> { symbols[Group1] = [ t, T,  Down ] };
  // key <AC09> { symbols[Group1] = [ n, N,    Up ] };
  // key <AC10> { symbols[Group1] = [ s, S, Right ] };
     key <AC11> { [     minus, underscore, dead_belowdot, dead_macron ] };
 //  key <AC12> { [     minus, underscore, dead_belowdot, dead_macron ] };
-    key <BKSL> { [ apostrophe,  asterisk,         grave,    multiply ] };
+    key <BKSL> { [apostrophe,   asterisk,         grave,    multiply ] };
 
     key <AB01> { [    period,   colon, periodcentered, dead_abovedot ] };
     key <AB02> { [         q,          Q,           at,      because ] };
-    key <AB03> { [         j,          J,         Down               ] };
+    key <AB03> { [         j,          J,         Down,    downarrow ] };
  // key <AB03> { symbols[Group1] = [ j, J,  Down ] };
   //key <AB03> { [         j,          J,    elementof, notelementof ] };
-    key <AB04> { [         k,          K,           Up               ] };
+    key <AB04> { [         k,          K,           Up,      uparrow ] };
  // key <AB04> { symbols[Group1] = [ k, K,    Up ] };
   //key <AB04> { [         k,          K,           at,           at ] };
     key <AB05> { [         x,          X,           at,           at ] };
 #  export TERM=xterm
 #  export TERM=rxvt-unicode-256color
 #fi
-if [ x$TERM = xscreen ]; then
-  export TERM=screen-256color
-fi
 
 export GREP_OPTIONS='--color=auto' # -P
 export GREP_COLORS='cx=37'
 alias .....="cd ../../../.."
 
 alias ff_colours='for i in `seq 30 37`; do echo -e "\e[0;${i}m $i \e[1;${i}m $i \e[m"; done'
+alias make-luakit="make clean && USE_UNIQUE=1 USE_LUAJIT=1 CC=clang make -j4"
 
-alias make-luakit="make clean && USE_UNIQUE=1 USE_LUAJIT=1 CC=clang make -j4"
+function mkdircd {
+  mkdir "$@"
+  cd "${@[$#]}"  # (last argument)
+}
 
 # allow vim's :h to work in the shell, and make it behave like less
 function :h {

File vim/syntax/selfml.vim

 
 
 """" Highlighting """""""""""""""""""""""""""""""""""""""""""""""""""
-hi def link  selfmlEssExpr             Literal
+hi def link  selfmlEssExpr             Constant
 
 hi def link  selfmlLineComment         Comment
 hi def link  selfmlBlockComment        Comment
 
 
 """" Formatting, aesthetics """""""""""""""""""""""""""""""""""""""""
-set number                      " Use line numbering
+"set number                      " Use line numbering
 set ruler                       " Show scroll percentage in statusline
 set cursorline                  " Highlight cursor's line
 
                                 " exceeding screen size.
 set scrolloff=5                 " Keep 5 lines visible vertically
 
-set formatoptions+=n            " Better indent numbered lists in comments
+set formatoptions+=n            " Indent numbered lists in comments better
 set formatoptions+=l            " Don't wrap lines that were already long
 set formatoptions+=j            " Remove comment leaders when joining
 
 
 
 " Add a few custom filetypes
-au BufRead,BufNewFile {*.json}               setfiletype javascript
-au BufRead,BufNewFile {/usr/share/X11/xkb/*} setfiletype c
-au BufRead,BufNewFile {*.md}                 setfiletype markdown
+au BufRead,BufNewFile {*.json}               setf javascript
+au BufRead,BufNewFile {/usr/share/X11/xkb/*} setf xkb
+au BufRead,BufNewFile {*.md}                 setf markdown
 
-au BufRead,BufNewFile {*.lecnote}            setfiletype lecnote
-au BufRead,BufNewFile {*.selfml}             setfiletype selfml
-au BufRead,BufNewFile {*.todo,todo}          setfiletype todo
-au BufRead            {*/xchatlogs/*.log}    setfiletype irclog | set readonly nomodifiable
+au BufRead,BufNewFile {*.lecnote}            setf lecnote
+au BufRead,BufNewFile {*.selfml}             setf selfml
+au BufRead,BufNewFile {*.todo,todo}          setf todo
+au BufRead,BufNewFile {*.ijx}                setf j
+au BufRead            {*/xchatlogs/*.log}    setf irclog | set ro noma
 
 " Add custom filetype-dependent metadata
 au FileType lua  setlocal comments=:--
 if $TERM == "xterm"
   " assume 256-colour terminal
   set t_Co=256
+
+  " italics
+  set t_ZH=
+  set t_ZR=
 end
 "if $TERM != "linux" && $TERM != "screen"
 "  set t_Co=256
 \                        , '256ctermbg' : 'NONE' }
 \     , 'ModeMsg'      : { 'attr'       : 'bold'
 \                        , '256ctermfg' : '2'    }
+\     , 'Operator'     : { '256ctermfg' : '73'   }
 \     }
 "\                          '256ctermfg' : '253'
 color jellybeans
 # ~/.xinitrc
 #
 
-(sleep 1 && dropboxd) &			# launch dropboxd as user.
+#(sleep 10 && dropboxd) &			# launch dropboxd as user.
+#(sleep 5 && xbindkeys) &            # xbindkeys (bind fn keys)
+#xcape                               # lets Ctrl act as Esc if not held.
+pulseaudio --start                  # mmm, pulseaudio
+#(sleep 5 && xcape) &
 
-# Feed xmodmap with my config
-(xmodmap ~/.Xmodmap) &
+xbacklight = 0
+
+(sleep 5 &&
+  setxkbmap se-ff
+  xbindkeys
+  xcape
+) &
+
+#(sleep 10 && kmail) &
 
 # Enable QGtkStyle by exporting some env vars
 export GTK2_RC_FILES="$HOME/.gtkrc-2.0"
 bindkey -a '^K'    kill-whole-line
 
 # Also fix a bunch of other keys
-bindkey '^[[7~' beginning-of-line
-bindkey '^[[8~' end-of-line
-bindkey "^[Od"  backward-word
-bindkey "^[Oc"  forward-word
+bindkey '^[[H'     beginning-of-line # <Home>
+bindkey '^[[F'     end-of-line       # <End>
+bindkey "^[[1;5D"  backward-word     # <C-left>
+bindkey "^[[1;5C"  forward-word      # <C-right>
 
-bindkey "^K"    kill-whole-line
-bindkey "^U"    undo
-bindkey "^['"   quote-line
+bindkey "^K"       kill-whole-line
+bindkey "^U"       undo
+bindkey "^['"      quote-line
+bindkey "^[[39;5u" quote-line