Страницы

Что надо сделать после установки Ubuntu 24.04

Увеличим безопасность и удобство.

Подробней:


#!/bin/sh

# Установи trash для удаления в корзину из ком-строки
/bin/sudo apt install trash-cli --yes

# Закрой от редактирования настройки shell
/bin/sudo sh -c 'chown root ~/.bashrc ~/.profile
chmod 640 ~/.bashrc ~/.profile'

# Настрой в Gnome адекватные величины для уведомлений о нехватке свободного места
note() { gsettings set org.gnome.settings-daemon.plugins.housekeeping free-$1 $2; }
note percent-notify       0.25
note percent-notify-again 0.10
note size-gb-no-notify    101

# Установи lime для запуска команд в ограничениях
pushd /tmp
git clone https://github.com/ComdivByZero/lime.git --depth 1 && cd lime &&
/bin/sudo sh -c 'apt install cgroup-tools debootstrap trash-cli --yes
P=/usr/local; R=/etc/sudoers.d/lime
cp lime $P/bin/
cp lime_backend.sh $P/lib/
echo "%sudo ALL=(root) NOPASSWD: $P/lib/lime_backend.sh" >> $R
chmod 0440 $R
visudo --check'
popd

# Дополнительно

# Установи оболочку fish вместо bash
FC=~/.config/fish/config.fish
[ -f $FC ] || install -Dm 640 /dev/null $FC

/bin/sudo sh -c"apt install fish
chown root $FC
chsh -s /usr/bin/fish $USER"
# Замени раскладку ua(homophonic) на unicode версию для
# удобного ввода русского и некоторых дополнительных литер
FP="/usr/share/X11/xkb/symbols/ua"
TF=$(mktemp)

cat <<EOF >"$TF"
xkb_symbols "homophonic" {

    include "ua(unicode)"

    name[Group1]= "Ukrainian (ru)";

    key <AE01>  {[               1,          exclam,    onesuperior,          notsign ]};
    key <AE03>  {[               3,      numerosign,        section,       numbersign ]};
    key <AE05>  {[               5,         percent,         degree,            U20B4 ]};
    key <AE06>  {[               6,           colon,           less,            U2264 ]};
    key <AE07>  {[               7,        question,        greater,            U2265 ]};
    key <AE08>  {[               8,        asterisk, enfilledcircbullet,  asciicircum ]};

    key <AD07>  {[    Cyrillic_ghe,     Cyrillic_GHE,      ampersand                  ]};
    key <AD12>  {[Cyrillic_hardsign,Cyrillic_HARDSIGN,   Ukrainian_yi,   Ukrainian_YI ]};

    key <AC02>  {[   Cyrillic_yeru,   Cyrillic_YERU,    Ukrainian_i,      Ukrainian_I ]};
    key <AC11>  {[      Cyrillic_e,     Cyrillic_E,    Ukrainian_ie,     Ukrainian_IE ]};

    include "level3(ralt_switch)"
};
EOF

/bin/sudo cp "$FP" "${FP}~"
/bin/sudo sed -i "/xkb_symbols \"homophonic\" {/,/^}/{
    /^}/r $TF
    d
}" "$FP"

rm "$TF"

Комментариев нет:

Отправить комментарий