Added more templates and removed debugging
This commit is contained in:
parent
35cfef9857
commit
65aed10fa2
|
|
@ -186,16 +186,12 @@ class sys_command():
|
||||||
|
|
||||||
yield output
|
yield output
|
||||||
|
|
||||||
print('Debug...')
|
|
||||||
# Since we're in a subsystem, we gotta bail out!
|
# Since we're in a subsystem, we gotta bail out!
|
||||||
# Bail bail bail!
|
# Bail bail bail!
|
||||||
os.write(child_fd, b'shutdown now\n')
|
os.write(child_fd, b'shutdown now\n')
|
||||||
|
|
||||||
print('Shutdown initatied')
|
|
||||||
|
|
||||||
exit_code = os.waitpid(self.pid, 0)[1]
|
exit_code = os.waitpid(self.pid, 0)[1]
|
||||||
|
|
||||||
print('Exit code:', exit_code)
|
|
||||||
if exit_code != 0:
|
if exit_code != 0:
|
||||||
print('[E] Command "{}" exited with status code:'.format(self.cmd[0]), exit_code)
|
print('[E] Command "{}" exited with status code:'.format(self.cmd[0]), exit_code)
|
||||||
print(trace_log)
|
print(trace_log)
|
||||||
|
|
@ -641,7 +637,7 @@ if __name__ == '__main__':
|
||||||
del(opts['pass-args'])
|
del(opts['pass-args'])
|
||||||
elif 'format' in opts:
|
elif 'format' in opts:
|
||||||
del(opts['format'])
|
del(opts['format'])
|
||||||
else:
|
elif ('debug' in opts and opts['debug']) or ('debug' in conf and conf['debug']):
|
||||||
print('[-] Options: {}'.format(opts))
|
print('[-] Options: {}'.format(opts))
|
||||||
if 'pass-args' in opts and opts['pass-args']:
|
if 'pass-args' in opts and opts['pass-args']:
|
||||||
command = command.format(**args)
|
command = command.format(**args)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"sed -i 's/^twm &/#&/' /etc/X11/xinit/xinitrc" : null,
|
||||||
|
"sed -i 's/^xclock/#&/' /etc/X11/xinit/xinitrc" : null,
|
||||||
|
"sed -i 's/^xterm/#&/' /etc/X11/xinit/xinitrc" : null,
|
||||||
|
"sed -i 's/^exec xterm/#&/' /etc/X11/xinit/xinitrc" : null,
|
||||||
|
"sh -c \"echo 'xscreensaver -no-splash &' >> /etc/X11/xinit/xinitrc\"" : null,
|
||||||
|
"sh -c \"echo 'exec {_window_manager}' >> /etc/X11/xinit/xinitrc\"" : {"pass-args" : true},
|
||||||
|
"sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"Chromium\\\", \\\"chromium\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null,
|
||||||
|
"sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"File handler\\\", \\\"nemo\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null,
|
||||||
|
"sh -c \"sed -i 's/^globalkeys = gears.table.join(/&\n awful.key({ modkey, }, \\\"l\\\", function() awful.spawn(\\\"xscreensaver-command -lock &\\\") end),\n/' /etc/xdg/awesome/rc.lua\"" : null,
|
||||||
|
"sh -c \"awk -i inplace -v RS='' '{gsub(/awful.key\\({ modkey,.*?}, \\\"Tab\\\",.*?\\\"client\\\"}\\),/, \\\"awful.key({ modkey, }, \\\"Tab\\\",\n function ()\n awful.client.focus.byidx(-1)\n if client.focus then\n client.focus:raise()\n end\n end),\n awful.key({ modkey, \\\"Shift\\\" }, \\\"Tab\\\",\n function ()\n awful.client.focus.byidx(1)\n if client.focus then\n client.focus.raise()\n end\n end),\\\"); print}' /etc/xdg/awesome/rc.lua\"" : null,
|
||||||
|
"gsettings set org.nemo.desktop show-desktop-icons false" : null,
|
||||||
|
"xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search" : null
|
||||||
|
}
|
||||||
|
|
@ -16,21 +16,10 @@
|
||||||
"Setup virtulization" : {
|
"Setup virtulization" : {
|
||||||
"sh -c \"Description=\\\"Bridge for virtual machines\\\"\nInterface=br0\nConnection=bridge\nBindsToInterfaces=(eno1)\nIP=no\nExecUpPost=\\\"ip link set dev br0 address $(cat /sys/class/net/eno1/address); IP=dhcp; ip_set\\\"\nExecDownPre=\\\"IP=dhcp\\\"\n\n## Ignore (R)STP and immediately activate the bridge\nSkipForwardingDelay=yes\"" : null
|
"sh -c \"Description=\\\"Bridge for virtual machines\\\"\nInterface=br0\nConnection=bridge\nBindsToInterfaces=(eno1)\nIP=no\nExecUpPost=\\\"ip link set dev br0 address $(cat /sys/class/net/eno1/address); IP=dhcp; ip_set\\\"\nExecDownPre=\\\"IP=dhcp\\\"\n\n## Ignore (R)STP and immediately activate the bridge\nSkipForwardingDelay=yes\"" : null
|
||||||
},
|
},
|
||||||
"Setup desktop environment" : {
|
"Setup loclization" : {
|
||||||
"sed -i 's/^twm &/#&/' /etc/X11/xinit/xinitrc" : null,
|
|
||||||
"sed -i 's/^xclock/#&/' /etc/X11/xinit/xinitrc" : null,
|
|
||||||
"sed -i 's/^xterm/#&/' /etc/X11/xinit/xinitrc" : null,
|
|
||||||
"sed -i 's/^exec xterm/#&/' /etc/X11/xinit/xinitrc" : null,
|
|
||||||
"sh -c \"echo 'setxkbmap se' >> /etc/X11/xinit/xinitrc\"" : null,
|
"sh -c \"echo 'setxkbmap se' >> /etc/X11/xinit/xinitrc\"" : null,
|
||||||
"sh -c \"echo 'xscreensaver -no-splash &' >> /etc/X11/xinit/xinitrc\"" : null,
|
"sh -c \"echo 'KEYMAP={_keyboard_layout}\nFONT=lat9w-16' >> /etc/vconsole.conf\"" : {"pass-args" : true}
|
||||||
"sh -c \"echo 'exec {_window_manager}' >> /etc/X11/xinit/xinitrc\"" : {"pass-args" : true},
|
},
|
||||||
"sh -c \"echo 'KEYMAP={_keyboard_layout}\nFONT=lat9w-16' >> /etc/vconsole.conf\"" : {"pass-args" : true},
|
"Configure desktop environment" : "awesome"
|
||||||
"sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"Chromium\\\", \\\"chromium\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null,
|
|
||||||
"sh -c \"sed -i 's/{ \\\"open terminal\\\", terminal/{ \\\"File handler\\\", \\\"nemo\\\" },\n &1/' /etc/xdg/awesome/rc.lua\"" : null,
|
|
||||||
"sh -c \"sed -i 's/^globalkeys = gears.table.join(/&\n awful.key({ modkey, }, \\\"l\\\", function() awful.spawn(\\\"xscreensaver-command -lock &\\\") end),\n/' /etc/xdg/awesome/rc.lua\"" : null,
|
|
||||||
"sh -c \"awk -i inplace -v RS='' '{gsub(/awful.key\\({ modkey,.*?}, \\\"Tab\\\",.*?\\\"client\\\"}\\),/, \\\"awful.key({ modkey, }, \\\"Tab\\\",\n function ()\n awful.client.focus.byidx(-1)\n if client.focus then\n client.focus:raise()\n end\n end),\n awful.key({ modkey, \\\"Shift\\\" }, \\\"Tab\\\",\n function ()\n awful.client.focus.byidx(1)\n if client.focus then\n client.focus.raise()\n end\n end),\\\"); print}' /etc/xdg/awesome/rc.lua\"" : null,
|
|
||||||
"gsettings set org.nemo.desktop show-desktop-icons false" : null,
|
|
||||||
"xdg-mime default nemo.desktop inode/directory application/x-gnome-saved-search" : null
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue