-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc_tumbleweed
147 lines (147 loc) · 8.48 KB
/
.bashrc_tumbleweed
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# openSUSE Tumbleweed #
#######################
# .bashrc by BArko #
#######################
#
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
###
#
# ostali aliasi
test -s ~/.alias && . ~/.alias || true
#
kopiraj_fun() {
if [ "$#" -ge 2 ]; then
echo -n "Ste prepričani, da želite nadaljevati? (D/N): "
read -r odgovor
odgovor=$(echo "$odgovor" | tr '[:upper:]' '[:lower:]')
if [ "$odgovor" = "d" ]; then
sudo rsync -a --info=progress2 --delete "$@"
else
echo "Operacija preklicana."
fi
else
echo "Uporaba: kopiraj vir cilj [dodatni parametri rsync]"
fi
}
alias kopiraj='kopiraj_fun'
#
export EDITOR=nano
export VISUAL=nano
#
export PS1="\[$(tput setaf 33)\]\u\[$(tput setaf 69)\]@\[$(tput setaf 105)\]\h \[$(tput setaf 141)\]\w \[$(tput sgr0)\]\n> "
#
alias top='btop'
alias toutf8tmp='for file in *.srt; do encoding=$(enca -i "$file"); if [ "$encoding" != "UTF-8" ]; then iconv -f "$encoding" -t "UTF-8" "$file" -o "${file}.tmp" && mv "${file}.tmp" "$file"; else echo "$file je že v UTF-8"; fi; done'
alias removeitmp='for file in *.srt; do sed -i "s/<i>//g; s/<\/i>//g" "$file"; done'
alias toutf8="toutf8tmp;removeitmp"
alias df='df -H'
alias updatedb='sudo updatedb'
alias bios='sudo dmidecode -s bios-version'
alias reboot='sudo reboot'
alias iotop='sudo iotop'
alias db='distrobox'
alias ubuntu="db enter ubuntu"
#alias waydroid="distrobox enter --root waydroid"
#
alias nopassword='sudo usermod -p "" $USER'
alias setpassword='sudo passwd $USER'
alias tar='tar -cvzf'
alias untar='tar -xvzf'
alias makeiso='mkisofs -iso-level 3 -o makeiso.iso .'
alias iotop='sudo iotop -o'
alias spremembe="find . -type f -printf '%T@ %p\n' | sort -n | tail -n 10"
alias icons_restore="cp /home/$USER/.local/share/gvfs-metadata/home.$USER /home/$USER/.local/share/gvfs-metadata/home"
alias icons_backup="cp /home/$USER/.local/share/gvfs-metadata/home /home/$USER/.local/share/gvfs-metadata/home.$USER"
alias db="distrobox"
alias apkinstall="waydroid app install $1"
alias fixopenfolder='xdg-mime default org.gnome.Nautilus.desktop inode/directory'
alias fixwinesound='sudo mkdir -p /usr/share/pipewire/pipewire-pulse.conf.d; echo "pulse.rules = [{matches = [{application.process.binary = \"wine64-preloader\" }], actions = {update-props = {pulse.min.quantum = 1024/48000}}}] " | sudo tee /usr/share/pipewire/pipewire-pulse.conf.d/wine_gaming.conf > /dev/null'
alias fixflatpakicons='flatpak --user override --filesystem=~/.local/share/icons/:ro'
alias fixicons='gsettings set org.gnome.desktop.interface icon-theme "Hatter"'
alias fixmaxsound="gsettings set org.gnome.desktop.sound allow-volume-above-100-percent 'true'"
alias fixwait="gsettings set org.gnome.mutter check-alive-timeout 60000"
alias fixlaptoplid="sudo mkdir -p '/etc/systemd/logind.conf.d'; echo -e \"[Login]\\nHandleLidSwitch=ignore\" | sudo tee '/etc/systemd/logind.conf.d/99-laptop-server.conf' > '/dev/null'"
alias fixaddtog1="if grep -q wheel /etc/group; then sudo usermod -a -G wheel $USER; else echo 'Skupina wheel ne obstaja'; fi"
alias fixaddtog2="if grep -q vboxusers /etc/group; then sudo usermod -a -G vboxusers $USER; else echo 'Skupina vboxusers ne obstaja'; fi"
alias fixaddtog3="if grep -q gamemode /etc/group; then sudo usermod -a -G gamemode $USER; else echo 'Skupina gamemode ne obstaja'; fi"
alias fixaddtog4="if grep -q libvirt /etc/group; then sudo usermod -a -G libvirt,kvm,qemu $USER; else echo 'Skupina libvirt ne obstaja'; fi"
alias fixyasticons="sudo rsync -a --delete $HOME/.local/share/icons/$(gsettings get org.gnome.desktop.interface icon-theme | awk '{print $2}' | tr -d "'")/ /usr/share/icons/$(gsettings get org.gnome.desktop.interface icon-theme | awk '{print $2}' | tr -d "'")/"
alias fixwindowbuttons='gsettings set org.gnome.desktop.wm.preferences button-layout "appmenu:minimize,maximize,close"'
alias fixlocalhost="sudo hostnamectl set-hostname namiznik"
alias fixzram='echo -e "[zram0]\nzram-size = min(ram, 8192)\ncompression-algorithm = zstd" | sudo tee /usr/lib/systemd/zram-generator.conf'
alias pkoff="sudo systemctl disable --now packagekit;sudo systemctl mask packagekit"
alias pkon="sudo systemctl unmask packagekit; sudo systemctl enable --now packagekit"
alias checkall="sudo zypper verify; sudo rpm --verify --all"
alias fixzypper='sudo sed -i "/^# installRecommends = yes/s/^# installRecommends = yes/installRecommends = no/" /etc/zypp/zypper.conf'
alias fixkvm="sudo systemctl enable --now libvirtd"
alias fixnmwos="sudo systemctl disable NetworkManager-wait-online.service"
alias fixterminal="gsettings set org.gnome.desktop.default-applications.terminal exec '/usr/bin/ptyxis'"
#
alias gpt='function _chatgpt() {
response=$(curl -s https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d "{
\"model\": \"gpt-4o-mini\",
\"messages\": [
{
\"role\": \"system\",
\"content\": \"za računanje uporabi python knjižnice, za odgovore uporabi slovenščino, za valute uporabi EUR in znak €, za odgovore porabi do največ 250 znakov, bodi zelo kratek v odgovorih\"
},
{
\"role\": \"user\",
\"content\": \"$*\"
}
]
}")
echo $response | jq -r '.choices[0].message.content'
}; _chatgpt'
#
fixgd() {
if [ -f "$1" ]; then
sed -i 's/"showWatermark": true/"showWatermark": false/g' "$1"
sed -i 's/"showGDevelopSplash": true/"showGDevelopSplash": false/g' "$1"
sed -i 's/"showProgressBar": true/"showProgressBar": false/g' "$1"
echo "Datoteka '$1' je bila uspešno posodobljena."
else
echo "Napaka: Datoteka '$1' ne obstaja."
fi
}
#
alias install_wifi='echo "blacklist rtw88_8822bu" | sudo tee /etc/modprobe.d/rtw8822bu.conf && ([ -d /usr/src/rtl88x2bu-git ] && (cd /usr/src/rtl88x2bu-git && sudo git pull) || sudo git clone "https://github.com/RinCat/RTL88x2BU-Linux-Driver" /usr/src/rtl88x2bu-git) && sudo sed -i "s/PACKAGE_VERSION=\"@PKGVER@\"/PACKAGE_VERSION=\"git\"/g" /usr/src/rtl88x2bu-git/dkms.conf && sudo dkms add -m rtl88x2bu -v git && sudo dkms autoinstall --force'
alias uninstall_wifi='sudo dkms remove rtl88x2bu/git --all && sudo rm -rf /usr/src/rtl88x2bu-git && sudo rm /etc/modprobe.d/rtw8822bu.conf'
alias update_wifi='cd /usr/src/rtl88x2bu-git && sudo git fetch && UPSTREAM=${1:-'@{u}'}; LOCAL=$(sudo git rev-parse @); REMOTE=$(sudo git rev-parse "$UPSTREAM"); BASE=$(sudo git merge-base @ "$UPSTREAM"); if [ $LOCAL = $REMOTE ]; then echo "Already up to date."; else sudo git pull && sudo dkms build rtl88x2bu/git --force && sudo dkms install rtl88x2bu/git --force; fi'
#
alias myinstall1="sudo zypper in -y -t pattern devel_kernel; sudo zypper in -y --type pattern devel_basis; sudo zypper in -y virtualbox-host-source dkms git-core; sudo systemctl enable --now dkms"
alias myinstall2="sudo zypper in -y fastfetch inkscape nautilus-file-roller nautilus-extension-seahorse nautilus-image-converter winetricks wine-mono wine rhythmbox bc deluge git-core enca busybox-net-tools fetchmsttfonts vulkan-tools fluidsynth sshpass gtk2 gnome-tweaks steam lutris podman distrobox bottles filezilla file-roller gamemode virtualbox-qt opi gnome-boxes libnsl1 libgthread-2_0-0 plocate java-11-openjdk-devel kernel-firmware-amdgpu libdrm_amdgpu1 libdrm_amdgpu1-32bit libdrm_radeon1 libdrm_radeon1-32bit libvulkan_radeon libvulkan_radeon-32bit libvulkan1 libvulkan1-32bit eyedropper blanket ptyxis"
alias myinstall3="sudo opi -n megasync; sudo opi -n vscodium"
alias myinstall="myinstall1;myinstall2;myinstall3"
alias fixall="myinstall; fixwindowbuttons; fixlocalhost; fixwinesound; fixflatpakicons; fixicons; fixmaxsound; fixwait; fixyasticons; fixaddtog1; fixaddtog2; fixaddtog3; fixaddtog4"
#
alias zypper="sudo zypper"
alias z="zypper"
alias zrm="z rm --clean-deps"
alias upg='sudo zypper refresh --services; sudo zypper dist-upgrade -y --allow-downgrade --allow-name-change --allow-arch-change --allow-vendor-change --auto-agree-with-licenses; flatpak -y update'
alias cleanup="sudo journalctl --vacuum-time=1d; z clean; z purge-kernels"
alias zps="z ps -s"
alias zf="z se --provides"
#
alias backup="kopiraj /home/barko/ /run/media/barko/L_BACKUPS/barko/"
alias xampp="sudo /opt/lampp/xampp"
alias snapper="sudo snapper"
alias neofetch='fastfetch --config neofetch.jsonc'
neofetch