-
Notifications
You must be signed in to change notification settings - Fork 0
/
common_profile.sh
executable file
·122 lines (97 loc) · 3.42 KB
/
common_profile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/usr/bin/env bash
export MANPAGER="less --ignore-case"
# Wallpaper
WALLPAPER=~/Documents/wallpaper8.jpg
# Needed by Python 3 and others
# Use en_GB to force 24-hour time
export LC_ALL=en_GB.UTF-8
export LANG=en_GB.UTF-8
export EDITOR="vim"
# Overcome the madness: http://www.economyofeffort.com/2014/07/04/zsh/
export TERM=xterm-256color
[ -n "$TMUX" ] && export TERM=screen-256color
# Fixes different things on Ubuntu. May not be up-to-date, since Ubuntu gets
# better every year
function fix_ubuntu() {
# See: https://bugs.launchpad.net/ubuntu/+source/at-spi2-core/+bug/1193236
export NO_AT_BRIDGE=1
# Fix .Xresources
# (https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1163129)
if [ -e ~/.Xresources ]; then
xrdb ~/.Xresources
fi
# Files with commands to be loaded by both Bash and ZSH
if command_exists wmname; then
wmname LG3D
fi
# Disable touchpad while typing (reactive 1 second after typing finished)
# if command_exists xinput && ((xinput list | grep synaptics > /dev/null) || (xinput list | grep ALPS > /dev/null)); then
# echo "syndaemon configured"
# syndaemon -i 1 -d
# fi
}
# Get distribution name
# OS="CentOS"
# if command_exists lsb_release; then
# OS=$(lsb_release -si)
# fi
# Executed when in X mode (e.g. DISPLAY is set)
# xrandr_display_count=`xrandr --query | grep " connected" | wc -l`
# if [ -z ${DISPLAY} ] || [ $xrandr_display_count -eq 1 ] ; then
# DISPLAY unset
# :
# else
# xrandr --output VGA1 --mode 1680x1050 --right-of LVDS1
# PL keyboard layout
# if command_exists setxkbmap && [[ "$UNAME_OUTPUT" != 'Darwin' ]] ; then
# setxkbmap pl
# fi
# fi # end DISPLAY setup
# if [ -f ~/.optional.sh ]; then
# source "$HOME"/.optional.sh
# fi
function execute_on_login_only() {
# Wallpaper
if [ -e $WALLPAPER ]; then
feh --bg-scale $WALLPAPER
fi
}
# This takes too much time
# execute_on_login_only
# Keyboard
if command_exists xbindkeys && [[ -z $IS_WSL ]]; then
killall xbindkeys 2>/dev/null
xbindkeys -f ~/.xbindkeysrc
fi
export HOMEBREW_AUTO_UPDATE_SECS="$((60 * 60 * 3))"
# Android development
# export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"
# export ANT_HOME=/usr/local/opt/ant
# export MAVEN_HOME=/usr/local/opt/maven
# export GRADLE_HOME=/usr/local/opt/gradle
# export ANDROID_HOME=/usr/local/opt/android-sdk
# export ANDROID_NDK_HOME=/usr/local/opt/android-ndk
# SDK Man replaced GVM. Using for Groovy, Gradle, and Maven Version Management
# export SDKMAN_DIR="$HOME/.sdkman"
# [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"
# macOS only (delete symlink created after system update)
rm -f ~/Desktop/Relocated\ Items
# Make Bash 4 work on macOS
export PATH="/usr/local/bin:$PATH"
export PATH=$PATH:$HOME/.npm-packages/bin:/mnt/c/Windows:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32
# Windows (WSL)
if grep -qEi "(Microsoft|WSL)" /proc/version &>/dev/null; then
# Making GUI applications work on WSL:
# https://github.com/gencay/vscode-chatgpt/issues/25#issuecomment-1425089512
export DISPLAY=:0
# alternatively try:
# export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0
# or:
# export DISPLAY=$(ip route list default | awk '{print $3}'):0
export LIBGL_ALWAYS_INDIRECT=1
fi
export ANDROID_HOME=/home/antoni/Android/cmdline-tools/latest
export ANDROID_SDK_ROOT=/home/antoni/Android
PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
PATH=$PATH:$ANDROID_HOME/bin
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64