Skip to content

Instantly share code, notes, and snippets.

@yne yne/postinstall.sh
Last active May 3, 2018

Embed
What would you like to do?
wget -O- git.io/yne.install | bash
#!/bin/bash
set -x
crontab -l | grep -q .wall || (echo '0 * * * * ID=$(curl -sL gist.githubusercontent.com/yne/729655bd0557bfde7a088e15b40b9e6d/raw/ | shuf -n 1);for t in jpg png; do curl -sfL nik.bot.nu/o$ID.$t -o "$HOME/.wall"; done') | crontab -
#wget http://ppa.launchpad.net/oiteam/xfce4/ubuntu/pool/main/x/xfce4-windowck-plugin/xfce4-windowck-plugin_0.3.1-0ubuntu1~oiteam0_$(uname -m | grep -q 64 && echo amd64 || echo i386).deb &&
#until sudo dpkg --install *.deb ; do sleep 10 ; done
#rm -f *.deb
#curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg >/dev/null
#echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | sudo tee /etc/apt/sources.list.d/vscode.list
#echo 'deb http://download.opensuse.org/repositories/home:/jgeboski/xUbuntu_17.10 ./' | sudo tee /etc/apt/sources.list.d/jgeboski.list
#wget -qO- https://jgeboski.github.io/obs.key | sudo apt-key add -
until sudo apt -y update && sudo apt -y upgrade ; do sleep 10; done
#purple-facebook
#until sudo apt -y remove libxfce4ui-utils popularity-contest indicator-messages xfce4-dict onboard xfburn gnome-mines orage gucharmap gnome-software gnome-sudoku catfish xubuntu-docs gigolo libreoffice-* parole sgt-* mythes-en-us xfce4-taskmanager xfce4-notes update-manager xfce4-appfinder xfce4-verve-plugin xfce4-systemload-plugin xfce4-quicklauncher-plugin xfce4-netload-plugin xfce4-cpugraph-plugin yelp yelp-xsl xubuntu-docs ; do sleep 10; done
until sudo apt -y install p7zip-full p7zip-rar inotify-tools wmctrl exfat-fuse exfat-utils pulseaudio-module-bluetooth tig git vim cmus htop tmux sshfs chromium-browser mpv curl python-pip wine-stable wine-binfmt hunspell-fr aspell-fr winbind; do sleep 10; done
until sudo apt -y autoremove ; do sleep 10; done
mkdir -p $HOME/.purple/plugins && curl -L https://github.com/EionRobb/pidgin-opensteamworks/releases/download/1.6.1/libsteam64-1.6.1.so > $HOME/.purple/plugins/libsteam64-1.6.1.so
sudo update-binfmts --import wine
pactl load-module module-bluetooth-discover
# wckbuttons install + config
#xfce4-panel --add wckbuttons ; sleep 1;
#xfce4-panel -r ; sleep 3; xfce4-panel -q ;
#cat << 'EOF' > $HOME/.config/xfce4/panel/wckbuttons-9.rc
#only_maximized=true
#show_on_desktop=true
#sync_wm_theme=true
#button_layout=HMC
#theme=Numix
#inactive_text_alpha=60
#inactive_text_shade=110
#EOF
#xfce4-panel &
cat << 'EOF' >> "$HOME/.config/xfce4/terminal/terminalrc"
[Configuration]
ColorPalette=rgb(4,3,3);rgb(204,0,0);rgb(78,154,6);rgb(196,160,0);rgb(52,101,164);rgb(117,80,123);rgb(6,152,154);rgb(211,215,207);rgb(148,148,148);rgb(239,41,41);rgb(138,226,52);rgb(252,233,79);rgb(115,159,207);rgb(173,127,168);rgb(52,226,226);rgb(238,238,236)
FontName=Liberation Mono 10
MiscAlwaysShowTabs=FALSE
MiscCursorBlinks=TRUE
MiscCursorShape=TERMINAL_CURSOR_SHAPE_BLOCK
MiscMenubarDefault=FALSE
MiscMouseAutohide=TRUE
MiscToolbarDefault=FALSE
MiscTabCloseButtons=FALSE
MiscUseShiftArrowsToScroll=TRUE
ScrollingBar=TERMINAL_SCROLLBAR_NONE
ScrollingUnlimited=TRUE
TitleMode=TERMINAL_TITLE_REPLACE
FontAllowBold=FALSE
BackgroundDarkness=0,760000
ColorBackground=#444344434443
ColorCursor=#0000aaa90000
ShortcutsNoHelpkey=TRUE
ShortcutsNoMenukey=TRUE
EOF
#hide "config" menu from whisher (reload needed)
mkdir -p "$HOME/.local/share/desktop-directories"
cat << 'EOF' >> "$HOME/.local/share/desktop-directories/xfce-settings.directory"
[Desktop Entry]
Version=1.0
Type=Directory
Name=Settings
Comment=Desktop and system settings applications
Icon=preferences-desktop
NoDisplay=true
Categories=X-XFCE;X-Xfce-Toplevel;
StartupNotify=false
Terminal=false
EOF
CFG="$HOME/.config/xfce4/panel/whiskermenu-1.rc"
sed -i 's/\(button-icon=\)[-[:alnum:]]*/\1application-menu-symbolic/' "$CFG"
sed -i 's/\(launcher-show-tooltip=\)[[:alnum:]]*/\1false/' "$CFG"
sed -i 's/\(item-icon-size=\)[[:alnum:]]*/\10/' "$CFG"
sed -i 's/\(hover-switch-category=\)[[:alnum:]]*/\1true/' "$CFG"
sed -i 's/\(category-show-name=\)[[:alnum:]]*/\1false/' "$CFG"
sed -i 's/\(load-hierarchy=\)[[:alnum:]]*/\1false/' "$CFG"
sed -i 's/\(position-commands-alternate=\)[[:alnum:]]*/\1true/' "$CFG"
sed -i 's/\(show-command-settings=\)[[:alnum:]]*/\1false/' "$CFG"
sed -i 's/\(show-command-lockscreen=\)[[:alnum:]]*/\1false/' "$CFG"
sed -i 's/\(menu-width=\)[[:alnum:]]*/\1220/' "$CFG"
sed -i 's/\(menu-height=\)[[:alnum:]]*/\1400/' "$CFG"
sed -i 's/\(menu-opacity=\)[[:alnum:]]*/\190/' "$CFG"
sed -i 's/\(recent-items-max=\)[[:alnum:]]*/\10/' "$CFG"
cat << 'EOF' >> "$CFG"
[action5]
name=Calculate
pattern=^=(.*)
command=bash -c "notify-send -i accessories-calculator-symbolic $((\\1))"
regex=true
EOF
#^=(.*) bash -c "notify-send $((\1))"
clockid=$(xfconf-query -c xfce4-panel -l | grep digital-format | sed 's/[^0-9]//g')
xfconf-query -c xfce4-keyboard-shortcuts -p / -rR
xfparams="
xsettings/Gtk/FontName=Liberation Sans 10
xsettings/Net/ThemeName=Numix
xsettings/Xft/Antialias=1
xsettings/Xft/Hinting=1
xsettings/Xft/HintStyle=hintfull
thunar/last-view=ThunarDetailsView
thunar/last-statusbar-visible=false
thunar/last-side-pane=void
thunar/last-location-bar=void
thunar/last-menubar-visible=false
thunar/misc-full-path-in-title=true
xfce4-panel/plugins/plugin-$clockid/digital-format=%H:%M
xfce4-panel/plugins/plugin-$clockid/tooltip-format=%A %d %B %Y (%V)
xfwm4/general/theme=Numix
xfwm4/general/title_alignment=left
xfwm4/general/title_font=Liberation Sans 9
xfwm4/general/titleless_maximize=true
xfwm4/general/easy_click=Super
xfce4-keyboard-shortcuts/commands/custom/override=true
xfce4-keyboard-shortcuts/commands/custom/<Super>e=exo-open --launch FileManager
xfce4-keyboard-shortcuts/commands/custom/Print=xfce4-screenshooter -r
xfce4-keyboard-shortcuts/commands/custom/<Primary>Print=xfce4-screenshooter -r -c
xfce4-keyboard-shortcuts/commands/custom/<Super>p=xfce4-display-settings --minimal
xfce4-keyboard-shortcuts/commands/custom/<Primary><Alt>t=exo-open --launch TerminalEmulator
xfce4-keyboard-shortcuts/commands/custom/<Primary><alt>Return=exo-open --launch TerminalEmulator
xfce4-keyboard-shortcuts/commands/custom/<Super>Page_Up=wmctrl -r :ACTIVE: -b toggle,above
xfce4-keyboard-shortcuts/commands/custom/œ=xfce4-popup-whiskermenu
xfce4-keyboard-shortcuts/xfwm4/custom/override=true
xfce4-keyboard-shortcuts/xfwm4/custom/<Alt>Tab=cycle_windows_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Alt><Shift>Tab=cycle_reverse_windows_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Super>Up=maximize_window_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Super>d=show_desktop_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Super>Down=hide_window_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Super>Left=tile_left_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Super>Right=tile_right_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Shift><Super>ISO_Left_Tab=prev_workspace_key
xfce4-keyboard-shortcuts/xfwm4/custom/<Alt><Shift>Tab=cycle_reverse_windows_key
xfce4-panel/panels/panel-0/background-alpha=+100
xfce4-panel/panels/panel-0/size=+26
xfce4-panel/panels/panel-0/background-style=+1
xfce4-desktop/backdrop/screen0/monitor1/workspace0/last-image=$HOME/.wall
xfce4-desktop/backdrop/screen0/monitor1/workspace1/last-image=$HOME/.wall
"
IFS=$'\n'; for x in $xfparams ; do
c=${x%%/*};ps=${x#*/};p=/${ps%=*};s=${ps#*=}
t=string ; [[ "$s" =~ ^-?[0-9]+$ ]] && t=int ; [[ "$s" =~ ^\+[0-9]+$ ]] && t=uint ; [ "$s" == "true" -o "$s" == "false" ] && t=bool
xfconf-query -t $t -c $c -p $p -s "${s#+*}" --create &>/dev/null
xfconf-query -t $t -c $c -p $p -s "${s#+*}"
done
unset IFS;
##################################
######### WINE ###########
##################################
# NPP
NPP_REPOS=notepad-plus-plus.org/repository
NPP_MAJOR=$(curl -s -L "$NPP_REPOS?C=M;O=D" | sed -E 's/.*?href="(.*?)\/".*/\1/' | sed -n 10p)
NPP_MINOR=$(curl -s -L "$NPP_REPOS/$NPP_MAJOR?C=M;O=D" | sed -E 's/.*?href="(.*?)\/".*/\1/' | sed -n 10p)
curl -sL $NPP_REPOS/$NPP_MAJOR/$NPP_MINOR/npp.$NPP_MINOR.Installer.exe -o npp.exe
wine npp /S
# PSP + time trial remove #oldversion.com/windows/download/paint-shop-pro-7-04
curl -sfL software.oldversion.com/download.php?f=YTo1OntzOjQ6InRpbWUiO2k6MTUxMTUzMjEyMztzOjI6ImlkIjtpOjIxMTY7czo0OiJmaWxlIjtzOjEyOiJwc3A3MDRldi5leGUiO3M6MzoidXJsIjtzOjUzOiJodHRwOi8vd3d3Lm9sZHZlcnNpb24uY29tL3dpbmRvd3MvcGFpbnQtc2hvcC1wcm8tNy0wNCI7czo0OiJwYXNzIjtzOjMyOiJjODg4YjkzZjFmOTg4MjBhY2VjMTVjMTI1YTQ2ZjA3MSI7fQ%3D%3D -o psp7.exe
curl -sfL oldapps.com/Paint_Shop_Pro.php?app=5811aab0e8009f3ae710fe549a679a1b -o psp7.exe
wine psp7 /V/passive
PSP_PATH=$(find ~/.wine -name psp.exe | grep -v /users/)
for off in 1decde-90 1decdf-e9 32d784-90 32d785-90 32d786-90 32d787-90 32d788-90 32d789-90 32d7a5-90 32d7a6-90 32d7a7-90 32d7a8-90 32d7a9-90 32d7aa-90 32d7bc-90 32d7bd-e9 56bdac-30 ; do eval "printf '\x${off#*-}' | dd of='$PSP_PATH' bs=1 count=1 conv=notrunc seek=$((0x${off%-*})) 2>/dev/null" ; done;
# Goldwave 5.18 + register E78KEBDCW/AUHVZCDSE
#curl -sfL oldapps.com/goldwave.php?app=3f93e982aefa1b34c9a560618bc1070b -o goldwave.exe
#cat << 'EOF' >> "$HOME/.wine/system.reg"
#[Software\\GoldWave\\GoldWave\\Options] 1493570553
#"License"="E78KEBDCWJT6KE6M5L"
#EOF
# Goldwave 5.68 + register GN8P95AX9/RTGE3BVJ5
curl -sfL software.oldversion.com/download.php?f=YTo1OntzOjQ6InRpbWUiO2k6MTUxMTUzMjk4MjtzOjI6ImlkIjtpOjkyMjA7czo0OiJmaWxlIjtzOjEyOiJnd2F2ZTU2OC5leGUiO3M6MzoidXJsIjtzOjQ3OiJodHRwOi8vd3d3Lm9sZHZlcnNpb24uY29tL3dpbmRvd3MvZ29sZHdhdmUtNS02OCI7czo0OiJwYXNzIjtzOjMyOiJiNDAyODIyYTk1ZGJlZDQyZGI1MGNkMWYwMzY2ZmJjZCI7fQ%3D%3D -o goldwave.exe
wine goldwave -s
wget https://download.microsoft.com/download/c/6/e/c6e88215-0178-4c6c-b5f3-158ff77b1f38/NetFx20SP2_x86.exe
wine NetFx20SP2_x86 /q
# ISO2PNG for imgur upload
# wget gist.githubusercontent.com/briandeheus/9df32136c756227df4bfbff580a1aadd/raw/b1c9ee25c4eb6ae7e79aacadac5445116e42e5c5/punk.py
# wget raw.githubusercontent.com/mathiasbynens/small/master/png-transparent.png
# split -a3 -d -b1MB --additional-suffix=.iso office2010.iso office2010.
# for i in office2010.*.iso ; do cp png-transparent.png $i.png ; python <<< "from punk import Punk; Punk().encode(\"$i.png\", file(\"$i\").read())" ; done
#
# setup cleanup
rm -f *.exe
# Wine ricing
cat << 'EOF' >> "$HOME/.wine/user.reg"
[Control Panel\\Colors] 1492729683
"ActiveTitle"="68 68 68"
"AppWorkSpace"="68 68 68"
"Background"="68 68 68"
"ButtonDkShadow"="16 16 16"
"ButtonFace"="68 68 68"
"ButtonHilight"="128 128 128"
"ButtonLight"="96 96 96"
"ButtonShadow"="32 32 32"
"ButtonText"="196 196 196"
"GradientActiveTitle"="68 68 68"
"GradientInactiveTitle"="68 68 68"
"GrayText"="32 32 32"
"Hilight"="200 73 73"
"HilightText"="255 255 255"
"InactiveTitle"="68 68 68"
"InactiveTitleText"="128 128 128"
"InfoText"="255 255 255"
"InfoWindow"="0 0 0"
"Menu"="68 68 68"
"MenuBar"="68 68 68"
"MenuHilight"="0 255 0"
"MenuText"="255 255 255"
"Scrollbar"="68 68 68"
"Window"="32 32 32"
"WindowText"="128 128 128"
[Software\\Wine\\DllOverrides] 1491146810
"riched20"="native,builtin"
EOF
ME=$(whoami)
NPP_DIR="$HOME/.wine/drive_c/users/$ME/Application Data/Notepad++"
cat << 'EOF' >> "$NPP_DIR/config.xml"
<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus><FindHistory/><History/><GUIConfigs>
<GUIConfig name="StatusBar">hide</GUIConfig>
<GUIConfig name="ToolBar" visible="no"/>
<GUIConfig name="MenuBar">hide</GUIConfig>
<GUIConfig name="TabBar" dragAndDrop="yes" drawTopBar="yes" drawInactiveTab="yes" reduce="yes" closeButton="no" doubleClick2Close="yes" vertical="no" multiLine="no" hide="no" quitOnEmpty="no" />
<GUIConfig name="ScintillaPrimaryView" lineNumberMargin="show" borderEdge="no" bookMarkMargin="hide" whiteSpaceShow="show" borderWidth="0" />
<GUIConfig name="TabSetting" replaceBySpace="no" size="2" />
<GUIConfig name="titleBar" short="no" />
<GUIConfig name="stylerTheme" path="C:\users\${ME}\Application Data\Notepad++\themes\Monokai.xml" />
<GUIConfig name="auto-completion" autoCAction="0" autoCIgnoreNumbers="no" funcParams="no"/>
</GUIConfigs></NotepadPlus>
EOF
CFG="$NPP_DIR/shortcuts.xml"
sed -i 's#<InternalCommands />#<InternalCommands>\
<Shortcut id="48011" Ctrl="yes" Alt="no" Shift="no" Key="80"/>\
<Shortcut id="41010" Ctrl="no" Alt="no" Shift="no" Key="0"/>\
</InternalCommands>#' "$CFG"
CFG="$NPP_DIR/themes/Monokai.xml"
sed -i 's/272822/444444/' "$CFG"
sed -i 's/\(fontName="\)[^"]*/\1Liberation Mono/' "$CFG"
sed -i 's/\(fontSize="\)[^"]*/\18/' "$CFG"
mv $HOME/.local/share/applications/wine/Programs/*/*.desktop $HOME/.local/share/applications
chmod -w $HOME/.config/chromium/Default/History # disable chrome history storing
#{"manifest_version": 2, "name": "StripOpenSearch", "version": "1.0.0", "description": "Strip OpenSearch.", "content_scripts": [{"matches": ["<all_urls>"], "js": ["noOpenSearch.js"]}],"permissions": ["http://*/*","https://*/*"]}
#document.querySelectorAll('[type="application/opensearchdescription+xml"]').forEach(n=>n.remove())
#xinput list | sed -ne 's/.*SYNA.*id=\([[:digit:]]\+\).*/\1/p'
cat << 'EOF' >> "$HOME/.bash_aliases"
test -f ~/.bash_git || wget https://raw.github.com/git/git/master/contrib/completion/git-prompt.sh -O $HOME/.bash_git
type -t __git_ps1 || source $HOME/.bash_git
GIT_PS1_SHOWCOLORHINTS=1;GIT_PS1_SHOWDIRTYSTATE=1;GIT_PS1_SHOWSTASHSTATE=1;GIT_PS1_SHOWUNTRACKEDFILES=1;GIT_PS1_SHOWUPSTREAM=verbose;GIT_PS1_DESCRIBE_STYLE=branch
PS1='\[\e]2;\u@\h:\w$(__git_ps1 " (%s)")\a\]\$ '
alias g='git'
alias tiga='tig --all'
alias apt='sudo apt'
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then notify-send -i network-server-symbolic "Incoming SSH" "from $SSH_CLIENT"; fi
PATH=~/.local/bin:$PATH
EOF
mkdir "$HOME/Code"
cat << 'EOF' >> "$HOME/.config/user-dirs.dirs"
XDG_DOCUMENTS_DIR="$HOME/Code"
EOF
cat << 'EOF' >> "$HOME/.config/autostart/NaturalScroll.desktop"
[Desktop Entry]
Type=Application
Name=synclient
Exec=synclient HorizScrollDelta=-45 VertScrollDelta=-45 HorizHysteresis=0 VertHysteresis=0 TapButton3=2
OnlyShowIn=XFCE;
EOF
git config --global alias.cp cherry-pick
git config --global alias.co checkout
git config --global alias.c commit
git config --global alias.s status
git config --global user.name yne
git config --global user.email yne@users.noreply.github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.