#!/usr/bin/env bash #---------------------------------------------------------------------- # # TODO: # - keyd -- copy config from syncthing... # - tor (user) + link cfg # - link config files # - copy config files # - edit system config files # - might be a good idea to add gui/no-gui options... # - ssh-keygen... # - add --system and --user flags to only do system/user stuff... # - profile packager/extractor??? # # XXX we should split this into user/system config # XXX might be a good idea to add scripts for more high-level things like: # setup system # -> setup account # -> sync config # -> config specific stuff # XXX Q: should we do this based on feature or as it is now??? # A: looks like it would be logical to split this in two: # - general system state and singular tools # - tasks -- each can consist of configuration and several packages... # # # XXX @ does not work with cat < /dev/null # added by f_lynx/post-install script... fastmirror=True max_parallel_downloads=10 defaultyes=True EOF else echo Already updated. fi } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-dir(){ @setupList mkdir -p - ${DIR[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # link user files/dirs (syncthing, ...)... ##function feature-user-link(){ ## # XXX ## true ##} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # copy user files/dirs (syncthing, ...)... ##function feature-user-copy(){ ## # XXX ## true ##} # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-dnf(){ @ sudo dnf update @setupList sudo dnf install - ${PKG_DNF[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-npm(){ @setupList sudo npm install -g - ${PKG_NPM[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-rpmfusion(){ @ sudo dnf install \ https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm @ sudo dnf install \ https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-flathub(){ @ sudo flatpak remote-add --if-not-exists flathub \ https://flathub.org/repo/flathub.flatpakrepo } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-flatpak(){ @setupList sudo flatpak install - ${PKG_FLATPAK[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-snap(){ @ sudo dnf install snapd @ sudo ln -s /var/lib/snapd/snap /snap # this is here to compensate for snap not being ready right away... # ...did not dig into why... @ sleep 5 @setupList sudo snap install - ${PKG_SNAP[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-go(){ @ sudo dnf install golang @setupList sudo go install - ${PKG_GO[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-start-services(){ @setupList sudo systemctl start - ${SERVICES_START[@]} @setupList sudo systemctl enable - ${SERVICES_START[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-start-user-services(){ @setupList sudo systemctl --user enable - ${SERVICES_USER_START[@]} @setupList sudo systemctl --user start - ${SERVICES_USER_START[@]} } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-vim(){ @ sudo dnf install vim gvim # default editor... @ sudo dnf install vim-default-editor --allowerasing } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # see: # https://github.com/rvaiya/keyd # XXX copy config: /etc/keyd/.conf... function feature-keyd-source(){ ( @ mkdir -p ~/work/EXTERNAL @ cd ~/work/EXTERNAL if ! [ -d keyd ] ; then @ git clone https://github.com/rvaiya/keyd fi @ cd keyd @ make \ && @ sudo make install @ sudo systemctl enable keyd \ && @ sudo systemctl start keyd ) } function feature-keyd(){ ( @ sudo dnf copr enable alternateved/keyd @ sudo dnf install keyd ) } # see: https://wayland.freedesktop.org/libinput/doc/latest/palm-detection.html function feature-keyd-quirk(){ ( local QUIRKS_FILE=/etc/libinput/local-overrides.quirks # check if already installed... if [ -e "$QUIRKS_FILE" ] \ && grep -q '\[keyd\]' "$QUIRKS_FILE" ; then echo "File \"$QUIRKS_FILE\" already exists and contains \"[keyd]\" section, aborting." 1>&2 return fi # install... @ sudo mkdir -p "$(dirname "$QUIRKS_FILE")" cat <<-EOF | sudo tee -a "$QUIRKS_FILE" > /dev/null [keyd] MatchUdevType=keyboard MatchName=keyd virtual keyboard AttrKeyboardIntegration=internal EOF ) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # to update: # $ cd /opt/ventoy && ./VentoyGUI.x86_64 # # see: # https://copr.fedorainfracloud.org/coprs/karlisk/ventoy/ function feature-ventoy(){ ( @ sudo dnf copr enable karlisk/ventoy @ sudo dnf install ventoy ) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # see: # https://gitlab.com/warningnonpotablewater/libinput-config # https://www.reddit.com/r/Fedora/comments/qn0o9w/adjust_touchpad_scroll_speed_enable_mouse_wheel/ function feature-libinput-config(){ ( @ sudo dnf install libinput libinput-devel systemd-devel @ mkdir -p ~/work/EXTERNAL @ cd ~/work/EXTERNAL if ! [ -d libinput-config ] ; then @ git clone https://gitlab.com/warningnonpotablewater/libinput-config.git fi @ cd libinput-config @ meson build @ cd build @ ninja @ sudo ninja install # config... # for more info on options see: # https://gitlab.com/warningnonpotablewater/libinput-config cat <<-EOF | sudo tee -a /etc/libinput.conf > /dev/null dwt=enabled scroll-factor=0.3 gesture-speed=1.5 EOF ) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-bashctrl(){ ( @ mkdir -p ~/work/ @ cd ~/work/ if ! [ -d bashctrl ] ; then @ git clone git@github.com:flynx/bashctrl fi @ cd bashctrl @ ./bashctrl -y setup ) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-gamma(){ @ mkdir -p ~/work/EXTERNAL/ @ cd ~/work/EXTERNAL/ if ! [ -d bashctrl ] ; then @ git clone https://github.com/zb3/gnome-gamma-tool fi @ cd gnome-gamma-tool/ @ ./gnome-gamma-tool.py -g 1.15 } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-far(){ @ sudo dnf copr enable polter/far2l @ sudo dnf install far2l far2l-tty } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # a disk usage utility... function feature-dust(){ @ sudo dnf copr enable gourlaysama/dust @ sudo dnf install dust } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-shadowsocks-rust(){ @ sudo dnf copr enable spyophobia/shadowsocks-rust @ sudo dnf install shadowsocks-rust } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-gnome(){ # fractional scaling... @ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" # disable beeps... @ gsettings set org.gnome.desktop.sound event-sounds false # visual bell... @ gsettings set org.gnome.desktop.wm.preferences visual-bell true @ gsettings set org.gnome.desktop.wm.preferences visual-bell-type frame-flash # per window input selection... @ gsettings set org.gnome.desktop.input-sources.per-window true # swap language with alt-shift... # NOTE: with the way the gui is setup not this is not possible to set there... @ gsettings set org.gnome.desktop.wm.keybindings switch-input-source-backward "['Shift_L']" @ gsettings set org.gnome.desktop.wm.keybindings switch-input-source "['Alt_L']" # custom keys... # XXX } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function feature-syncthing(){ @ mkdir -p ~/Sync/ALL @ sudo dnf install syncthing @ sudo systemctl --user enable --now syncthing #@ sudo systemctl --user start syncthing # XXX can we do this from CLI??? # need to: # - link device # - share ALL directory # - wait for sync echo "Waiting for Syncthing to be connected with other devices manually." read -p "(press any key when done)" } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # XXX needs a bit more setup... function feature-snapshots(){ ( @ dnf install snapper python3-dnf-plugin-snapper @ sudo snapper -c root create-config / @ sudo snapper -c home create-config /home @ sudo snapper -c boot create-config /boot @ cd ~/work/EXTERNAL/ if ! [ -d grub-btrfs ] ; then @ git clone https://github.com/Antynea/grub-btrfs.git fi @ cd grub-btrfs @ sudo make install ) } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # XXX needs a bit more setup... function feature-s1yoga-touchpad(){ # XXX detect hardware and abort setup on non-compatible machines... cat <