basic configuration(create repo).

This commit is contained in:
2017-09-30 23:32:28 +08:00
commit c3c39b6531
16 changed files with 1267 additions and 0 deletions

105
awesome/aweror.lua Normal file
View File

@@ -0,0 +1,105 @@
-- aweror.lua
-- Save this file as "aweror.lua" in awesome's system library directory "/usr/local/share/awesome/lib",
-- "/usr/share/awesome/lib", or your own config directory "~/.config/awesome/".
-- You will also need a "ror.lua" file (contains your key bindings) in your config directory.
-- Now you need to generate and add the keybindings in your ~/.config/awesome/rc.lua
-- In the rc.lua file there will be a "root.keys(globalkeys)" command that sets
-- your keys, you need to add the following lines just before that command:
--
-- local ror = require("aweror")
-- globalkeys = awful.util.table.join(globalkeys, ror.genkeys(modkey))
-- get our key bindings from separate ror.lua file
require("ror")
local awful= require("awful")
local client=client
local pairs=pairs
local table=table
local allt1=table5
local print=print
local USE_T = true
--local USE_T = false
local aweror = {}
function aweror.run_or_raise(cmd, properties)
local clients = client.get()
local focused = awful.client.next(0)
local findex = 0
local matched_clients = {}
local n = 0
for i, c in pairs(clients) do
--make an array of matched clients
if match(properties, c) then
n = n + 1
matched_clients[n] = c
if c == focused then
findex = n
end
end
end
if n > 0 then
local c = matched_clients[1]
-- if the focused window matched switch focus to next in list
if 0 < findex and findex < n then
c = matched_clients[findex+1]
end
local ctags = c:tags()
if #ctags == 0 then
-- ctags is empty, show client on current tag
local curtag = awful.tag.selected()
awful.client.movetotag(curtag, c)
else
-- Otherwise, pop to first tag client is visible on
awful.tag.viewonly(ctags[1])
end
-- And then focus the client
client.focus = c
c:raise()
return
end
awful.util.spawn(cmd)
end
-- Returns true if all pairs in table1 are present in table2
function match (table1, table2)
for k, v in pairs(table1) do
if table2[k] == nil or (table2[k] ~= v and not table2[k]:find(v)) then
return false
end
end
return true
end
function genfun(t3)
local cmd=t3[1]
local rule=t3[2]
local flag=t3[3]
local table1={}
s1="class"
if flag then
s1=flag
end
table1[s1]=rule
return function()
aweror.run_or_raise(cmd,table1)
end
end
function aweror.genkeys(mod1)
rorkeys = awful.util.table.join()
for i,v in pairs(allt1) do
modifier=""
if i:len() > 1 then
modifier=i:sub(1, i:find("-")-1)
i=i:sub(-1,-1)
end
rorkeys = awful.util.table.join(rorkeys,
awful.key({ mod1, modifier}, i, genfun(v)))
end
return rorkeys
end
return aweror

710
awesome/rc.lua Normal file
View File

