diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..341c30b --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,166 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + diff --git a/README.md b/README.md index fef0b5d..49fb1bc 100644 --- a/README.md +++ b/README.md @@ -1 +1,19 @@ -# archdi-pkg +# archdi + +Just a simple bash script to install and configure a full personal computer with Arch Linux. + +First, install Arch Linux with the official média and optionally with archfi.
+Look at archfi project to start your arch linux installation : https://github.com/MatMoul/archfi + +After reboot, type the next two lines : + +curl -L matmoul.github.io/archdi
+sh archdi + +you can install it on your system with
+sh archdi -i
+And then you can use archdi cmd.
+With this, you can make your updates or install packages later. + +You can watch my videos to show how to use it :
+https://www.youtube.com/watch?v=-Ne4pYDqslc&list=PLytHgIKLV1caHlCrcTSkm5OF2WSVI1_Sq diff --git a/config/bash/aliases b/config/bash/aliases new file mode 100644 index 0000000..fc739ee --- /dev/null +++ b/config/bash/aliases @@ -0,0 +1,57 @@ +#!/bin/bash +. ./lib + +options=() +options+=("ls" "ls --color=auto -l --time-style long-iso" on) +options+=("ls(2)" "ls --color=auto -l" off) +options+=("ls(3)" "ls --color=auto" off) +options+=("l" "ls --color=auto -lA --time-style long-iso" on) +options+=("l(2)" "ls --color=auto -lA" off) +options+=("ll" "ls --color=auto -la --time-style long-iso" on) +options+=("ll(2)" "ls --color=auto -la" off) +options+=("cd.." "cd .." on) +options+=(".." "cd .." on) +options+=("..." "cd ../../../" on) +options+=("...." "cd ../../../../" on) +options+=("....." "cd ../../../../" on) +options+=("ff" "find / -name" on) +options+=("f" "find . -name" on) +options+=("grep" "grep --color=auto" on) +options+=("egrep" "egrep --color=auto" on) +options+=("fgrep" "fgrep --color=auto" on) +options+=("mkdir" "mkdir -pv" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Aliases in /etc/profile.d/alias.sh :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +rm /etc/profile.d/alias.sh > /dev/null +echo "#!/bin/bash" > /etc/profile.d/alias.sh +chmod 755 /etc/profile.d/alias.sh +for itm in $sel; do + case $itm in + '"ls"') echo "alias ls='ls --color=auto -l --time-style long-iso'" >> /etc/profile.d/alias.sh;; + '"ls(2)"') echo "alias ls='ls --color=auto -l'" >> /etc/profile.d/alias.sh;; + '"ls(3)"') echo "alias ls='ls --color=auto'" >> /etc/profile.d/alias.sh;; + '"l"') echo "alias l='ls --color=auto -lA --time-style long-iso'" >> /etc/profile.d/alias.sh;; + '"l(2)"') echo "alias l='ls --color=auto -lA'" >> /etc/profile.d/alias.sh;; + '"ll"') echo "alias ll='ls --color=auto -la --time-style long-iso'" >> /etc/profile.d/alias.sh;; + '"ll(2)"') echo "alias ll='ls --color=auto -la'" >> /etc/profile.d/alias.sh;; + '"cd.."') echo "alias cd..='cd ..'" >> /etc/profile.d/alias.sh;; + '".."') echo "alias ..='cd ..'" >> /etc/profile.d/alias.sh;; + '"..."') echo "alias ...='cd ../../'" >> /etc/profile.d/alias.sh;; + '"...."') echo "alias ....='cd ../../../'" >> /etc/profile.d/alias.sh;; + '"....."') echo "alias .....='cd ../../../../'" >> /etc/profile.d/alias.sh;; + '"ff"') echo "alias ff='find / -name'" >> /etc/profile.d/alias.sh;; + '"f"') echo "alias f='find . -name'" >> /etc/profile.d/alias.sh;; + '"grep"') echo "alias grep='grep --color=auto'" >> /etc/profile.d/alias.sh;; + '"egrep"') echo "alias egrep='egrep --color=auto'" >> /etc/profile.d/alias.sh;; + '"fgrep"') echo "alias fgrep='fgrep --color=auto'" >> /etc/profile.d/alias.sh;; + '"mkdir"') echo "alias mkdir='mkdir -pv'" >> /etc/profile.d/alias.sh;; + esac +done + +exit 0 \ No newline at end of file diff --git a/config/bash/bashrc b/config/bash/bashrc new file mode 100644 index 0000000..f3cb0ba --- /dev/null +++ b/config/bash/bashrc @@ -0,0 +1,17 @@ +#!/bin/bash +. ./lib + +if ( confirm "Replace /etc/skel/.bashrc ?\n\n(content of the file : source /etc/profile)" ) then + echo "source /etc/profile" > /etc/skel/.bashrc +fi +if ( confirm "Replace /root/.bashrc ?\n\n(content of the file : source /etc/profile)" ) then + echo "source /etc/profile" > /root/.bashrc +fi +items=$(ls /home/) +for item in $items; do + if ( confirm "Replace /home/$items/.bashrc ?\n\n(content of the file : source /etc/profile)" ) then + echo "source /etc/profile" > /home/$items/.bashrc + fi +done + +exit 0 diff --git a/config/bash/default b/config/bash/default new file mode 100644 index 0000000..19e0b55 --- /dev/null +++ b/config/bash/default @@ -0,0 +1,40 @@ +#!/bin/bash +. ./lib + +#archey3 + +cat > /etc/profile.d/alias.sh << "EOF" +#!/bin/bash +alias cd..='cd ..' +alias ll='ls --color=auto -l' +alias l='ls --color=auto -lA' +alias ff='find / -name' +alias f='find . -name' +EOF +chmod 755 /etc/profile.d/alias.sh + + +if [ ! -f /etc/profile.d/dircolors.sh ]; then +cat >> /etc/bash.bashrc << "EOF" +export PS1="\`if [ \$? = 0 ]; then echo -e '\[\033[01;32m\]'; else echo -e '\[\033[01;31m\]'; fi\`\w \\$ \[\033[01;0m\]" +EOF +fi + +cat > /etc/profile.d/dircolors.sh << "EOF" +#!/bin/bash +if [ -f "/etc/dircolors" ] ; then + eval $(dircolors -b /etc/dircolors) + if [ -f "$HOME/.dircolors" ] ; then + eval $(dircolors -b $HOME/.dircolors) + fi +fi +export LS_OPTS='--color=auto' +alias ls='ls ${LS_OPTS}' +export LESS="--RAW-CONTROL-CHARS" +[[ -f ~/.LESS_TERMCAP ]] && . ~/.LESS_TERMCAP +export GREP_OPTIONS="--color=auto" +EOF +chmod 755 /etc/profile.d/dircolors.sh + +echo "source /etc/profile" > /etc/skel/.bashrc +echo "source /etc/profile" > /root/.bashrc diff --git a/config/bash/menu b/config/bash/menu new file mode 100644 index 0000000..fdf2f86 --- /dev/null +++ b/config/bash/menu @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() +options+=("/etc/profile.d/alias.sh" "") +options+=("/etc/profile.d/ps1.sh" "") +options+=("Update .bashrc" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Bash Configuration :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + '/etc/profile.d/alias.sh') script config/bash/aliases;; + '/etc/profile.d/ps1.sh') script config/bash/ps1;; + 'Update .bashrc') script config/bash/bashrc;; +esac + +exit 0 diff --git a/config/bash/ps1 b/config/bash/ps1 new file mode 100644 index 0000000..e970f65 --- /dev/null +++ b/config/bash/ps1 @@ -0,0 +1,61 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Minimal" "/home #") +options+=("User" "user:/home #") +options+=("User and Hostname" "user@hostname:/home #") + +sel=$(whiptail --backtitle "$apptitle" --title "Bash PS Configuration :" --menu "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + + +updateps1(){ + case $1 in + 'Minimal') + cat > /etc/profile.d/ps1.sh << "EOF" +#!/bin/bash +clrreset='\e[0m' +clrwhite='\e[1;37m' +clrgreen='\e[1;32m' +clrred='\e[1;31m' +export PS1="\[$clrwhite\]\w \`if [ \$? = 0 ]; then echo -e '\[$clrgreen\]'; else echo -e '\[$clrred\]'; fi\`\\$ \[$clrreset\]" +EOF + chmod 755 /etc/profile.d/ps1.sh + ;; + 'User') + cat > /etc/profile.d/ps1.sh << "EOF" +#!/bin/bash +clrreset='\e[0m' +clrwhite='\e[1;37m' +clrgreen='\e[1;32m' +clrred='\e[1;31m' +export PS1="\[$clrwhite\]$USER:\w \`if [ \$? = 0 ]; then echo -e '\[$clrgreen\]'; else echo -e '\[$clrred\]'; fi\`\\$ \[$clrreset\]" +EOF + chmod 755 /etc/profile.d/alias.sh + ;; + 'User and Hostname') + cat > /etc/profile.d/ps1.sh << "EOF" +#!/bin/bash +clrreset='\e[0m' +clrwhite='\e[1;37m' +clrgreen='\e[1;32m' +clrred='\e[1;31m' +export PS1="\[$clrwhite\]$USER@$HOSTNAME:\w \`if [ \$? = 0 ]; then echo -e '\[$clrgreen\]'; else echo -e '\[$clrred\]'; fi\`\\$ \[$clrreset\]" +EOF + chmod 755 /etc/profile.d/alias.sh + ;; + esac +} + +if ( confirm "Create /etc/profile.d/ps1.sh and force load it at end of /etc/bash.bashrc ?" ) then + updateps1 $sel + grep -q -F 'source /etc/profile.d/ps1.sh' /etc/bash.bashrc || echo 'source /etc/profile.d/ps1.sh' >> /etc/bash.bashrc +fi + +exit 0 + diff --git a/config/firewall/menu b/config/firewall/menu new file mode 100644 index 0000000..2e3cfc3 --- /dev/null +++ b/config/firewall/menu @@ -0,0 +1,58 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Edit IPv4" "nano /etc/iptables/iptables.rules") +options+=("Edit IPv6" "nano /etc/iptables/ip6tables.rules") +options+=("" "") +options+=("Load Rules" "iptables-restore & ip6tables-restore") +options+=("" "") +options+=("Start At Boot" "systemctl enable iptables & systemctl enable ip6tables") +options+=("Generate Default Rules" "/etc/iptables/iptables.rules & /etc/iptables/ip6tables.rules") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Firewall Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Edit IPv4') nano /etc/iptables/iptables.rules;; + 'Edit IPv6') nano /etc/iptables/ip6tables.rules;; + 'Load Rules') iptables-restore < /etc/iptables/iptables.rules + ip6tables-restore < /etc/iptables/ip6tables.rules;; + 'Start At Boot') systemctl enable iptables + systemctl start iptables + systemctl enable ip6tables + systemctl start ip6tables;; + 'Generate Default Rules') + file=/etc/iptables/iptables.rules + echo '*filter' > $file + echo ':INPUT DROP [0:0]' >> $file + echo ':FORWARD DROP [0:0]' >> $file + echo ':OUTPUT ACCEPT [0:0]' >> $file + echo '-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT' >> $file + echo '-A INPUT -i lo -j ACCEPT' >> $file + echo '# SSH' >> $file + echo '#-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT' >> $file + echo '# Ping' >> $file + echo '#-A INPUT -p icmp -j ACCEPT' >> $file + echo '# SNMP' >> $file + echo '#-A INPUT -s 192.168.0.0/24 -p udp -m udp --dport 161 -m state --state NEW -j ACCEPT' >> $file + echo 'COMMIT' >> $file + iptables-restore $file + file=/etc/iptables/ip6tables.rules + echo '*filter' > $file + echo ':INPUT DROP [0:0]' >> $file + echo ':FORWARD DROP [0:0]' >> $file + echo ':OUTPUT ACCEPT [0:0]' >> $file + echo '-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT' >> $file + echo '-A INPUT -i lo -j ACCEPT' >> $file + echo 'COMMIT' >> $file + ip6tables-restore $file;; +esac + +exit 0 diff --git a/config/menu b/config/menu new file mode 100644 index 0000000..2c64b7c --- /dev/null +++ b/config/menu @@ -0,0 +1,33 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Bash" "") +options+=("Firewall" "") +options+=("Users" "") +options+=("Sudoers" "") +options+=("XOrg" "") +options+=("Grub" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Config Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Bash') menu config/bash/menu;; + 'Firewall') menu config/firewall/menu;; + 'Users') menu config/users/menu;; + 'Sudoers') menu config/sudoers/menu;; + 'XOrg') menu config/xorg/menu;; + 'Grub') nano /etc/default/grub + if(confirm "Run grub-mkconfig -o /boot/grub/grub.cfg ?") then + grub-mkconfig -o /boot/grub/grub.cfg + fi;; +esac + +exit 0 diff --git a/config/sudoers/menu b/config/sudoers/menu new file mode 100644 index 0000000..7dcac4a --- /dev/null +++ b/config/sudoers/menu @@ -0,0 +1,67 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Add sudoer" "") +options+=("Edit sudoer" "") +options+=("Delete sudoer" "") +options+=("" "") +options+=("Edit /etc/sudoers" "") + +defaultitem="Add sudoer" +sel=$(whiptail --backtitle "$apptitle" --title "Sudoers Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Add sudoer') + users=$(awk -F: '{if ($3 >= 1000) { print $1 } }' /etc/passwd) + userlist=() + for itm in $users; do + userlist+=("$itm" "") + done + sel=$(whiptail --backtitle "$apptitle" --title "Add sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${userlist[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + echo "$sel ALL=(ALL) ALL" > /etc/sudoers.d/$sel + fi + ;; + 'Edit sudoer') + sudoers=$(ls /etc/sudoers.d) + sudoerlist=() + for itm in $sudoers; do + sudoerlist+=("$itm" "") + done + sel=$(whiptail --backtitle "$apptitle" --title "Edit sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${sudoerlist[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + nano /etc/sudoers.d/$sel + fi + ;; + 'Delete sudoer') + sudoers=$(ls /etc/sudoers.d) + sudoerlist=() + for itm in $sudoers; do + sudoerlist+=("$itm" "") + done + sel=$(whiptail --backtitle "$apptitle" --title "Delete sudoer :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${sudoerlist[@]}" \ + 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + if (confirm "Remove $sel from sudoers"); then + rm /etc/sudoers.d/$sel + fi + fi + ;; + 'Edit /etc/sudoers') + nano /etc/sudoers + ;; +esac + +exit 0 diff --git a/config/users/menu b/config/users/menu new file mode 100644 index 0000000..234f585 --- /dev/null +++ b/config/users/menu @@ -0,0 +1,45 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Add User" "") +options+=("List Users" "") +options+=("Delete User" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Users Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'List Users') + clear + awk -F: '{if ($3 >= 1000) { print $1 } }' /etc/passwd + read -n1 -p "press a key to continue" + ;; + 'Add User') + username=$(whiptail --backtitle "$apptitle" --title "Add User" --inputbox "Enter the new user name :" 0 0 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + useradd -d /home/$username -s /bin/bash -m -N $username + clear + echo "User $username created." + echo "" + echo "Choose a password for $username :" + echo "" + passwd $username + pressanykey + fi + ;; + 'Delete User') + username=$(whiptail --backtitle "$apptitle" --title "Delete User" --inputbox "Enter the user name to delete :" 0 0 3>&1 1>&2 2>&3) + if [ "$?" = "0" ]; then + userdel -r -f $username + fi + ;; +esac + +exit 0 diff --git a/config/xorg/keyboard b/config/xorg/keyboard new file mode 100644 index 0000000..b6446f9 --- /dev/null +++ b/config/xorg/keyboard @@ -0,0 +1,71 @@ +#!/bin/bash +. ./lib + +options=() +items=$(localectl list-x11-keymap-layouts) +for item in $items; do + options+=("$item" "") +done +layout=$(whiptail --backtitle "$apptitle" --title "Select keyboard layout :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +options=() +options+=("ignore" "") +options+=("pc104" "Default") +options+=("pc105" "") +items=$(localectl list-x11-keymap-models) +for item in $items; do + options+=("$item" "") +done +model=$(whiptail --backtitle "$apptitle" --title "Select keyboard model :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +if [ "$model" = "ignore" ]; then + model="" +fi + +options=() +options+=("ignore" "Default") +items=$(localectl list-x11-keymap-variants $layout) +for item in $items; do + options+=("$item" "") +done +variant=$(whiptail --backtitle "$apptitle" --title "Select keyboard variant :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +if [ "$variant" = "ignore" ]; then + variant="" +fi + +options=() +options+=("ignore" "Default") +items=$(localectl list-x11-keymap-options) +for item in $items; do + options+=("$item" "") +done +option=$(whiptail --backtitle "$apptitle" --title "Select keyboard option :" --menu "" --cancel-button "Cancel" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +if [ "$option" = "ignore" ]; then + option="" +fi + + +if ( confirm "Run localectl set-x11-keymap $layout $model $variant $option ?") then + localectl set-x11-keymap $layout $model $variant $option +fi + +exit 0 diff --git a/config/xorg/menu b/config/xorg/menu new file mode 100644 index 0000000..f72e0a8 --- /dev/null +++ b/config/xorg/menu @@ -0,0 +1,38 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Generate /etc/X11/xorg.conf.d/00-keyboard.conf" "") +options+=("Edit /etc/X11/xorg.conf.d/00-keyboard.conf" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Bash Configuration :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + "Generate /etc/X11/xorg.conf.d/00-keyboard.conf") + localectl > /dev/null + if [ "$?" = "0" ]; then + script config/xorg/keyboard + else + echo '# Because dbus is not available in arch-chroot, if you run this command after reboot a best wizard is provided' > /etc/X11/xorg.conf.d/00-keyboard.conf + echo 'Section "InputClass"' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' Identifier "system-keyboard"' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' MatchIsKeyboard "on"' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' Option "XkbLayout" "us"' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' Option "XkbModel" "pc104"' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' Option "XkbVariant" ""' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo ' Option "XkbOptions" ""' >> /etc/X11/xorg.conf.d/00-keyboard.conf + echo 'EndSection' >> /etc/X11/xorg.conf.d/00-keyboard.conf + nano /etc/X11/xorg.conf.d/00-keyboard.conf + fi + ;; + "Edit /etc/X11/xorg.conf.d/00-keyboard.conf") nano /etc/X11/xorg.conf.d/00-keyboard.conf;; +esac + +exit 0 diff --git a/install/apps/dev b/install/apps/dev new file mode 100644 index 0000000..d6049fd --- /dev/null +++ b/install/apps/dev @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Geany" "" off) +options+=("WebStorm" "(AUR)" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Dev applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"WebStorm"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/games b/install/apps/games new file mode 100644 index 0000000..54a1eda --- /dev/null +++ b/install/apps/games @@ -0,0 +1,23 @@ +#!/bin/bash +. ./lib + +options=() +options+=("0AD" "" off) +options+=("puzzles" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Game applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/graphic b/install/apps/graphic new file mode 100644 index 0000000..4bbf3cf --- /dev/null +++ b/install/apps/graphic @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() +options+=("gimp" "" on) +options+=("inkscape" "" on) +options+=("dia" "" off) +options+=("calligra-krita" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Graphic applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + #'""') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"gimp"') choosepkg "gimp-help-";; + esac +done + +exit 0 diff --git a/install/apps/gstreamer b/install/apps/gstreamer new file mode 100644 index 0000000..af9669a --- /dev/null +++ b/install/apps/gstreamer @@ -0,0 +1,39 @@ +#!/bin/bash +. ./lib + +options=() + +options+=("gst-plugins-base" "" on) +options+=("gst-plugins-good" "" on) +options+=("gst-plugins-ugly" "" on) +options+=("gst-plugins-bad" "" off) +options+=("gst-libav" "" on) +#options+=("gst-plugin-libde265" "(AUR)" off) +options+=("gstreamer0.10-base-plugins" "" on) +options+=("gstreamer0.10-good-plugins-slim" "(AUR)" off) +options+=("gstreamer0.10-good-plugins" "" on) +options+=("gstreamer0.10-ugly-plugins" "" on) +options+=("gstreamer0.10-bad-plugins" "" off) +options+=("gstreamer0.10-ffmpeg" "" on) +#options+=("gstreamer0.10-plugin-libde265" "(AUR)" off) +#options+=("libde265" "(AUR)" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Gstreamer Install" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + 'gst-plugin-libde265' | \ + 'gstreamer0.10-good-plugins-slim' | \ + 'gstreamer0.10-plugin-libde265') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/internet b/install/apps/internet new file mode 100644 index 0000000..f9658a3 --- /dev/null +++ b/install/apps/internet @@ -0,0 +1,42 @@ +#!/bin/bash +. ./lib + +options=() +options+=("chromium" "" on) +options+=("chromium-pepper-flash" "(AUR)" on) +options+=("chromium-pepper-flash-standalone" "(AUR)" off) +options+=("firefox" "" on) +options+=("flashplugin" "" off) +options+=("freshplayerplugin-git" "(AUR)" on) +options+=("freshplayerplugin" "(AUR)" off) +options+=("tixati" "(AUR)" on) +options+=("thunderbird" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Internet applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"chromium-pepper-flash"' | \ + '"chromium-pepper-flash-standalone"' | \ + '"freshplayerplugin-git"' | \ + '"freshplayerplugin"' | \ + '"tixati"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"firefox"') choosepkg "firefox-i18n-";; + '"thunderbird"') choosepkg "thunderbird-i18n-";; + esac +done + +exit 0 diff --git a/install/apps/menu b/install/apps/menu new file mode 100644 index 0000000..403667f --- /dev/null +++ b/install/apps/menu @@ -0,0 +1,39 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Office" "") +options+=("Internet" "") +options+=("GStreamer" "") +options+=("Multimedia" "") +options+=("Graphic" "") +#options+=("Network" "") +options+=("System" "") +options+=("PacMan GUI" "") +#options+=("Dev" "") +#options+=("Games" "") + + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Apps Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + "Office") script install/apps/office;; + "Internet") script install/apps/internet;; + "GStreamer") script install/apps/gstreamer;; + "Multimedia") script install/apps/multimedia;; + "Graphic") script install/apps/graphic;; + "Network") script install/apps/network;; + "System") script install/apps/system;; + "PacMan GUI") script install/apps/pacmangui;; + "Dev") script install/apps/dev;; + "Games") script install/apps/games;; +esac + +exit 0 diff --git a/install/apps/multimedia b/install/apps/multimedia new file mode 100644 index 0000000..0f3cb34 --- /dev/null +++ b/install/apps/multimedia @@ -0,0 +1,35 @@ +#!/bin/bash +. ./lib + +options=() +options+=("vlc" "Video player" off) +options+=("smplayer" "Video player" off) +options+=("mpv" "Recommended for smplayer" off) +options+=("smtube" "Youtube Player" off) +options+=("amarok" "Audio Player" off) +options+=("guayadeque" "Audio Player" off) +options+=("clementine" "Audio Player" off) +options+=("mixxx" "Audio Player" off) +options+=("gmusicbrowser" "(AUR) Audio Player" off) +options+=("avidemux-gtk" "Video Editor" off) +options+=("avidemux-qt" "Video Editor" off) +options+=("simplescreenrecorder" "Screen Recorder" off) +#options+=("lib32-simplescreenrecorder" "For simplescreenrecorder" off) #Need multilib + +sel=$(whiptail --backtitle "$apptitle" --title "Multimedia applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"gmusicbrowser"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/network b/install/apps/network new file mode 100644 index 0000000..e14cb25 --- /dev/null +++ b/install/apps/network @@ -0,0 +1,29 @@ +#!/bin/bash +. ./lib + +options=() +options+=("remmina" "" off) +#options+=("kdenetwork-krdc" "" off) +#options+=("kvpnc" "" off) +options+=("teamviewer" "(AUR)" off) +#options+=("zenmap" "" off) +options+=("jnetmap" "(AUR)" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Network applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"teamviewer"' | \ + '"jnetmap"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/office b/install/apps/office new file mode 100644 index 0000000..afb30f2 --- /dev/null +++ b/install/apps/office @@ -0,0 +1,33 @@ +#!/bin/bash +. ./lib + +options=() +options+=("libreoffice-fresh" "" on) +options+=("libreoffice-still" "" off) +options+=("calcoo" "(AUR)" off) +options+=("qalculate-gtk" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Office applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"calcoo"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"libreoffice-fresh"') choosepkg "libreoffice-fresh-";; + '"libreoffice-still"') choosepkg "libreoffice-still-";; + esac +done + +exit 0 diff --git a/install/apps/pacmangui b/install/apps/pacmangui new file mode 100644 index 0000000..f7939b2 --- /dev/null +++ b/install/apps/pacmangui @@ -0,0 +1,39 @@ +#!/bin/bash +. ./lib +options=() +options+=("octopi" "(AUR) (QT)" off) +options+=("appset-qt" "(AUR) (QT)" off) +options+=("pamac-aur" "(AUR) (GTK)" off) + +sel=$(whiptail --backtitle "$apptitle" --title "PacMan GUI applications :" --checklist "Recommended to choose one" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"octopi"' | \ + '"appset-qt"' | \ + '"pamac-aur"') + multilib="true" + aurpkg="$aurpkg $(echo $itm | sed 's/"//g')" + ;; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +if [ "$multilib" = "true" ]; then + if ( confirm "To install wine or wine_gecko, multilib repo is requires.\nFor this, the script edit the [mulilib] part in /etc/pacman.conf and run pacman -Syu\n\nEnable multilib repo ?" ) then + sed -i '/\[multilib\]/s/^#//g' /etc/pacman.conf + sed -i '/\[multilib\]/{n;s/^#//g}' /etc/pacman.conf + pacman -Syu + else + exit 1 + fi +fi + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/apps/system b/install/apps/system new file mode 100644 index 0000000..08b6408 --- /dev/null +++ b/install/apps/system @@ -0,0 +1,78 @@ +#!/bin/bash +. ./lib +options=() +#options+=("octopi" "(AUR) qt pacman gui" off) +#options+=("appset-qt" "(AUR) qt pacman gui" off) +#options+=("pamac-aur" "(AUR) gtk pacman gui" off) +options+=("gparted" "Partitions manager" off) +options+=("bleachbit" "profile cleaner" off) +options+=("keepass" "Password Manager" off) +options+=("keepassx" "Password Manager" off) +options+=("keepassx-git" "(AUR) Password Manager" off) +options+=("virtualbox" "" off) +options+=("virtualbox-host-dkms" "recommended for virtualbox" off) +#options+=("virtualbox-host-modules" "" on) +options+=("wine" "MS Windows App Support" off) +options+=("wine_gecko" "MS Windows App Support" off) +options+=("wine-mono" "MS Windows App Support" off) +options+=("zenity" "recommended for wine" off) +options+=("winetricks" "recommended for wine" off) +options+=("k4dirstat" "(AUR)" off) +options+=("conky" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "System applications :" --checklist "Choose what you want" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"octopi"' | \ + '"appset-qt"' | \ + '"pamac-aur"' | \ + '"keepassx-git"' | \ + '"k4dirstat"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + '"wine"' | \ + '"wine_gecko"') + multilib="true" + pkg="$pkg $(echo $itm | sed 's/"//g')" + ;; + '"virtualbox-host-modules"') + pkg="$pkg virtualbox-host-dkms" + pkg="$pkg virtualbox-host-modules" + ;; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +if [ "$multilib" = "true" ]; then + if ( confirm "To install wine or wine_gecko, multilib repo is requires.\nFor this, the script edit the [mulilib] part in /etc/pacman.conf and run pacman -Syu\n\nEnable multilib repo ?" ) then + sed -i '/\[multilib\]/s/^#//g' /etc/pacman.conf + sed -i '/\[multilib\]/{n;s/^#//g}' /etc/pacman.conf + pacman -Syu + else + exit 1 + fi +fi + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"virtualbox-host-dkms"') + if ( confirm "virtualbox-host-dkms require to rebuild initcpio.\n\nRun mkinitcpio -o linux ?" ) then + mkinitcpio -p linux + fi + svcenable dkms + svcstart dkms + dkms autoinstall + ;; + '"virtualbox-host-modules"') + dkms autoinstall + ;; + esac +done + +exit 0 diff --git a/install/console/menu b/install/console/menu new file mode 100644 index 0000000..725c75e --- /dev/null +++ b/install/console/menu @@ -0,0 +1,48 @@ +#!/bin/bash +. ./lib + +options=() +options+=("bash-completion" "Best completion in bash" on) +options+=("lsof" "ls open file" on) +options+=("nmon" "System monitor" on) +options+=("rsync" "Sync files" on) +#options+=("unzip" "ZIP files" on) +#options+=("unrar" "RAR files" off) +#options+=("zip" "Compress files" off) +#options+=("p7zip" "File Archiver" off) +options+=("dnsutils" "DNS tools (nslookup)" on) +options+=("traceroute" "Trace network route" on) +options+=("nmap" "Network scanner" off) +options+=("mc" "Dual pane file explorer" off) +options+=("links" "Web browser" off) +options+=("powertop" "power mon and management" off) +#options+=("gpm" "Console mouse support" off) +options+=("wavemon" "WIFI monitor" off) +options+=("net-tools" "(deprecated) old ifconfig" off) + + +sel=$(whiptail --backtitle "$apptitle" --title "Console applications :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"gpm"') + svcstart gpm + svcenable gpm + ;; + esac +done + +exit 0 diff --git a/install/desktop/TODO b/install/desktop/TODO new file mode 100644 index 0000000..5480ea8 --- /dev/null +++ b/install/desktop/TODO @@ -0,0 +1,2 @@ +Add cinnamon +Add LXQT diff --git a/install/desktop/cinnamon/menu b/install/desktop/cinnamon/menu new file mode 100644 index 0000000..7572df6 --- /dev/null +++ b/install/desktop/cinnamon/menu @@ -0,0 +1,30 @@ +#!/bin/bash +. ./lib + +options=() +options+=("mate" "") +options+=("mate-extra" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Mate Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'mate') + require install/desktop/mate/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/mate/packages + script install/desktop/mate/packages + ;; + 'mate-extra') + require install/desktop/mate/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/mate/packages + script install/desktop/mate/packages + ;; +esac + +exit 0 diff --git a/install/desktop/cinnamon/packages b/install/desktop/cinnamon/packages new file mode 100644 index 0000000..c8e246a --- /dev/null +++ b/install/desktop/cinnamon/packages @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() + +package="cinnamon" +items=$(pacman -Ssq $package) +for item in $items; do + options+=("$item" "" on) +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/enlightenment/TODO b/install/desktop/enlightenment/TODO new file mode 100644 index 0000000..0889143 --- /dev/null +++ b/install/desktop/enlightenment/TODO @@ -0,0 +1,2 @@ +Add complements +No terminal diff --git a/install/desktop/enlightenment/packages b/install/desktop/enlightenment/packages new file mode 100644 index 0000000..8188ce3 --- /dev/null +++ b/install/desktop/enlightenment/packages @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +options+=("enlightenment" "" on) +options+=("connman" "" on) +options+=("acpid" "" on) + +sel=$(whiptail --backtitle "$apptitle" --title "Enlightenment Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/gnome/menu b/install/desktop/gnome/menu new file mode 100644 index 0000000..d7a3805 --- /dev/null +++ b/install/desktop/gnome/menu @@ -0,0 +1,30 @@ +#!/bin/bash +. ./lib + +options=() +options+=("gnome" "") +options+=("gnome-extra" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "XFCE4 Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'gnome') + require install/desktop/gnome/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/gnome/packages + script install/desktop/gnome/packages + ;; + 'gnome-extra') + require install/desktop/gnome/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/gnome/packages + script install/desktop/gnome/packages + ;; +esac + +exit 0 diff --git a/install/desktop/gnome/packages b/install/desktop/gnome/packages new file mode 100644 index 0000000..df8c468 --- /dev/null +++ b/install/desktop/gnome/packages @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +items=$(pacman -Sqg $package) +for item in $items; do + options+=("$item" "" on) +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + 'gdm') svcenable gdm;; + esac +done + +exit 0 diff --git a/install/desktop/kde4/complements b/install/desktop/kde4/complements new file mode 100644 index 0000000..8960f13 --- /dev/null +++ b/install/desktop/kde4/complements @@ -0,0 +1,66 @@ +#!/bin/bash +. ./lib + +options=() +options+=("kdebase-plasma" "" on) +options+=("kdeplasma-applets-plasma-nm" "" on) +options+=("numlockx" "(Numlock on for kdm)" on) +options+=("kdesu" "" on) +options+=("kdesu4" "" on) +options+=("konsolepart4" "" on) +options+=("gnome-keyring" "" on) +options+=("smb4k" "" on) +options+=("partitionmanager" "" on) +options+=("archlinux-themes-kdm" "theme" on) +options+=("breeze-kde4" "theme" on) +options+=("breeze" "theme" on) +options+=("oxygen-gtk2" "theme gtk 2" on) +options+=("oxygen-gtk3-git" "(AUR) theme gtk 3" off) +options+=("qtcurve-kde4" "theme" off) +options+=("gtk-kde4" "(AUR) gtk2 theme config" on) +options+=("gtk3-dark-theme-patch" "/etc/skel/.config/gtk-3.0/settings.ini" off) +#options+=("qtcurve-gtk2" "" off) +#options+=("kde-gtk-config" "gtk theme config FOR PLASMA5" off) +#qtcurve-kde4 +#qtcurve-gtk2 +#qtcurve-qt4 +#qtcurve-qt5 +#options+=("gtk-qt-engine" "(AUR)" off) +options+=("kdeconnect" "" off) +options+=("sshfs" "(For kdeconnect)" off) + +sel=$(whiptail --backtitle "$apptitle" --title "KDE Complements :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"gtk-qt-engine"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + '"gtk-kde4"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + '"oxygen-gtk3-git"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + '"gtk3-dark-theme-patch"') ;; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"gtk3-dark-theme-patch"') + mkdir -p /etc/skel/.config/gtk-3.0 + echo "[Settings]" > /etc/skel/.config/gtk-3.0/settings.ini + echo "gtk-application-prefer-dark-theme=true" >> /etc/skel/.config/gtk-3.0/settings.ini + ;; + '"numlockx"') + if ( confirm "Add numlockx on to /usr/share/config/kdm/Xsetup ?" ) then + echo "numlockx on" >> /usr/share/config/kdm/Xsetup + fi + ;; + esac +done + +exit 0 diff --git a/install/desktop/kde4/kdeapps b/install/desktop/kde4/kdeapps new file mode 100644 index 0000000..369bfb7 --- /dev/null +++ b/install/desktop/kde4/kdeapps @@ -0,0 +1,95 @@ +#!/bin/bash +. ./lib + +options=() + +#kde-agent +#kdepim-kleopatra +#kdeutils-kgpg + +items=$(pacman -Sqg kde-applications) +for item in $items; do + case $item in + "dolphin" | \ + "kdepasswd" | \ + "kdialog" | \ + "kfind" | \ + "workspace" | \ + "ksystemlog" | \ + "kuser" | \ + "ark" | \ + "kwalletmanager" | \ + "kgamma" | \ + "ksnapshot" | \ + "okular" | \ + "audiocd-kio" | \ + "ffmpegthumbs" | \ + "kmix" | \ + "mplayerthumbs" | \ + "filesharing" | \ + "zeroconf-ioslave" | \ + "kate" | \ + "thumbnailers" | \ + "kdebase-dolphin" | \ + "kdebase-kdepasswd" | \ + "kdebase-kdialog" | \ + "kdebase-kfind" | \ + "kdebase-workspace" | \ + "konsole" | \ + "kwrite" | \ + "kcron" | \ + "kdeadmin-ksystemlog" | \ + "kdeadmin-kuser" | \ + "kdeutils-ark" | \ + "kdeutils-kwalletmanager" | \ + "kcalc" | \ + "kcharselect" | \ + "print-manager" | \ + "kdegraphics-kgamma" | \ + "kdegraphics-ksnapshot" | \ + "kdegraphics-okular" | \ + "kdemultimedia-audiocd-kio" | \ + "kdemultimedia-ffmpegthumbs" | \ + "kdemultimedia-kmix" | \ + "kdemultimedia-mplayerthumbs" | \ + "kdenetwork-filesharing" | \ + "kdenetwork-zeroconf-ioslave" | \ + "kate" | \ + "kdesdk-thumbnailers" | \ + "kleopatra" | \ + "kdepim-kleopatra" | \ + "kdeartwork-"*) options+=("$item" "" on);; + "akregator" | \ + "kaddressbook" | \ + "kalarm" | \ + "kmail" | \ + "knotes" | \ + "kontact" | \ + "korganizer" | \ + "kdepim-akregator" | \ + "kdepim-kaddressbook" | \ + "kdepim-kalarm" | \ + "kdepim-kmail" | \ + "kdepim-knotes" | \ + "kdepim-kontact" | \ + "kdepim-korganizer" | \ + "kdeartwork-"*) options+=("$item" "(recommended)" off);; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/kde4/kdeplasma b/install/desktop/kde4/kdeplasma new file mode 100644 index 0000000..0c36f30 --- /dev/null +++ b/install/desktop/kde4/kdeplasma @@ -0,0 +1,28 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(pacman -Ssq kdeplasma4-) +for item in $items; do + case $item in + "kdeplasma-applets-plasma-nm") options+=("$item" "" on);; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "KDE Plasma :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/kde4/localisations b/install/desktop/kde4/localisations new file mode 100644 index 0000000..b0e238c --- /dev/null +++ b/install/desktop/kde4/localisations @@ -0,0 +1,24 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(pacman -Ssq kde-l10n-) +for item in $items; do + options+=("$item" "" off) +done + +sel=$(whiptail --backtitle "$apptitle" --title "KDE localisations :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/kde4/menu b/install/desktop/kde4/menu new file mode 100644 index 0000000..9f4e75a --- /dev/null +++ b/install/desktop/kde4/menu @@ -0,0 +1,43 @@ +#!/bin/bash +. ./lib + +options=() +options+=("KDE Base" "kdebase-workspace") +options+=("KDE Localisations" "kde-l10n-") +options+=("KDE Plasma" "kdeplasma4-") +options+=("KDE Apps Meta Full" "kde-applications-meta") +options+=("KDE Apps Full" "kde-applications") +options+=("KDE Apps" "") +options+=("KDE Complements" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "KDE4 Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'KDE Base') + instpkg "kdebase-workspace" "" + svcenable kdm + ;; + 'KDE Localisations') script install/desktop/kde4/localisations;; + 'KDE Plasma') script install/desktop/kde4/kdeplasma;; + 'KDE Apps Meta Full') + if ( confirm "This option install all KDE applications with meta packages.\n\nInstall KDE Meta Full (pacman -S kde-applications-meta) ?" ) then + instpkg "kde-applications-meta" "" + fi + ;; + 'KDE Apps Full') + if ( confirm "This option install all KDE applications.\n\nInstall KDE Full (pacman -S kde-applications) ?" ) then + instpkg "kde-applications" "" + fi + ;; + 'KDE Apps') menu install/desktop/kde4/kdeapps;; + 'KDE Complements') script install/desktop/kde4/complements;; +esac + +exit 0 diff --git a/install/desktop/kde4/metapackages b/install/desktop/kde4/metapackages new file mode 100644 index 0000000..a697064 --- /dev/null +++ b/install/desktop/kde4/metapackages @@ -0,0 +1,35 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(for i in $(pacman -Sqg kde-applications-meta); do echo ${i#kde-meta-};done) +for item in $items; do + case $item in + "kdebase") options+=("$item" "" on);; + "kdeadmin") options+=("$item" "" on);; + "kdegraphics") options+=("$item" "" on);; + "kdemultimedia") options+=("$item" "" on);; + "kdeutils") options+=("$item" "" on);; + "kdepim") options+=("$item" "" on);; + "kdeartwork") options+=("$item" "" on);; + "kde-wallpapers") ;; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "KDE Meta Packages :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/kde4/packagecategories b/install/desktop/kde4/packagecategories new file mode 100644 index 0000000..9b67f10 --- /dev/null +++ b/install/desktop/kde4/packagecategories @@ -0,0 +1,44 @@ +#!/bin/bash +. ./lib + +options=() + +options+=("kdebase" "") +options+=("kdeadmin" "") +options+=("kdeutils" "") +options+=("kdegraphics" "") +options+=("kdemultimedia" "") +options+=("kdenetwork" "") +options+=("kdesdk" "") +options+=("kdepim" "") +items=$(for i in $(pacman -Sqg kde-applications-meta); do echo ${i#kde-meta-};done) +for item in $items; do + case $item in + "kdebase") ;; + "kdeadmin") ;; + "kdeutils") ;; + "kdegraphics") ;; + "kdemultimedia") ;; + "kdenetwork") ;; + "kdesdk") ;; + "kdepim") ;; + "kde-wallpapers") ;; + "telepathy-kde-meta") ;; + *) options+=("$item" "");; + esac +done + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "KDE Package Categories :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +require install/desktop/kde4/packages 755 +sed -i "/^package=/c\package=\"$sel\"" install/desktop/kde4/packages +script install/desktop/kde4/packages + +exit 0 diff --git a/install/desktop/kde4/packages b/install/desktop/kde4/packages new file mode 100644 index 0000000..9bd06a3 --- /dev/null +++ b/install/desktop/kde4/packages @@ -0,0 +1,90 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +items=$(pacman -Sqg $package) +for item in $items; do + case $item in + "dolphin" | \ + "kdepasswd" | \ + "kdialog" | \ + "kfind" | \ + "workspace" | \ + "ksystemlog" | \ + "kuser" | \ + "ark" | \ + "kgamma" | \ + "ksnapshot" | \ + "okular" | \ + "audiocd-kio" | \ + "ffmpegthumbs" | \ + "kmix" | \ + "mplayerthumbs" | \ + "filesharing" | \ + "zeroconf-ioslave" | \ + "kate" | \ + "thumbnailers" | \ + "akregator" | \ + "kaddressbook" | \ + "kalarm" | \ + "kleopatra" | \ + "kmail" | \ + "knotes" | \ + "kontact" | \ + "korganizer" | \ + "kdebase-dolphin" | \ + "kdebase-kdepasswd" | \ + "kdebase-kdialog" | \ + "kdebase-kfind" | \ + "kdebase-workspace" | \ + "konsole" | \ + "kwrite" | \ + "kcron" | \ + "kdeadmin-ksystemlog" | \ + "kdeadmin-kuser" | \ + "kdeutils-ark" | \ + "filelight" | \ + "kcalc" | \ + "kcharselect" | \ + "print-manager" | \ + "kdegraphics-kgamma" | \ + "kdegraphics-ksnapshot" | \ + "kdegraphics-okular" | \ + "kdemultimedia-audiocd-kio" | \ + "kdemultimedia-ffmpegthumbs" | \ + "kdemultimedia-kmix" | \ + "kdemultimedia-mplayerthumbs" | \ + "kdenetwork-filesharing" | \ + "kdenetwork-zeroconf-ioslave" | \ + "kate" | \ + "kdesdk-thumbnailers" | \ + "kdepim-akregator" | \ + "kdepim-kaddressbook" | \ + "kdepim-kalarm" | \ + "kdepim-kleopatra" | \ + "kdepim-kmail" | \ + "kdepim-knotes" | \ + "kdepim-kontact" | \ + "kdepim-korganizer" | \ + "kdeartwork-"*) options+=("$item" "" on);; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/lxde/TODO b/install/desktop/lxde/TODO new file mode 100644 index 0000000..16cd749 --- /dev/null +++ b/install/desktop/lxde/TODO @@ -0,0 +1 @@ +Test on 32bit version diff --git a/install/desktop/lxde/packages b/install/desktop/lxde/packages new file mode 100644 index 0000000..dd18aa2 --- /dev/null +++ b/install/desktop/lxde/packages @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +items=$(pacman -Sqg $package) +for item in $items; do + options+=("$item" "" on) +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + 'lxdm') svcenable lxdm;; + esac +done + +exit 0 diff --git a/install/desktop/mate/TODO b/install/desktop/mate/TODO new file mode 100644 index 0000000..88b994c --- /dev/null +++ b/install/desktop/mate/TODO @@ -0,0 +1,4 @@ +Add Complements +- No terminal + +lightdm-gtk2-greeter as optional dependencie diff --git a/install/desktop/mate/menu b/install/desktop/mate/menu new file mode 100644 index 0000000..7572df6 --- /dev/null +++ b/install/desktop/mate/menu @@ -0,0 +1,30 @@ +#!/bin/bash +. ./lib + +options=() +options+=("mate" "") +options+=("mate-extra" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Mate Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'mate') + require install/desktop/mate/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/mate/packages + script install/desktop/mate/packages + ;; + 'mate-extra') + require install/desktop/mate/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/mate/packages + script install/desktop/mate/packages + ;; +esac + +exit 0 diff --git a/install/desktop/mate/packages b/install/desktop/mate/packages new file mode 100644 index 0000000..f72fefe --- /dev/null +++ b/install/desktop/mate/packages @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +items=$(pacman -Sqg $package) +for item in $items; do + options+=("$item" "" on) +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/menu b/install/desktop/menu new file mode 100644 index 0000000..8b62a29 --- /dev/null +++ b/install/desktop/menu @@ -0,0 +1,44 @@ +#!/bin/bash +. ./lib + +options=() +options+=("KDE4" "") +options+=("XFCE4" "") +options+=("Gnome" "") +options+=("Plasma5" "") +options+=("LXDE" "") +options+=("Cinnamon" "") +options+=("Mate" "") +options+=("Enlightenment" "") +#options+=("LXQT" "") +#options+=("GnuStep" "") +#options+=("i3" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Install Desktop Menu :" --menu "First item is most maintained" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Plasma5') menu install/desktop/plasma5/menu;; + 'KDE4') menu install/desktop/kde4/menu;; + 'XFCE4') menu install/desktop/xfce4/menu;; + 'Gnome') menu install/desktop/gnome/menu;; + 'LXDE') + require install/desktop/lxde/packages 755 + sed -i "/^package=/c\package=\"lxde\"" install/desktop/lxde/packages + script install/desktop/lxde/packages + svcenable lxdm + ;; + 'Enlightenment') + script install/desktop/enlightenment/packages + ;; + 'Mate') menu install/desktop/mate/menu;; + 'Cinnamon') script install/desktop/cinnamon/packages;; +esac + +exit 0 diff --git a/install/desktop/plasma5/complements b/install/desktop/plasma5/complements new file mode 100644 index 0000000..2b30131 --- /dev/null +++ b/install/desktop/plasma5/complements @@ -0,0 +1,59 @@ +#!/bin/bash +. ./lib + +options=() +#options+=("sddm-kcm" "" off) +options+=("networkmanager" "" on) +options+=("partitionmanager" "" on) +options+=("kmix" "" on) +#plasma-nm +#muon (package manager) +#options+=("kdesu" "" on) +#options+=("kdesu4" "" on) +options+=("gnome-keyring" "" on) +#options+=("konsolepart4" "" on) +#options+=("octopi" "(AUR)" on) +#options+=("kde-gtk-config" "" on) +#options+=("oxygen-gtk2" "" on) +#options+=("oxygen-gtk3-git" "(AUR)" off) +#options+=("breeze-kde4" "" on) +#options+=("breeze" "" on) +#options+=("archlinux-themes-kdm" "" on) +#options+=("numlockx" "" on) +#options+=("kdeconnect" "" off) +#options+=("kdeconnect+sshfs" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Plasma Complements :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"octopi"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + '"oxygen-gtk3-git"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"networkmanager"') + systemctl disable dhcpcd + if (svcenable NetworkManager) then + svcdisable dhcpd + fi + ;; + '"numlockx"') + if ( confirm "Add numlockx on to /usr/share/config/kdm/Xsetup ?" ) then + echo "numlockx on" >> /usr/share/config/kdm/Xsetup + fi + ;; + esac +done + +exit 0 diff --git a/install/desktop/plasma5/kdeapps b/install/desktop/plasma5/kdeapps new file mode 100644 index 0000000..15a0b91 --- /dev/null +++ b/install/desktop/plasma5/kdeapps @@ -0,0 +1,89 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(pacman -Sqg kde-applications) +for item in $items; do + case $item in + "dolphin" | \ + "kdepasswd" | \ + "kdialog" | \ + "kfind" | \ + "workspace" | \ + "ksystemlog" | \ + "kuser" | \ + "ark" | \ + "kwalletmanager" | \ + "kgamma" | \ + "ksnapshot" | \ + "okular" | \ + "audiocd-kio" | \ + "ffmpegthumbs" | \ + "mplayerthumbs" | \ + "filesharing" | \ + "zeroconf-ioslave" | \ + "kate" | \ + "thumbnailers" | \ + "kdebase-dolphin" | \ + "kdebase-kdepasswd" | \ + "kdebase-kdialog" | \ + "kdebase-kfind" | \ + "kdebase-workspace" | \ + "konsole" | \ + "kwrite" | \ + "kcron" | \ + "kdeadmin-ksystemlog" | \ + "kdeadmin-kuser" | \ + "kdeutils-ark" | \ + "kdeutils-kwalletmanager" | \ + "kcalc" | \ + "kcharselect" | \ + "print-manager" | \ + "kdegraphics-kgamma" | \ + "kdegraphics-ksnapshot" | \ + "kdegraphics-okular" | \ + "kdemultimedia-audiocd-kio" | \ + "kdemultimedia-ffmpegthumbs" | \ + "kdemultimedia-mplayerthumbs" | \ + "kdenetwork-filesharing" | \ + "kdenetwork-zeroconf-ioslave" | \ + "kate" | \ + "kdesdk-thumbnailers" | \ + "kdeartwork-"*) options+=("$item" "" on);; + "akregator" | \ + "kaddressbook" | \ + "kalarm" | \ + "kleopatra" | \ + "kmail" | \ + "knotes" | \ + "kontact" | \ + "korganizer" | \ + "kdepim-akregator" | \ + "kdepim-kaddressbook" | \ + "kdepim-kalarm" | \ + "kdepim-kleopatra" | \ + "kdepim-kmail" | \ + "kdepim-knotes" | \ + "kdepim-kontact" | \ + "kdepim-korganizer" | \ + "kdeartwork-"*) options+=("$item" "(recommended)" off);; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/plasma5/kdeplasma b/install/desktop/plasma5/kdeplasma new file mode 100644 index 0000000..699fd74 --- /dev/null +++ b/install/desktop/plasma5/kdeplasma @@ -0,0 +1,29 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(pacman -Ssq kdeplasma-) +for item in $items; do + case $item in + "kdeplasma-addons-applets-icontasks" | \ + "kdeplasma-applets-plasma-nm") options+=("$item" "" on);; + *) options+=("$item" "" off);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "KDE Plasma :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/plasma5/menu b/install/desktop/plasma5/menu new file mode 100644 index 0000000..fcc5db7 --- /dev/null +++ b/install/desktop/plasma5/menu @@ -0,0 +1,29 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Plasma Packages" "") +#options+=("Plasma Meta Full" "pacman -S plasma-meta") +#options+=("Plasma Full" "pacman -S plasma") +options+=("KDE Apps" "") +options+=("Complements" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Plasma5 Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Plasma Packages') menu install/desktop/plasma5/plasma-packages;; + 'Plasma Meta Full') instpkg "plasma-meta" "";; + 'Plasma Full') instpkg "plasma" "";; + 'KDE Plasma') script install/desktop/plasma5/kdeplasma;; + 'KDE Apps') menu install/desktop/plasma5/kdeapps;; + 'Complements') script install/desktop/plasma5/complements;; +esac + +exit 0 diff --git a/install/desktop/plasma5/plasma-packages b/install/desktop/plasma5/plasma-packages new file mode 100644 index 0000000..8bafed2 --- /dev/null +++ b/install/desktop/plasma5/plasma-packages @@ -0,0 +1,29 @@ +#!/bin/bash +. ./lib + +options=() + +package="plasma" +items=$(pacman -Sqg $package) +for item in $items; do + case $item in + "plasma-mediacenter") options+=("$item" "" off);; + *) options+=("$item" "" on);; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/desktop/xfce4/complements b/install/desktop/xfce4/complements new file mode 100644 index 0000000..65ccc7b --- /dev/null +++ b/install/desktop/xfce4/complements @@ -0,0 +1,28 @@ +#!/bin/bash +. ./lib + +options=() +options+=("gksu" "" on) +options+=("gvfs" "" on) +options+=("gvfs-afc" "" on) +options+=("udisks" "" on) +options+=("network-manager-applet" "" on) + +sel=$(whiptail --backtitle "$apptitle" --title "XFCE4 Complements :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +pressanykey + +exit 0 diff --git a/install/desktop/xfce4/menu b/install/desktop/xfce4/menu new file mode 100644 index 0000000..6161b7e --- /dev/null +++ b/install/desktop/xfce4/menu @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() +options+=("xfce4" "") +options+=("xfce4-goodies" "") +options+=("Complements" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "XFCE4 Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'xfce4') + require install/desktop/xfce4/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/xfce4/packages + script install/desktop/xfce4/packages + ;; + 'xfce4-goodies') + require install/desktop/xfce4/packages 755 + sed -i "/^package=/c\package=\"$sel\"" install/desktop/xfce4/packages + script install/desktop/xfce4/packages + ;; + 'Complements') script install/desktop/xfce4/complements;; +esac + +exit 0 diff --git a/install/desktop/xfce4/packages b/install/desktop/xfce4/packages new file mode 100644 index 0000000..f72fefe --- /dev/null +++ b/install/desktop/xfce4/packages @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() + +package="" +items=$(pacman -Sqg $package) +for item in $items; do + options+=("$item" "" on) +done + +sel=$(whiptail --backtitle "$apptitle" --title "$package Install :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/displaymngr/menu b/install/displaymngr/menu new file mode 100644 index 0000000..c271783 --- /dev/null +++ b/install/displaymngr/menu @@ -0,0 +1,53 @@ +#!/bin/bash +. ./lib + +options=() +options+=("kdm" "KDE Login") +options+=("gdm" "Gnome Login") +options+=("sddm" "QT5 Login") +options+=("lxdm" "LXDE Login") +options+=("lightdm-gtk-greeter" "Other Login") +#options+=("lightdm-kde-greeter" "Other Login") +options+=("slim" "Other Login") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Install Display Manager Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + "kdm") + instpkg kdebase-workspace + svcenable kdm + ;; + "gdm") + instpkg gdm + svcenable gdm + ;; + "sddm") + instpkg sddm + svcenable sddm + ;; + "lxdm") + instpkg lxdm + svcenable lxdm + ;; + "lightdm-gtk-greeter") + instpkg lightdm-gtk-greeter + svcenable lightdm + ;; + "lightdm-kde-greeter") + instpkg lightdm-kde-greeter + svcenable lightdm + ;; + "slim") + instpkg slim + svcenable slim + ;; +esac + +exit 0 diff --git a/install/menu b/install/menu new file mode 100644 index 0000000..bb3d75b --- /dev/null +++ b/install/menu @@ -0,0 +1,30 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Console" "") +options+=("System" "") +options+=("XOrg" "") +options+=("Desktop Environment" "") +options+=("Display Manager" "") +options+=("Applications" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + "Console") script install/console/menu;; + "System") menu install/system/menu;; + "XOrg") menu install/xorg/menu;; + "Display Manager") menu install/displaymngr/menu;; + "Desktop Environment") menu install/desktop/menu;; + "Applications") menu install/apps/menu;; +esac + +exit 0 diff --git a/install/system/filesystem b/install/system/filesystem new file mode 100644 index 0000000..033870c --- /dev/null +++ b/install/system/filesystem @@ -0,0 +1,46 @@ +#!/bin/bash +. ./lib + +options=() +options+=("os-prober" "Detect OS for multi-boot (grub)" off) +options+=("snapper" "snapshot manager (ext4, lvm, btrfs)" off) +options+=("dosfstools" "FAT32 file support (Windows Drives)" on) +options+=("ntfs-3g" "NTFS file support (Windows Drives)" on) +options+=("btrfs-progs" "BTRFS file utils" on) +options+=("gptfdisk" "" on) +options+=("autofs" "" on) +options+=("fuse" "" on) +options+=("fuseiso" "" on) +options+=("samba" "" off) +options+=("nfs-utils" "" off) +options+=("open-iscsi" "" off) +options+=("sshfs" "" off) +#options+=("mtpfs" "" off) +#options+=("unionfs-fuse" "" off) +#options+=("glusterfs" "" off) +#options+=("fuse-exfat" "" off) +#options+=("exfat-utils" "" off) +#options+=("f2fs-tools" "" off) +#options+=("nilfs-utils" "" off) +#options+=("favfs2" "" off) +#options+=("gnome-vfs" "" off) +#options+=("s3fs-fuse" "" off) +#options+=("hfsprogs" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "File System Install" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/system/menu b/install/system/menu new file mode 100644 index 0000000..5c312c4 --- /dev/null +++ b/install/system/menu @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Services" "") +options+=("File System" "") +options+=("Sound" "") +options+=("Print" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "System Install Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Services') script install/system/services/menu;; + 'File System') script install/system/filesystem;; + 'Sound') script install/system/sound/sound;; + 'Print') script install/system/print;; +esac + +exit 0 diff --git a/install/system/print b/install/system/print new file mode 100644 index 0000000..465c974 --- /dev/null +++ b/install/system/print @@ -0,0 +1,40 @@ +#!/bin/bash +. ./lib + +options=() +options+=("cups" "Print support" on) +options+=("ghostscript" "" on) +options+=("cups-pdf" "" on) +options+=("hplip" "" off) +options+=("gutenprint" "" off) +options+=("foomatic-db" "" off) +options+=("foomatic-db-engine" "" off) +options+=("foomatic-db-nonfree" "" off) +#options+=("system-config-printer" "" off) + +sel=$(whiptail --backtitle "$apptitle" --title "System Print Install" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"cups"') svcenable org.cups.cupsd cups;; + '"cups-pdf"') + #if (confirm "Add a PDF Printer ?") then + + #fi + #Redirect target folder + ;; + esac +done + +exit 0 diff --git a/install/system/services/menu b/install/system/services/menu new file mode 100644 index 0000000..562ab55 --- /dev/null +++ b/install/system/services/menu @@ -0,0 +1,87 @@ +#!/bin/bash +. ./lib + +options=() +options+=("networkmanager" "Network Management" on) +options+=("openssh" "Server SSH" on) +options+=("cronie" "Cron tasks server" on) +options+=("ntp" "Client NTP for clock sync" on) +options+=("numlockon" "numlock on on tty" on) +options+=("net-snmp" "SNMP Server" off) +options+=("syslog-ng" "" off) +#options+=("rsyslog" "" off) +#options+=("systemd-readahead" "(AUR) boot improvement" off) + +sel=$(whiptail --backtitle "$apptitle" --title "Services Install" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"numlockon"') ;; + '"systemd-readahead"') aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"networkmanager"') + systemctl disable dhcpcd + if (svcenable NetworkManager) then + svcdisable dhcpd + fi + ;; + '"openssh"') + svcenable sshd "SSH Server" + ;; + '"cronie"') + svcenable cronie + ;; + '"ntp"') + svcenable ntpd "NTP Server" + ;; + '"numlockon"') script install/system/services/numlockon;; + '"syslog-ng"') + #echo "ForwardToSyslog=yes" >> /etc/systemd/journald.conf + systemctl enable syslog-ng + ;; + '"rsyslog"') + systemctl enable rsyslog + ;; + '"net-snmp"') + if (confirm "Create and edit /etc/snmp/snmpd.conf ?") then + mkdir /etc/snmp > /dev/null + echo "# SNMP Server Config" > /etc/snmp/snmpd.conf + echo "# ------------------" >> /etc/snmp/snmpd.conf + echo "" >> /etc/snmp/snmpd.conf + echo "# SNMP 1 and 2" >> /etc/snmp/snmpd.conf + echo "#rocommunity read_only_user" >> /etc/snmp/snmpd.conf + echo "#rwcommunity read_write_user" >> /etc/snmp/snmpd.conf + echo "" >> /etc/snmp/snmpd.conf + echo "# SNMP 3" >> /etc/snmp/snmpd.conf + echo "#rouser read_only_user" >> /etc/snmp/snmpd.conf + nano /etc/snmp/snmpd.conf + fi + if (confirm "Create and edit /var/net-snmp/snmpd.conf (for SNMPv3) ?") then + mkdir -p /var/net-snmp/ > /dev/null + echo "# Note : Clear text password will be encrypted when you restart snmpd." > /var/net-snmp/snmpd.conf + echo "" >> /var/net-snmp/snmpd.conf + echo "#createUser read_only_user SHA password1 AES password2" >> /var/net-snmp/snmpd.conf + nano /var/net-snmp/snmpd.conf + fi + svcenable snmpd "SNMP Server" + ;; + '"systemd-readahead"') + svcenable systemd-readahead + ;; + esac +done + +exit 0 diff --git a/install/system/services/numlockon b/install/system/services/numlockon new file mode 100644 index 0000000..fc0a1ed --- /dev/null +++ b/install/system/services/numlockon @@ -0,0 +1,18 @@ +#!/bin/bash +. ./lib + +if (confirm "numlockon is a custom service created by this script.\nIt call ""setleds -D +num"" on tty1 to tty6.\n\nCreate /etc/systemd/system/numlockon.service ?") then + cat > /etc/systemd/system/numlockon.service << "EOF" +[Unit] +Description=Switch on numlock from tty1 to tty6 + +[Service] +ExecStart=/bin/bash -c 'for tty in /dev/tty{1..6};do /usr/bin/setleds -D +num < \"$tty\";done' + +[Install] +WantedBy=multi-user.target +EOF + svcenable numlockon +fi + +exit 0 diff --git a/install/system/sound/sound b/install/system/sound/sound new file mode 100644 index 0000000..57f0c4e --- /dev/null +++ b/install/system/sound/sound @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() +options+=("alsa-utils" "Sound support" on) +options+=("alsa-plugins" "Extra alsa plugins" on) +#options+=("lib32-alsa-plugins" "Extra alsa plugins" on) +options+=("pulseaudio" "Sound server" on) +options+=("pulseaudio-alsa" "ALSA Configuration for PulseAudio" on) + +sel=$(whiptail --backtitle "$apptitle" --title "System Sound Install" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/xorg/complements/complements b/install/xorg/complements/complements new file mode 100644 index 0000000..ab4a429 --- /dev/null +++ b/install/xorg/complements/complements @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() +#options+=("numlockx" "" on) + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg Complements :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +for itm in $sel; do + case $itm in + '"numlockx"') + if ( confirm "Add numlockx on to /usr/share/config/kdm/Xsetup ?" ) then + echo "numlockx on" >> /usr/share/config/kdm/Xsetup + fi + ;; + esac +done + +exit 0 diff --git a/install/xorg/fonts/default b/install/xorg/fonts/default new file mode 100644 index 0000000..d2c503e --- /dev/null +++ b/install/xorg/fonts/default @@ -0,0 +1,32 @@ +#!/bin/bash +. ./lib + +options=() +options+=("artwiz-fonts" "" on) +options+=("font-bh-ttf" "" on) +options+=("font-bitstream-speedo" "" on) +options+=("gsfonts" "" on) +options+=("sdl_ttf" "" on) +options+=("ttf-bitstream-vera" "" on) +options+=("ttf-cheapskate" "" on) +options+=("ttf-dejavu" "" on) +options+=("ttf-liberation" "" on) +options+=("xorg-fonts-type1" "" on) + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg Default Fonts :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/xorg/fonts/menu b/install/xorg/fonts/menu new file mode 100644 index 0000000..717a7eb --- /dev/null +++ b/install/xorg/fonts/menu @@ -0,0 +1,22 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Default" "") +options+=("TTF" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "XOrg Fonts Install Menu" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Default') script install/xorg/fonts/default;; + 'TTF') script install/xorg/fonts/ttf;; +esac + +exit 0 diff --git a/install/xorg/fonts/ttf b/install/xorg/fonts/ttf new file mode 100644 index 0000000..16c6288 --- /dev/null +++ b/install/xorg/fonts/ttf @@ -0,0 +1,29 @@ +#!/bin/bash +. ./lib + +options=() +options+=("ttf-ms-fonts" "(AUR)" off) + +items=$(pacman -Ssq ttf-) +for item in $items; do + options+=("$item" "" off) +done + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg TTF :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"ttf-ms-fonts"') aurpkg="$aurpkg ttf-ms-fonts";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/xorg/input-drivers/input-drivers b/install/xorg/input-drivers/input-drivers new file mode 100644 index 0000000..c11ba6c --- /dev/null +++ b/install/xorg/input-drivers/input-drivers @@ -0,0 +1,47 @@ +#!/bin/bash +. ./lib + +options=() + +items=$(pacman -Ssq xf86-input) +for item in $items; do + case $item in + "xf86-input-keyboard") options+=("$item" "" on);; + "xf86-input-mouse") options+=("$item" "" on);; + "xf86-input-synaptics") options+=("$item" "(For Most TrackPad)" off);; + "xf86-input-vmmouse") options+=("$item" "(VMWare)" off);; + *) options+=("$item" "" off);; + esac +done + +options+=("Saitek-R.A.T.3" "(Not tested)" off) +options+=("Madcatz-R.A.T.3" "(Not tested)" off) +options+=("Madcatz-R.A.T.5" "(Not tested)" off) +options+=("Madcatz-R.A.T.7" "" off) +options+=("Madcatz-R.A.T.9" "(Not tested)" off) +options+=("Madcatz-R.A.T.TE" "(Not tested)" off) + + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg input drivers :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + '"Saitek-R.A.T.3"') script install/xorg/input-drivers/saitekrat3;; + '"Madcatz-R.A.T.3"') script install/xorg/input-drivers/madcatzrat3;; + '"Madcatz-R.A.T.5"') script install/xorg/input-drivers/madcatzrat5;; + '"Madcatz-R.A.T.7"') script install/xorg/input-drivers/madcatzrat7;; + '"Madcatz-R.A.T.9"') script install/xorg/input-drivers/madcatzrat9;; + '"Madcatz-R.A.T.TE"') script install/xorg/input-drivers/madcatzratte;; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/xorg/input-drivers/madcatzrat3 b/install/xorg/input-drivers/madcatzrat3 new file mode 100644 index 0000000..35bce5b --- /dev/null +++ b/install/xorg/input-drivers/madcatzrat3 @@ -0,0 +1,15 @@ +#!/bin/bash +. ./lib + +if ( confirm "MadCatz Mad R.A.T.3 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzrat3.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzrat3.conf +Section "InputClass" + Identifier "Madcatz Mad Catz R.A.T.3" + MatchProduct "Madcatz Mad Catz R.A.T.3 Mouse" + MatchDevicePath "/dev/input/event*" + Option "ButtonMapping" "1 2 3 4 5 6 7 8 9 0 0 0 13 14 15 16 17 18" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/input-drivers/madcatzrat5 b/install/xorg/input-drivers/madcatzrat5 new file mode 100644 index 0000000..87e7a6c --- /dev/null +++ b/install/xorg/input-drivers/madcatzrat5 @@ -0,0 +1,18 @@ +#!/bin/bash +. ./lib + +if ( confirm "MadCatz Mad R.A.T.5 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzrat5.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzrat5.conf +Section "InputClass" + Identifier "Madcatz Mad Catz R.A.T.5" + MatchProduct "Madcatz Mad Catz R.A.T.5 Mouse" + MatchDevicePath "/dev/input/event*" + Option "Buttons" "21" + Option "ButtonMapping" "1 2 3 4 5 0 0 11 10 7 6 8 0 0 0 0" + Option "ZAxisMapping" "4 5 11 10" + Option "AutoReleaseButtons" "13 14 15" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/input-drivers/madcatzrat7 b/install/xorg/input-drivers/madcatzrat7 new file mode 100644 index 0000000..8815d9d --- /dev/null +++ b/install/xorg/input-drivers/madcatzrat7 @@ -0,0 +1,18 @@ +#!/bin/bash +. ./lib + +if ( confirm "MadCatz R.A.T.7 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzrat7.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzrat7.conf +Section "InputClass" + Identifier "Mad Catz R.A.T.7" + MatchProduct "Mad Catz R.A.T.7 Mouse" + MatchDevicePath "/dev/input/event*" + Option "Buttons" "17" + Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17" + Option "AutoReleaseButtons" "13 14 15" + Option "ZAxisMapping" "4 5 6 7" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/input-drivers/madcatzrat9 b/install/xorg/input-drivers/madcatzrat9 new file mode 100644 index 0000000..5f9f9b2 --- /dev/null +++ b/install/xorg/input-drivers/madcatzrat9 @@ -0,0 +1,18 @@ +#!/bin/bash +. ./lib + +if ( confirm "MadCatz R.A.T.9 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzrat9.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzrat9.conf +Section "InputClass" + Identifier "Mad Catz R.A.T.9" + MatchProduct "Mad Catz R.A.T.9 Mouse" + MatchDevicePath "/dev/input/event*" + Option "Buttons" "17" + Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 7 6 12 0 0 0 16 17" + Option "AutoReleaseButtons" "13 14 15" + Option "ZAxisMapping" "4 5 6 7" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/input-drivers/madcatzratte b/install/xorg/input-drivers/madcatzratte new file mode 100644 index 0000000..5bb5c54 --- /dev/null +++ b/install/xorg/input-drivers/madcatzratte @@ -0,0 +1,16 @@ +#!/bin/bash +. ./lib + +if ( confirm "MadCatz Mad R.A.T.TE patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-madcatzratte.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-madcatzratte.conf +Section "InputClass" + Identifier "Mad Catz Mad Catz R.A.T.TE" + MatchProduct "Mad Catz Mad Catz R.A.T.TE" + MatchDevicePath "/dev/input/event*" + Option "ButtonMapping" " 1 2 3 4 5 6 7 8 9 10 11 12 0 0 0" + Option "ZAxisMapping" "4 5 6 7" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/input-drivers/saitekrat3 b/install/xorg/input-drivers/saitekrat3 new file mode 100644 index 0000000..1e25f7e --- /dev/null +++ b/install/xorg/input-drivers/saitekrat3 @@ -0,0 +1,15 @@ +#!/bin/bash +. ./lib + +if ( confirm "Saitek Cyborg R.A.T.3 patch for xorg. This correct the stop working mouse bug after start X session.\n\nCreate /usr/share/X11/xorg.conf.d/50-saitekrat3.conf ?" ) then +cat << EOF > /usr/share/X11/xorg.conf.d/50-saitekrat3.conf +Section "InputClass" + Identifier "Saitek Cyborg R.A.T.3" + MatchProduct "Saitek Cyborg R.A.T.3 Mouse" + MatchDevicePath "/dev/input/event*" + Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 0 0 0 13 14" +EndSection +EOF +fi + +exit 0 diff --git a/install/xorg/install b/install/xorg/install new file mode 100644 index 0000000..9a2d785 --- /dev/null +++ b/install/xorg/install @@ -0,0 +1,36 @@ +#!/bin/bash +. ./lib + +options=() +options+=("xorg-server" "" on) +options+=("xorg-xinit" "" on) +options+=("xorg-utils" "" on) + +items=$(pacman -Ssq xorg-) +for item in $items; do + case $item in + "xorg-server") ;; + "xorg-xinit") ;; + "xorg-utils") ;; + *) + if [ ! "$(echo $item | cut -d '-' -f 1)" = "xf86" ]; then + options+=("$item" "" off) + fi + ;; + esac +done + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg packages :" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/install/xorg/menu b/install/xorg/menu new file mode 100644 index 0000000..23718ee --- /dev/null +++ b/install/xorg/menu @@ -0,0 +1,28 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Install" "") +options+=("Fonts" "") +options+=("Input Drivers" "") +options+=("Video Drivers" "") +#options+=("Complements" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "XOrg Install Menu" --menu "" --default-item "$defaultitem" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + 'Install') script install/xorg/install;; + 'Fonts') menu install/xorg/fonts/menu;; + 'Input Drivers') script install/xorg/input-drivers/input-drivers;; + 'Video Drivers') script install/xorg/video-drivers/video-drivers;; + 'Complements') script install/xorg/complements/complements;; +esac + +exit 0 diff --git a/install/xorg/video-drivers/video-drivers b/install/xorg/video-drivers/video-drivers new file mode 100644 index 0000000..a018bcb --- /dev/null +++ b/install/xorg/video-drivers/video-drivers @@ -0,0 +1,37 @@ +#!/bin/bash +. ./lib + +gpus=$(lspci | grep -e VGA -e 3D) +whiptail --backtitle "$apptitle" --title "Detected video card" --msgbox "$gpus" 0 0 + +options=() +options+=("virtualbox-guest-utils" "" off) +options+=("nvidia" "" off) +options+=("nvidia-340xx" "" off) +options+=("nvidia-304xx" "" off) +#options+=("catalyst" "(AUR)" off) +#options+=("catalyst-total-hd234k" "(AUR)" off) + +items=$(pacman -Ssq xf86-video) +for item in $items; do + options+=("$item" "" off) +done + +sel=$(whiptail --backtitle "$apptitle" --title "XOrg video drivers :" --checklist "Choose video drivers for your system :" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +for itm in $sel; do + case $itm in + "catalyst" | \ + "catalyst-total-hd234k") aurpkg="$aurpkg $(echo $itm | sed 's/"//g')";; + *) pkg="$pkg $(echo $itm | sed 's/"//g')";; + esac +done + +instpkg "$pkg" "$aurpkg" + +exit 0 diff --git a/lib b/lib new file mode 100644 index 0000000..054f19a --- /dev/null +++ b/lib @@ -0,0 +1,180 @@ +#!/bin/bash + + +# Arch Linux Desktop Install (archdi) +# ----------------------------------- +# author : matmoul[@sourceforge.net] +# license : GPLv3 (http://opensource.org/licenses/GPL-3.0) + + + +apptitle="Arch Linux Desktop Install (archdi) - Version: 2015.06.15.21.37.45 (GPLv3)" +baseurl=https://raw.githubusercontent.com/MatMoul/archdi/master +cachedir=~/.cache/archdi + + + + + +# $1: path +menu(){ + require $1 755 + $cachedir/$1 + if [ $? = 0 ]; then + menu $1 + fi +} + + +# $1: path +script(){ + require $1 755 + $cachedir/$1 +} + + +# $1: pacman packages +# $2: aur packages +instpkg(){ + if [ ! "$1" = "" ]; then + clear + echo "# pacman -S --needed $1" + pacman -S --needed $1 + pressanykey + fi + if [ ! "$2" = "" ]; then + if [ -f /usr/bin/yaourt ]; then + clear + echo "# sudo -u aurbuilder yaourt -S --needed $2" + sudo -u aurbuilder yaourt -S --needed $2 + pressanykey + else + if [ -f /usr/bin/packer ]; then + clear + echo "# sudo -u aurbuilder packer -S $2" + sudo -u aurbuilder packer -S $2 + pressanykey + else + clear + echo "To install AUR packages, you need to install yaourt or packer in updates menu !" + fi + fi + fi +} + + +# $1: string +# $2: [title] +choosepkg(){ + if [ "$2" = "" ]; then + title=$1 + else + title=$2 + fi + options=() + items=$(pacman -Ssq $1) + for item in $items; do + options+=("$item" "" off) + done + sel=$(whiptail --backtitle "$apptitle" --title "$title" --checklist "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) + if [ ! "$?" = "0" ]; then + exit 1 + fi + for itm in $sel; do + pkg="$pkg $(echo $itm | sed 's/"//g')" + done + instpkg "$pkg" "$aurpkg" + exit 0 +} + + +# $1: path +# $2: chmod +require(){ + if [ ! -f "$cachedir/$1" ]; then + path=$(dirname $1) + mkdir -p $cachedir/$path 2> /dev/null + cd $cachedir/$path + wget $baseurl/$1 2> /dev/null + fi + chmod $2 $cachedir/$1 + cd $cachedir +} + + +# $1 : message +# $2 : args +confirm(){ + whiptail --backtitle "$apptitle" --yesno "$1" $2 0 0 +} + + +pressanykey(){ + read -n1 -p "Press any key to continue." +} + + +# $1 : servicename +# $2 : [displayname] +svcstart(){ + if [ "$2" = "" ]; then + displayname="$1" + else + displayname="$2 ($1)" + fi + if (confirm "Start $displayname service ?\n\nsystemctl start $1") then + systemctl start $1 + else + exit 1 + fi +} + +# $1 : servicename +# $2 : [displayname] +svcenable(){ + if [ "$2" = "" ]; then + displayname="$1" + else + displayname="$2 ($1)" + fi + if (confirm "Start $displayname service at boot ?\n\nsystemctl enable $1") then + systemctl enable $1 + else + exit 1 + fi +} + +# $1 : servicename +# $2 : [displayname] +svcdisable(){ + if [ "$2" = "" ]; then + displayname="$1" + else + displayname="$2 ($1)" + fi + if (confirm "Disable $displayname service at boot ?\n\nsystemctl disable $1") then + systemctl disable $1 + else + exit 1 + fi +} + + + +while (( "$#" )); do + case $1 in + --root) + menu menu + exit 0 + ;; + --chroot) + require menu 755 + sed -i "/options+=(\"Shutdown\" \"\")/d" menu + menu menu + exit 0 + ;; + esac + shift +done diff --git a/menu b/menu new file mode 100644 index 0000000..e95a7a3 --- /dev/null +++ b/menu @@ -0,0 +1,26 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Updates" "") +options+=("Install" "") +options+=("Config" "") +options+=("Shutdown" "") + +defaultitem="" +sel=$(whiptail --backtitle "$apptitle" --title "Main Menu :" --menu "" --default-item "$defaultitem" --cancel-button "Exit" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi +sed -i "/^defaultitem=/c\defaultitem=\"$sel\"" $0 + +case $sel in + Updates) menu updates/menu;; + Config) menu config/menu;; + Install) menu install/menu;; + Shutdown) menu shutdown/menu;; +esac + +exit 0 diff --git a/shutdown/menu b/shutdown/menu new file mode 100644 index 0000000..25a22cd --- /dev/null +++ b/shutdown/menu @@ -0,0 +1,28 @@ +#!/bin/bash +. ./lib + +options=() +options+=("Reboot" "") +options+=("Shutdown" "") + +sel=$(whiptail --backtitle "$apptitle" --title "Shutdown Menu :" --menu "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +case $sel in + Reboot) + if (confirm "Reboot now ?" --defaultno) then + reboot + fi + ;; + Shutdown) + if (confirm "Shutdown now ?" --defaultno) then + shutdown now + fi + ;; +esac + +exit 0 diff --git a/updates/menu b/updates/menu new file mode 100644 index 0000000..a521f73 --- /dev/null +++ b/updates/menu @@ -0,0 +1,85 @@ +#!/bin/bash +. ./lib + +options=() +if [ -f /usr/bin/yaourt ]; then + options+=("Upgrade with yaourt" "yaourt -Syua") + aurhelper=1 +fi +if [ -f /usr/bin/packer ]; then + options+=("Upgrade with packer" "packer -Syu") + aurhelper=1 +fi +if [ ! "$aurhelper" = "1" ]; then + options+=("Install yaourt" "") + options+=("Install packer" "") + options+=("" "") +fi +options+=("Upgrade" "pacman -Syu") +options+=("Clean" "pacman -Sc") +options+=("" "") +options+=("Edit pacman.conf" "") +options+=("Edit mirrorlist" "") +options+=("" "") +if [ "$aurhelper" = "1" ]; then + if [ ! -f /usr/bin/yaourt ]; then + options+=("Install yaourt" "") + fi + if [ ! -f /usr/bin/packer ]; then + options+=("Install packer" "") + fi +fi + +sel=$(whiptail --backtitle "$apptitle" --title "Updates Menu :" --menu "" --cancel-button "Back" 0 0 0 \ + "${options[@]}" \ + 3>&1 1>&2 2>&3) +if [ ! "$?" = "0" ]; then + exit 1 +fi + +checkaurdependencies(){ + if [ ! -f /usr/bin/automake ]; then + pacman -S --needed base-devel + fi + if [ ! $(id -u "aurbuilder") ]; then + newpass=$(< /dev/urandom tr -dc "@#*%&_A-Z-a-z-0-9" | head -c16) + useradd -r -N -M -d /home/.aurbuilder -s /usr/bin/nologin aurbuilder + echo -e "$newpass\n$newpass\n"|passwd aurbuilder + echo "aurbuilder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers + echo "root ALL=(aurbuilder) NOPASSWD: ALL" >> /etc/sudoers + newpass="" + fi +} +checkarchlinuxfrrepo(){ + if [ ! $(cat /etc/pacman.conf | grep "archlinuxfr") ]; then + echo "[archlinuxfr]" >> /etc/pacman.conf + echo "SigLevel = Never" >> /etc/pacman.conf + echo 'Server = http://repo.archlinux.fr/$arch' >> /etc/pacman.conf + pacman -Syy + fi +} + +case $sel in + 'Upgrade') pacman -Syu;; + 'Upgrade with yaourt') sudo -u aurbuilder yaourt -Syua;; + 'Upgrade with packer') sudo -u aurbuilder packer -Syu;; + 'Clean') pacman -Sc;; + 'Edit pacman.conf') nano /etc/pacman.conf;; + 'Edit mirrorlist') nano /etc/pacman.d/mirrorlist;; + 'Install yaourt') + if(confirm "Yaourt allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall yaourt ?") then + checkaurdependencies + checkarchlinuxfrrepo + pacman -S --needed yaourt + fi + ;; + 'Install packer') + if(confirm "Packer allow you to access the AUR applications.\nBecause is not possible to compile applications as root,\nthis installer create an aurbuilder user.\n\nInstall packer ?") then + checkaurdependencies + checkarchlinuxfrrepo + pacman -S --needed packer + fi + ;; +esac + +exit 0