#!/bin/sh # This script can be used after having upgraded to slint64-14.2.1.2 # before the upgrade, so they be the same as if they had been created # after the upgrade. # It backs up files modified or deleted, appending to their name a .~ or # a .bak suffix, so that the user can restore customized settings after # having run it, case occurring. if [ "$(id -u)" = 0 ]; then echo "Please run this script as regular user, as starting a graphical" echo "environment as root is not advisable." exit fi setxkbforlxpanel () { Directory=.config/lxpanel Layout=$(grep XkbLayout /etc/X11/xorg.conf.d/10-keymap.conf|sed 's/.*"\([^"]*\)"[[:space:]]*$/\1/') Variant=$(grep XkbVariant /etc/X11/xorg.conf.d/10-keymap.conf|sed 's/.*"\([^"]*\)"[[:space:]]*$/\1/') Options=$(grep XkbOptions /etc/X11/xorg.conf.d/10-keymap.conf|sed 's/.*"\([^"]*\)"[[:space:]]*$/\1/') if [ -d $Directory ]; then for panels in $(find $Directory -type d -name panels); do (cd $panels sed "/LayoutsList/s/.*/ LayoutsList=$Layout/" panel > PANEL mv PANEL panel if [ ! "$Variant" = "" ]; then sed "/VariantsList/s/.*/ VariantsList=$Variant/" panel > PANEL mv PANEL panel fi if [ ! "$Options" = "" ]; then sed "/ToggleOpt/s/.*/ ToggleOpt=$Options/" panel > PANEL mv PANEL panel fi ) done fi } cd FROM=/etc/skel # write .config/autostart/startorca.desktop if not already there mkdir -p .config/autostart if [ ! -f .config/autostart/startorca.desktop ]; then cp $FROM/.config/autostart/startorca.desktop .config/autostart fi cp -b $FROM/.profile ./ # If the user had orca enabled, run orca-on to set the a11y parameters # in .profile if grep -wq "idden=false" .config/autostart/startorca.desktop; then orca-on fi # Set a specific lxpanel for LXDE. # In all lxpanels, remove the xkb plugin and include geany instead of # pluma as text editor # Also, set sefaut terminal emulator as lxterminal instead of xterm # This specific setting is done in .config/lxpanel/launchtaskbar.cfg cp -rb $FROM/.config/lxpanel .config/ setxkbforlxpanel checkifbis() { if [ -f "$1" ] ; then echo " The backup file: $1 has been found, so we assume that you have already used this script. Running it again would make you loose your saved customization. If this is the first time you run $0, dispose of $1 first, then try again. If you want to force the update, ignoring this warning, type instead: $0 -f " exit fi } # We won't check all backups, this sample should suffice if [ ! "$1" = "-f" ]; then for i in .blackbox/menu~ .blackbox/menu1~ \ .config/autostart/xfcalendar.desktop.bak \ .config/orage/oragerc.bak \ .config/xfce4/desktop/icons.screen0-1904x1029.rc.bak \ .fluxbox/keys~ \ .fluxbox/menu~ \ .twmrc.skel~ \ GNUstep/Defaults/WMRootMenu~ \ GNUstep/Defaults/WindowMaker~; do checkifbis $i done fi # Update .Xresources cp -b $FROM/.Xresources ./ # Update .gtkrc-2.0 cp -b $FROM/.gtkrc-2.0 ./ # In all WMs, key bindings are now set this way: # Mod1+F1: pop up the Application menu from the panel # Mod1+F2: pop up a Run... dialog (but in Fluxbox) # Mod1+F4: close the raised (upmost) window # in the blackbox menu, display Dashboard Slint instead of Slint Control # Center cp -b $FROM/.blackbox/{menu,menu1} .blackbox/ # Do not autostart xfcalendar [ -f .config/autostart/xfcalendar.desktop ] && mv .config/autostart/xfcalendar.desktop \ .config/autostart/xfcalendar.desktop.bak # Set engrampa as archiver and lxterminal as terminal and show all # places in pcmanfm. # Thes settings can be changed afterwards in pcmanfm's menu: # Edition => Preferences => Advanced cp -r $FROM/.config/libfm .config/ # Default seetings for lxterminal: font monospace size 12, background # color 001B33 (blue cobalt). cp -rb $FROM/.config/lxterminal .config/ # In lxde and xfce menus, include qcontrolcenter.desktop instead of # slint-control-center.desktop cp -b $FROM/.config/menus/{lxde-applications.menu,xfce-applications.menu} \ .config/menus # Remove the default configuration for Orage. [ -f .config/orage/oragerc ] && \ mv .config/orage/oragerc .config/orage/oragerc.bak # Include a default configuration for pcmanfm in # .config/pcamfm/{default,LXDE} # and a default background for LXDE in # .config/pcamfm/LXDE/desktop-items-0.conf cp -r $FROM/.config/pcmanfm .config/ # Remove customized default config of the desktop items for Xfce. [ -f .config/xfce4/desktop/icons.screen0-1904x1029.rc ] && \ mv .config/xfce4/desktop/icons.screen0-1904x1029.rc \ .config/xfce4/desktop/icons.screen0-1904x1029.rc.bak # Set TerminalEmulator as custom-TerminalEmulator instead of xterm in # the Xfce4 configuration. cp -b $FROM/.config/xfce4/helpers.rc .config/xfce4/ # Replace pluma by geany in a launcher in the xfce4 panel. cp -b $FROM/.config/xfce4/panel/launcher-19/14756025122.desktop \ .config/xfce4/panel/launcher-19/ # Remove an empty directory if still empty. rmdir .config/xfce4/xfwm 2>/dev/null # Provide default mouse and keyboard shortcuts for fluxbox. cp -b $FROM/.fluxbox/keys .fluxbox/ # In the fluxbox menu, display Dashboard Slint instead of # Slint Control Center. cp -b $FROM/.fluxbox/menu .fluxbox/ # Provide a specific fvwm context menu for LXDE. cp -b $FROM/.fvwm/config .fvwm/ cp $FROM/.fvwm/{config.lxde,config.others} .fvwm/ # Set Indexing-Enabled=false in .kde/share/config/baloofilerc mkdir -p .kde/share/config cp -b $FROM/.kde/share/config/baloofilerc .kde/share/config/ # Remove all previous content of .local/share/applications (cd .local/share/applications for i in $(ls|grep -v ".bak$"); do mv $i ${i}.bak done ) # Set lxterminal as custom terminal emulator in Xfce mkdir -p .local/share/xfce4/helpers cp $FROM/.local/share/xfce4/helpers/custom-TerminalEmulator.desktop \ .local/share/xfce4/helpers # In twm, make the shortcut Alt+F2 pop up the xfrun4 GUI, and display # Dashboard Slint instead of Slint Control Center in the context menu. cp -bf $FROM/.twmrc.skel ./ # In blackbox, set default key bindings cp -bf $FROM/.bbkeysrc ./ # In Desktop/qcontrolcenter.desktop localize the name, changed from # Slint Control Center to Dashboard Slint. mkdir -p Desktop cp -f $FROM/Desktop/qcontrolcenter.desktop Desktop/ chmod 755 Desktop/qcontrolcenter.desktop # In windowmker, display Dashboard Slint instead of Slint Control Center # in the context menu. mkdir -p GNUstep/Defaults cp -b $FROM/GNUstep/Defaults/WMRootMenu GNUstep/Defaults/ # In windowmaker the keyboard shortcut Alt+F2 pops up a Run dialog. cp -b $FROM/GNUstep/Defaults/WindowMaker GNUstep/Defaults/ # update the dashboard Slint if [ -d .qcontrolcenter ];then mv .qcontrolcenter .qcontrolcenter.bak fi cp -rf $FROM/.qcontrolcenter ./ echo "All done."