cleanup, st has its own repo now
This commit is contained in:
parent
6d394a1be3
commit
6237ee1294
8 changed files with 0 additions and 1809 deletions
|
@ -1,27 +0,0 @@
|
|||
#! /bin/sh
|
||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||
|
||||
bspc config border_width 2
|
||||
bspc config window_gap 2
|
||||
|
||||
bspc config split_ratio 0.50
|
||||
bspc config borderless_monocle true
|
||||
bspc config gapless_monocle true
|
||||
bspc config focus_by_distance true
|
||||
bspc config focus_follows_pointer true
|
||||
bspc config pointer_follows_monitor true
|
||||
bspc config top_padding 16
|
||||
|
||||
screens=$(xrandr|grep ' connected')
|
||||
primary=$(awk '{if ($3 == "primary") print $1}' <<< $screens)
|
||||
secondary=$(awk '{if ($3 != "primary") print $1}' <<< $screens)
|
||||
bspc monitor $primary -d 1 2 3
|
||||
bspc monitor $secondary -d q w e
|
||||
|
||||
wmname "LG3D"
|
||||
|
||||
#bspc rule -a Gimp desktop=^8 follow=on floating=on
|
||||
#bspc rule -a Chromium desktop=^2
|
||||
#bspc rule -a mplayer2 floating=on
|
||||
#bspc rule -a Kupfer.py focus=on
|
||||
#bspc rule -a Screenkey manage=off
|
827
defunct/rc.lua
827
defunct/rc.lua
|
@ -1,827 +0,0 @@
|
|||
-- {{{ Includes
|
||||
-- Standard awesome library
|
||||
local gears = require('gears')
|
||||
local awful = require('awful')
|
||||
awful.rules = require('awful.rules')
|
||||
require('awful.autofocus')
|
||||
-- Widget and layout library
|
||||
local wibox = require('wibox')
|
||||
-- Theme handling library
|
||||
local beautiful = require('beautiful')
|
||||
-- Notification library
|
||||
local naughty = require('naughty')
|
||||
local menubar = require('menubar')
|
||||
-- }}}
|
||||
-- {{{ Custom functions
|
||||
-- test if file exists
|
||||
function exists(name)
|
||||
local f=io.open(name,'r')
|
||||
if f ~= nil then
|
||||
io.close(f)
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
-- verify if element is part of the table
|
||||
function enters(element, table)
|
||||
for key, value in pairs(table) do
|
||||
if value == element then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- update wallpapers, useful when attaching screens
|
||||
function update_wallpapers(wallpaper)
|
||||
for s = 1, screen.count() do
|
||||
gears.wallpaper.centered(wallpaper, s)
|
||||
end
|
||||
end
|
||||
|
||||
-- battery indicator
|
||||
function battery_status ()
|
||||
local batt_status = "/sys/class/power_supply/BAT0/status"
|
||||
local batt_capacity = "/sys/class/power_supply/BAT0/capacity"
|
||||
local fd = io.open(batt_status, "r")
|
||||
if not fd then
|
||||
do return "" end
|
||||
end
|
||||
local text = fd:read("*a")
|
||||
io.close(fd)
|
||||
local fd = io.open(batt_capacity, "r")
|
||||
if not fd then
|
||||
do return "" end
|
||||
end
|
||||
local battery = string.match(fd:read("*a"), "%d+")
|
||||
io.close(fd)
|
||||
local icon
|
||||
if string.match(text, "Charging") then
|
||||
icon = "↑"
|
||||
elseif string.match(text, "Discharging") then
|
||||
icon = "↓"
|
||||
else
|
||||
icon = "•"
|
||||
end
|
||||
return ' ' .. battery .. icon
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Error handling
|
||||
-- Check if awesome encountered an error during startup and fell back to
|
||||
-- another config (This code will only ever execute for the fallback config)
|
||||
if awesome.startup_errors then
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = 'Oops, there were errors during startup!',
|
||||
text = awesome.startup_errors
|
||||
})
|
||||
end
|
||||
|
||||
-- Handle runtime errors after startup
|
||||
do
|
||||
local in_error = false
|
||||
awesome.connect_signal(
|
||||
'debug::error',
|
||||
function (err)
|
||||
-- Make sure we don't go into an endless error loop
|
||||
if in_error then
|
||||
return
|
||||
end
|
||||
in_error = true
|
||||
|
||||
naughty.notify({
|
||||
preset = naughty.config.presets.critical,
|
||||
title = 'Oops, an error happened!',
|
||||
text = err
|
||||
})
|
||||
in_error = false
|
||||
end
|
||||
)
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Variable definitions
|
||||
-- Themes define colours, icons, and wallpapers
|
||||
beautiful.init('/usr/share/awesome/themes/default/theme.lua')
|
||||
theme.font = 'Terminus 9'
|
||||
theme.taglist_font = 'Terminus 11'
|
||||
theme.taglist_squares_sel = nil
|
||||
theme.taglist_squares_unsel = nil
|
||||
|
||||
theme.border_width = 2
|
||||
|
||||
-- amount of pixels to snap windows from
|
||||
snap = 7
|
||||
|
||||
-- set wallpaper
|
||||
local wallpaper = '/home/von/.wallpaper.png'
|
||||
if exists(wallpaper) then
|
||||
theme.wallpaper = wallpaper
|
||||
end
|
||||
|
||||
-- This is used later as the default terminal and editor to run.
|
||||
terminal = 'urxvt'
|
||||
editor = 'gvim'
|
||||
editor_cmd = 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'
|
||||
|
||||
-- Tables of layouts to cover with awful.layout.inc, order matters.
|
||||
local layouts = {
|
||||
tiled = {
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.tile.top,
|
||||
awful.layout.suit.tile.left,
|
||||
awful.layout.suit.tile.bottom
|
||||
},
|
||||
max = {
|
||||
awful.layout.suit.max,
|
||||
awful.layout.suit.max.fullscreen
|
||||
},
|
||||
float = {
|
||||
awful.layout.suit.floating
|
||||
},
|
||||
magnifier = {
|
||||
awful.layout.suit.magnifier
|
||||
},
|
||||
|
||||
-- Some weird shit I don't use, but it still exists:
|
||||
|
||||
fair = {
|
||||
awful.layout.suit.fair,
|
||||
awful.layout.suit.fair.horizontal
|
||||
},
|
||||
spiral = {
|
||||
awful.layout.suit.spiral,
|
||||
awful.layout.suit.spiral.dwindle
|
||||
}
|
||||
}
|
||||
-- }}}
|
||||
-- {{{ Wallpaper
|
||||
if beautiful.wallpaper then
|
||||
update_wallpapers(beautiful.wallpaper)
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Tags
|
||||
-- Provide tag names and layout settings if we wish to define them
|
||||
tags = {}
|
||||
saved_layouts = {}
|
||||
for s = 1, screen.count() do
|
||||
tags[s] = { name = {}, layout = {} }
|
||||
saved_layouts[s] = { tiled = {}, max = {} }
|
||||
end
|
||||
-- screen 1
|
||||
--tags[1].name = {
|
||||
-- [1] = 'example',
|
||||
-- [9] = 'example2'
|
||||
--}
|
||||
tags[1].layout = {
|
||||
[1] = layouts.max[1],
|
||||
[4] = layouts.float[1]
|
||||
}
|
||||
-- screens 2+
|
||||
if screen.count() >= 2 then
|
||||
tags[2].layout = {
|
||||
}
|
||||
end
|
||||
-- Fill the missing values with defaults
|
||||
for s = 1, screen.count() do
|
||||
-- Set default tiled layout for all the screens
|
||||
-- if s == 1 and screen.count() ~= 1 then -- in case I ever want to have default for less than 2 screens
|
||||
--if s == 1 then
|
||||
-- default_tiled = layouts.tiled[1]
|
||||
--else
|
||||
-- default_tiled = layouts.tiled[3]
|
||||
--end
|
||||
default_tiled = layouts.tiled[1]
|
||||
for tag = 1, 9 do
|
||||
local name = tags[s].name[tag] or tostring(tag)
|
||||
local layout = tags[s].layout[tag] or default_tiled
|
||||
tags[s].name[tag] = name
|
||||
tags[s].layout[tag] = layout
|
||||
-- Assign saved tiled layout so that we can use it right away
|
||||
if enters(layout, layouts.tiled) then
|
||||
saved_layouts[s].tiled[name] = layout
|
||||
else
|
||||
saved_layouts[s].tiled[name] = default_tiled
|
||||
end
|
||||
saved_layouts[s].max[name] = layouts.max[1]
|
||||
end
|
||||
end
|
||||
-- Set tags instances in wm
|
||||
for s = 1, screen.count() do
|
||||
tags[s] = awful.tag(tags[s].name, s, tags[s].layout)
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Menu
|
||||
-- Create a laucher widget and a main menu
|
||||
mymainmenu_restart = {
|
||||
{ 'restart', awesome.restart }
|
||||
}
|
||||
mymainmenu_screens = {
|
||||
{ 'one', function() awful.util.spawn_with_shell('1monitor') end },
|
||||
{ 'two', function() awful.util.spawn_with_shell('2monitors') end }
|
||||
}
|
||||
--mymainmenu_quit = {
|
||||
-- { 'quit', awesome.quit }
|
||||
--}
|
||||
|
||||
mymainmenu = awful.menu({
|
||||
items = {
|
||||
{ 'restart', mymainmenu_restart, beautiful.awesome_icon },
|
||||
{ 'screens', mymainmenu_screens, beautiful.awesome_icon }
|
||||
-- { 'quit', mymainmenu_quit, beautiful.awesome_icon }
|
||||
}
|
||||
})
|
||||
|
||||
-- Menubar configuration
|
||||
menubar.utils.terminal = terminal -- Set the terminal for applications that require it
|
||||
-- }}}
|
||||
-- {{{ Menu for layoutbox
|
||||
mylbmenu = awful.menu({
|
||||
items = {
|
||||
{ 'Tiled',
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local tag = awful.tag.selected(screen).name
|
||||
awful.layout.set(saved_layouts[screen].tiled[tag])
|
||||
end
|
||||
},
|
||||
{ 'Maximized', function () awful.layout.set(layouts.max[1]) end },
|
||||
{ 'Floating', function () awful.layout.set(layouts.float[1]) end },
|
||||
{ 'Spiral', function () awful.layout.set(layouts.spiral[1]) end }
|
||||
}
|
||||
})
|
||||
-- }}}
|
||||
-- {{{ Wibox
|
||||
-- Create a textclock widget
|
||||
mytextclock = awful.widget.textclock(' %a %d %H:%M ')
|
||||
mytextclock:set_font('Terminus Bold 11')
|
||||
-- Create a mail notification widget
|
||||
mytextbox = wibox.widget.textbox()
|
||||
mytextbox:set_text('')
|
||||
mytextbox:set_font('Terminus 9')
|
||||
-- A box to show info about new mail, temporary unneeded
|
||||
--mytextbox_bg = wibox.widget.background()
|
||||
--mytextbox_bg:set_widget(mytextbox)
|
||||
--mytextbox_bg:set_bg(theme.bg_minimize)
|
||||
--mytextbox_bg:set_fg(theme.fg_minimize)
|
||||
-- Create keyboard layout indicator widget
|
||||
--mykblayout = wibox.widget.textbox()
|
||||
--mykblayout:set_text('US')
|
||||
--mykblayout:set_font('Terminus Bold 11')
|
||||
|
||||
-- Battery indicator
|
||||
mybattstatus = wibox.widget.textbox()
|
||||
mybattstatus:set_font('Terminus Bold 11')
|
||||
|
||||
-- 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)
|
||||
)
|
||||
mytasklist = {}
|
||||
mytasklist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1,
|
||||
function (c)
|
||||
if c ~= client.focus then
|
||||
-- Without this, the following
|
||||
-- :isvisible() makes no sense
|
||||
c.minimized = false
|
||||
if not c:isvisible() then
|
||||
awful.tag.viewonly(c:tags()[1])
|
||||
end
|
||||
-- This will also un-minimize
|
||||
-- the client, if needed
|
||||
client.focus = c
|
||||
c:raise()
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3,
|
||||
function ()
|
||||
if instance then
|
||||
instance:hide()
|
||||
instance = nil
|
||||
else
|
||||
instance = awful.menu.clients({ width=250 })
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 4,
|
||||
function ()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 5,
|
||||
function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end)
|
||||
)
|
||||
|
||||
for s = 1, screen.count() do
|
||||
-- Create a promptbox for each screen
|
||||
mypromptbox[s] = awful.widget.prompt()
|
||||
-- Create an imagebox widget which will contains an icon indicating which layout we're using.
|
||||
-- We need one layoutbox per screen.
|
||||
mylayoutbox[s] = awful.widget.layoutbox(s)
|
||||
mylayoutbox[s]:buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({ }, 1,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local current_layout = awful.layout.get(screen)
|
||||
if enters(current_layout, layouts.tiled) then
|
||||
local tag = awful.tag.selected(screen).name
|
||||
awful.layout.inc(layouts.tiled, 1)
|
||||
saved_layouts[screen].tiled[tag] = awful.layout.get(screen)
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3, function () mylbmenu:toggle() end)
|
||||
)
|
||||
)
|
||||
-- Create a taglist widget
|
||||
mytaglist[s] = awful.widget.taglist(s, awful.widget.taglist.filter.noempty, mytaglist.buttons)
|
||||
|
||||
-- Create a tasklist widget
|
||||
mytasklist[s] = awful.widget.tasklist(s, awful.widget.tasklist.filter.currenttags, mytasklist.buttons)
|
||||
|
||||
-- Create the wibox
|
||||
mywibox[s] = awful.wibox({ position = 'top', height = '18', screen = s })
|
||||
|
||||
local left_layout = wibox.layout.fixed.horizontal()
|
||||
local right_layout = wibox.layout.fixed.horizontal()
|
||||
if s == 1 then
|
||||
right_layout:add(mypromptbox[s])
|
||||
--right_layout:add(mytextbox_bg)
|
||||
right_layout:add(mytaglist[s])
|
||||
right_layout:add(wibox.widget.systray())
|
||||
right_layout:add(mybattstatus)
|
||||
right_layout:add(mytextclock)
|
||||
right_layout:add(mylayoutbox[s])
|
||||
elseif s == 2 then
|
||||
--left_layout:add(mylayoutbox[s])
|
||||
--left_layout:add(mytextclock)
|
||||
--left_layout:add(mytaglist[s])
|
||||
--left_layout:add(mypromptbox[s])
|
||||
right_layout:add(mypromptbox[s])
|
||||
right_layout:add(mytaglist[s])
|
||||
right_layout:add(mytextclock)
|
||||
right_layout:add(mylayoutbox[s])
|
||||
else
|
||||
left_layout:add(mytaglist[s])
|
||||
left_layout:add(mypromptbox[s])
|
||||
right_layout:add(mylayoutbox[s])
|
||||
end
|
||||
|
||||
-- Now bring it all together (with the tasklist in the middle)
|
||||
local layout = wibox.layout.align.horizontal()
|
||||
layout:set_left(left_layout)
|
||||
layout:set_middle(mytasklist[s])
|
||||
layout:set_right(right_layout)
|
||||
|
||||
mywibox[s]:set_widget(layout)
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(
|
||||
awful.util.table.join(
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end)
|
||||
)
|
||||
)
|
||||
-- }}}
|
||||
-- {{{ Key bindings
|
||||
globalkeys = awful.util.table.join(
|
||||
awful.key({ modkey, }, 'Up', function () awful.screen.focus_relative( 1) end),
|
||||
awful.key({ modkey, }, 'Down', function () awful.screen.focus_relative(-1) end),
|
||||
awful.key({ modkey, }, 'Left', awful.tag.viewprev),
|
||||
awful.key({ modkey, }, 'Right', awful.tag.viewnext),
|
||||
awful.key({ modkey, }, 'Escape', awful.tag.history.restore),
|
||||
|
||||
-- Switch between windows
|
||||
awful.key({ modkey, }, 'j', function () awful.client.focus.byidx( 1) client.focus:raise() end),
|
||||
awful.key({ modkey, }, 'k', function () awful.client.focus.byidx(-1) client.focus:raise() end),
|
||||
awful.key({ modkey, }, 'i', function () client.focus:raise() end),
|
||||
awful.key({ modkey, }, 'w', function () mymainmenu:show() end),
|
||||
|
||||
-- Switch between screens
|
||||
awful.key({ modkey, }, 'o', function () awful.screen.focus_relative(1) 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, }, 'u', awful.client.urgent.jumpto),
|
||||
|
||||
-- Mod#+Tab hotkeys
|
||||
awful.key({ modkey, }, 'Tab',
|
||||
function ()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
awful.key({ 'Mod1', }, 'Tab',
|
||||
function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
awful.key({ 'Mod1', 'Shift' }, 'Tab',
|
||||
function ()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
|
||||
awful.key({ modkey, }, 'l', function () awful.tag.incmwfact( 0.05) end),
|
||||
awful.key({ modkey, }, 'h', function () awful.tag.incmwfact(-0.05) end),
|
||||
awful.key({ modkey, 'Shift' }, 'h', function () awful.tag.incnmaster( 1) end),
|
||||
awful.key({ modkey, 'Shift' }, 'l', function () awful.tag.incnmaster(-1) end),
|
||||
awful.key({ modkey, 'Control' }, 'h', function () awful.tag.incncol( 1) end),
|
||||
awful.key({ modkey, 'Control' }, 'l', function () awful.tag.incncol(-1) end),
|
||||
awful.key({ modkey, }, 'f', function () awful.layout.set(layouts.float[1]) end),
|
||||
awful.key({ modkey, }, 'g', function () awful.layout.set(layouts.magnifier[1]) end),
|
||||
awful.key({ modkey, }, 'm',
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local current_layout = awful.layout.get(screen)
|
||||
local tag = awful.tag.selected(screen).name
|
||||
if not enters(current_layout, layouts.max) then
|
||||
awful.layout.set(saved_layouts[screen].max[tag])
|
||||
else
|
||||
awful.layout.inc(layouts.max, 1)
|
||||
saved_layouts[screen].max[tag] = awful.layout.get(screen)
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, }, 't',
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local current_layout = awful.layout.get(screen)
|
||||
local tag = awful.tag.selected(screen).name
|
||||
if not enters(current_layout, layouts.tiled) then
|
||||
awful.layout.set(saved_layouts[screen].tiled[tag])
|
||||
else
|
||||
awful.layout.inc(layouts.tiled, 1)
|
||||
saved_layouts[screen].tiled[tag] = awful.layout.get(screen)
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, }, 's',
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local current_layout = awful.layout.get(screen)
|
||||
if not enters(current_layout, layouts.spiral) then
|
||||
awful.layout.set(layouts.spiral[1])
|
||||
else
|
||||
awful.layout.inc(layouts.spiral, 1)
|
||||
end
|
||||
end),
|
||||
|
||||
awful.key({ modkey, 'Control' }, 'n', awful.client.restore),
|
||||
|
||||
-- Prompt
|
||||
awful.key({ modkey, }, 'r', function () mypromptbox[mouse.screen]:run() end),
|
||||
|
||||
awful.key({ modkey, }, 'e',
|
||||
function ()
|
||||
awful.prompt.run(
|
||||
{ prompt = 'Run Lua code: ' },
|
||||
mypromptbox[mouse.screen].widget,
|
||||
awful.util.eval, nil,
|
||||
awful.util.getdir('cache') .. '/history_eval'
|
||||
)
|
||||
end),
|
||||
-- Menubar
|
||||
awful.key({ modkey, }, 'p', function () menubar.show() end),
|
||||
-- Glbal commands
|
||||
awful.key({ modkey, 'Shift' }, '\\', function () awful.util.spawn('/home/von/vscripts/compton_toggle', false) end),
|
||||
awful.key({ modkey, }, 'x', function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey, }, 'q', function () awful.util.spawn('/home/von/.local/bin/ticket_watch', false) end),
|
||||
awful.key({ modkey, }, 'z', function () awful.util.spawn('bash -c "until i3lock -entc 661111 -i /home/von/.wallpaper.png; do :; done"') end),
|
||||
awful.key({ modkey, }, 'F6', function () awful.util.spawn('/home/von/touchpad_hotkey.sh', false) end),
|
||||
awful.key({ }, 'Print', function () awful.util.spawn('xfce4-screenshooter -ws /home/von/screenshots') end),
|
||||
awful.key({ modkey, }, 'Print', function () awful.util.spawn('xfce4-screenshooter -fs /home/von/screenshots') end)
|
||||
)
|
||||
|
||||
clientkeys = awful.util.table.join(
|
||||
awful.key({ modkey, 'Shift' }, 'c', function (c) c:kill() end),
|
||||
awful.key({ modkey, }, 'Return', function (c) c:swap(awful.client.getmaster()) end),
|
||||
awful.key({ modkey, 'Shift' }, 'o', awful.client.movetoscreen ),
|
||||
awful.key({ modkey, }, 'n', function (c) c.minimized = true end),
|
||||
|
||||
-- Window properties
|
||||
awful.key({ modkey, 'Shift' }, 'Return', function (c) c.fullscreen = not c.fullscreen end),
|
||||
awful.key({ modkey, }, 'b',
|
||||
function (c)
|
||||
if c.border_width ~= 0 then
|
||||
c.border_width = 0
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, 'Shift' }, 't', function (c) c.ontop = not c.ontop end),
|
||||
awful.key({ modkey, 'Shift' }, 's', function (c) c.sticky = not c.sticky end),
|
||||
awful.key({ modkey, }, '`', awful.client.floating.toggle ),
|
||||
awful.key({ modkey, 'Shift' }, 'm',
|
||||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
if c.maximized_horizontal == true and c.maximized_vertical == true then
|
||||
c.border_width = 0
|
||||
client.focus:raise()
|
||||
else
|
||||
c.border_width = beautiful.border_width
|
||||
end
|
||||
end)
|
||||
)
|
||||
|
||||
-- Bind all key numbers to tags.
|
||||
-- Be careful: we use keycodes to make it works on any keyboard layout.
|
||||
-- This should map on the top row of your keyboard, usually 1 to 9.
|
||||
for i = 1, 9 do
|
||||
globalkeys = awful.util.table.join(globalkeys,
|
||||
awful.key({ modkey }, '#' .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local tag = awful.tag.gettags(screen)[i]
|
||||
if tag then
|
||||
if awful.tag.selected(screen) == tag and awful.tag.selectedlist(screen)[2] == nil then
|
||||
awful.tag.history.restore()
|
||||
else
|
||||
awful.tag.viewonly(tag)
|
||||
end
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, 'Control' }, '#' .. i + 9,
|
||||
function ()
|
||||
local screen = mouse.screen
|
||||
local tag = awful.tag.gettags(screen)[i]
|
||||
if tag then
|
||||
awful.tag.viewtoggle(tag)
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, 'Shift' }, '#' .. i + 9,
|
||||
function ()
|
||||
if client.focus then
|
||||
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||
if tag then
|
||||
awful.client.movetotag(tag)
|
||||
end
|
||||
end
|
||||
end),
|
||||
awful.key({ modkey, 'Control', 'Shift' }, '#' .. i + 9,
|
||||
function ()
|
||||
if client.focus then
|
||||
local tag = awful.tag.gettags(client.focus.screen)[i]
|
||||
if tag then
|
||||
awful.client.toggletag(tag)
|
||||
end
|
||||
end
|
||||
end)
|
||||
)
|
||||
end
|
||||
|
||||
clientbuttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||
awful.button({ modkey }, 1, function (c) client.focus = c; awful.mouse.client.move(c, snap) end),
|
||||
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 = awful.client.focus.filter,
|
||||
keys = clientkeys,
|
||||
buttons = clientbuttons
|
||||
}
|
||||
},
|
||||
-- Floating only rules:
|
||||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
'Deadbeef',
|
||||
'Google-musicmanager',
|
||||
'mpv',
|
||||
'Pavucontrol',
|
||||
'pinentry',
|
||||
'plugin-container',
|
||||
'Skype',
|
||||
'Vncviewer'
|
||||
},
|
||||
instance = {
|
||||
'sun-awt-X11-XFramePeer'
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
floating = true
|
||||
}
|
||||
},
|
||||
-- Floating borderless, because winamp nostalgia:
|
||||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
'Audacious',
|
||||
'Qmmp'
|
||||
},
|
||||
role = {
|
||||
'bubble'
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
border_width = 0,
|
||||
floating = true
|
||||
}
|
||||
},
|
||||
-- Per app rules
|
||||
-- firefox
|
||||
{
|
||||
rule = { class = 'Firefox' },
|
||||
except = { instance = 'Navigator' },
|
||||
properties = { floating = true }
|
||||
},
|
||||
-- ardour3
|
||||
{
|
||||
rule = { class = 'Ardour' },
|
||||
except = { instance = 'ardour_editor' },
|
||||
properties = { floating = true }
|
||||
},
|
||||
-- Specific desktops rules: place windows only on specific tags by default
|
||||
-- tag 4: games = maximized
|
||||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
'BaldursGate',
|
||||
'BaldursGateII',
|
||||
'IcewindDale',
|
||||
'starbound',
|
||||
'Terraria.bin.x86',
|
||||
'Terraria.bin.x86_64'
|
||||
},
|
||||
name = {
|
||||
'Pillars of Eternity'
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
border_width = 0,
|
||||
maximized = true
|
||||
}
|
||||
},
|
||||
-- tag 4: steam and games
|
||||
{
|
||||
rule_any = {
|
||||
class = { 'Steam' },
|
||||
instance = { 'Steam.exe' }
|
||||
},
|
||||
properties = { tag = tags[1][4] }
|
||||
},
|
||||
{
|
||||
rule_any = {
|
||||
class = {
|
||||
'Awesomenauts.bin.x86',
|
||||
'Civ5XP',
|
||||
'CivBE',
|
||||
'Cities In Motion.bin',
|
||||
'ck2',
|
||||
'csgo_linux',
|
||||
'DefenseGrid2',
|
||||
'deponia_tcj',
|
||||
'dota_linux',
|
||||
'dota2',
|
||||
'game.x86_64',
|
||||
'hl2_linux',
|
||||
'Pandora',
|
||||
'Strife',
|
||||
'Symphony.bin.x86_64',
|
||||
'eu4',
|
||||
'witcher2'
|
||||
},
|
||||
instance = {
|
||||
'Civ4BeyondSword.exe',
|
||||
'GameApp.exe',
|
||||
'KB.exe',
|
||||
'nwn2main.exe'
|
||||
},
|
||||
name = {
|
||||
'Cities in Motion 2',
|
||||
'GunsOfIcarusOnline',
|
||||
'Hand of Fate',
|
||||
'Serious Sam 3 - Linux'
|
||||
}
|
||||
},
|
||||
properties = {
|
||||
border_width = 0,
|
||||
floating = true,
|
||||
tag = tags[1][4]
|
||||
}
|
||||
}
|
||||
}
|
||||
-- }}}
|
||||
-- {{{ Signals
|
||||
-- Signal function to execute when a new client appears.
|
||||
client.connect_signal(
|
||||
'manage',
|
||||
function (c, startup)
|
||||
-- Enable sloppy focus
|
||||
c:connect_signal(
|
||||
'mouse::enter',
|
||||
function(c)
|
||||
if awful.layout.get(c.screen) ~= layouts.magnifier[1] 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 do 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.connect_signal('focus', function(c) c.border_color = beautiful.border_focus end)
|
||||
client.connect_signal('unfocus', function(c) c.border_color = beautiful.border_normal end)
|
||||
|
||||
-- save floating layout parameters for windows created and managed during the current session
|
||||
tag.connect_signal(
|
||||
'property::layout',
|
||||
function(t)
|
||||
for k, c in ipairs(t:clients()) do
|
||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
||||
c:geometry(awful.client.property.get(c, 'floating_geometry'))
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'manage',
|
||||
function(c)
|
||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
||||
awful.client.property.set(c, 'floating_geometry', c:geometry())
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
client.connect_signal(
|
||||
'property::geometry',
|
||||
function(c)
|
||||
if awful.layout.get(mouse.screen) == awful.layout.suit.floating then
|
||||
awful.client.property.set(c, 'floating_geometry', c:geometry())
|
||||
end
|
||||
end
|
||||
)
|
||||
|
||||
-- timers
|
||||
if exists("/sys/class/power_supply/BAT0") then
|
||||
mytimer = timer({ timeout = 1 })
|
||||
mybattstatus:set_text('•••')
|
||||
mytimer:connect_signal("timeout", function() mybattstatus:set_text(battery_status()) end)
|
||||
mytimer:start()
|
||||
end
|
||||
-- }}}
|
||||
-- {{{ Autostart
|
||||
-- don't forget you sync this file
|
||||
-- this shit runs every time you restart your wm, dumbass.
|
||||
---- set keyboard layouts (fixkb.zsh is made to fix that)
|
||||
--awful.util.spawn_with_shell('setxkbmap -layout us,ru -variant altgr-intl,typewriter -option ctrl:nocaps,grp:win_space_toggle,grp_led:caps,compose:menu')
|
||||
--awful.util.spawn_with_shell('xkbcomp $DISPLAY - | egrep -v "group . = AltGr;" | xkbcomp - $DISPLAY')
|
||||
---- populate xrdb with .Xresources config
|
||||
if exists('/home/von/.Xresources') then
|
||||
awful.util.spawn_with_shell('xrdb /home/von/.Xresources')
|
||||
end
|
||||
---- execute all the other shit, installation specific
|
||||
if exists('/home/von/.autostart') then
|
||||
awful.util.spawn_with_shell('/home/von/.autostart')
|
||||
end
|
||||
-- }}}
|
358
defunct/shellrc
358
defunct/shellrc
|
@ -1,358 +0,0 @@
|
|||
# vim: ft=zsh
|
||||
# If not running interactively, don't do anything
|
||||
[[ $- != *i* ]] && return
|
||||
|
||||
# {{{ environment
|
||||
# a bunch of functions and vars to make this whole thing work
|
||||
is_zsh() [[ -n ${ZSH_VERSION} ]]
|
||||
is_bash() [[ -n ${BASH_VERSION} ]]
|
||||
|
||||
if is_zsh; then
|
||||
is_exec() [[ -x $(whence ${1}) ]]
|
||||
export HOSTNAME=${HOST}
|
||||
else
|
||||
is_exec() [[ -x $(type -P ${1}) ]]
|
||||
alias whence='type -P'
|
||||
fi
|
||||
|
||||
newline="
|
||||
"
|
||||
vscripts="${HOME}/vscripts"
|
||||
local_bin="${HOME}/.local/bin"
|
||||
gem_bin="${HOME}/.local/gem-bin"
|
||||
[[ -d ${vscripts} && ${PATH} != *${vscripts}* ]] && export PATH=${PATH}:${vscripts}
|
||||
[[ -d ${local_bin} && ${PATH} != *${local_bin}* ]] && export PATH=${PATH}:${local_bin}
|
||||
[[ -h ${gem_bin} && ${PATH} != *${gem_bin}* ]] && export PATH=${PATH}:${gem_bin}
|
||||
unset local_bin vscripts
|
||||
|
||||
dotfiles="${HOME}/vdotfiles"
|
||||
comp_enabled=true
|
||||
vcs_enabled=true
|
||||
|
||||
export MYSQL_PS1="mysql [\d]> "
|
||||
export SSH_AUTH_SOCK="${HOME}/.ssh/ssh_auth_sock"
|
||||
export TIME_STYLE='long-iso'
|
||||
if [[ ${LANG} != 'ru_RU.KOI8-R' ]]; then
|
||||
export LANG='en_US.utf8'
|
||||
export LANGUAGE="$LANG"
|
||||
if [[ ${OSTYPE} != 'cygwin' ]]; then
|
||||
export LC_TIME='en_DK.utf8'
|
||||
export LC_MEASUREMENT='en_DK.utf8'
|
||||
fi
|
||||
fi
|
||||
export EDITOR='vim'
|
||||
export PAGER='less -R'
|
||||
export LS_COLORS='no=00:fi=00:di=34:ow=34;40:ln=35:pi=30;44:so=35;44:do=35;44:bd=33;44:cd=37;44:or=05;37;41:mi=05;37;41:ex=01;31:*.cmd=01;31:*.exe=01;31:*.com=01;31:*.bat=01;31:*.reg=01;31:*.app=01;31:*.txt=32:*.org=32:*.md=32:*.mkd=32:*.h=32:*.c=32:*.C=32:*.cc=32:*.cpp=32:*.cxx=32:*.objc=32:*.sh=32:*.csh=32:*.zsh=32:*.el=32:*.vim=32:*.java=32:*.pl=32:*.pm=32:*.py=32:*.rb=32:*.hs=32:*.php=32:*.htm=32:*.html=32:*.shtml=32:*.erb=32:*.haml=32:*.xml=32:*.rdf=32:*.css=32:*.sass=32:*.scss=32:*.less=32:*.js=32:*.coffee=32:*.man=32:*.0=32:*.1=32:*.2=32:*.3=32:*.4=32:*.5=32:*.6=32:*.7=32:*.8=32:*.9=32:*.l=32:*.n=32:*.p=32:*.pod=32:*.tex=32:*.bmp=33:*.cgm=33:*.dl=33:*.dvi=33:*.emf=33:*.eps=33:*.gif=33:*.jpeg=33:*.jpg=33:*.JPG=33:*.mng=33:*.pbm=33:*.pcx=33:*.pdf=33:*.pgm=33:*.png=33:*.ppm=33:*.pps=33:*.ppsx=33:*.ps=33:*.svg=33:*.svgz=33:*.tga=33:*.tif=33:*.tiff=33:*.xbm=33:*.xcf=33:*.xpm=33:*.xwd=33:*.xwd=33:*.yuv=33:*.aac=33:*.au=33:*.flac=33:*.mid=33:*.midi=33:*.mka=33:*.mp3=33:*.mpa=33:*.mpeg=33:*.mpg=33:*.ogg=33:*.ra=33:*.wav=33:*.anx=33:*.asf=33:*.avi=33:*.axv=33:*.flc=33:*.fli=33:*.flv=33:*.gl=33:*.m2v=33:*.m4v=33:*.mkv=33:*.mov=33:*.mp4=33:*.mp4v=33:*.mpeg=33:*.mpg=33:*.nuv=33:*.ogm=33:*.ogv=33:*.ogx=33:*.qt=33:*.rm=33:*.rmvb=33:*.swf=33:*.vob=33:*.wmv=33:*.doc=31:*.docx=31:*.rtf=31:*.dot=31:*.dotx=31:*.xls=31:*.xlsx=31:*.ppt=31:*.pptx=31:*.fla=31:*.psd=31:*.7z=1;35:*.apk=1;35:*.arj=1;35:*.bin=1;35:*.bz=1;35:*.bz2=1;35:*.cab=1;35:*.deb=1;35:*.dmg=1;35:*.gem=1;35:*.gz=1;35:*.iso=1;35:*.jar=1;35:*.msi=1;35:*.rar=1;35:*.rpm=1;35:*.tar=1;35:*.tbz=1;35:*.tbz2=1;35:*.tgz=1;35:*.tx=1;35:*.war=1;35:*.xpi=1;35:*.xz=1;35:*.z=1;35:*.Z=1;35:*.zip=1;35:*.ANSI-30-black=30:*.ANSI-01;30-brblack=01;30:*.ANSI-31-red=31:*.ANSI-01;31-brred=01;31:*.ANSI-32-green=32:*.ANSI-01;32-brgreen=01;32:*.ANSI-33-yellow=33:*.ANSI-01;33-bryellow=01;33:*.ANSI-34-blue=34:*.ANSI-01;34-brblue=01;34:*.ANSI-35-magenta=35:*.ANSI-01;35-brmagenta=01;35:*.ANSI-36-cyan=36:*.ANSI-01;36-brcyan=01;36:*.ANSI-37-white=37:*.ANSI-01;37-brwhite=01;37:*.log=01;32:*~=01;32:*#=01;32:*.bak=01;33:*.BAK=01;33:*.old=01;33:*.OLD=01;33:*.org_archive=01;33:*.off=01;33:*.OFF=01;33:*.dist=01;33:*.DIST=01;33:*.orig=01;33:*.ORIG=01;33:*.swp=01;33:*.swo=01;33:*,v=01;33:*.gpg=34:*.gpg=34:*.pgp=34:*.asc=34:*.3des=34:*.aes=34:*.enc=34:'
|
||||
|
||||
# }}}
|
||||
# {{{ common aliases
|
||||
alias less='command less -R'
|
||||
alias cower='command cower -c'
|
||||
alias pacman='command pacman --color=auto'
|
||||
alias rscreen='command screen -Dr'
|
||||
alias rdesktop='command rdesktop -g1580x860'
|
||||
alias rgrep='command grep --exclude-dir=\.git -R'
|
||||
alias hist='fc -l 1'
|
||||
alias beep='printf "\007"'
|
||||
alias fixterm='printf "c"'
|
||||
alias vi='command vim'
|
||||
alias pg-linux-client='command sudo -u postgres psql'
|
||||
alias mysql='mysql --sigint-ignore'
|
||||
|
||||
# iconv
|
||||
alias iconvwk='command iconv -c -f cp1251 -t koi8-r'
|
||||
alias iconvuk='command iconv -c -f utf-8 -t koi8-r'
|
||||
alias iconvku='command iconv -c -f koi8-r -t utf-8'
|
||||
alias iconvwu='command iconv -c -f cp1251 -t utf-8'
|
||||
|
||||
# grc
|
||||
if is_exec grc; then
|
||||
alias ping='command grc --colour=auto ping'
|
||||
alias ping6='command grc --colour=auto ping'
|
||||
alias traceroute='command grc --colour=auto traceroute'
|
||||
alias traceroute6='command grc --colour=auto traceroute'
|
||||
alias make='command grc --colour=auto make'
|
||||
alias diff='command grc --colour=auto diff'
|
||||
alias cvs='command grc --colour=auto cvs'
|
||||
alias netstat='command grc --colour=auto netstat'
|
||||
fi
|
||||
|
||||
# ls
|
||||
alias ls='command ls --color=auto --group-directories-first '
|
||||
alias la='ls -FA'
|
||||
alias ll='ls -lha'
|
||||
alias ld='ls -lhda'
|
||||
|
||||
# diff and colordiff
|
||||
if is_exec colordiff; then
|
||||
alias diff='command colordiff -u'
|
||||
fi
|
||||
alias rdiff='diff -urx.svn'
|
||||
|
||||
# mount
|
||||
alias mountiso='sudo mount -t iso9660 -o loop'
|
||||
alias mountmdf='sudo mount -o loop'
|
||||
alias mountnrg='sudo mount -o loop,offset=307200'
|
||||
|
||||
# git
|
||||
alias gss='command git status -s'
|
||||
alias gdf='command git diff'
|
||||
alias gci='command git commit -a'
|
||||
alias gup='command git pull'
|
||||
|
||||
# svn
|
||||
alias sss='command svn status'
|
||||
alias sdf='command svn diff'
|
||||
alias sci='command svn commit'
|
||||
alias sup='command svn up'
|
||||
|
||||
# tmux
|
||||
alias tmux='command tmux -2'
|
||||
alias atmux='command tmux -2 attach'
|
||||
# }}}
|
||||
# {{{ common functions
|
||||
screenoff-disable() { xset -dpms; xset s off; }
|
||||
screenoff-enable() { xset +dpms; xset s on; }
|
||||
dotfiles-update() { git --work-tree="${dotfiles}" --git-dir="${dotfiles}/.git" pull; }
|
||||
|
||||
hide-info() { hide_info=true; }
|
||||
unhide-info() { unset hide_info; }
|
||||
|
||||
tmuxrc() { tmux source-file "${HOME}/.tmux.conf"; tmux display-message "Config reloaded."; }
|
||||
|
||||
if [[ -z "${DISPLAY}" ]]; then
|
||||
x() { exec xinit -- :0 -nolisten tcp vt$XDG_VTNR; }
|
||||
else
|
||||
fixkb() {
|
||||
setxkbmap -layout us,ru -variant altgr-intl,typewriter -option ctrl:nocaps,grp:win_space_toggle,grp_led:caps,compose:menu
|
||||
xkbcomp $DISPLAY - | egrep -v "group . = AltGr;" | xkbcomp - $DISPLAY 2>/dev/null
|
||||
}
|
||||
fi
|
||||
|
||||
# }}}
|
||||
if is_zsh; then # {{{
|
||||
# {{{ ~ options
|
||||
setopt APPEND_HISTORY EXTENDED_HISTORY HIST_IGNORE_DUPS EXTENDED_GLOB AUTO_CD AUTO_PUSHD PRINT_EXIT_VALUE
|
||||
unsetopt BEEP NO_MATCH NOTIFY
|
||||
|
||||
SAVEHIST=1000
|
||||
HISTSIZE=1000
|
||||
HISTFILE="${HOME}/.histfile"
|
||||
|
||||
#hl_script='/usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh'
|
||||
extras=( "${HOME}/.zshrc.extras" )
|
||||
|
||||
# completion
|
||||
if [[ -n ${comp_enabled} ]]; then
|
||||
autoload -Uz compinit zsh/terminfo
|
||||
compinit
|
||||
setopt MENU_COMPLETE
|
||||
zstyle ':completion:*' completer _list _complete _ignored
|
||||
zstyle ':completion:*' insert-unambiguous true
|
||||
zstyle ':completion:*' file-sort name
|
||||
zstyle ':completion:*' format 'Completing %d'
|
||||
zstyle ':completion:*' group-name ''
|
||||
zstyle ':completion:*' list-colors ''
|
||||
zstyle ':completion:*' list-prompt '%SAt %p: Hit TAB for more, or the character to insert%s'
|
||||
zstyle ':completion:*' list-suffixes true
|
||||
zstyle ':completion:*' menu select=long-list select=0
|
||||
zstyle ':completion:*' original true
|
||||
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
|
||||
zstyle ':completion:*' matcher-list 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}'
|
||||
zstyle ':completion:*' rehash true
|
||||
zstyle ':completion:*:kill:*:processes' command 'ps --forest -A -o pid,user,cmd'
|
||||
zstyle ':completion:*:processes-names' command 'ps axho command'
|
||||
zstyle ':completion:*:default' list-colors ${(s.:.)LS_COLORS}
|
||||
fi
|
||||
if [[ -n ${vcs_enabled} ]]; then
|
||||
autoload -Uz vcs_info
|
||||
zstyle ':vcs_info:*' enable git svn
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
zstyle ':vcs_info:*' stagedstr " %F{green}v%f"
|
||||
zstyle ':vcs_info:*' unstagedstr " %F{red}x%f"
|
||||
zstyle ':vcs_info:svn*' branchformat '%r'
|
||||
zstyle ':vcs_info:*' formats " %s:%B%F{magenta}%r%f%%b %F{yellow}%b%f%u%c"
|
||||
fi
|
||||
# }}}
|
||||
# {{{ ~ prompt
|
||||
lb='[ '
|
||||
rb=' ]'
|
||||
bb=':'
|
||||
prompt_user='%(1000#..%(1205#..%F{red}%n%f%b ))'
|
||||
prompt_host=${HOSTNAME}
|
||||
prompt_cwd='%B%d%b'
|
||||
prompt_bang='%(!.%F{red}>%f.%B>%b)'
|
||||
prompt_jobs='%(1j. jobs:%B%F{red}%j%f%b.)'
|
||||
precmd() {
|
||||
[[ -n ${vcs_enabled} ]] && vcs_info
|
||||
if [[ -z ${hide_info} ]]; then
|
||||
prompt_info="${lb}${prompt_user}${prompt_host}${bb}${prompt_cwd}${prompt_jobs}${vcs_info_msg_0_}${rb}"
|
||||
else
|
||||
prompt_info=''
|
||||
fi
|
||||
PROMPT="${prompt_info}${newline}${prompt_bang} "
|
||||
}
|
||||
PROMPT2='%b%f%_%B%F{green}>%f%b '
|
||||
PROMPT3='%b%f?%B%F{green}#%f%b '
|
||||
PROMPT4='%b%f+%N:%i%B%F{green}>%f%b '
|
||||
# }}}
|
||||
# {{{ ~ key bindings
|
||||
bindkey -e
|
||||
# urxvt
|
||||
bindkey '^[[7~' beginning-of-line # home
|
||||
bindkey '^[[8~' end-of-line # end
|
||||
bindkey '^[Oc' forward-word # ctrl + right
|
||||
bindkey '^[Od' backward-word # ctrl + left
|
||||
bindkey '^[[3^' delete-word # ctrl + del
|
||||
# screen
|
||||
bindkey '^[[1~' beginning-of-line # home
|
||||
bindkey '^[[4~' end-of-line # end
|
||||
# xterm
|
||||
bindkey '^[[H' beginning-of-line # home
|
||||
bindkey '^[[F' end-of-line # end
|
||||
# most of them (but not urxvt)
|
||||
bindkey '^[[1;5C' forward-word # ctrl + right
|
||||
bindkey '^[[1;5D' backward-word # ctrl + left
|
||||
bindkey '^[[3;5~' delete-word # ctrl + del
|
||||
# all of them
|
||||
bindkey '^[[5~' backward-word # page up
|
||||
bindkey '^[[6~' forward-word # page down
|
||||
bindkey '^[[3~' delete-char # del
|
||||
bindkey '^R' history-incremental-search-backward # ctrl + r
|
||||
bindkey '^[m' copy-prev-shell-word # alt + m
|
||||
bindkey -s '^j' '^atime ^m' # ctrl + j
|
||||
# }}}
|
||||
# {{{ ~ global aliases
|
||||
alias -g L='| less -R'
|
||||
alias -g H='| head'
|
||||
alias -g T='| tail'
|
||||
alias -g G='| grep'
|
||||
alias -g PV='| pv |'
|
||||
alias -g WCL='| wc -l'
|
||||
alias -g NCL='| nc -l 17777'
|
||||
|
||||
# redirection
|
||||
alias -g NO='1> /dev/null'
|
||||
alias -g NE='2> /dev/null'
|
||||
alias -g EO='2> &1'
|
||||
alias -g OE='1> &2'
|
||||
alias -g TEE='>&1 >>'
|
||||
|
||||
# iconv
|
||||
alias -g WK='| iconvwk'
|
||||
alias -g UK='| iconvuk'
|
||||
alias -g KU='| iconvku'
|
||||
alias -g WU='| iconvwu'
|
||||
# }}}
|
||||
# {{{ ~ suffix aliases
|
||||
editor=${EDITOR}
|
||||
text=( 'txt' 'xml' 'cfg' 'cnf' 'conf' 'ini' 'erb' 'pp' )
|
||||
for i in ${text[@]}; do
|
||||
alias -s ${i}=${editor}
|
||||
done
|
||||
|
||||
player='mpv'
|
||||
media=( 'mkv' 'mp4' 'avi' 'mpg' 'mp3' 'ogg' 'mpeg' 'mov' 'webm' 'flv' )
|
||||
for i in ${media[@]}; do
|
||||
alias -s ${i}=${player}
|
||||
done
|
||||
|
||||
viewer='eog'
|
||||
image=( 'jpg' 'png' 'gif' 'bmp' 'jpeg' )
|
||||
for i in ${image[@]}; do
|
||||
alias -s ${i}=${viewer}
|
||||
done
|
||||
|
||||
# wine:
|
||||
if [[ ${OSTYPE} != 'cygwin' ]]; then
|
||||
alias -s exe=wine
|
||||
fi
|
||||
# }}}
|
||||
# {{{ ~ plugins
|
||||
# command line syntax highlight from https://github.com/zsh-users/zsh-syntax-highlighting
|
||||
if [[ -r ${hl_script} ]]; then
|
||||
source ${hl_script}
|
||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=(main brackets pattern)
|
||||
ZSH_HIGHLIGHT_STYLES[path]='fg=black,bold'
|
||||
ZSH_HIGHLIGHT_STYLES[path_prefix]='fg=black,bold'
|
||||
fi
|
||||
# }}}
|
||||
fi # }}}
|
||||
if is_bash; then # {{{
|
||||
# {{{ ~ options
|
||||
HISTSIZE=1000
|
||||
HISTCONTROL=ignoredups:ignorespace
|
||||
shopt -s histappend checkwinsize
|
||||
[[ ${BASH_VERSINFO} -ge 4 ]] && shopt -s autocd
|
||||
|
||||
extras=( "${HOME}/.bashrc.extras" )
|
||||
# }}}
|
||||
# {{{ ~ prompt
|
||||
colors=('black' 'red' 'green' 'yellow' 'blue' 'magenta' 'cyan' 'white')
|
||||
for i in 0 1 2 3 4 5 6 7; do
|
||||
eval "n${colors[$i]}='\[\e[0;3${i}m\]'"
|
||||
eval "b${colors[$i]}='\[\e[1;3${i}m\]'"
|
||||
done
|
||||
reset='\[\e[0m\]'
|
||||
bold='\[\e[1m\]'
|
||||
lb="[ "
|
||||
rb=" ]"
|
||||
bb=":"
|
||||
prompt_host="${HOSTNAME}"
|
||||
prompt_bang=">${reset}"
|
||||
precmd() {
|
||||
if [[ -z ${hide_info} ]]; then
|
||||
prompt_cwd="${bold}${PWD}${reset}"
|
||||
if [[ ${UID} -eq 1000 || ${UID} -eq 1205 ]]; then
|
||||
prompt_user=''
|
||||
else
|
||||
prompt_user="${nred}\u${reset} "
|
||||
fi
|
||||
prompt_info="${lb}${prompt_user}${prompt_host}${bb}${prompt_cwd} bash:${nyellow}\v${reset}${rb}"
|
||||
else
|
||||
prompt_info=''
|
||||
fi
|
||||
if [[ $UID -eq 0 ]]; then
|
||||
prompt_bang_color="${nred}"
|
||||
else
|
||||
prompt_bang_color="${bold}"
|
||||
fi
|
||||
PS1="${prompt_info}${newline}${prompt_bang_color}${prompt_bang} "
|
||||
}
|
||||
PROMPT_COMMAND='precmd'
|
||||
# }}}
|
||||
# {{{ ~ key bindings
|
||||
# time $command bind
|
||||
bind '"\C-j":"\C-atime \C-m"'
|
||||
# urxvt
|
||||
bind '"\e[7~"':beginning-of-line # home
|
||||
bind '"\e[8~"':end-of-line # end
|
||||
# screen
|
||||
bind '"\e[1~"':beginning-of-line # home
|
||||
bind '"\e[4~"':end-of-line # end
|
||||
# xterm
|
||||
bind '"\e[H~"':beginning-of-line # home
|
||||
bind '"\e[F~"':end-of-line # end
|
||||
# all of them
|
||||
bind '"\e[5~"':backward-word # page up
|
||||
bind '"\e[6~"':forward-word # page down
|
||||
# }}}
|
||||
# {{{ ~ plugins
|
||||
completion_path='/usr/share/bash-completion/bash_completion'
|
||||
if [[ -n ${comp_enabled} && -r ${completion_path} ]]; then
|
||||
source ${completion_path}
|
||||
fi
|
||||
unset completion_path
|
||||
# }}}
|
||||
# {{{ ~ traps
|
||||
# we want to see exit code on error (it also has to be the last entry here)
|
||||
trap 'printf "\e[0m>> exit \e[1;37m%s\e[0m\n" $?' ERR
|
||||
# }}}
|
||||
fi # }}}
|
||||
# {{{ source extras
|
||||
for i in ${extras[@]}; do
|
||||
if [[ -r ${i} ]]; then
|
||||
source ${i}
|
||||
fi
|
||||
done
|
||||
# }}}
|
111
defunct/sxhkdrc
111
defunct/sxhkdrc
|
@ -1,111 +0,0 @@
|
|||
#
|
||||
# bspwm hotkeys
|
||||
#
|
||||
|
||||
super + alt + Escape
|
||||
bspc quit
|
||||
|
||||
super + shift + c
|
||||
bspc window -c
|
||||
|
||||
super + t
|
||||
bspc desktop -l next
|
||||
|
||||
super + b
|
||||
bspc desktop -B
|
||||
|
||||
super + {s,f}
|
||||
bspc window -t {floating,fullscreen}
|
||||
|
||||
super + {o,Tab}
|
||||
bspc {monitor,window} -f next
|
||||
|
||||
super + shift + {o,Tab}
|
||||
bspc {monitor,window} -f prev
|
||||
|
||||
super + apostrophe
|
||||
bspc window -s last
|
||||
|
||||
#super + {o,i}
|
||||
# bspc control --record-history off; \
|
||||
# bspc window {older,newer} -f; \
|
||||
# bspc control --record-history on
|
||||
|
||||
super + y
|
||||
bspc window -w last.manual
|
||||
|
||||
super + m
|
||||
bspc window -s biggest
|
||||
|
||||
super + {_,shift + }{h,j,k,l}
|
||||
bspc window -{f,s} {left,down,up,right}
|
||||
|
||||
super + {_,shift + }c
|
||||
bspc window -f {next,prev}
|
||||
|
||||
super + {comma,period}
|
||||
bspc desktop -C {backward,forward}
|
||||
|
||||
super + bracket{left,right}
|
||||
bspc desktop -f {prev,next}
|
||||
|
||||
super + ctrl + {h,j,k,l}
|
||||
bspc window -p {left,down,up,right}
|
||||
|
||||
super + ctrl + {_,shift + }space
|
||||
bspc {window -p cancel,desktop -c}
|
||||
|
||||
super + alt + {j,l}
|
||||
bspc window -e {down,right} +32
|
||||
|
||||
super + alt + {k,h}
|
||||
bspc window -e {down,right} -32
|
||||
|
||||
#super + alt + {h,j,k,l}
|
||||
# bspc window -e {left -10,down +10,up -10,right +10}
|
||||
|
||||
#super + alt + shift + {h,j,k,l}
|
||||
# bspc window -e {right -10,up +10,down -10,left +10}
|
||||
|
||||
super + ctrl + {1-9}
|
||||
bspc window -r 0.{1-9}
|
||||
|
||||
#super + {_,shift + }{1-9,0}
|
||||
# bspc {desktop -f,window -d} ^{1-9,10}
|
||||
|
||||
super + {_,shift + }{1-3}
|
||||
bspc {desktop -f,window -d} ^{1-3}
|
||||
|
||||
super + {_,shift + }{q,w,e}
|
||||
bspc {desktop -f,window -d} ^{4,5,6}
|
||||
|
||||
~button1
|
||||
bspc pointer -g focus
|
||||
|
||||
super + button{1-3}
|
||||
bspc pointer -g {move,resize_side,resize_corner}
|
||||
|
||||
super + !button{1-3}
|
||||
bspc pointer -t %i %i
|
||||
|
||||
super + @button{1-3}
|
||||
bspc pointer -u
|
||||
|
||||
#
|
||||
# wm independent hotkeys
|
||||
#
|
||||
super + z
|
||||
i3lock -entc 661111 -i /home/von/.wallpaper.png
|
||||
|
||||
super + x
|
||||
urxvt
|
||||
|
||||
super + r
|
||||
gmrun
|
||||
|
||||
super + a
|
||||
/home/von/.local/bin/ticket_watch
|
||||
|
||||
# make sxhkd reload its configuration files:
|
||||
super + Escape
|
||||
pkill -USR1 -x sxhkd
|
|
@ -1,4 +0,0 @@
|
|||
" vim: set ft=vimperator:
|
||||
|
||||
set hintchars="qwertyuiop[]asdfghjkl;'zxcvbnm,./"
|
||||
set toolbars=addons,nobookmarks,nomenu,nonavigation,tabs
|
Loading…
Add table
Add a link
Reference in a new issue