2022-06-04 02:14:25 +02:00
#!/usr/bin/env bash
2022-11-06 15:57:25 +01:00
set -o errexit # crash the script when a command crash
2023-03-13 16:02:20 +01:00
set -o pipefail # same as above for piped command
2022-11-06 15:57:25 +01:00
set -o nounset # crash when a variable doesnt exist
# TRACE=1 for debug
if [ [ " ${ TRACE -0 } " = = "1" ] ] ; then
2023-09-13 11:51:35 +02:00
set -o xtrace
2022-11-06 15:57:25 +01:00
fi
cd " $( dirname " $0 " ) " # change script directory
2024-03-30 17:50:32 +01:00
function main {
2024-03-30 17:27:51 +01:00
# === Variables ==
2024-05-13 13:46:07 +02:00
local repo gs_mediakey shortcut
2023-09-13 22:37:04 +02:00
repo = https://git.mylloon.fr/Anri/confOS/raw/branch/main
2024-05-13 13:46:07 +02:00
gs_mediakey = org.gnome.settings-daemon.plugins.media-keys
shortcut = /org/gnome/settings-daemon/plugins/media-keys/custom-keybindings
2023-09-13 22:37:04 +02:00
2024-03-30 17:27:51 +01:00
# === Assure that keyring is installed ==
2023-09-13 11:51:35 +02:00
pacman -D --asexplicit archlinux-keyring # keep this package
2023-11-15 09:59:24 +01:00
2024-03-30 17:27:51 +01:00
# === Remove extra packages from Gnome default + useless dependencies ==
2023-09-13 11:51:35 +02:00
sudo pacman -Rsn --noconfirm \
2023-09-13 22:45:51 +02:00
epiphany gnome-maps cheese gnome-weather gnome-music gnome-books vim \
gnome-boxes gnome-photos malcontent gnome-contacts totem gedit
" $( pacman -Qqtd) "
2024-03-30 17:27:51 +01:00
# === Global OS configuration set-up ==
2024-04-08 20:00:44 +02:00
curl ${ repo } /meta.sh -s | bash -s -- ${ repo }
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
2024-05-20 22:00:06 +02:00
# === Add pacman hooks ==
sudo mkdir -p /etc/pacman.d/hooks
local hooks
2024-05-22 09:59:28 +02:00
hooks = ( "stop-wine-associations" "gnome-terminal-shortcut" "blackbox-shortcut"
2024-06-21 21:43:14 +02:00
"honkai-shortcut" "vesktop" )
2024-05-20 22:00:06 +02:00
for hook in " ${ hooks [@] } "
do
2024-05-20 22:12:00 +02:00
sudo wget -q --show-progress ${ repo } /pacman.d/hooks/" $hook " .hook -O /etc/pacman.d/hooks/" $hook " .hook
2024-05-20 22:00:06 +02:00
done
2023-09-13 11:51:35 +02:00
# === AUR packages ==
paru -S --noconfirm \
2024-07-23 17:18:08 +02:00
obsidian parsec-bin evolution-etesync-git x11-emoji-picker ufw-docker \
gnome-shell-extension-dash-to-dock gnome-shell-extension-tiling-assistant \
2024-06-14 18:24:02 +02:00
dracula-icons-git vscodium-bin otf-symbola touchegg evdi displaylink \
2024-05-23 14:35:55 +02:00
gnome-shell-extension-nightthemeswitcher nerd-fonts-meslo tex-match \
2023-09-13 22:45:51 +02:00
gnome-shell-extension-x11gestures gnome-shell-extension-no-overview \
2024-07-23 17:22:35 +02:00
gnome-shell-extension-gsconnect org.gnome.shell.extensions.color-picker \
2024-07-23 17:18:08 +02:00
gnome-shell-extension-rounded-window-corners-reborn blackbox-terminal \
2023-09-13 22:45:51 +02:00
gnome-shell-extension-alphabetical-grid-extension texlive-latexindent-meta \
2024-02-28 10:26:17 +01:00
gnome-shell-extension-quick-settings-tweaks-git gpu-screen-recorder-git \
2023-12-16 10:35:23 +01:00
epson-inkjet-printer-stylus-photo-px810fw-series heroic-games-launcher-bin \
2024-03-26 00:17:00 +01:00
gnome-shell-extension-blur-my-shell clamav-unofficial-sigs vesktop-bin \
2024-10-22 11:22:38 +02:00
nautilus-open-any-terminal tuned-ppd
2023-09-13 22:45:51 +02:00
2023-09-13 11:51:35 +02:00
# === Disable wayland ==
sed -i "s/#Wayland/Wayland/g" /etc/gdm/custom.conf
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Locales ==
sudo sed -i "s/fr_FR.UTF-8.UTF-8 UTF-8/fr_FR.UTF8 UTF-8/g" /etc/locale.gen
sudo locale-gen
localectl set-locale fr_FR.UTF-8
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Fish ==
2024-03-30 17:27:51 +01:00
# Custom Arch configuration
2023-09-13 22:37:04 +02:00
curl -s ${ repo } /.config/fish/conf.d/abbr_arch.fish >> " $HOME " /.config/fish/conf.d/abbr.fish
2023-11-15 09:58:58 +01:00
curl -s ${ repo } /.config/fish/conf.d/alias_arch.fish >> " $HOME " /.config/fish/conf.d/alias.fish
2023-09-13 11:51:35 +02:00
2023-09-13 14:10:21 +02:00
# Themes in Gnome Terminal, the default one will be the dark one
2023-09-13 14:35:31 +02:00
local GT_default
2023-09-13 13:03:55 +02:00
GT_default = $( gsettings get org.gnome.Terminal.ProfilesList default | tr -d \' )
2024-10-06 21:19:47 +02:00
wget -q ${ repo } /.config/update_theme.sh -O " $HOME " /.config/update_theme.sh
2023-09-13 14:35:31 +02:00
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / use-custom-command true
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / custom-command "fish"
# Default colors
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / use-theme-colors "false"
# Size and font
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / use-system-font false
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / default-size-columns 105
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / default-size-rows 25
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / font "MesloLGM Nerd Font 12"
gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:" ${ GT_default } " / use-system-font false
2023-09-13 21:50:20 +02:00
# Theme (use dark for the purpose of the installation since we need to choose one, doesn't really matter)
2023-09-13 14:22:11 +02:00
bash " $HOME " /.config/update_theme.sh sunset
2023-09-13 11:51:35 +02:00
# Keybinds
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ close-tab "<Control>w"
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ new-tab "<Control>t"
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ zoom-in "<Control>equal" # ctrl++
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ zoom-normal "<Control>agrave" # ctrl+0
gsettings set org.gnome.Terminal.Legacy.Keybindings:/org/gnome/terminal/legacy/keybindings/ next-tab "<Control>tab" # ctrl+tab
# === Spotify ==
2024-03-07 17:15:54 +01:00
# is `spotify-launcher --force-update` needed before patching?
bash <( curl -sSL https://spotx-official.github.io/run.sh) -ce
2024-06-21 21:30:07 +02:00
gsettings set org.gnome.desktop.notifications.application:/org/gnome/desktop/notifications/application/spotify-launcher/ enable false # disable notifications
2023-09-13 11:51:35 +02:00
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Syncthing ==
systemctl enable syncthing@" $USER " .service
systemctl start syncthing@" $USER " .service
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Flameshot ==
# Custom configuration
2024-10-06 21:19:47 +02:00
wget -q --show-progress ${ repo } /.config/flameshot/flameshot.ini -O " $HOME " /.config/flameshot/flameshot.ini
2023-09-13 11:51:35 +02:00
# Change keybindings
gsettings set org.gnome.shell.keybindings show-screenshot-ui "[]"
2024-05-13 13:55:59 +02:00
local custom_keybindings_list flameshot_shortcuts
2024-05-13 13:46:07 +02:00
custom_keybindings_list = $( gsettings get ${ gs_mediakey } custom-keybindings)
2024-05-13 13:55:59 +02:00
flameshot_shortcuts = " ' ${ shortcut } /flameshot-shortcut/', ' ${ shortcut } /flameshot-shortcut-2/' "
2023-09-13 11:51:35 +02:00
if [ [ $custom_keybindings_list = = "@as []" ] ] # creating new list if not exists
then
2024-05-13 13:55:59 +02:00
custom_keybindings_list = " [ ${ flameshot_shortcuts } ] "
2023-09-13 11:51:35 +02:00
else # if already existing, adding our new element
2024-05-13 13:55:59 +02:00
custom_keybindings_list = " ${ custom_keybindings_list : :- 1 } , ${ flameshot_shortcuts } ] "
2023-09-13 11:51:35 +02:00
fi
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } custom-keybindings " $custom_keybindings_list "
2024-05-13 13:55:59 +02:00
# Shortcut 1
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut/ name "Flameshot" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut/ command "flameshot gui" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut/ binding "Print" # set key
2024-05-13 13:55:59 +02:00
# Shortcut 2
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut-2/ name "Flameshot Windows style" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut-2/ command "flameshot gui" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /flameshot-shortcut-2/ binding "<Shift><Super>s" # set key
2023-09-13 11:51:35 +02:00
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Emoji picker ==
# Custom configuration
2024-10-06 21:19:47 +02:00
wget -q --show-progress ${ repo } /.config/gazatu.xyz/emoji-picker.ini -O " $HOME " /.config/gazatu.xyz/emoji-picker.ini
2023-09-13 11:51:35 +02:00
# Add keybinding
2024-05-13 13:46:07 +02:00
custom_keybindings_list = $( gsettings get ${ gs_mediakey } custom-keybindings)
2023-09-13 11:51:35 +02:00
if ! echo " $custom_keybindings_list " | grep -q "x11-emoji-picker"
then
if [ " $custom_keybindings_list " = "@as []" ] # creating new list if not exists
then
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [' ${ shortcut } /x11-emoji-picker/'] "
2023-09-13 11:51:35 +02:00
else # if already existing, adding our new element
custom_keybindings_list = $( echo " $custom_keybindings_list " | sed "s/\[//" | sed "s/\]//" )
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [ $custom_keybindings_list , ' ${ shortcut } /x11-emoji-picker/'] "
2022-06-04 02:14:25 +02:00
fi
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } custom-keybindings " $custom_keybindings_list " # update the list
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /x11-emoji-picker/ name "Emoji-Picker" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /x11-emoji-picker/ command "emoji-picker" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /x11-emoji-picker/ binding "<Super>period" # set shortcut
2023-09-13 11:51:35 +02:00
fi
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Gnome configuration ==
# Enable location
gsettings set org.gnome.system.location enabled true
2024-05-28 16:53:18 +02:00
# Theme (dark by default)
2023-09-13 11:51:35 +02:00
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
gsettings set org.gnome.desktop.interface icon-theme "Dracula"
# Extensions
2024-10-11 09:26:43 +02:00
killall -HUP gnome-shell # restart gnome
2023-09-13 11:51:35 +02:00
gsettings set org.gnome.shell disable-user-extensions false # enable extensions globally
gsettings set org.gnome.shell disable-extension-version-validation true # legacy extension support
gnome-extensions enable dash-to-dock@micxgx.gmail.com
2024-07-23 17:27:26 +02:00
gnome-extensions enable tiling-assistant@leleat-on-github
2023-09-13 11:51:35 +02:00
gnome-extensions enable x11gestures@joseexposito.github.io
2024-07-23 17:27:26 +02:00
gnome-extensions enable nightthemeswitcher@romainvigier.fr
gnome-extensions enable quick-settings-tweaks@qwreey
2023-09-13 11:51:35 +02:00
gnome-extensions enable appindicatorsupport@rgcjonas.gmail.com
gnome-extensions enable AlphabeticalAppGrid@stuarthayhurst
2024-07-23 17:27:26 +02:00
gnome-extensions enable ding@rastersoft.com
2024-04-08 19:51:57 +02:00
gnome-extensions enable color-picker@tuberry
2024-07-23 17:27:26 +02:00
gnome-extensions enable gsconnect@andyholmes.github.io
gnome-extensions enable blur-my-shell@aunetx
gnome-extensions enable rounded-window-corners@fxgn
2024-10-11 09:26:49 +02:00
gnome-extensions enable caffeine@patapon.info
2024-07-23 17:27:26 +02:00
gnome-extensions enable no-overview@fthx
2023-09-13 11:51:35 +02:00
# Nautilus keybinding
2024-05-13 13:46:07 +02:00
custom_keybindings_list = $( gsettings get ${ gs_mediakey } custom-keybindings)
2023-09-13 11:51:35 +02:00
if [ [ $custom_keybindings_list = = "@as []" ] ] # creating new list if not exists
then
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [' ${ shortcut } /nautilus-shortcut/'] "
2023-09-13 11:51:35 +02:00
else # if already existing, adding our new element
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " ${ custom_keybindings_list : :- 1 } , ' ${ shortcut } /nautilus-shortcut/'] "
2023-09-13 11:51:35 +02:00
fi
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } custom-keybindings " $custom_keybindings_list " # updating the list
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /nautilus-shortcut/ name "Nautilus" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /nautilus-shortcut/ command "nautilus -w" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /nautilus-shortcut/ binding "<Super>E" # set shortcut
2023-09-13 11:51:35 +02:00
# Some Gnome configuration
gsettings set org.gnome.shell.extensions.dash-to-dock click-action minimize # add minimized window on dock click
gsettings set org.gnome.shell.extensions.dash-to-dock show-trash false # add Dash to Dock
gsettings set org.gnome.shell.extensions.dash-to-dock show-apps-at-top true # apps button at left
2024-06-14 18:24:02 +02:00
gsettings set org.gnome.shell.extensions.dash-to-dock multi-monitor true # show on all screens
2024-03-26 09:14:29 +01:00
gsettings get org.gnome.shell.extensions.blur-my-shell.panel blur false # don't blur the topbar
2023-09-13 11:51:35 +02:00
gsettings set org.gnome.desktop.wm.preferences button-layout ":minimize,maximize,close" # affiche les boutons maximisé et minimisé
gsettings set org.gnome.desktop.wm.preferences audible-bell false # remove sound of notification when going too far away in a window
gsettings set org.gnome.desktop.wm.keybindings close "['<Super>Q', '<Alt>F4']" # Alt-F4 keybinding
2023-12-06 08:59:02 +01:00
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Alt>Tab']" # alt-tab for windows
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "['<Shift><Alt>Tab']" # same as above but backword
gsettings set org.gnome.desktop.wm.keybindings switch-applications "['<Super>Tab']" # windows-tab for applications
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "['<Shift><Super>Tab']" # same as above but backword
2023-09-13 11:51:35 +02:00
gsettings set org.gnome.desktop.interface clock-show-seconds true # affiche les secondes dans l'horloge
gsettings set org.gnome.desktop.interface show-battery-percentage true # show battery poucentage
gsettings set org.gnome.desktop.interface enable-hot-corners false # disable top-right corner "activities"
gsettings set org.gnome.desktop.background show-desktop-icons true # show icons on desktop
gsettings set org.gnome.nautilus.preferences show-image-thumbnails "always" # thumbnails nautilus
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type "nothing" # no sleep on AC
gsettings set org.gnome.settings-daemon.plugins.color night-light-enabled true # mode "nuit" (lumière bleue)
gsettings set org.gnome.desktop.peripherals.touchpad click-method areas # right click on laptop
gsettings set org.gnome.desktop.peripherals.mouse speed -0.6 # mouse speed
2023-09-18 17:30:29 +02:00
gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled-on-external-mouse # disable touchpad when mouse connected
2023-09-13 11:51:35 +02:00
gsettings --schemadir /usr/share/gnome-shell/extensions/nightthemeswitcher@romainvigier.fr/schemas/ set org.gnome.shell.extensions.nightthemeswitcher.gtk-variants enabled true # enable GTK theme to change
2023-09-13 13:28:57 +02:00
gsettings --schemadir /usr/share/gnome-shell/extensions/nightthemeswitcher@romainvigier.fr/schemas/ set org.gnome.shell.extensions.nightthemeswitcher.commands sunset " bash $HOME /.config/update_theme.sh sunset " # run script for the sunset
gsettings --schemadir /usr/share/gnome-shell/extensions/nightthemeswitcher@romainvigier.fr/schemas/ set org.gnome.shell.extensions.nightthemeswitcher.commands sunrise " bash $HOME /.config/update_theme.sh sunrise " # run script for the sunrise
2024-03-25 14:05:28 +01:00
gsettings --schemadir /usr/share/gnome-shell/extensions/nightthemeswitcher@romainvigier.fr/schemas/ set org.gnome.shell.extensions.nightthemeswitcher.color-scheme day "prefer-light" # use light theme for the day, instead of "default"
2023-12-06 09:04:13 +01:00
gsettings set org.gnome.SessionManager logout-prompt false # remove pop up when logging out
2023-09-13 11:51:35 +02:00
2024-03-26 09:14:29 +01:00
2023-09-13 11:51:35 +02:00
# Default app Nautilus
sed -i "s/inode\/directory=nautilus.desktop/inode\/directory=org.gnome.Nautilus.desktop/g" " $HOME " /.config/mimeapps.list
# Configuration TextEditor
2023-09-13 22:48:07 +02:00
gsettings set org.gnome.TextEditor style-scheme "kate-dark"
gsettings set org.gnome.TextEditor indent-style "space"
2023-09-13 11:51:35 +02:00
gsettings set org.gnome.TextEditor tab-width "uint32 4"
gsettings set org.gnome.TextEditor show-map true
gsettings set org.gnome.TextEditor show-line-numbers true
2024-03-26 00:17:00 +01:00
# Configuration Blackbox
2024-10-06 21:19:47 +02:00
wget -q --show-progress ${ repo } /.local/share/blackbox/user-keymap.json -O " $HOME " /.local/share/blackbox/user-keymap.json # keymap # TODO: Quid de mkdir avant?
2024-03-26 00:17:00 +01:00
gsettings set com.raggesilver.BlackBox use-custom-command true # custom shell
gsettings set com.raggesilver.BlackBox custom-shell-command "fish" # use fish as default
gsettings set com.raggesilver.BlackBox easy-copy-paste true # allow ^C and ^V
gsettings set com.raggesilver.BlackBox remember-window-size true
gsettings set com.raggesilver.BlackBox window-height 600 # initial height
gsettings set com.raggesilver.BlackBox window-width 1000 # initial width
gsettings set com.raggesilver.BlackBox terminal-bell false # disable bell
gsettings set com.raggesilver.BlackBox theme-dark "Dracula" # dark theme
gsettings set com.raggesilver.BlackBox theme-light "Solarized Light" # light theme
gsettings set com.raggesilver.BlackBox working-directory-mode 1 # working dir is home dir
2024-03-26 08:57:11 +01:00
gsettings set com.raggesilver.BlackBox notify-process-completion false # disable notifiction on each command
gsettings set com.github.stunkymonkey.nautilus-open-any-terminal terminal "blackbox" # blackbox context menu in nautilus
2024-03-26 00:17:00 +01:00
2024-04-08 19:51:57 +02:00
# Configuration Color Picker
gsettings set org.gnome.shell.extensions.color-picker enable-systray false # disable icon in systray
gsettings set org.gnome.shell.extensions.color-picker enable-shortcut true # enable shortcut
gsettings set org.gnome.shell.extensions.color-picker color-picker-shortcut "['<Super>C']" # define shortcut
2023-09-13 11:51:35 +02:00
# Add gesture and tap on touchpad
gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
systemctl enable touchegg.service
systemctl start touchegg
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Clipboard manager ==
gsettings set org.gnome.shell.keybindings toggle-message-tray "[]"
2024-05-13 13:46:07 +02:00
custom_keybindings_list = $( gsettings get ${ gs_mediakey } custom-keybindings)
2023-09-13 11:51:35 +02:00
if [ [ $custom_keybindings_list = = "@as []" ] ] # creating new list if not exists
then
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [' ${ shortcut } /clipboard-shortcut/'] "
2023-09-13 11:51:35 +02:00
else # if already existing, adding our new element
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " ${ custom_keybindings_list : :- 1 } , ' ${ shortcut } /clipboard-shortcut/'] "
2023-09-13 11:51:35 +02:00
fi
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } custom-keybindings " $custom_keybindings_list " # updating the list
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /clipboard-shortcut/ name "Copyq" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /clipboard-shortcut/ command "copyq show" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /clipboard-shortcut/ binding "<Super>V" # set shortcut
2023-09-13 11:51:35 +02:00
copyq > /dev/null & disown
copyq config autostart true
echo "style_main_window=true" >> /usr/share/copyq/themes/dark.ini
copyq loadTheme /usr/share/copyq/themes/dark.ini
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === UBW (pare-feu) ==
ufw enable
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Firefox ==
firefox &
sleep 2
pkill firefox
2023-09-13 22:37:04 +02:00
wget -q --show-progress ${ repo } /.mozilla/firefox/user.js -P " $HOME " /.mozilla/firefox/*.default-release
curl -s ${ repo } /.mozilla/firefox/user-arch.js >> " $HOME " /.mozilla/firefox/*.default-release/user.js
2023-09-13 11:51:35 +02:00
# 2 fingers history control
echo "export MOZ_USE_XINPUT2=1" >> " $HOME " /.profile
# Hardware acceleration
echo "export MOZ_DRM_DEVICE=/dev/dri/renderD128" >> " $HOME " /.profile
# Download extension configuration (TODO: Check Download Folder's Name)
2024-10-06 21:19:47 +02:00
#wget -q --show-progress ${repo}/.mozilla/firefox/extensions/Dark-Reader-Settings.json -O "$HOME"/Téléchargements/Dark-Reader-Settings.json
#wget -q --show-progress ${repo}/.mozilla/firefox/extensions/SponsorBlockConfig.json -O "$HOME"/Téléchargements/SponsorBlockConfig.json
#wget -q --show-progress ${repo}/.mozilla/firefox/extensions/auto-tab-discard-preferences.json -O "$HOME"/Téléchargements/auto-tab-discard-preferences.json
2023-09-13 11:51:35 +02:00
2023-09-18 10:14:44 +02:00
2023-09-13 11:51:35 +02:00
# === Docker ==
systemctl enable docker.service
systemctl start docker.service
usermod -aG docker " $USER "
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Unused icons ==
2023-09-13 22:45:51 +02:00
apps = ( "fish" "cmake-gui" "com.github.hluk.copyq" "electron17" "htop" "yelp"
"avahi-discover" "bssh" "bvnc" "org.flameshot.Flameshot" "lstopo"
"org.fontforge.FontForge" "micro" "qv4l2" "qvidcap" "org.gnome.Evince"
"x11-emoji-picker" "xdvi" "spotify" )
2023-09-13 11:51:35 +02:00
for app in " ${ apps [@] } "
do
if [ -f /usr/share/applications/" $app " .desktop ]
2022-06-04 15:46:58 +02:00
then
2023-09-13 11:51:35 +02:00
mv /usr/share/applications/" $app " .desktop /usr/share/applications/" $app " .desktop.bak
2022-06-04 02:14:25 +02:00
fi
2023-09-13 11:51:35 +02:00
done
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Enable Bluetooth ==
systemctl enable bluetooth.service
systemctl start bluetooth.service
sed -i "s/#AutoEnable=true/AutoEnable=false/g" /etc/bluetooth/main.conf
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === VSCodium ==
2024-10-06 21:19:47 +02:00
wget -q ${ repo } /.config/VSCodium/product.json -O " $HOME " /.config/VSCodium/product.json
2023-09-13 11:51:35 +02:00
# === Discord ==
# Skip update
path_config_discord = " $HOME " /.config/discord/settings.json
updated_config_discord = " $( < " $path_config_discord " jq '. + { "SKIP_HOST_UPDATE": true }' ) "
echo " $updated_config_discord " > " $path_config_discord "
# === Printers ==
sudo systemctl enable cups.socket
sudo systemctl start cups.socket
sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === UFW ==
sudo systemctl enable ufw.service
sudo systemctl start ufw.service
sudo ufw default deny
sudo ufw allow syncthing
sudo ufw allow 1714:1764/udp # KDEConnect
sudo ufw allow 1714:1764/tcp # KDEConnect
sudo ufw-docker install
sudo systemctl restart ufw
2024-03-30 17:27:51 +01:00
2023-09-13 11:51:35 +02:00
# === Optimizations ==
# Disable NetworkManager-wait-online.service because it add 8s at boot
sudo systemctl disable NetworkManager-wait-online.service
2024-01-29 09:54:54 +01:00
# === s-tui ==
# Configuration
2024-10-06 21:19:47 +02:00
wget -q --show-progress ${ repo } /.config/s-tui/s-tui.conf -O " $HOME " /.config/s-tui/s-tui.conf
2024-01-29 09:54:54 +01:00
2024-03-30 17:27:51 +01:00
2024-02-26 12:43:08 +01:00
# === ClamAV ==
# Virus definitions
sudo systemctl enable clamav-freshclam.service
sudo systemctl start clamav-freshclam.service
# Daemon
sudo systemctl enable clamav-daemon.service
sudo systemctl start clamav-daemon.service
2024-03-30 17:27:51 +01:00
2024-02-28 10:26:17 +01:00
# === GPU Screen recorder ==
2024-02-28 12:42:26 +01:00
# Configuration
2024-10-06 21:19:47 +02:00
wget -q --show-progress ${ repo } /.config/gpu-screen-recorder.env -O " $HOME " /.config/gpu-screen-recorder.env
2024-02-28 12:42:26 +01:00
# Enable
systemctl enable --now --user gpu-screen-recorder
# Keybind
2024-05-13 13:46:07 +02:00
custom_keybindings_list = $( gsettings get ${ gs_mediakey } custom-keybindings)
2024-02-28 12:42:26 +01:00
if ! echo " $custom_keybindings_list " | grep -q "gpu-screen-recorder"
then
if [ " $custom_keybindings_list " = "@as []" ] # creating new list if not exists
then
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [' ${ shortcut } /gpu-screen-recorder/'] "
2024-02-28 12:42:26 +01:00
else # if already existing, adding our new element
custom_keybindings_list = $( echo " $custom_keybindings_list " | sed "s/\[//" | sed "s/\]//" )
2024-05-13 13:46:07 +02:00
custom_keybindings_list = " [ $custom_keybindings_list , ' ${ shortcut } /gpu-screen-recorder/'] "
2024-02-28 12:42:26 +01:00
fi
2024-05-13 13:46:07 +02:00
gsettings set ${ gs_mediakey } custom-keybindings " $custom_keybindings_list " # update the list
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /gpu-screen-recorder/ name "Shadowplay" # set name
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /gpu-screen-recorder/ command "bash -c \"killall -SIGUSR1 gpu-screen-recorder && notify-send -et 3000 -- 'Shadowplay' '2 dernières minutes sauvés dans ~/Vidéos'\"" # set command
gsettings set ${ gs_mediakey } .custom-keybinding:${ shortcut } /gpu-screen-recorder/ binding "<Super>Print" # set shortcut
2024-02-28 12:42:26 +01:00
fi
2024-02-28 10:26:17 +01:00
2024-04-08 19:30:37 +02:00
2024-06-14 18:24:02 +02:00
# === DisplayLink ==
# For screens trough hub
sudo systemctl enable displaylink.service
sudo systemctl start displaylink.service
2024-06-14 18:45:16 +02:00
sudo sed -i "s/#HandleLidSwitchDocked=ignore/HandleLidSwitchDocked=ignore/g" /etc/systemd/logind.conf
2024-06-14 18:24:02 +02:00
2024-10-10 13:24:54 +02:00
# === Power management ==
sudo systemctl enable tuned.service
sudo systemctl start tuned.service
2024-10-10 13:27:04 +02:00
tuned-adm auto_profile # change the profile automatically
2024-10-10 13:24:54 +02:00
2023-09-13 11:51:35 +02:00
printf "\nConcernant le Secure Boot, voici le tuto :"
echo "https://www.reddit.com/r/archlinux/comments/zo83gb/how_i_setup_secure_boot_for_arch_linux_simple/"
echo -e "\n\nInstallation terminée.\nIl faut redémarrer l'ordinateur."
2022-11-06 15:57:25 +01:00
}
if grep "archlinux" /proc/version > /dev/null;
then
2023-09-13 11:51:35 +02:00
main " $@ "
2022-06-04 02:14:25 +02:00
else
2023-09-13 11:51:35 +02:00
echo "Ce script ne fonctionne que sur Arch." >& 2
2022-06-04 02:14:25 +02:00
fi