@@ -0,0 +1,710 @@
--[[
Awesome WM configuration template
github.com/copycat-killer
--]]
-- {{{ Required libraries
local awesome, client, screen, tag = awesome, client, screen, tag
local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type
local gears = require("gears")
local awful = require("awful")
require("awful.autofocus")
local wibox = require("wibox")
local beautiful = require("beautiful")
local naughty = require("naughty")
local lain = require("lain")
--local menubar = require("menubar")
local freedesktop = require("freedesktop")
local hotkeys_popup = require("awful.hotkeys_popup").widget
-- }}}
-- {{{ Error handling
if awesome.startup_errors then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, there were errors during startup!",
text = awesome.startup_errors })
end
do
local in_error = false
awesome.connect_signal("debug::error", function (err)
if in_error then return end
in_error = true
naughty.notify({ preset = naughty.config.presets.critical,
title = "Oops, an error happened!",
text = tostring(err) })
in_error = false
end)
end
-- }}}
-- {{{ Autostart windowless processes
local function run_once(cmd_arr)
for _, cmd in ipairs(cmd_arr) do
findme = cmd
firstspace = cmd:find(" ")
if firstspace then
findme = cmd:sub(0, firstspace-1)
end
awful.spawn.with_shell(string.format("pgrep -u $USER -x %s > /dev/null || (%s)", findme, cmd))
end
end
run_once({ "urxvtd", "unclutter -root", "fcitx -d", "/usr/libexec/polkit-gnome-authentication-agent-1 &", "xcompmgr -c" })
-- }}}
-- {{{ Variable definitions
local chosen_theme = "multicolor"
local modkey = "Mod4"
local altkey = "Mod1"
local terminal = "urxvtc"
local editor = os.getenv("EDITOR") or "nano" or "vi"
local gui_editor = "gvim"
local browser = "firefox"
awful.util.terminal = terminal
-- ❶❷❸❹❺❻❼❽❾❿ ➊➋➌➍➎➏➐➑➒➓
awful.util.tagnames = { "➊ term", "➋ web", "➌ doc", "➍ media", "➎ VirtualBox", "➏ others" }
awful.layout.layouts = {
awful.layout.suit.tile,
awful.layout.suit.floating,
awful.layout.suit.tile.bottom,
awful.layout.suit.fair,
awful.layout.suit.floating,
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.corner.nw,
-- awful.layout.suit.corner.ne,
-- awful.layout.suit.corner.sw,
-- awful.layout.suit.corner.se,
-- lain.layout.cascade,
-- lain.layout.cascade.tile,
-- lain.layout.centerwork,
-- lain.layout.centerwork.horizontal,
-- lain.layout.termfair,
-- lain.layout.termfair.center,
}
awful.util.taglist_buttons = awful.util.table.join(
awful.button({ }, 1, function(t) t:view_only() end),
awful.button({ modkey }, 1, function(t)
if client.focus then
client.focus:move_to_tag(t)
end
end),
awful.button({ }, 3, awful.tag.viewtoggle),
awful.button({ modkey }, 3, function(t)
if client.focus then
client.focus:toggle_tag(t)
end
end),
awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end),
awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end)
)
awful.util.tasklist_buttons = awful.util.table.join(
awful.button({ }, 1, function (c)
if c == client.focus then
c.minimized = true
else
-- Without this, the following
-- :isvisible() makes no sense
c.minimized = false
if not c:isvisible() and c.first_tag then
c.first_tag:view_only()
end
-- This will also un-minimize
-- the client, if needed
client.focus = c
c:raise()
end
end),
awful.button({ }, 3, function()
local instance = nil
return function ()
if instance and instance.wibox.visible then
instance:hide()
instance = nil
else
instance = awful.menu.clients({ theme = { width = 250 } })
end
end
end),
awful.button({ }, 4, function ()
awful.client.focus.byidx(1)
end),
awful.button({ }, 5, function ()
awful.client.focus.byidx(-1)
end))
lain.layout.termfair.nmaster = 3
lain.layout.termfair.ncol = 1
lain.layout.termfair.center.nmaster = 3
lain.layout.termfair.center.ncol = 1
lain.layout.cascade.tile.offset_x = 2
lain.layout.cascade.tile.offset_y = 32
lain.layout.cascade.tile.extra_padding = 5
lain.layout.cascade.tile.nmaster = 5
lain.layout.cascade.tile.ncol = 2
local theme_path = string.format("%s/.config/awesome/themes/%s/theme.lua", os.getenv("HOME"), chosen_theme)
beautiful.init(theme_path)
-- }}}
-- {{{ Menu
local myawesomemenu = {
{ "hotkeys", function() return false, hotkeys_popup.show_help end },
{ "manual", terminal .. " -e man awesome" },
{ "edit config", string.format("%s -e %s %s", terminal, editor, awesome.conffile) },
{ "restart", awesome.restart },
{ "quit", function() awesome.quit() end }
}
awful.util.mymainmenu = freedesktop.menu.build({
icon_size = beautiful.menu_height or 16,
before = {
{ "Awesome", myawesomemenu, beautiful.awesome_icon },
-- other triads can be put here
},
after = {
{ "Open terminal", terminal },
-- other triads can be put here
}
})
--menubar.utils.terminal = terminal -- Set the Menubar terminal for applications that require it
-- }}}
-- {{{ Screen
-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution)
screen.connect_signal("property::geometry", function(s)
-- Wallpaper
if beautiful.wallpaper then
local wallpaper = beautiful.wallpaper
-- If wallpaper is a function, call it with the screen
if type(wallpaper) == "function" then
wallpaper = wallpaper(s)
end
gears.wallpaper.maximized(wallpaper, s, true)
end
end)
-- Create a wibox for each screen and add it
awful.screen.connect_for_each_screen(function(s) beautiful.at_screen_connect(s) end)
-- }}}
-- {{{ Mouse bindings
root.buttons(awful.util.table.join(
awful.button({ }, 3, function () awful.util.mymainmenu:toggle() end),
awful.button({ }, 4, awful.tag.viewnext),
awful.button({ }, 5, awful.tag.viewprev)
))
-- }}}
-- {{{ Key bindings
globalkeys = awful.util.table.join(
-- Take a screenshot
-- https://github.com/copycat-killer/dots/blob/master/bin/screenshot
awful.key({ altkey }, "p", function() os.execute("screenshot") end),
-- Hotkeys
awful.key({ modkey, }, "s", hotkeys_popup.show_help,
{description="show help", group="awesome"}),
-- Tag browsing
awful.key({ modkey, }, "Left", awful.tag.viewprev,
{description = "view previous", group = "tag"}),
awful.key({ modkey, }, "Right", awful.tag.viewnext,
{description = "view next", group = "tag"}),
awful.key({ modkey, }, "Escape", awful.tag.history.restore,
{description = "go back", group = "tag"}),
-- Non-empty tag browsing
awful.key({ altkey }, "Left", function () lain.util.tag_view_nonempty(-1) end,
{description = "view previous nonempty", group = "tag"}),
awful.key({ altkey }, "Right", function () lain.util.tag_view_nonempty(1) end,
{description = "view previous nonempty", group = "tag"}),
-- Default client focus
awful.key({ altkey, }, "j",
function ()
awful.client.focus.byidx( 1)
end,
{description = "focus next by index", group = "client"}
),
awful.key({ altkey, }, "k",
function ()
awful.client.focus.byidx(-1)
end,
{description = "focus previous by index", group = "client"}
),
-- By direction client focus
awful.key({ modkey }, "j",
function()
awful.client.focus.bydirection("down")
if client.focus then client.focus:raise() end
end),
awful.key({ modkey }, "k",
function()
awful.client.focus.bydirection("up")
if client.focus then client.focus:raise() end
end),
awful.key({ modkey }, "h",
function()
awful.client.focus.bydirection("left")
if client.focus then client.focus:raise() end
end),
awful.key({ modkey }, "l",
function()
awful.client.focus.bydirection("right")
if client.focus then client.focus:raise() end
end),
awful.key({ modkey, }, "w", function () awful.util.mymainmenu:show() end,
{description = "show main menu", group = "awesome"}),
-- Layout manipulation
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end,
{description = "swap with next client by index", group = "client"}),
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end,
{description = "swap with previous client by index", group = "client"}),
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end,
{description = "focus the next screen", group = "screen"}),
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end,
{description = "focus the previous screen", group = "screen"}),
awful.key({ modkey, }, "u", awful.client.urgent.jumpto,
{description = "jump to urgent client", group = "client"}),
awful.key({ modkey, }, "Tab",
function ()
awful.client.focus.history.previous()
if client.focus then
client.focus:raise()
end
end,
{description = "go back", group = "client"}),
-- Show/Hide Wibox
awful.key({ modkey }, "b", function ()
for s in screen do
s.mywibox.visible = not s.mywibox.visible
if s.mybottomwibox then
s.mybottomwibox.visible = not s.mybottomwibox.visible
end
end
end),
-- On the fly useless gaps change
awful.key({ altkey, "Control" }, "+", function () lain.util.useless_gaps_resize(1) end),
awful.key({ altkey, "Control" }, "-", function () lain.util.useless_gaps_resize(-1) end),
-- Dynamic tagging
awful.key({ modkey, "Shift" }, "n", function () lain.util.add_tag() end),
awful.key({ modkey, "Shift" }, "r", function () lain.util.rename_tag() end),
awful.key({ modkey, "Shift" }, "Left", function () lain.util.move_tag(1) end), -- move to next tag
awful.key({ modkey, "Shift" }, "Right", function () lain.util.move_tag(-1) end), -- move to previous tag
awful.key({ modkey, "Shift" }, "d", function () lain.util.delete_tag() end),
-- Standard program
awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end,
{description = "open a terminal", group = "launcher"}),
awful.key({ modkey, "Control" }, "r", awesome.restart,
{description = "reload awesome", group = "awesome"}),
awful.key({ modkey, "Shift" }, "q", awesome.quit,
{description = "quit awesome", group = "awesome"}),
awful.key({ altkey, "Shift" }, "l", function () awful.tag.incmwfact( 0.05) end,
{description = "increase master width factor", group = "layout"}),
awful.key({ altkey, "Shift" }, "h", function () awful.tag.incmwfact(-0.05) end,
{description = "decrease master width factor", group = "layout"}),
awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end,
{description = "increase the number of master clients", group = "layout"}),
awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end,
{description = "decrease the number of master clients", group = "layout"}),
awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end,
{description = "increase the number of columns", group = "layout"}),
awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end,
{description = "decrease the number of columns", group = "layout"}),
awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end,
{description = "select next", group = "layout"}),
awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end,
{description = "select previous", group = "layout"}),
awful.key({ modkey, "Control" }, "n",
function ()
local c = awful.client.restore()
-- Focus restored client
if c then
client.focus = c
c:raise()
end
end,
{description = "restore minimized", group = "client"}),
-- Dropdown application
awful.key({ modkey, }, "z", function () awful.screen.focused().quake:toggle() end),
-- Widgets popups
awful.key({ altkey, }, "c", function () lain.widget.calendar.show(7) end),
awful.key({ altkey, }, "h", function () if beautiful.fs then beautiful.fs.show(7) end end),
awful.key({ altkey, }, "w", function () if beautiful.weather then beautiful.weather.show(7) end end),
-- ALSA volume control
awful.key({ }, "XF86AudioRaiseVolume",
function ()
os.execute(string.format("amixer set %s 1%%+", beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ }, "XF86AudioLowerVolume",
function ()
os.execute(string.format("amixer set %s 1%%-", beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ }, "XF86AudioMute",
function ()
os.execute(string.format("amixer set %s toggle", beautiful.volume.togglechannel or beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ altkey, "Control" }, "m",
function ()
os.execute(string.format("amixer set %s 100%%", beautiful.volume.channel))
beautiful.volume.update()
end),
awful.key({ altkey, "Control" }, "0",
function ()
os.execute(string.format("amixer -q set %s 0%%", beautiful.volume.channel))
beautiful.volume.update()
end),
-- MPD control
awful.key({ altkey, "Control" }, "Up",
function ()
awful.spawn.with_shell("mpc toggle")
beautiful.mpd.update()
end),
awful.key({ altkey, "Control" }, "Down",
function ()
awful.spawn.with_shell("mpc stop")
beautiful.mpd.update()
end),
awful.key({ altkey, "Control" }, "Left",
function ()
awful.spawn.with_shell("mpc prev")
beautiful.mpd.update()
end),
awful.key({ altkey, "Control" }, "Right",
function ()
awful.spawn.with_shell("mpc next")
beautiful.mpd.update()
end),
awful.key({ altkey }, "0",
function ()
local common = { text = "MPD widget ", position = "top_middle", timeout = 2 }
if beautiful.mpd.timer.started then
beautiful.mpd.timer:stop()
common.text = common.text .. lain.util.markup.bold("OFF")
else
beautiful.mpd.timer:start()
common.text = common.text .. lain.util.markup.bold("ON")
end
naughty.notify(common)
end),
-- Copy primary to clipboard (terminals to gtk)
--awful.key({ modkey }, "c", function () awful.spawn("xsel | xsel -i -b") end),
-- Copy clipboard to primary (gtk to terminals)
--awful.key({ modkey }, "v", function () awful.spawn("xsel -b | xsel") end),
-- User programs
-- awful.key({ modkey }, "e", function () awful.spawn(gui_editor) end),
awful.key({ modkey }, "e", function () awful.spawn("pcmanfm") end),
awful.key({ modkey }, "q", function () awful.spawn(browser) end),
-- Default
--[[ Menubar
awful.key({ modkey }, "p", function() menubar.show() end,
{description = "show the menubar", group = "launcher"})
--]]
--[[ dmenu
awful.key({ modkey }, "x", function ()
awful.spawn(string.format("dmenu_run -i -fn 'Monospace' -nb '%s' -nf '%s' -sb '%s' -sf '%s'",
beautiful.bg_normal, beautiful.fg_normal, beautiful.bg_focus, beautiful.fg_focus))
end)
--]]
-- Prompt
awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end,
{description = "run prompt", group = "launcher"}),
awful.key({ modkey }, "x",
function ()
awful.prompt.run {
prompt = "Run Lua code: ",
textbox = awful.screen.focused().mypromptbox.widget,
exe_callback = awful.util.eval,
history_path = awful.util.get_cache_dir() .. "/history_eval"
}
end,
{description = "lua execute prompt", group = "awesome"})
--]]
)
clientkeys = awful.util.table.join(
awful.key({ altkey, "Shift" }, "m", lain.util.magnify_client ),
awful.key({ modkey, }, "f",
function (c)
c.fullscreen = not c.fullscreen
c:raise()
end,
{description = "toggle fullscreen", group = "client"}),
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end,
{description = "close", group = "client"}),
awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle ,
{description = "toggle floating", group = "client"}),
awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end,
{description = "move to master", group = "client"}),
awful.key({ modkey, }, "o", function (c) c:move_to_screen() end,
{description = "move to screen", group = "client"}),
awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end,
{description = "toggle keep on top", group = "client"}),
awful.key({ modkey, }, "n",
function (c)
-- The client currently has the input focus, so it cannot be
-- minimized, since minimized clients can't have the focus.
c.minimized = true
end ,
{description = "minimize", group = "client"}),
awful.key({ modkey, }, "m",
function (c)
c.maximized = not c.maximized
c:raise()
end ,
{description = "maximize", group = "client"})
)
-- Bind all key numbers to tags.
-- Be careful: we use keycodes to make it works on any keyboard layout.
-- This should map on the top row of your keyboard, usually 1 to 9.
for i = 1, 9 do
globalkeys = awful.util.table.join(globalkeys,
-- View tag only.
awful.key({ modkey }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
tag:view_only()
end
end,
{description = "view tag #"..i, group = "tag"}),
-- Toggle tag display.
awful.key({ modkey, "Control" }, "#" .. i + 9,
function ()
local screen = awful.screen.focused()
local tag = screen.tags[i]
if tag then
awful.tag.viewtoggle(tag)
end
end,
{description = "toggle tag #" .. i, group = "tag"}),
-- Move client to tag.
awful.key({ modkey, "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:move_to_tag(tag)
end
end
end,
{description = "move focused client to tag #"..i, group = "tag"}),
-- Toggle tag on focused client.
awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9,
function ()
if client.focus then
local tag = client.focus.screen.tags[i]
if tag then
client.focus:toggle_tag(tag)
end
end
end,
{description = "toggle focused client on tag #" .. i, group = "tag"})
)
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))
-- load the 'run or raise' function
local ror = require("aweror")
-- generate and add the 'run or raise' key bindings to the globalkeys table
globalkeys = awful.util.table.join(globalkeys, ror.genkeys(altkey))
-- Set keys
root.keys(globalkeys)
-- }}}
-- {{{ Rules
-- Rules to apply to new clients (through the "manage" signal).
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
properties = { border_width = beautiful.border_width,
border_color = beautiful.border_normal,
focus = awful.client.focus.filter,
raise = true,
keys = clientkeys,
buttons = clientbuttons,
screen = awful.screen.preferred,
placement = awful.placement.no_overlap+awful.placement.no_offscreen,
size_hints_honor = false
}
},
-- Titlebars
{ rule_any = { type = { "dialog", "normal" } },
properties = { titlebars_enabled = true } },
-- Set Firefox to always map on the second tag on screen 1.
{ rule = { class = "Firefox" },
properties = { screen = 1, tag = screen[1].tags[2] } },
{ rule = { class = "VirtualBox" },
properties = { screen = 1, tag = screen[1].tags[5] } },
{ rule = { class = "Emacs" },
properties = { screen = 1, tag = screen[1].tags[3] } },
{ rule = { class = "Gimp", role = "gimp-image-window" },
properties = { maximized = true } },
}
-- }}}
-- {{{ Signals
-- Signal function to execute when a new client appears.
client.connect_signal("manage", function (c)
-- Set the windows at the slave,
-- i.e. put it at the end of others instead of setting it master.
-- if not awesome.startup then awful.client.setslave(c) end
if awesome.startup and
not c.size_hints.user_position
and not c.size_hints.program_position then
-- Prevent clients from being unreachable after screen count changes.
awful.placement.no_offscreen(c)
end
end)
-- Add a titlebar if titlebars_enabled is set to true in the rules.
client.connect_signal("request::titlebars", function(c)
-- Custom
if beautiful.titlebar_fun then
beautiful.titlebar_fun(c)
return
end
-- Default
-- buttons for the titlebar
local buttons = awful.util.table.join(
awful.button({ }, 1, function()
client.focus = c
c:raise()
awful.mouse.client.move(c)
end),
awful.button({ }, 3, function()
client.focus = c
c:raise()
awful.mouse.client.resize(c)
end)
)
awful.titlebar(c, {size = 16}) : setup {
{ -- Left
awful.titlebar.widget.iconwidget(c),
buttons = buttons,
layout = wibox.layout.fixed.horizontal
},
{ -- Middle
{ -- Title
align = "center",
widget = awful.titlebar.widget.titlewidget(c)
},
buttons = buttons,
layout = wibox.layout.flex.horizontal
},
{ -- Right
awful.titlebar.widget.floatingbutton (c),
awful.titlebar.widget.maximizedbutton(c),
awful.titlebar.widget.stickybutton (c),
awful.titlebar.widget.ontopbutton (c),
awful.titlebar.widget.closebutton (c),
layout = wibox.layout.fixed.horizontal()
},
layout = wibox.layout.align.horizontal
}
end)
-- Enable sloppy focus, so that focus follows mouse.
client.connect_signal("mouse::enter", function(c)
if awful.layout.get(c.screen) ~= awful.layout.suit.magnifier
and awful.client.focus.filter(c) then
client.focus = c
end
end)
-- No border for maximized clients
client.connect_signal("focus",
function(c)
if c.maximized then -- no borders if only 1 client visible
c.border_width = 0
elseif #awful.screen.focused().clients > 1 then
c.border_width = beautiful.border_width
c.border_color = beautiful.border_focus
end
end)
client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end)
-- turn off energy saving when some window is fullscreen
local fullscreened_clients = {}
local function remove_client(tabl, c)
local index = awful.util.table.hasitem(tabl, c)
if index then
table.remove(tabl, index)
if #tabl == 0 then
awful.util.spawn("xset s on")
awful.util.spawn("xset +dpms")
end
end
end
client.connect_signal("property::fullscreen",
function(c)
if c.fullscreen then
table.insert(fullscreened_clients, c)
if #fullscreened_clients == 1 then
awful.util.spawn("xset s off")
awful.util.spawn("xset -dpms")
end
else
remove_client(fullscreened_clients, c)
end
end
)
client.connect_signal("unmanage",
function(c)
if c.fullscreen then
remove_client(fullscreened_clients, c)
end
end
)
-- }}}

37
awesome/ror.lua Normal file
View File

@@ -0,0 +1,37 @@
-- ror.lua
-- This is the file goes in your ~/.config/awesome/ directory
-- It contains your table of 'run or raise' key bindings for aweror.lua
-- Table entry format: ["key"]={"function", "match string", "optional attribute to match"}
-- The "key" can include "Control-", "Shift-", and "Mod1-" modifiers (eg "Control-z")
-- The "key" will be bound as "modkey + key". (eg from above would end up as modkey+Control+z)
-- The "function" is what gets run if no matching client windows are found.
-- Usual attributes are "class","instance", or "name". If no attribute is given it defaults to "class".
-- The "match string" will match substrings. So "Firefox" will match "blah Firefox blah"
-- Use xprop to get this info from a window. WM_CLASS(STRING) gives you "instance", "class".
-- WM_NAME(STRING) gives you the name of the selected window (usually something like the web page title
-- for browsers, or the file name for emacs).
--[[
table5={
["Control-z"]={"google-chrome --app=http://www.rdio.com","www.rdio.com", "instance"},
["e"]={"emacsclient -a emacs -n -c","Emacs"},
["w"]={"firefox","Firefox"},
["v"]={"firefox -new-window 'http://www.evernote.com/Home.action?login=true#v=l&so=mn'","Evernote", "name"},
["g"]={"firefox -new-window 'http://mail.google.com/mail/'","Gmail","name"},
["x"]={"xterm","xterm", "instance"},
["f"]={"xterm -name mcTerm -e mc -d","mcTerm", "instance"},
["Shift-s"]={"xterm -name rootTerm -cr red -title rootTerm -e su","rootTerm", "instance"},
["t"]={"xterm -name htopTerm -e htop","htopTerm","instance"},
["b"]={"xterm -name rtorrentTerm -e rtorrent","rtorrentTerm","instance"},
["z"]={"xterm -name mocpTerm -e mocp","mocpTerm", "instance"}
}
--]]
-- ror.lua
table5={
["Control-f"]={"firefox","Firefox"},
["Control-v"]={"VirtualBox","VirtualBox"},
-- ["v"]={"gvim", "Gvim"},
["Control-r"]={"urxvtc","URxvt"},
["Control-e"]={"emacs", "Emacs"},
["Shift-e"]={"pcmanfm", "Pcmanfm"}
}

