#!/bin/bash
cp -fv /home/user/Backup/background.png /etc/xdg/openbox/
cp -fv /home/user/Backup/conky.conf /etc/conky/
ln -sf /usr/share/zoneinfo/Asia/Bangkok /etc/localtime
sed -i 's/Clearlooks/Onyx/g' /etc/xdg/openbox/rc.xml
sed -i '86s/9/14/g' /etc/xdg/openbox/rc.xml
sed -i '95s/9/14/g' /etc/xdg/openbox/rc.xml
sed -i '23s/6d95de/0000ff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '24s/2b829d/0000ff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '25s/f8f8f8/ffffff/g' /usr/share/themes/Onyx/openbox-3/themerc
sed -i '42s/mediumblue/blue/g' /etc/conky/conky.conf
rm -f /etc/motd
cat > /etc/motd << EOF
TrashOS
EOF
xsetroot -solid black
xset s off -dpms
setxkbmap -option caps:none
xhost +si:localuser:root
feh --bg-center /etc/xdg/openbox/background.png
conky -b &
cat >> /root/.bashrc << "EOA"
source /home/user/.bashrc
EOA
cat >> /home/user/.bashrc << "EOA"
# ~/.bashrc: executed by bash(1) for non-login shells.
[ -z "$PS1" ] && return
HISTCONTROL=$HISTCONTROL${HISTCONTROL+:}ignoredups
shopt -s histappend
shopt -s checkwinsize
case "$TERM" in
xterm-color) color_prompt=yes;;
esac
if [ -n "$force_color_prompt" ]; then
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
color_prompt=yes
else
color_prompt=
fi
fi
if [ "$color_prompt" = yes ]; then
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
;;
*)
;;
esac
red='\[\e[0;31m\]'
RED='\[\e[1;31m\]'
blue='\[\e[0;34m\]'
BLUE='\[\e[1;34m\]'
cyan='\[\e[0;36m\]'
CYAN='\[\e[1;36m\]'
green='\[\e[0;32m\]'
GREEN='\[\e[1;32m\]'
yellow='\[\e[0;33m\]'
YELLOW='\[\e[1;33m\]'
PURPLE='\[\e[1;35m\]'
purple='\[\e[0;35m\]'
nc='\[\e[0m\]'
if [ "$UID" = 0 ]; then
PS1="$nc\u$nc@$nc\H$nc:$nc\w$nc\\n$nc#$nc "
else
PS1="$blue\u$nc@$nc\H$nc:$blue\w$nc\\n$blue\$$nc "
fi
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
fi
alias aliases='sudo nano /home/user/.bashrc && source /home/user/.bashrc'
alias c='clear'
alias x='exit'
alias pubip='wget -qO- checkip.dyn.com | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"'
alias menu='sudo nano /etc/xdg/openbox/menu.xml && openbox --reconfigure'
alias pmon='watch -d -n4 sudo lsof -i -o'
alias dmon='sudo iotop -a'
alias fmon='watch -d -n4 "ls -lth /tmp"'
alias crypt='test -f /usr/bin/veracrypt && /usr/bin/veracrypt || ~/Backup/./veracrypt-x86'
alias nyt='wget
https://www.nytimes.com -O i.htm && lynx i.htm && sudo rm -f i.htm'
alias sound='pulseaudio --start && sleep 2s && pavucontrol'
alias pdf='chromium --headless --disable-gpu --print-to-pdf=/home/user/Downloads/grc.pdf
https://www.grc.com/securitynow.htm && chromium file:///home/user/Downloads/grc.pdf'
EOA
mv -v /etc/xdg/openbox/menu.xml /etc/xdg/openbox/menu.xml.bak
cat > /etc/xdg/openbox/menu.xml << EOF
<?xml version="1.0" encoding="UTF-8"?>
<openbox_menu xmlns="
http://openbox.org/3.4/menu">
<menu id="root-menu" label="Openbox 3">
<separator label="TrashOS" />
<item label="Terminal">
<action name="Execute">
<command>xfce4-terminal --geometry=99x40 --hide-scrollbar --hide-menubar --title=t0s</command>
</action>
</item>
<item label="Chromium">
<action name="Execute">
<command>chromium</command>
</action>
</item>
<item label="Files">
<action name="Execute">
<command>pcmanfm</command>
</action>
</item>
<item label="Text">
<action name="Execute">
<command>mousepad</command>
</action>
</item>
<menu id="menu" label="Tools">
<item label="Networks">
<action name="Execute">
<command>nm-connection-editor</command>
</action>
</item>
<item label="ScreenSh">
<action name="Execute">
<command>gnome-screenshot -i</command>
</action>
</item>
<item label="ScreenRc">
<action name="Execute">
<command>vokoscreen</command>
</action>
</item>
<item label="Wireshark">
<action name="Execute">
<command>sudo wireshark</command>
</action>
</item>
</menu>
<item label="Shutdown">
<action name="Execute">
<command>sudo shutdown -P --no-wall now</command>
</action>
</item>
</menu>
</openbox_menu>
EOF
sed -i '317s/scrot/gnome-screenshot \-i/g' /etc/xdg/openbox/rc.xml
sed -i '319i\
<keybind key="W-t">\
<action name="Execute"><command>xfce4-terminal --geometry=99x40 --hide-scrollbar --hide-menubar --title=TrashOS</command></action>\
</keybind>\
<keybind key="W-f">\
<action name="Execute"><command>pcmanfm</command></action>\
</keybind>\
<keybind key="W-w">\
<action name="Execute"><command>mousepad</command></action>\
</keybind>\
<keybind key="W-s">\
<action name="Execute"><command>gnome-screenshot -i</command></action>\
</keybind>\
<keybind key="W-r">\
<action name="Execute"><command>vokoscreen</command></action>\
</keybind>\
' /etc/xdg/openbox/rc.xml
openbox --reconfigure
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
echo "Port 44444" >> /etc/ssh/sshd_config
sed -i '56s/no/yes/g' /etc/ssh/sshd_config
systemctl stop ssh
killall pulseaudio
ufw enable
ufw logging medium
exit 0