Tweaks and cleanup
This commit is contained in:
parent
3aad6fe631
commit
a6093d1758
@ -92,7 +92,7 @@ function add_applications_icons(arg)
|
||||
click = function () awful.util.spawn(program.cmdline) end
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Adds subdirs and files icons to the desktop
|
||||
@ -117,7 +117,7 @@ function add_dirs_and_files_icons(arg)
|
||||
click = function () awful.util.spawn(arg.open_with .. ' ' .. file.path) end
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function add_desktop_icons(args)
|
||||
|
@ -52,7 +52,7 @@ end
|
||||
terminal = "termite"
|
||||
editor = os.getenv("EDITOR") or "vim"
|
||||
editor_cmd = terminal .. " -e " .. editor
|
||||
rmenu = "rofi-gorice"
|
||||
rmenu = "rofr.sh"
|
||||
browser = "firefox"
|
||||
filemgr = "thunar"
|
||||
txteditor = "geany"
|
||||
@ -70,7 +70,7 @@ modkey = "Mod4"
|
||||
|
||||
-- Table of layouts to cover with awful.layout.inc, order matters.
|
||||
local layouts =
|
||||
{
|
||||
{
|
||||
awful.layout.suit.floating,
|
||||
awful.layout.suit.tile,
|
||||
awful.layout.suit.tile.left,
|
||||
@ -83,7 +83,7 @@ local layouts =
|
||||
awful.layout.suit.max,
|
||||
awful.layout.suit.max.fullscreen,
|
||||
awful.layout.suit.magnifier
|
||||
}
|
||||
}
|
||||
-- }}}
|
||||
|
||||
-- {{{ Naughty presets
|
||||
@ -205,16 +205,16 @@ mypromptbox = {}
|
||||
mylayoutbox = {}
|
||||
mytaglist = {}
|
||||
mytaglist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, awful.tag.viewonly),
|
||||
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||
awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
|
||||
awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
|
||||
awful.button({ }, 1, awful.tag.viewonly),
|
||||
awful.button({ modkey }, 1, awful.client.movetotag),
|
||||
awful.button({ }, 3, awful.tag.viewtoggle),
|
||||
awful.button({ modkey }, 3, awful.client.toggletag),
|
||||
awful.button({ }, 4, function(t) awful.tag.viewnext(awful.tag.getscreen(t)) end),
|
||||
awful.button({ }, 5, function(t) awful.tag.viewprev(awful.tag.getscreen(t)) end)
|
||||
)
|
||||
mytasklist = {}
|
||||
mytasklist.buttons = awful.util.table.join(
|
||||
awful.button({ }, 1, function (c)
|
||||
awful.button({ }, 1, function (c)
|
||||
if c == client.focus then
|
||||
c.minimized = true
|
||||
else
|
||||
@ -229,23 +229,23 @@ mytasklist.buttons = awful.util.table.join(
|
||||
client.focus = c
|
||||
c:raise()
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
end),
|
||||
awful.button({ }, 3, function ()
|
||||
if instance then
|
||||
instance:hide()
|
||||
instance = nil
|
||||
else
|
||||
instance = awful.menu.clients({ width=200 })
|
||||
end
|
||||
end),
|
||||
awful.button({ }, 4, function ()
|
||||
end),
|
||||
awful.button({ }, 4, function ()
|
||||
awful.client.focus.byidx(1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.button({ }, 5, function ()
|
||||
end),
|
||||
awful.button({ }, 5, function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end)
|
||||
end)
|
||||
)
|
||||
|
||||
for s = 1, screen.count() do
|
||||
@ -327,84 +327,84 @@ end
|
||||
|
||||
-- {{{ Mouse bindings
|
||||
root.buttons(awful.util.table.join(
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
awful.button({ }, 3, function () mymainmenu:toggle() end),
|
||||
awful.button({ }, 4, awful.tag.viewnext),
|
||||
awful.button({ }, 5, awful.tag.viewprev)
|
||||
))
|
||||
-- }}}
|
||||
|
||||
-- {{{ Key bindings
|
||||
globalkeys = awful.util.table.join(
|
||||
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
||||
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
||||
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
||||
awful.key({ modkey, }, "Left", awful.tag.viewprev ),
|
||||
awful.key({ modkey, }, "Right", awful.tag.viewnext ),
|
||||
awful.key({ modkey, }, "Escape", awful.tag.history.restore),
|
||||
|
||||
awful.key({ modkey, }, "j",
|
||||
function ()
|
||||
awful.key({ modkey, }, "j",
|
||||
function ()
|
||||
awful.client.focus.byidx( 1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.key({ modkey, }, "k",
|
||||
function ()
|
||||
end),
|
||||
awful.key({ modkey, }, "k",
|
||||
function ()
|
||||
awful.client.focus.byidx(-1)
|
||||
if client.focus then client.focus:raise() end
|
||||
end),
|
||||
awful.key({ }, "Print", function () awful.util.spawn("upload_screens scr") end),
|
||||
end),
|
||||
awful.key({ }, "Print", function () awful.util.spawn("upload_screens scr") end),
|
||||
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||
awful.key({ modkey, }, "Tab",
|
||||
function ()
|
||||
-- Layout manipulation
|
||||
awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end),
|
||||
awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end),
|
||||
awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end),
|
||||
awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end),
|
||||
awful.key({ modkey, }, "u", awful.client.urgent.jumpto),
|
||||
awful.key({ modkey, }, "Tab",
|
||||
function ()
|
||||
awful.client.focus.history.previous()
|
||||
if client.focus then
|
||||
client.focus:raise()
|
||||
end
|
||||
end),
|
||||
end),
|
||||
|
||||
-- Standard program
|
||||
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, "Control" }, "space", function () awful.layout.inc(layouts, -1) end),
|
||||
awful.key({ modkey, }, "w", function () awful.util.spawn(browser) end),
|
||||
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey }, "t", function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey }, "e", function () awful.util.spawn(txteditor) end),
|
||||
awful.key({ modkey }, "f", function () awful.util.spawn(filemgr) end),
|
||||
awful.key({ modkey }, "r", function () awful.util.spawn(rmenu) end),
|
||||
awful.key({ modkey }, "space", function () awful.util.spawn(rmenu) end),
|
||||
awful.key({ modkey, "Shift" }, "r", awesome.restart),
|
||||
awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||
-- Menubar
|
||||
awful.key({ modkey }, "b", function() menubar.show() end)
|
||||
-- Standard program
|
||||
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, "Control" }, "space", function () awful.layout.inc(layouts, -1) end),
|
||||
awful.key({ modkey, }, "w", function () awful.util.spawn(browser) end),
|
||||
awful.key({ modkey, }, "Return", function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey }, "t", function () awful.util.spawn(terminal) end),
|
||||
awful.key({ modkey }, "e", function () awful.util.spawn(txteditor) end),
|
||||
awful.key({ modkey }, "f", function () awful.util.spawn(filemgr) end),
|
||||
awful.key({ modkey }, "r", function () awful.util.spawn(rmenu) end),
|
||||
awful.key({ modkey }, "space", function () awful.util.spawn(rmenu) end),
|
||||
awful.key({ modkey, "Shift" }, "r", awesome.restart),
|
||||
awful.key({ modkey, "Shift" }, "q", awesome.quit),
|
||||
awful.key({ modkey, "Control" }, "n", awful.client.restore),
|
||||
-- Menubar
|
||||
awful.key({ modkey }, "b", function() menubar.show() end)
|
||||
)
|
||||
|
||||
clientkeys = awful.util.table.join(
|
||||
awful.key({ modkey, "Shift" }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
|
||||
awful.key({ modkey, "Shift" }, "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" }, "t", function (c) c.ontop = not c.ontop end),
|
||||
awful.key({ modkey, }, "n",
|
||||
function (c)
|
||||
awful.key({ modkey, "Shift" }, "f", function (c) c.fullscreen = not c.fullscreen end),
|
||||
awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end),
|
||||
awful.key({ modkey, "Shift" }, "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" }, "t", function (c) c.ontop = not c.ontop end),
|
||||
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),
|
||||
awful.key({ modkey, }, "m",
|
||||
function (c)
|
||||
end),
|
||||
awful.key({ modkey, }, "m",
|
||||
function (c)
|
||||
c.maximized_horizontal = not c.maximized_horizontal
|
||||
c.maximized_vertical = not c.maximized_vertical
|
||||
end)
|
||||
end)
|
||||
)
|
||||
|
||||
-- Compute the maximum number of digit we need, limited to 9
|
||||
@ -447,9 +447,9 @@ for i = 1, keynumber do
|
||||
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))
|
||||
awful.button({ }, 1, function (c) client.focus = c; c:raise() end),
|
||||
awful.button({ modkey }, 1, awful.mouse.client.move),
|
||||
awful.button({ modkey }, 3, awful.mouse.client.resize))
|
||||
|
||||
-- Set keys
|
||||
root.keys(globalkeys)
|
||||
|
@ -47,7 +47,7 @@ vicious.register(batpct, vicious.widgets.bat, function(widget, args)
|
||||
end
|
||||
|
||||
return args[2] .. "%"
|
||||
end, nil, "BAT1")
|
||||
end, nil, "BAT1")
|
||||
|
||||
-- Buttons
|
||||
function popup_bat()
|
||||
@ -88,7 +88,7 @@ vicious.register(pacwidget, vicious.widgets.pkg, function(widget, args)
|
||||
end
|
||||
|
||||
return args[1]
|
||||
end, 1801, "Arch S") -- Arch S for ignorepkg
|
||||
end, 1801, "Arch S") -- Arch S for ignorepkg
|
||||
--
|
||||
-- Buttons
|
||||
function popup_pac()
|
||||
@ -121,12 +121,12 @@ vicious.register(volpct, vicious.widgets.volume, "$1%", nil, "Master")
|
||||
--
|
||||
-- Buttons
|
||||
volicon:buttons(awful.util.table.join(
|
||||
awful.button({ }, 1,
|
||||
function() awful.util.spawn_with_shell("amixer -q set Master toggle") end),
|
||||
awful.button({ }, 4,
|
||||
function() awful.util.spawn_with_shell("amixer -q set Master 3+% unmute") end),
|
||||
awful.button({ }, 5,
|
||||
function() awful.util.spawn_with_shell("amixer -q set Master 3-% unmute") end)
|
||||
awful.button({ }, 1,
|
||||
function() awful.util.spawn_with_shell("pamixer -t") end),
|
||||
awful.button({ }, 4,
|
||||
function() awful.util.spawn_with_shell("pamixer -i 3") end),
|
||||
awful.button({ }, 5,
|
||||
function() awful.util.spawn_with_shell("pamixer -d 3") end)
|
||||
))
|
||||
volpct:buttons(volicon:buttons())
|
||||
volspace:buttons(volicon:buttons())
|
||||
|
@ -1,46 +1,99 @@
|
||||
#!/bin/sh
|
||||
# Executed by startx
|
||||
# By calling this with arguments we can start different sessions
|
||||
# eg. startx ~/.xinitrc i3 or startx ~/.xinitrc bspwm
|
||||
# simply using startx, openbox is set as the default
|
||||
|
||||
# this file is executed when calling startx
|
||||
|
||||
# To run different WM, run:
|
||||
# startx ~/.xinitrc SESSION
|
||||
# eg. startx ~/.xinitrc openbox
|
||||
|
||||
# Commands for autologin with Systemd & Arch
|
||||
# No editing files or messing about required
|
||||
#--------------------------------------#
|
||||
# This copies the default getty service file so we can modify it
|
||||
# 1. sudo cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service
|
||||
|
||||
# This removes the existing link and creates a link to the file copied above
|
||||
# 2. sudo rm -f /etc/systemd/system/getty.target.wants/getty@tty1.service && sudo ln -s /etc/systemd/system/autologin@.service /etc/systemd/system/getty.target.wants/getty@tty1.service
|
||||
|
||||
# This command sets your user as the autologin user
|
||||
# 3. sudo sed -i "/ExecStart/ c ExecStart=-/sbin/agetty -a ${USER} %I \$TERM" /etc/systemd/system/autologin@.service
|
||||
|
||||
# This command will back up existing ~/.zprofile or ~/.bash_profile
|
||||
# 4. for f in $HOME/.{zprofile,bash_profile}; do if [[ -f $f ]]; then mv $f $HOME/${f}.bak; fi; done
|
||||
|
||||
# This command creates a new ~/.zprofile & ~/.bash_profile.. you can delete the one you don't need
|
||||
# 5. for x in $HOME/.{zprofile,bash_profile}; do echo -e "# $x\n\nif [[ \$DISPLAY ]] && [[ -n \$XDG_VTNR ]] && [[ \$XDG_VTNR -eq 1 ]]; then\n exec startx\nfi\n" > $x; done
|
||||
|
||||
# Finish up
|
||||
# 6. Remove Your Current Display Manager and Reboot!!
|
||||
#--------------------------------------#
|
||||
|
||||
|
||||
# Session to run if none given
|
||||
session=${1:-openbox}
|
||||
|
||||
# set ENV window manager for use in other scripts
|
||||
export WM="$session"
|
||||
|
||||
if [ -f /etc/X11/xinit/.Xmodmap ]; then
|
||||
xmodmap /etc/X11/xinit/.Xmodmap
|
||||
fi
|
||||
# bspwm requires this to be set
|
||||
export XDG_CONFIG_HOME=$HOME/.config
|
||||
|
||||
|
||||
# Default Arch xinit scripts
|
||||
if [ -d /etc/X11/xinit/xinitrc.d ]; then
|
||||
for f in /etc/X11/xinit/xinitrc.d/*.sh; do
|
||||
[ -x "$f" ] && . "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ -f ~/.Xresources ]; then
|
||||
xrdb -load ~/.Xresources
|
||||
if [ -f /etc/X11/xinit/.Xmodmap ]; then
|
||||
xmodmap /etc/X11/xinit/.Xmodmap
|
||||
fi
|
||||
|
||||
# user init scripts and settings
|
||||
if [ -f ~/.Xmodmap ]; then
|
||||
xmodmap ~/.Xmodmap
|
||||
fi
|
||||
|
||||
if [ -f ~/.xprofile ]; then
|
||||
. ~/.xprofile
|
||||
if [ -f ~/.Xresources ]; then
|
||||
xrdb -merge ~/.Xresources
|
||||
fi
|
||||
|
||||
if [ -f ~/.xprofile ]; then
|
||||
source ~/.xprofile
|
||||
fi
|
||||
|
||||
# keyring for storing passwords
|
||||
gnome-keyring-daemon --start --components=pkcs11 &
|
||||
|
||||
# run policy kit
|
||||
lxpolkit &
|
||||
|
||||
# keyboard repeat rate
|
||||
kbdrate -d 400 -r 50
|
||||
xset r rate 400 50
|
||||
|
||||
# display timeout
|
||||
xset s 3600 3600
|
||||
|
||||
# start the session
|
||||
|
||||
# Do NOT put code below this case statement
|
||||
case $session in
|
||||
i3|i3wm) exec i3 ;;
|
||||
bsp|bspwm) exec bspwm ;;
|
||||
awesome) exec awesome ;;
|
||||
xfce|xfce4) exec startxfce4 ;;
|
||||
openbox|openbox-session) exec openbox-session ;;
|
||||
*) exec "$1"
|
||||
dwm)
|
||||
exec dwm
|
||||
;;
|
||||
i3|i3wm)
|
||||
exec i3
|
||||
;;
|
||||
bsp|bspwm)
|
||||
exec bspwm
|
||||
;;
|
||||
xfce|xfce4)
|
||||
exec startxfce4
|
||||
;;
|
||||
openbox)
|
||||
exec openbox-session
|
||||
;;
|
||||
*)
|
||||
exec "$1" # Unknown, try running it
|
||||
esac
|
||||
|
Reference in New Issue
Block a user