14
dot/.Xdefaults Normal file
View File

@@ -0,0 +1,14 @@
URxvt.urgentOnBell: false
URxvt.multichar_encoding: utf-8
URxvt.depth: 32
URxvt.background: [90]black
URxvt.foreground: white
URxvt.colorBD: yellow
URxvt.colorUL: green
URxvt.scrollBar: False
URxvt.font: xft:YaHei Consolas Hybrid:size=13
!URxvt.font: xft:Ubuntu Mono:size=13
!URxvt.font: xft:Consolas:size=13
!URxvt.font: xft:Source Code Pro:size=13
!URxvt.font: xft:xos4 Terminus:size=14

32
dot/.eslintrc.json Normal file
View File

@@ -0,0 +1,32 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"extends": "eslint:recommended",
"rules": {
"no-console": "off",
"no-unused-vars": "warn",
"semi": ["error", "always"]
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"es6": true,
"mocha": true
},
"plugins": [
"react"
],
"globals": {
"cc": false,
"CC_EDITOR": false,
"CC_DEV": false,
"CC_JSB": false,
"_ccsg": false
}
}

3
dot/.gitconfig Normal file
View File

@@ -0,0 +1,3 @@
[user]
name = Zedhugh Chen
email = zedhugh@gmail.com

149
dot/.globalrc Normal file
View File

