unixwz0r

thlinst.c

Sep 16th, 2021 (edited)
857
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 6.73 KB | None | 0 0
  1. /*
  2.  *
  3.  * thlinst.c Arch Linux installer Program
  4.  * gcc thlinst.c -o thlinst  
  5.  * ./thlinst
  6.  * The Tux Hat Linux Project By: Gary Perreault, Vince Ford, Cody & Will.
  7.  * 2013-2021
  8.  *
  9.  *
  10.  * Copyright (c) 2021, The Tux Hat Linux Project Team.
  11.  * All rights reserved.
  12.  *
  13.  * Redistribution and use in source and binary forms, with or without
  14.  * modification, are permitted provided that the following conditions are met:
  15.  *
  16.  * 1. Redistributions of source code must retain the above copyright notice, this
  17.  * list of conditions and the following disclaimer.
  18.  * 2. Redistributions in binary form must reproduce the above copyright notice,
  19.  * this list of conditions and the following disclaimer in the documentation
  20.  * and/or other materials provided with the distribution.
  21.  *
  22.  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  23.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  24.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  25.  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
  26.  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  27.  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  28.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  29.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30.  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  31.  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32.  *
  33.  * The views and conclusions contained in the software and documentation are those
  34.  * of the authors and should not be interpreted as representing official policies,
  35.  * either expressed or implied, of the FreeBSD Project.
  36.  */
  37. #include <unistd.h> // chdir  
  38. #include <errno.h> // strerror
  39. #include <ncurses.h>
  40. #include <stdio.h>
  41. #include <stdlib.h>
  42. #include <sys/utsname.h>
  43. #include <unistd.h>
  44. #include <string.h>
  45. #include <errno.h>
  46. #include <sys/wait.h>
  47. #define RED     "\x1b[31m" // Colours for the logo to make it pretty!
  48. #define GREEN   "\x1b[32m"
  49. #define BLUE    "\x1b[34m"
  50. #define RESET   "\x1b[0m"
  51.  
  52. void print_logo(){
  53.  
  54. printf(GREEN"╔═══════════════════════════════════════════════════════════════════╗\n");
  55. printf(GREEN"║                     Tux Hat Linux Base Installer                  "GREEN"║\n");
  56. printf(GREEN"║                     (c) 2021 - FreeBSD Licensed                   "GREEN"║\n");
  57. printf(GREEN"║                    By: Tux Hat Linux Project Team                 "GREEN"║\n");
  58. printf(GREEN"╚═══════════════════════════════════════════════════════════════════╝"RESET"\n");
  59. printf("\n\n");
  60. printf(BLUE"//**"GREEN"Welcome to Tux Hat Linux Desktop for Arch Linux"BLUE"**//\n");
  61. printf("\n\n");
  62. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  63. getchar();
  64. }
  65. //void network(){
  66. //printf("\n\n");
  67. //printf(BLUE"Arch Linux is about to Pacman Update .. ");
  68. //printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  69. //getchar();
  70. //printf("\n\n");
  71. //system("/usr/bin/iwctl");
  72. //}
  73.  
  74. /* This function does pacman -Syy to update Arch Linux  */
  75. void pacman_update(){
  76. printf("\n\n");
  77. printf(BLUE"//**"GREEN"Arch Linux is about to Pacman Update"BLUE"**//");
  78. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  79. getchar();
  80. printf("\n\n");
  81. system("/usr/bin/sudo /usr/bin/pacman -Syy --noconfirm");
  82. }
  83.  
  84. /* This function does pacman -Syu to upgrade Arch Linux */
  85. void pacman_upgrade(){
  86. printf("\n\n");
  87. printf(BLUE"//**"GREEN"Arch Linux is about to Pacman Upgrade"BLUE"**//");
  88. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  89. getchar();
  90. printf("\n\n");
  91. system("/usr/bin/sudo /usr/bin/pacman -Syu --noconfirm");
  92. }
  93.  
  94. /* This function does pacman -S to all the packages you need for the Skel */
  95. void base_inst(){
  96. printf("\n\n");
  97. printf(BLUE"//**"GREEN"This is the Base Packages for Arch Linux base, base-devel, Grub, Gnome, GDM, Drivers, Kernel, wayland & X11, and extra useful packages"BLUE"**//");
  98. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  99. getchar();
  100. printf("\n\n");
  101. system("/usr/bin/sudo /usr/bin/pacman -S --noconfirm base base-devel linux-firmware ffmpeg lollypop nano gnome wget gdm vlc intel-ucode geany vim intel-media-driver firefox libva-intel-driver openshot mc zsh gimp alsa-utils pulseaudio pulseaudio-bluetooth bluez bluez-utils git neofetch mc tmux scrot grub efibootmgr networkmanager network-manager-applet dialog wpa_supplicant xdg-utils xdg-user-dirs inetutils");
  102. }
  103.  
  104. //** Gnome-terminal themes you can select 1 or choose them ALL needs gogh.sh**//
  105. void gt_theme(){
  106. printf("\n\n");
  107. printf(BLUE"//**"GREEN"Gnome-terminal themes you can select 1 or choose them ALL"BLUE"**//");
  108. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  109. getchar();
  110. printf("\n\n");
  111. system("sh gogh.sh");            
  112. }
  113.  
  114. /* installing yay for archlinux aur*/
  115. void yay_inst(){
  116. printf("\n\n");
  117. printf(BLUE"//**"GREEN"To install packages from AUR you need to install Yay Package Manager"BLUE"**//");
  118. printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  119. getchar();
  120. printf("\n\n");
  121. system("git clone https://aur.archlinux.org/yay.git");            
  122. }
  123.  
  124. // ... cd yay
  125. void cd_yay(){
  126. char *dir = "yay"; // cd to  yay <dir>
  127. int ret;
  128. ret = chdir (dir);
  129. if (ret){ // same as ret!=0, means an error occurred and errno is set
  130.     fprintf(stderr, "error: %s\n", strerror(errno));
  131. }
  132. }
  133.  
  134. //** makepkg yay pkgbuild AUR
  135. void mkpkg_yay(){
  136.  system("/usr/bin/makepkg -sri --noconfirm --needed");
  137. }
  138.  
  139.  
  140. //** Must be in user mode not root to use yay for AUR Packages **//
  141. // void yay_pkg(){
  142. // printf("\n\n");
  143. // printf(BLUE"//**"GREEN"This will install Timeshift and Timeshift Autosnap & Gnome Themes & Extensions"BLUE"**//");
  144. // printf(RED" PLEASE HIT "GREEN"ENTER"RED" TO PROCEED."GREEN"\n");
  145. // getchar();
  146. // system("yay -S timeshift timeshift-autosnap skeuos-gtk-theme-git obs-studio-git gnome-shell-extension-dash-to-dock-gnome40-git");                          
  147. // }
  148. /* This function just thank you for trying out the project ;) */
  149. void thank_you(){
  150.     printf("\n\n");
  151.     printf(BLUE"//**"GREEN"Thank You for trying out Tux Hat Linux"BLUE"**//"RESET"\n");
  152.     printf("\n\n");
  153.    
  154.  
  155. }
  156.  
  157.                      
  158.  
  159. int main( int argc, char **argv ){
  160.  
  161. print_logo();
  162. //network();
  163. pacman_update();
  164. pacman_upgrade();
  165. base_inst();
  166. gt_theme();
  167. yay_inst();
  168. cd_yay();
  169. mkpkg_yay();
  170. // yay_pkg();
  171. thank_you();
  172. return 0;
  173. }
  174.  
Add Comment
Please, Sign In to add comment