@@ -0,0 +1,149 @@
#
# Copyright (c) 1998, 1999, 2000, 2001, 2002, 2003, 2010, 2011, 2013
# Tama Communications Corporation
#
# This file is part of GNU GLOBAL.
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# *
# Configuration file for GNU GLOBAL source code tag system.
#
# Basically, GLOBAL doesn't need this file ('gtags.conf'), because it has
# default values in itsself. If you have the file as '/etc/gtags.conf' or
# "$HOME/.globalrc" in your system then GLOBAL overwrite the default values
# with the values in the file.
#
# The format is similar to termcap(5). You can specify a target with
# GTAGSLABEL environment variable. Default target is 'default'.
#
default:\
:tc=native:
native:\
:tc=gtags:tc=htags:
user:\
:tc=user-custom:tc=htags:
ctags:\
:tc=exuberant-ctags:tc=htags:
#---------------------------------------------------------------------
# Configuration for gtags(1)
# See gtags(1).
#---------------------------------------------------------------------
common:\
:skip=HTML/,HTML.pub/,tags,TAGS,ID,y.tab.c,y.tab.h,gtags.files,cscope.files,cscope.out,cscope.po.out,cscope.in.out,SCCS/,RCS/,CVS/,CVSROOT/,{arch}/,autom4te.cache/,*.orig,*.rej,*.bak,*~,#*#,*.swp,*.tmp,*_flymake.*,*_flymake:
#
# Built-in parsers.
#
gtags:\
:tc=common:\
:tc=builtin-parser:
builtin-parser:\
:langmap=c\:.c.h,yacc\:.y,asm\:.s.S,java\:.java,cpp\:.c++.cc.hh.cpp.cxx.hxx.hpp.C.H,php\:.php.php3.phtml:
#
# skeleton for user's custom parser.
#
user-custom|User custom plugin parser:\
:tc=common:\
:langmap=c\:.c.h:\
:gtags_parser=c\:/usr/lib/gtags/user-custom.la:
#
# Plug-in parser to use Exuberant Ctags.
#
exuberant-ctags|plugin-example|setting to use Exuberant Ctags plug-in parser:\
:tc=common:\
:langmap=Asm\:.asm.ASM.s.S:\
:langmap=Asp\:.asp.asa:\
:langmap=Awk\:.awk.gawk.mawk:\
:langmap=Basic\:.bas.bi.bb.pb:\
:langmap=BETA\:.bet:\
:langmap=C\:.c:\
:langmap=C++\:.c++.cc.cp.cpp.cxx.h.h++.hh.hp.hpp.hxx.C.H:\
:langmap=C#\:.cs:\
:langmap=Cobol\:.cbl.cob.CBL.COB:\
:langmap=DosBatch\:.bat.cmd:\
:langmap=Eiffel\:.e:\
:langmap=Erlang\:.erl.ERL.hrl.HRL:\
:langmap=Flex\:.as.mxml:\
:langmap=Fortran\:.f.for.ftn.f77.f90.f95.F.FOR.FTN.F77.F90.F95:\
:langmap=HTML\:.htm.html:\
:langmap=Java\:.java:\
:langmap=JavaScript\:.js:\
:langmap=Lisp\:.cl.clisp.el.l.lisp.lsp:\
:langmap=Lua\:.lua:\
:langmap=MatLab\:.m:\
:langmap=OCaml\:.ml.mli:\
:langmap=Pascal\:.p.pas:\
:langmap=Perl\:.pl.pm.plx.perl:\
:langmap=PHP\:.php.php3.phtml:\
:langmap=Python\:.py.pyx.pxd.pxi.scons:\
:langmap=REXX\:.cmd.rexx.rx:\
:langmap=Ruby\:.rb.ruby:\
:langmap=Scheme\:.SCM.SM.sch.scheme.scm.sm:\
:langmap=Sh\:.sh.SH.bsh.bash.ksh.zsh:\
:langmap=SLang\:.sl:\
:langmap=SML\:.sml.sig:\
:langmap=SQL\:.sql:\
:langmap=Tcl\:.tcl.tk.wish.itcl:\
:langmap=Tex\:.tex:\
:langmap=Vera\:.vr.vri.vrh:\
:langmap=Verilog\:.v:\
:langmap=VHDL\:.vhdl.vhd:\
:langmap=Vim\:.vim:\
:langmap=YACC\:.y:\
:gtags_parser=Asm\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Asp\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Awk\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Basic\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=BETA\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=C\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=C++\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=C#\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Cobol\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=DosBatch\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Eiffel\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Erlang\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Flex\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Fortran\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=HTML\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Java\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=JavaScript\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Lisp\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Lua\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=MatLab\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=OCaml\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Pascal\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Perl\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=PHP\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Python\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=REXX\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Ruby\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Scheme\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Sh\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=SLang\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=SML\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=SQL\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Tcl\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Tex\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Vera\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Verilog\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=VHDL\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=Vim\:/usr/lib/gtags/exuberant-ctags.la:\
:gtags_parser=YACC\:/usr/lib/gtags/exuberant-ctags.la:
#
# Drupal configuration.
#
drupal|Drupal content management platform:\
:tc=common:\
:langmap=php\:.php.module.inc.profile.install.test:
#---------------------------------------------------------------------
# Configuration for htags(1)
# See htags(1).
#---------------------------------------------------------------------
htags:\
:script_alias=/cgi-bin/:ncol#4:tabs#8:normal_suffix=html:gzipped_suffix=ghtml:

23
dot/.jsbeautifyrc Normal file
View File

@@ -0,0 +1,23 @@
{
"indent_size": 2,
"indent_char": " ",
"eol": "\n",
"indent_level": 0,
"indent_with_tabs": false,
"preserve_newlines": true,
"max_preserve_newlines": 2,
"jslint_happy": false,
"space_after_anon_function": false,
"brace_style": "collapse",
"keep_array_indentation": false,
"keep_function_indentation": false,
"space_before_conditional": true,
"break_chained_methods": true,
"eval_code": false,
"unescape_strings": false,
"wrap_line_length": 80,
"wrap_attributes": "auto",
"wrap_attributes_indent_size": 2,
"e4x": true,
"end_with_newline": true
}

23
dot/.tern-config Normal file
View File

@@ -0,0 +1,23 @@
{
"libs": [
"ecma5",
"ecma6",
"browser",
"jquery",
"react",
"node"
],
"plugins": {
"node": {},
"es_modules": {},
"doc_comment": {
"fullDocs": true,
"strong": true
}
},
"ecmaVersion": 6,
"env": {
"browser": true,
"node": true
}
}

25
dot/.xprofile Normal file
View File

@@ -0,0 +1,25 @@
#xrandr --output HDMI-1 --same-as LVDS-1
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
#xcompmgr -c &
#fcitx -d & > /dev/null
#sogou-qimpanel & > /dev/null
# eval $(gnome-keyring-daemon --components=pkcs11,secrets,ssh,gpg)
# export GNOME_KEYRING_PID
# export GNOME_KEYRING_SOCKET
# export SSH_AUTH_SOCK
# export GPG_AGENT_INFO
#nm-applet &
#/usr/libexec/polkit-gnome-authentication-agent-1 &
# stardict -h & > /dev/null &2 > /dev/null
# sudo sslocal -d start -p 443 -s zedhugh.me -k BlsEYioG1w > /dev/null
cd /home/zedhugh/tcpspeed_client
sudo java -jar tcpspeed_client.jar -b &
cd
sudo service shadowsocks.client start

19
emacs.d-init.el Normal file
View File

@@ -0,0 +1,19 @@
;; Added by Package.el. This must come before configurations of
;; installed packages. Don't delete this line. If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
;; (package-initialize)
;; (setq package-archives
;; '(
;; ("popkit" . "http://elpa.popkit.org/packages/")
;; ("melpa-cn" . "http://elpa.zilongshanren.com/melpa/")
;; ("org-cn" . "http://elpa.zilongshanren.com/org/")
;; ("gnu-cn" . "http://elpa.zilongshanren.com/gnu/")
;; ("melpa" . "https://melpa.org/packages/")
;; ("gnu" . "https://elpa.gnu.org/packages/")
;; ("org" . "http://orgmode.org/elpa/")
;; ))
(setq spacemacs-start-directory "~/.emacs.d/spacemacs/")
(load-file (concat spacemacs-start-directory "init.el"))

34
gentoo_portage/make.conf Normal file
View File

@@ -0,0 +1,34 @@
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="x86_64-pc-linux-gnu"
# These are the USE and USE_EXPAND flags that were used for
# buidling in addition to what is provided by the profile.
USE="bindist fbcon ffmpeg fuse mtp nvidia vdpau xft xvmc -bluetooth -cups -gpm -libav"
CPU_FLAGS_X86="mmx sse sse2"
PORTDIR="/usr/portage"
DISTDIR="${PORTDIR}/distfiles"
PKGDIR="${PORTDIR}/packages"
# user's configuration
ABI_X86="32 64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ALSA_CARDS="hda-intel"
APACHE2_MODULES="$APACHE2_MODULES access_compat"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
EMERGE_DEFAULT_OPTS="-n"
MAKEOPTS="-j9"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo
https://mirrors.ustc.edu.cn/gentoo
http://mirrors.xmu.edu.cn/gentoo
http://gentoo.osuosl.org"
GRUB_PLATFORMS="efi-64"
INPUT_DEVICES="evdev libinput"
RUBY_TARGETS="ruby24"
USE="alsa bindist fbcon ffmpeg fuse mtp nvidia pulseaudio vaapi vdpau xft xvmc -bluetooth -cups -gpm -libav"
VIDEO_CARDS="fbdev nvidia"

View File

@@ -0,0 +1,2 @@
#sys-devel/gcc **
sys-kernel/gentoo-sources -~amd64

View File

@@ -0,0 +1,3 @@
app-arch/rar RAR
app-emulation/virtualbox-bin PUEL
www-plugins/adobe-flash AdobeFlash-11.x

View File

@@ -0,0 +1,64 @@
app-accessibility/espeak portaudio
app-arch/p7zip rar -wxwidgets
app-editors/emacs dynamic-loading gfile gsettings imagemagick libxml2 sound source xft
app-editors/vim lua perl python ruby
app-emulation/virtualbox -qt5
app-eselect/eselect-php fpm
app-i18n/fcitx gtk2 gtk3
dev-db/postgresql python
dev-lang/python sqlite
dev-lang/ruby -rdoc
dev-libs/libpcre pcre16
gnome-base/gvfs gnome-keyring
lxde-base/lxdm gtk3
media-sound/alsa-utils bat
net-misc/curl threads
net-misc/iputils -caps -filecaps
sys-apps/the_silver_searcher lzma
sys-apps/util-linux static-libs
sys-process/cronie anacron
x11-terms/rxvt-unicode 256-color blink fading-colors unicode3 pixbuf
# nodejs
#net-libs/nodejs -ssl
dev-libs/openssl -bindist
net-misc/openssh -bindist
# java environment
dev-java/icedtea -webstart
dev-java/icedtea-bin -webstart
# gnome desktop environment
#app-misc/tracker -gstreamer
#gnome-base/gnome-control-center networkmanager
#media-libs/gegl jpeg2k raw
#sys-apps/dbus systemd
# KDE
app-text/poppler qt5
dev-libs/libdbusmenu-qt qt5
dev-qt/qtcore icu
dev-qt/qtwayland egl
dev-qt/qtgui egl
dev-qt/qtnetwork -bindist
dev-qt/qtopengl egl
kde-apps/akonadi sqlite -mysql
kde-frameworks/kdelibs plasma
kde-plasma/plasma-meta -sddm
media-libs/libsdl2 gles
media-libs/mesa gles2 wayland xa
media-libs/phonon -vlc
media-sound/pulseaudio gnome
sys-libs/zlib minizip
x11-drivers/nvidia-drivers wayland
# php
app-eselect/eselect-php apache2
dev-lang/php cgi curl fpm ftp gd imap mysql mysqli pdo postgres sockets sqlite apache2
# networkmanage
app-crypt/pinentry gnome-keyring
gnome-extra/nm-applet -modemmanager
net-misc/networkmanager connection-sharing -modemmanager
net-wireless/wpa_supplicant ap

24
gentoo_portage/repos.conf Normal file
View File

@@ -0,0 +1,24 @@
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /usr/portage
sync-type = rsync
#sync-uri = rsync://rsync.mirrors.ustc.edu.cn/gentoo-portage
sync-uri = rsync://mirrors.tuna.tsinghua.edu.cn/gentoo-portage
#sync-uri = rsync://mirrors.xmu.edu.cn/gentoo-portage
#sync-uri = rsync://mirrors.ustc.edu.cn/gentoo-portage
auto-sync = yes
#[czh-private]
#location = /usr/local/portage/czh-private
#[gentoo-zh]
#location = /usr/local/portage/gentoo-zh
#sync-type = git
#sync-uri = git://github.com/microcai/gentoo-zh.git
#auto-sync = yes
# for daily squashfs snapshots
#sync-type = squashdelta
#sync-uri = mirror://gentoo/../snapshots/squashfs