├── .github └── workflows │ └── shellcheck.yml ├── .gitignore ├── LICENSE ├── README.md ├── fifo ├── lilo ├── lilo.automode ├── sharedfuncs └── sharedfuncs_elihw /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | name: shellcheck 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | shellcheck: 11 | name: Shellcheck 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Run ShellCheck 16 | uses: ludeeus/action-shellcheck@master 17 | with: 18 | additional_files: "lilo.automode sharedfuncs_elihw" 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ### Jetbrains 2 | .idea/* 3 | 4 | ### Intellij idea 5 | *.iml 6 | 7 | ### VisualStudioCode 8 | .vscode/* 9 | !.vscode/settings.json 10 | !.vscode/tasks.json 11 | !.vscode/launch.json 12 | !.vscode/extensions.json 13 | 14 | ### Local log files 15 | *.log -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Project only accepting patches 2 | This project is not actively developed but *will* accept Pull Requests. 3 | 4 |

5 | Archlinux Ultimate Installer 6 |

7 |

Installation & Configuration of archlinux has never been much easier!

8 | 9 |

10 | 11 | 12 | 13 | 14 | 15 |

16 | 17 | ## Note 18 | * You can first try it in a `VirtualMachine` 19 | 20 | ## Prerequisites 21 | 22 | - A working internet connection 23 | - Logged in as 'root' 24 | 25 | ## Obtaining The Repository 26 | ### With git 27 | - Increase cowspace partition: `mount -o remount,size=2G /run/archiso/cowspace` 28 | - Get list of packages and install git: `pacman -Sy git` 29 | - Get the script: `git clone https://github.com/helmuthdu/aui` 30 | 31 | ### Without git 32 | - Increase cowspace partition: `mount -o remount,size=2G /run/archiso/cowspace` 33 | - Get the script: ` wget https://github.com/helmuthdu/aui/tarball/master -O - | tar xz` 34 | - an alternate URL (for less typing (github shorten)) is ` wget https://git.io/vS1GH -O - | tar xz` 35 | - an alternate URL (for less typing) is ` wget http://bit.ly/NoUPC6 -O - | tar xz` 36 | - super short `wget ow.ly/wnFgh -O aui.zip` 37 | 38 | ## How to use 39 | - FIFO [System Base]: `cd aui ; ./fifo` 40 | - LILO [The Rest]: `cd aui ; ./lilo` 41 | 42 | ## Features 43 | ### FIFO SCRIPT 44 | - Configure keymap 45 | - Select editor 46 | - Automatic configure mirrorlist 47 | - Create partition 48 | - Format device 49 | - Install system base 50 | - Configure fstab 51 | - Configure hostname 52 | - Configure timezone 53 | - Configure hardware clock 54 | - Configure locale 55 | - Configure mkinitcpio 56 | - Install/Configure bootloader 57 | - Configure mirrorlist 58 | - Configure root password 59 | 60 | ### LILO SCRIPT 61 | - Backup all modified files 62 | - Install additional repositories 63 | - Create and configure new user 64 | - Install and configure sudo 65 | - Automatic enable services in systemd 66 | - Install an AUR Helper [trizen, yay...] 67 | - Install Base System 68 | - Install systemd 69 | - Install Preload 70 | - Install Zram 71 | - Install Xorg 72 | - Install GPU Drivers 73 | - Install CUPS 74 | - Install Additional wireless/bluetooth firmwares 75 | - Ensuring access to GIT through a firewall 76 | - Install DE or WM [Cinnamon, Enlightenment, FluxBox, GNOME, i3, KDE, LXDE, OpenBox, XFCE...] 77 | - Install Developement tools [Vim, Emacs, Eclipse...] 78 | - Install Office apps [LibreOffice, GNOME-Office, Latex...] 79 | - Install System tools [Wine, Virtualbox, Grsync, Htop...] 80 | - Install Graphics apps [Inkscape, Gimp, Blender, MComix...] 81 | - Install Internet apps [Firefox, Google-Chrome, Jdownloader...] 82 | - Install Multimedia apps [Rhythmbox, Clementine, Codecs...] 83 | - Install Games [Desura, PlayOnLinux, Steam, Minecraft...] 84 | - Install Fonts [Liberation, MS-Fonts, Google-webfonts...] 85 | - Install and configure Web Servers 86 | - And Many More... 87 | 88 | 89 | ## Thank helmuthdu 90 | If you like my work, please consider a small Paypal donation at helmuthdu@gmail.com :) 91 | 92 | ## License :scroll: 93 | This project is licenced under the GNU General Public License V3. For more information, see the `LICENSE` file or visit https://www.gnu.org/licenses/gpl-3.0.en.html. 94 | -------------------------------------------------------------------------------- /fifo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # FIX THIS ISSUES | NON-ACUTE 3 | #shellcheck disable=SC1091,SC2001,SC2015,SC2153,SC2154,SC2155,SC2181,SC2207 4 | 5 | : 'ATTENTION!: 6 | -------------------------------------------------- 7 | | Created by helmuthdu | 8 | | Shellchecked by uniminin | 9 | | Formatted by molese | 10 | -------------------------------------------------- 11 | This program is free software: you can redistribute it and/or modify 12 | it under the terms of the GNU General Public License as published by 13 | the Free Software Foundation, either version 3 of the License, or 14 | (at your option) any later version. 15 | 16 | This program is distributed in the hope that it will be useful, 17 | but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | GNU General Public License for more details. 20 | 21 | You should have received a copy of the GNU General Public License 22 | along with this program. If not, see . 23 | ------------------------------------------------------------------------ 24 | Run this script after your first boot with archlinux (as root) 25 | ' 26 | 27 | if [[ -f $(pwd)/sharedfuncs ]]; then 28 | source sharedfuncs 29 | else 30 | echo "missing file: sharedfuncs" 31 | exit 1 32 | fi 33 | 34 | #ARCHLINUX INSTALL SCRIPTS MODE {{{ 35 | #SELECT KEYMAP {{{ 36 | select_keymap() { 37 | print_title "KEYMAP - https://wiki.archlinux.org/index.php/KEYMAP" 38 | keymap_list=($(find /usr/share/kbd/keymaps/ -type f -printf "%f\n" | sort -V | sed 's/.map.gz//g')) 39 | PS3="$prompt1" 40 | print_info "The KEYMAP variable is specified in the /etc/rc.conf file. It defines what keymap the keyboard is in the virtual consoles. Keytable files are provided by the kbd package." 41 | echo "keymap list in /usr/share/kbd/keymaps" 42 | select KEYMAP in "${keymap_list[@]}"; do 43 | if contains_element "$KEYMAP" "${keymap_list[@]}"; then 44 | loadkeys "$KEYMAP" 45 | break 46 | else 47 | invalid_option 48 | fi 49 | done 50 | } 51 | #}}} 52 | #DEFAULT EDITOR {{{ 53 | select_editor() { 54 | print_title "DEFAULT EDITOR" 55 | editors_list=("emacs" "nano" "vi" "vim" "neovim" "zile") 56 | PS3="$prompt1" 57 | echo -e "Select editor\n" 58 | select EDITOR in "${editors_list[@]}"; do 59 | if contains_element "$EDITOR" "${editors_list[@]}"; then 60 | package_install "$EDITOR" 61 | break 62 | else 63 | invalid_option 64 | fi 65 | done 66 | } 67 | #}}} 68 | #MIRRORLIST {{{ 69 | configure_mirrorlist() { 70 | # Modified from: https://stackoverflow.com/a/24628676 71 | SAVEIFS=$IFS 72 | IFS=$'\n' 73 | #`reflector --list-countries | sed 's/[0-9]//g' | sed 's/\s*$//g' | sed -r 's/(.*) /\1./' | cut -d '.' -f 1 | sed 's/\s*$//g'` 74 | local countries_name=($( (reflector --list-countries) | sed 's/[0-9]//g' | sed 's/\s*$//g' | sed -r 's/(.*) /\1./' | cut -d '.' -f 1 | sed 's/\s*$//g')) 75 | IFS=$SAVEIFS 76 | country_list() { 77 | PS3="$prompt1" 78 | echo "Select your country:" 79 | select country_name in "${countries_name[@]}"; do 80 | if contains_element "$country_name" "${countries_name[@]}"; then 81 | break 82 | else 83 | invalid_option 84 | fi 85 | done 86 | } 87 | print_title "MIRRORLIST - https://wiki.archlinux.org/index.php/Mirrors" 88 | print_info "This option is a guide to selecting and configuring your mirrors, and a listing of current available mirrors." 89 | OPTION=n 90 | while [[ $OPTION != y ]]; do 91 | country_list 92 | read_input_text "Confirm country: $country_name" 93 | done 94 | 95 | # Backup and replace current mirrorlist file. 96 | echo " Backing up the original mirrorlist..." 97 | mv -i /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.orig 98 | 99 | # Get fastest mirrors of the country by Reflector. 100 | echo " Fetching mirrors located in $country_name..." 101 | reflector --country "$country_name" --sort rate --protocol http --protocol https --save /etc/pacman.d/mirrorlist 102 | 103 | # allow global read access (required for non-root yaourt execution) 104 | chmod +r /etc/pacman.d/mirrorlist 105 | 106 | # Final touches to mirrorlist by $EDITOR 107 | $EDITOR /etc/pacman.d/mirrorlist 108 | } 109 | #}}} 110 | #UMOUNT PARTITIONS {{{ 111 | umount_partitions() { 112 | mounted_partitions=($(lsblk | grep "${MOUNTPOINT}" | awk '{print $7}' | sort -r)) 113 | swapoff -a 114 | for i in "${mounted_partitions[@]}"; do 115 | umount "$i" 116 | done 117 | } 118 | #}}} 119 | #SELECT DEVICE {{{ 120 | select_device() { 121 | devices_list=($(lsblk -d | awk '{print "/dev/" $1}' | grep 'sd\|hd\|vd\|nvme\|mmcblk')) 122 | PS3="$prompt1" 123 | echo -e "Attached Devices:\n" 124 | lsblk -lnp -I 2,3,8,9,22,34,56,57,58,65,66,67,68,69,70,71,72,91,128,129,130,131,132,133,134,135,259 | awk '{print $1,$4,$6,$7}' | column -t 125 | echo -e "\n" 126 | echo -e "Select device to partition:\n" 127 | select device in "${devices_list[@]}"; do 128 | if contains_element "${device}" "${devices_list[@]}"; then 129 | break 130 | else 131 | invalid_option 132 | fi 133 | done 134 | BOOT_MOUNTPOINT=$device 135 | } 136 | #}}} 137 | #CREATE PARTITION SCHEME {{{ 138 | create_partition_scheme() { 139 | LUKS=0 140 | LVM=0 141 | print_title "https://wiki.archlinux.org/index.php/Partitioning" 142 | print_info "Partitioning a hard drive allows one to logically divide the available space into sections that can be accessed independently of one another." 143 | print_warning "Maintain Current does not work with LUKS" 144 | partition_layouts=("Default" "LVM" "LVM+LUKS" "Maintain Current") 145 | PS3="$prompt1" 146 | echo -e "Select partition scheme:" 147 | select OPT in "${partition_layouts[@]}"; do 148 | partition_layout=$OPT 149 | case "$REPLY" in 150 | 1) 151 | create_partition 152 | ;; 153 | 2) 154 | create_partition 155 | setup_lvm 156 | ;; 157 | 3) 158 | create_partition 159 | setup_luks 160 | setup_lvm 161 | ;; 162 | 4) 163 | modprobe dm-mod 164 | vgscan &>/dev/null 165 | vgchange -ay &>/dev/null 166 | ;; 167 | *) 168 | invalid_option 169 | ;; 170 | esac 171 | [[ -n $OPT ]] && break 172 | done 173 | } 174 | #}}} 175 | #SETUP PARTITION{{{ 176 | create_partition() { 177 | apps_list=("cfdisk" "cgdisk" "fdisk" "gdisk" "parted") 178 | PS3="$prompt1" 179 | echo -e "Select partition program:" 180 | select OPT in "${apps_list[@]}"; do 181 | if contains_element "$OPT" "${apps_list[@]}"; then 182 | select_device 183 | case $OPT in 184 | parted) 185 | parted -a opt "${device}" 186 | ;; 187 | *) 188 | $OPT "${device}" 189 | ;; 190 | esac 191 | break 192 | else 193 | invalid_option 194 | fi 195 | done 196 | } 197 | #}}} 198 | #SETUP LUKS {{{ 199 | setup_luks() { 200 | print_title "LUKS - https://wiki.archlinux.org/index.php/LUKS" 201 | print_info "The Linux Unified Key Setup or LUKS is a disk-encryption specification created by Clemens Fruhwirth and originally intended for Linux." 202 | print_danger "\tDo not use this for boot partitions" 203 | block_list=($(lsblk | grep 'part' | awk '{print "/dev/" substr($1,3)}')) 204 | PS3="$prompt1" 205 | echo -e "Select partition:" 206 | select OPT in "${block_list[@]}"; do 207 | if contains_element "$OPT" "${block_list[@]}"; then 208 | cryptsetup --cipher aes-xts-plain64 --key-size 512 --hash sha512 --iter-time 5000 --use-random --verify-passphrase luksFormat "$OPT" 209 | if [[ $TRIM -eq 1 ]]; then 210 | cryptsetup open --type luks --allow-discards "$OPT" crypt 211 | else 212 | cryptsetup open --type luks "$OPT" crypt 213 | fi 214 | LUKS=1 215 | LUKS_DISK=$(echo "${OPT}" | sed 's/\/dev\///') 216 | break 217 | elif [[ $OPT == "Cancel" ]]; then 218 | break 219 | else 220 | invalid_option 221 | fi 222 | done 223 | } 224 | #}}} 225 | #SETUP LVM {{{ 226 | setup_lvm() { 227 | print_title "LVM - https://wiki.archlinux.org/index.php/LVM" 228 | print_info "LVM is a logical volume manager for the Linux kernel; it manages disk drives and similar mass-storage devices. " 229 | print_warning "Last partition will take 100% of free space left" 230 | if [[ $LUKS -eq 1 ]]; then 231 | pvcreate /dev/mapper/crypt 232 | vgcreate lvm /dev/mapper/crypt 233 | else 234 | block_list=($(lsblk | grep 'part' | awk '{print "/dev/" substr($1,3)}')) 235 | PS3="$prompt1" 236 | echo -e "Select partition:" 237 | select OPT in "${block_list[@]}"; do 238 | if contains_element "$OPT" "${block_list[@]}"; then 239 | pvcreate "$OPT" 240 | vgcreate lvm "$OPT" 241 | break 242 | else 243 | invalid_option 244 | fi 245 | done 246 | fi 247 | printf "%s" "Enter number of partitions [ex: 2]: " 248 | read -r number_partitions 249 | i=1 250 | while [[ $i -le $number_partitions ]]; do 251 | printf "%s" "Enter $iª partition name [ex: home]: " 252 | read -r partition_name 253 | if [[ $i -eq $number_partitions ]]; then 254 | lvcreate -l 100%FREE lvm -n "${partition_name}" 255 | else 256 | printf "%s" "Enter $iª partition size [ex: 25G, 200M]: " 257 | read -r partition_size 258 | lvcreate -L "${partition_size}" lvm -n "${partition_name}" 259 | fi 260 | i=$((i + 1)) 261 | done 262 | LVM=1 263 | } 264 | #}}} 265 | #SELECT|FORMAT PARTITIONS {{{ 266 | format_partitions() { 267 | print_title "https://wiki.archlinux.org/index.php/File_Systems" 268 | print_info "This step will select and format the selected partition where archlinux will be installed" 269 | print_danger "\tAll data on the ROOT and SWAP partition will be LOST." 270 | i=0 271 | 272 | block_list=($(lsblk | grep 'part\|lvm' | awk '{print substr($1,3)}')) 273 | 274 | # check if there is no partition 275 | if [[ ${#block_list[@]} -eq 0 ]]; then 276 | echo "No partition found" 277 | exit 0 278 | fi 279 | 280 | partitions_list=() 281 | for OPT in "${block_list[@]}"; do 282 | check_lvm=$(echo "$OPT" | grep lvm) 283 | if [[ -z $check_lvm ]]; then 284 | partitions_list+=("/dev/$OPT") 285 | else 286 | partitions_list+=("/dev/mapper/$OPT") 287 | fi 288 | done 289 | 290 | # partitions based on boot system 291 | if [[ $UEFI -eq 1 ]]; then 292 | partition_name=("root" "EFI" "swap" "another") 293 | else 294 | partition_name=("root" "swap" "another") 295 | fi 296 | 297 | select_filesystem() { 298 | filesystems_list=("btrfs" "ext2" "ext3" "ext4" "f2fs" "jfs" "nilfs2" "ntfs" "reiserfs" "vfat" "xfs") 299 | PS3="$prompt1" 300 | echo -e "Select filesystem:\n" 301 | select filesystem in "${filesystems_list[@]}"; do 302 | if contains_element "${filesystem}" "${filesystems_list[@]}"; then 303 | break 304 | else 305 | invalid_option 306 | fi 307 | done 308 | } 309 | 310 | disable_partition() { 311 | #remove the selected partition from list 312 | unset partitions_list["${partition_number}"] 313 | partitions_list=("${partitions_list[@]}") 314 | #increase i 315 | [[ ${partition_name[i]} != another ]] && i=$((i + 1)) 316 | } 317 | 318 | format_partition() { 319 | read_input_text "Confirm format $1 partition" 320 | if [[ $OPTION == y ]]; then 321 | [[ -z $3 ]] && select_filesystem || filesystem=$3 322 | mkfs."${filesystem}" "$1" \ 323 | "$([[ ${filesystem} == xfs || ${filesystem} == btrfs || ${filesystem} == reiserfs ]] && echo "-f")" \ 324 | "$([[ ${filesystem} == vfat ]] && echo "-F32")" \ 325 | "$([[ $TRIM -eq 1 && ${filesystem} == ext4 ]] && echo "-E discard")" 326 | fsck "$1" 327 | mkdir -p "$2" 328 | mount -t "${filesystem}" "$1" "$2" 329 | disable_partition 330 | fi 331 | } 332 | 333 | format_swap_partition() { 334 | read_input_text "Confirm format $1 partition" 335 | if [[ $OPTION == y ]]; then 336 | mkswap "$1" 337 | swapon "$1" 338 | disable_partition 339 | fi 340 | } 341 | 342 | create_swap() { 343 | swap_options=("partition" "file" "skip") 344 | PS3="$prompt1" 345 | echo -e "Select ${BYellow}${partition_name[i]}${Reset} filesystem:\n" 346 | select OPT in "${swap_options[@]}"; do 347 | case "$REPLY" in 348 | 1) 349 | select partition in "${partitions_list[@]}"; do 350 | #get the selected number - 1 351 | partition_number=$((REPLY - 1)) 352 | if contains_element "${partition}" "${partitions_list[@]}"; then 353 | format_swap_partition "${partition}" 354 | fi 355 | break 356 | done 357 | swap_type="partition" 358 | break 359 | ;; 360 | 2) 361 | total_memory=$(grep MemTotal /proc/meminfo | awk '{print $2/1024}' | sed 's/\..*//') 362 | dd if=/dev/zero of="${MOUNTPOINT}"/swapfile bs=1M count="${total_memory}" status=progress 363 | chmod 600 "${MOUNTPOINT}"/swapfile 364 | mkswap "${MOUNTPOINT}"/swapfile 365 | swapon "${MOUNTPOINT}"/swapfile 366 | i=$((i + 1)) 367 | swap_type="file" 368 | break 369 | ;; 370 | 3) 371 | i=$((i + 1)) 372 | swap_type="none" 373 | break 374 | ;; 375 | *) 376 | invalid_option 377 | ;; 378 | esac 379 | done 380 | } 381 | 382 | check_mountpoint() { 383 | if mount | grep "$2"; then 384 | echo "Successfully mounted" 385 | disable_partition "$1" 386 | else 387 | echo "WARNING: Not Successfully mounted" 388 | fi 389 | } 390 | 391 | set_efi_partition() { 392 | efi_options=("/boot/efi" "/boot") 393 | PS3="$prompt1" 394 | echo -e "Select EFI mountpoint:\n" 395 | select EFI_MOUNTPOINT in "${efi_options[@]}"; do 396 | if contains_element "${EFI_MOUNTPOINT}" "${efi_options[@]}"; then 397 | break 398 | else 399 | invalid_option 400 | fi 401 | done 402 | } 403 | 404 | while true; do 405 | PS3="$prompt1" 406 | if [[ ${partition_name[i]} == swap ]]; then 407 | create_swap 408 | else 409 | echo -e "Select ${BYellow}${partition_name[i]}${Reset} partition:\n" 410 | select partition in "${partitions_list[@]}"; do 411 | #get the selected number - 1 412 | partition_number=$((REPLY - 1)) 413 | if contains_element "${partition}" "${partitions_list[@]}"; then 414 | case ${partition_name[i]} in 415 | root) 416 | ROOT_PART=$(echo "${partition}" | sed 's/\/dev\/mapper\///' | sed 's/\/dev\///') 417 | ROOT_MOUNTPOINT=${partition} 418 | format_partition "${partition}" "${MOUNTPOINT}" 419 | ;; 420 | EFI) 421 | set_efi_partition 422 | read_input_text "Format ${partition} partition" 423 | if [[ $OPTION == y ]]; then 424 | format_partition "${partition}" "${MOUNTPOINT}${EFI_MOUNTPOINT}" vfat 425 | else 426 | mkdir -p "${MOUNTPOINT}${EFI_MOUNTPOINT}" 427 | mount -t vfat "${partition}" "${MOUNTPOINT}${EFI_MOUNTPOINT}" 428 | check_mountpoint "${partition}" "${MOUNTPOINT}${EFI_MOUNTPOINT}" 429 | fi 430 | ;; 431 | another) 432 | printf "%s" "Mountpoint [ex: /home]:" 433 | read -r directory 434 | [[ $directory == "/boot" ]] && BOOT_MOUNTPOINT=$(echo "${partition}" | sed 's/[0-9]//') 435 | select_filesystem 436 | read_input_text "Format ${partition} partition" 437 | if [[ $OPTION == y ]]; then 438 | format_partition "${partition}" "${MOUNTPOINT}${directory}" "${filesystem}" 439 | else 440 | read_input_text "Confirm fs=""${filesystem}"" part=""${partition}"" dir=""${directory}""" 441 | if [[ $OPTION == y ]]; then 442 | mkdir -p "${MOUNTPOINT}${directory}" 443 | mount -t "${filesystem}" "${partition}" "${MOUNTPOINT}""${directory}" 444 | check_mountpoint "${partition}" "${MOUNTPOINT}${directory}" 445 | fi 446 | fi 447 | ;; 448 | esac 449 | break 450 | else 451 | invalid_option 452 | fi 453 | done 454 | fi 455 | #check if there is no partitions left 456 | if [[ ${#partitions_list[@]} -eq 0 && ${partition_name[i]} != swap ]]; then 457 | break 458 | elif [[ ${partition_name[i]} == another ]]; then 459 | read_input_text "Configure more partitions" 460 | [[ $OPTION != y ]] && break 461 | fi 462 | done 463 | pause_function 464 | } 465 | #}}} 466 | #INSTALL BASE SYSTEM {{{ 467 | select_linux_version() { 468 | print_title "LINUX VERSION" 469 | version_list=("linux (default)" "linux-lts (long term support)" "linux-hardened (security features)" "linux-zen (tuned kernel)") 470 | PS3="$prompt1" 471 | echo -e "Select linux version to install\n" 472 | select VERSION in "${version_list[@]}"; do 473 | if contains_element "$VERSION" "${version_list[@]}"; then 474 | if [ "linux (default)" == "$VERSION" ]; then 475 | pacstrap "${MOUNTPOINT}" base linux linux-headers 476 | elif [ "linux-lts (long term support)" == "$VERSION" ]; then 477 | pacstrap "${MOUNTPOINT}" base linux-lts linux-lts-headers 478 | elif [ "linux-hardened (security features)" == "$VERSION" ]; then 479 | pacstrap "${MOUNTPOINT}" base linux-hardened linux-hardened-headers 480 | elif [ "linux-zen (tuned kernel)" == "$VERSION" ]; then 481 | pacstrap "${MOUNTPOINT}" base linux-zen linux-zen-headers 482 | fi 483 | pacstrap "${MOUNTPOINT}" \ 484 | cryptsetup lvm2 netctl dhcpcd inetutils jfsutils diffutils e2fsprogs \ 485 | less linux-firmware logrotate man-db man-pages mdadm nano \ 486 | perl reiserfsprogs s-nail sysfsutils texinfo usbutils vi which xfsprogs --needed 487 | break 488 | else 489 | invalid_option 490 | fi 491 | done 492 | } 493 | install_base_system() { 494 | print_title "INSTALL BASE SYSTEM" 495 | print_info "Installing PGP keyring" 496 | pacman -Sy archlinux-keyring 497 | print_info "Using the pacstrap script we install the base system. The base-devel package group will be installed also." 498 | rm "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/vmlinuz-linux 499 | select_linux_version 500 | pacstrap "${MOUNTPOINT}" base-devel parted btrfs-progs f2fs-tools net-tools --needed 501 | [[ $? -ne 0 ]] && error_msg "Installing base system to ${MOUNTPOINT} failed. Check error messages above." 502 | local PTABLE=$(parted -sl | grep "gpt") 503 | [[ -n $PTABLE ]] && pacstrap "${MOUNTPOINT}" gptfdisk --needed 504 | WIRELESS_DEV=$(ip link | grep wl | awk '{print $2}' | sed 's/://' | sed '1!d') 505 | if [[ -n $WIRELESS_DEV ]]; then 506 | pacstrap "${MOUNTPOINT}" iw wireless_tools wpa_supplicant dialog --needed 507 | else 508 | WIRED_DEV=$(ip link | grep "ens\|eno\|enp" | awk '{print $2}' | sed 's/://' | sed '1!d') 509 | if [[ -n $WIRED_DEV ]]; then 510 | arch_chroot "systemctl enable dhcpcd@${WIRED_DEV}.service" 511 | fi 512 | fi 513 | if is_package_installed "espeakup"; then 514 | pacstrap "${MOUNTPOINT}" alsa-utils --needed 515 | arch_chroot "systemctl enable espeakup.service" 516 | fi 517 | } 518 | #}}} 519 | #CONFIGURE KEYMAP {{{ 520 | configure_keymap() { 521 | #ADD KEYMAP TO THE NEW SETUP 522 | echo "KEYMAP=$KEYMAP" >"${MOUNTPOINT}"/etc/vconsole.conf 523 | localectl set-x11-keymap "$KEYMAP" 524 | } 525 | #}}} 526 | #CONFIGURE FSTAB {{{ 527 | configure_fstab() { 528 | print_title "FSTAB - https://wiki.archlinux.org/index.php/Fstab" 529 | print_info "The /etc/fstab file contains static filesystem information. It defines how storage devices and partitions are to be mounted and integrated into the overall system. It is read by the mount command to determine which options to use when mounting a specific partition or partition." 530 | if [[ ! -f ${MOUNTPOINT}/etc/fstab.aui ]]; then 531 | cp "${MOUNTPOINT}"/etc/fstab "${MOUNTPOINT}"/etc/fstab.aui 532 | else 533 | cp "${MOUNTPOINT}"/etc/fstab.aui "${MOUNTPOINT}"/etc/fstab 534 | fi 535 | if [[ $UEFI -eq 1 ]]; then 536 | fstab_list=("DEV" "PARTUUID" "LABEL") 537 | else 538 | fstab_list=("DEV" "UUID" "LABEL") 539 | fi 540 | 541 | PS3="$prompt1" 542 | echo -e "Configure fstab based on:" 543 | select OPT in "${fstab_list[@]}"; do 544 | case "$REPLY" in 545 | 1) genfstab -p "${MOUNTPOINT}" >>"${MOUNTPOINT}"/etc/fstab ;; 546 | 2) 547 | if [[ $UEFI -eq 1 ]]; then 548 | genfstab -t PARTUUID -p "${MOUNTPOINT}" >>"${MOUNTPOINT}"/etc/fstab 549 | else 550 | genfstab -U -p "${MOUNTPOINT}" >>"${MOUNTPOINT}"/etc/fstab 551 | fi 552 | ;; 553 | 3) genfstab -L -p "${MOUNTPOINT}" >>"${MOUNTPOINT}"/etc/fstab ;; 554 | *) invalid_option ;; 555 | esac 556 | [[ -n $OPT ]] && break 557 | done 558 | fstab=$OPT 559 | echo "Review your fstab" 560 | [[ -f ${MOUNTPOINT}/swapfile ]] && sed -i "s/\\${MOUNTPOINT}//" "${MOUNTPOINT}"/etc/fstab 561 | pause_function 562 | $EDITOR "${MOUNTPOINT}"/etc/fstab 563 | } 564 | #}}} 565 | #CONFIGURE HOSTNAME {{{ 566 | configure_hostname() { 567 | print_title "HOSTNAME - https://wiki.archlinux.org/index.php/HOSTNAME" 568 | print_info "A host name is a unique name created to identify a machine on a network.Host names are restricted to alphanumeric characters.\nThe hyphen (-) can be used, but a host name cannot start or end with it. Length is restricted to 63 characters." 569 | printf "%s" "Hostname [ex: archlinux]: " 570 | read -r host_name 571 | echo "$host_name" >"${MOUNTPOINT}"/etc/hostname 572 | if [[ ! -f ${MOUNTPOINT}/etc/hosts.aui ]]; then 573 | cp "${MOUNTPOINT}"/etc/hosts "${MOUNTPOINT}"/etc/hosts.aui 574 | else 575 | cp "${MOUNTPOINT}"/etc/hosts.aui "${MOUNTPOINT}"/etc/hosts 576 | fi 577 | arch_chroot "sed -i '/127.0.0.1/s/$/ '${host_name}'/' /etc/hosts" 578 | arch_chroot "sed -i '/::1/s/$/ '${host_name}'/' /etc/hosts" 579 | } 580 | #}}} 581 | #CONFIGURE TIMEZONE {{{ 582 | configure_timezone() { 583 | print_title "TIMEZONE - https://wiki.archlinux.org/index.php/Timezone" 584 | print_info "In an operating system the time (clock) is determined by four parts: Time value, Time standard, Time Zone, and DST (Daylight Saving Time if applicable)." 585 | OPTION=n 586 | while [[ $OPTION != y ]]; do 587 | settimezone 588 | read_input_text "Confirm timezone (${ZONE}/${SUBZONE})" 589 | done 590 | arch_chroot "ln -sf /usr/share/zoneinfo/${ZONE}/${SUBZONE} /etc/localtime" 591 | arch_chroot "sed -i '/#NTP=/d' /etc/systemd/timesyncd.conf" 592 | arch_chroot "sed -i 's/#Fallback//' /etc/systemd/timesyncd.conf" 593 | arch_chroot "echo \"FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 0.fr.pool.ntp.org\" >> /etc/systemd/timesyncd.conf" 594 | arch_chroot "systemctl enable systemd-timesyncd.service" 595 | } 596 | #}}} 597 | #CONFIGURE HARDWARECLOCK {{{ 598 | configure_hardwareclock() { 599 | print_title "HARDWARE CLOCK TIME - https://wiki.archlinux.org/index.php/Internationalization" 600 | print_info "This is set in /etc/adjtime. Set the hardware clock mode uniformly between your operating systems on the same machine. Otherwise, they will overwrite the time and cause clock shifts (which can cause time drift correction to be miscalibrated)." 601 | hwclock_list=('UTC' 'Localtime') 602 | PS3="$prompt1" 603 | select OPT in "${hwclock_list[@]}"; do 604 | case "$REPLY" in 605 | 1) 606 | arch_chroot "hwclock --systohc --utc" 607 | ;; 608 | 2) 609 | arch_chroot "hwclock --systohc --localtime" 610 | ;; 611 | *) invalid_option ;; 612 | esac 613 | [[ -n $OPT ]] && break 614 | done 615 | hwclock=$OPT 616 | } 617 | #}}} 618 | #CONFIGURE LOCALE {{{ 619 | configure_locale() { 620 | print_title "LOCALE - https://wiki.archlinux.org/index.php/Locale" 621 | print_info "Locales are used in Linux to define which language the user uses. As the locales define the character sets being used as well, setting up the correct locale is especially important if the language contains non-ASCII characters." 622 | OPTION=n 623 | while [[ $OPTION != y ]]; do 624 | setlocale 625 | read_input_text "Confirm locale ($LOCALE)" 626 | done 627 | echo 'LANG="'"$LOCALE_UTF8"'"' >"${MOUNTPOINT}"/etc/locale.conf 628 | arch_chroot "sed -i 's/#\('${LOCALE_UTF8}'\)/\1/' /etc/locale.gen" 629 | arch_chroot "locale-gen" 630 | } 631 | #}}} 632 | #CONFIGURE MKINITCPIO {{{ 633 | configure_mkinitcpio() { 634 | print_title "MKINITCPIO - https://wiki.archlinux.org/index.php/Mkinitcpio" 635 | print_info "mkinitcpio is a Bash script used to create an initial ramdisk environment." 636 | [[ $LUKS -eq 1 ]] && sed -i '/^HOOK/s/block/block keymap encrypt/' "${MOUNTPOINT}"/etc/mkinitcpio.conf 637 | [[ $LVM -eq 1 ]] && sed -i '/^HOOK/s/filesystems/lvm2 filesystems/' "${MOUNTPOINT}"/etc/mkinitcpio.conf 638 | $EDITOR "${MOUNTPOINT}"/etc/mkinitcpio.conf 639 | if [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep hardened -c)" -gt "0" ]; then 640 | arch_chroot "mkinitcpio -p linux-hardened" 641 | elif [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep lts -c)" -gt "0" ]; then 642 | arch_chroot "mkinitcpio -p linux-lts" 643 | elif [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep zen -c)" -gt "0" ]; then 644 | arch_chroot "mkinitcpio -p linux-zen" 645 | else 646 | arch_chroot "mkinitcpio -p linux" 647 | fi 648 | } 649 | #}}} 650 | #INSTALL BOOTLOADER {{{ 651 | install_bootloader() { 652 | print_title "BOOTLOADER - https://wiki.archlinux.org/index.php/Bootloader" 653 | print_info "The boot loader is responsible for loading the kernel and initial RAM disk before initiating the boot process." 654 | print_warning "\tROOT Partition: ${ROOT_MOUNTPOINT}" 655 | if [[ $UEFI -eq 1 ]]; then 656 | print_warning "\tUEFI Mode Detected" 657 | bootloaders_list=("Grub2" "Syslinux" "Systemd" "rEFInd" "Skip") 658 | else 659 | print_warning "\tBIOS Mode Detected" 660 | bootloaders_list=("Grub2" "Syslinux" "Skip") 661 | fi 662 | PS3="$prompt1" 663 | echo -e "Install bootloader:\n" 664 | select bootloader in "${bootloaders_list[@]}"; do 665 | case "$REPLY" in 666 | 1) 667 | pacstrap "${MOUNTPOINT}" grub os-prober --needed 668 | break 669 | ;; 670 | 2) 671 | pacstrap "${MOUNTPOINT}" syslinux gptfdisk --needed 672 | break 673 | ;; 674 | 3) 675 | break 676 | ;; 677 | 4) 678 | if [[ $UEFI -eq 1 ]]; then 679 | pacstrap "${MOUNTPOINT}" refind-efi os-prober --needed 680 | break 681 | else 682 | invalid_option 683 | fi 684 | ;; 685 | 5) 686 | [[ $UEFI -eq 1 ]] && break || invalid_option 687 | ;; 688 | *) 689 | invalid_option 690 | ;; 691 | esac 692 | done 693 | [[ $UEFI -eq 1 ]] && pacstrap "${MOUNTPOINT}" efibootmgr dosfstools --needed 694 | } 695 | #}}} 696 | #CONFIGURE BOOTLOADER {{{ 697 | configure_bootloader() { 698 | case $bootloader in 699 | Grub2) 700 | print_title "GRUB2 - https://wiki.archlinux.org/index.php/GRUB2" 701 | print_info "GRUB2 is the next generation of the GRand Unified Bootloader (GRUB).\nIn brief, the bootloader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to the Linux kernel." 702 | grub_install_mode=("Automatic" "Manual") 703 | PS3="$prompt1" 704 | echo -e "Grub Install:\n" 705 | select OPT in "${grub_install_mode[@]}"; do 706 | case "$REPLY" in 707 | 1) 708 | if [[ $LUKS -eq 1 ]]; then 709 | sed -i -e 's/GRUB_CMDLINE_LINUX="\(.\+\)"/GRUB_CMDLINE_LINUX="\1 cryptdevice=\/dev\/'"${LUKS_DISK}"':crypt"/g' -e 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cryptdevice=\/dev\/'"${LUKS_DISK}"':crypt"/g' "${MOUNTPOINT}"/etc/default/grub 710 | fi 711 | if [[ $UEFI -eq 1 ]]; then 712 | arch_chroot "grub-install --target=x86_64-efi --efi-directory=${EFI_MOUNTPOINT} --bootloader-id=arch_grub --recheck" 713 | else 714 | arch_chroot "grub-install --target=i386-pc --recheck --debug ${BOOT_MOUNTPOINT}" 715 | fi 716 | break 717 | ;; 718 | 2) 719 | arch-chroot "${MOUNTPOINT}" 720 | break 721 | ;; 722 | *) 723 | invalid_option 724 | ;; 725 | esac 726 | done 727 | arch_chroot "grub-mkconfig -o /boot/grub/grub.cfg" 728 | ;; 729 | Syslinux) 730 | print_title "SYSLINUX - https://wiki.archlinux.org/index.php/Syslinux" 731 | print_info "Syslinux is a collection of boot loaders capable of booting from hard drives, CDs, and over the network via PXE. It supports the fat, ext2, ext3, ext4, and btrfs file systems." 732 | syslinux_install_mode=("[MBR] Automatic" "[PARTITION] Automatic" "Manual") 733 | PS3="$prompt1" 734 | echo -e "Syslinux Install:\n" 735 | select OPT in "${syslinux_install_mode[@]}"; do 736 | case "$REPLY" in 737 | 1) 738 | arch_chroot "syslinux-install_update -iam" 739 | if [[ $LUKS -eq 1 ]]; then 740 | sed -i "s/APPEND root=.*/APPEND root=\/dev\/mapper\/${ROOT_PART} cryptdevice=\/dev\/${LUKS_DISK}:crypt ro/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 741 | elif [[ $LVM -eq 1 ]]; then 742 | sed -i "s/sda[0-9]/\/dev\/mapper\/${ROOT_PART}/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 743 | else 744 | sed -i "s/sda[0-9]/${ROOT_PART}/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 745 | fi 746 | print_warning "The partition in question needs to be whatever you have as / (root), not /boot." 747 | pause_function 748 | $EDITOR "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 749 | break 750 | ;; 751 | 2) 752 | arch_chroot "syslinux-install_update -i" 753 | if [[ $LUKS -eq 1 ]]; then 754 | sed -i "s/APPEND root=.*/APPEND root=\/dev\/mapper\/${ROOT_PART} cryptdevice=\/dev\/${LUKS_DISK}:crypt ro/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 755 | elif [[ $LVM -eq 1 ]]; then 756 | sed -i "s/sda[0-9]/\/dev\/mapper\/${ROOT_PART}/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 757 | else 758 | sed -i "s/sda[0-9]/${ROOT_PART}/g" "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 759 | fi 760 | print_warning "The partition in question needs to be whatever you have as / (root), not /boot." 761 | pause_function 762 | $EDITOR "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/syslinux/syslinux.cfg 763 | break 764 | ;; 765 | 3) 766 | print_info "Your boot partition, on which you plan to install Syslinux, must contain a FAT, ext2, ext3, ext4, or Btrfs file system. You should install it on a mounted directory, not a /dev/sdXY partition. You do not have to install it on the root directory of a file system, e.g., with partition /dev/sda1 mounted on /boot you can install Syslinux in the syslinux directory" 767 | echo -e "$prompt3" 768 | print_warning "mkdir /boot/syslinux\nextlinux --install /boot/syslinux " 769 | arch-chroot "${MOUNTPOINT}" 770 | break 771 | ;; 772 | *) 773 | invalid_option 774 | ;; 775 | esac 776 | done 777 | ;; 778 | Systemd) 779 | print_title "SYSTEMD-BOOT - https://wiki.archlinux.org/index.php/Systemd-boot" 780 | print_info "systemd-boot (previously called gummiboot), is a simple UEFI boot manager which executes configured EFI images. The default entry is selected by a configured pattern (glob) or an on-screen menu. It is included with systemd since systemd 220-2." 781 | print_warning "\tSystemd-boot heavily suggests that /boot is mounted to the EFI partition, not /boot/efi, in order to simplify updating and configuration." 782 | gummiboot_install_mode=("Automatic" "Manual") 783 | PS3="$prompt1" 784 | echo -e "Gummiboot install:\n" 785 | select OPT in "${gummiboot_install_mode[@]}"; do 786 | case "$REPLY" in 787 | 1) 788 | arch_chroot "bootctl --path=${EFI_MOUNTPOINT} install" 789 | print_warning "Please check your .conf file" 790 | partuuid=$(blkid -s PARTUUID "${ROOT_MOUNTPOINT}" | awk '{print $2}' | sed 's/"//g' | sed 's/^.*=//') 791 | if [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep hardened -c)" -gt "0" ]; then 792 | img_name="linux-hardened" 793 | elif [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep lts -c)" -gt "0" ]; then 794 | img_name="linux-lts" 795 | elif [ "$(arch-chroot "${MOUNTPOINT}" ls /boot | grep zen -c)" -gt "0" ]; then 796 | img_name="linux-zen" 797 | else 798 | img_name="linux" 799 | fi 800 | if [[ $LUKS -eq 1 ]]; then 801 | echo -e "title\tArch Linux\nlinux\t/vmlinuz-${img_name}\ninitrd\t/initramfs-${img_name}.img\noptions\tcryptdevice=\/dev\/${LUKS_DISK}:luks root=\/dev\/mapper\/${ROOT_PART} rw" >"${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/entries/arch.conf 802 | elif [[ $LVM -eq 1 ]]; then 803 | echo -e "title\tArch Linux\nlinux\t/vmlinuz-${img_name}\ninitrd\t/initramfs-${img_name}.img\noptions\troot=\/dev\/mapper\/${ROOT_PART} rw" >"${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/entries/arch.conf 804 | else 805 | echo -e "title\tArch Linux\nlinux\t/vmlinuz-${img_name}\ninitrd\t/initramfs-${img_name}.img\noptions\troot=PARTUUID=${partuuid} rw" >"${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/entries/arch.conf 806 | fi 807 | echo -e "default arch\ntimeout 5" >"${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/loader.conf 808 | pause_function 809 | $EDITOR "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/entries/arch.conf 810 | $EDITOR "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/loader/loader.conf 811 | break 812 | ;; 813 | 2) 814 | arch-chroot "${MOUNTPOINT}" 815 | break 816 | ;; 817 | *) 818 | invalid_option 819 | ;; 820 | esac 821 | done 822 | ;; 823 | rEFInd) 824 | print_title "REFIND - https://wiki.archlinux.org/index.php/REFInd" 825 | print_info "rEFInd is a UEFI boot manager capable of launching EFISTUB kernels. It is a fork of the no-longer-maintained rEFIt and fixes many issues with respect to non-Mac UEFI booting. It is designed to be platform-neutral and to simplify booting multiple OSes." 826 | print_warning "When refind-install (used in Automatic mode) is run in chroot (e.g. in live system when installing Arch Linux) /boot/refind-linux.conf is populated with kernel options from the live system not the one on which it is installed. You need to adjust kernel options in /boot/refind-linux.conf manually." 827 | refind_install_mode=("Automatic" "Manual") 828 | PS3="$prompt1" 829 | echo -e "rEFInd install:\n" 830 | select OPT in "${refind_install_mode[@]}"; do 831 | case "$REPLY" in 832 | 1) 833 | arch_chroot "refind-install" 834 | $EDITOR "${MOUNTPOINT}""${EFI_MOUNTPOINT}"/refind_linux.conf 835 | break 836 | ;; 837 | 2) 838 | arch-chroot "${MOUNTPOINT}" 839 | break 840 | ;; 841 | *) 842 | invalid_option 843 | ;; 844 | esac 845 | done 846 | ;; 847 | esac 848 | pause_function 849 | } 850 | #}}} 851 | #ROOT PASSWORD {{{ 852 | root_password() { 853 | print_title "ROOT PASSWORD" 854 | print_warning "Enter your new root password" 855 | arch_chroot "passwd" 856 | pause_function 857 | } 858 | #}}} 859 | #FINISH {{{ 860 | finish() { 861 | print_title "INSTALL COMPLETED" 862 | #COPY AUI TO ROOT FOLDER IN THE NEW SYSTEM 863 | print_warning "\nA copy of the AUI will be placed in /root directory of your new system" 864 | cp -R "$(pwd)" "${MOUNTPOINT}"/root 865 | read_input_text "Reboot system" 866 | if [[ $OPTION == y ]]; then 867 | umount_partitions 868 | reboot 869 | fi 870 | exit 0 871 | } 872 | #}}} 873 | 874 | pause_function 875 | check_boot_system 876 | check_connection 877 | check_trim 878 | pacman -Sy 879 | while true; do 880 | print_title "ARCHLINUX ULTIMATE INSTALL - https://github.com/helmuthdu/aui" 881 | echo " 1) $(mainmenu_item "${checklist[1]}" "Select Keymap" "${KEYMAP}")" 882 | echo " 2) $(mainmenu_item "${checklist[2]}" "Select Editor" "${EDITOR}")" 883 | echo " 3) $(mainmenu_item "${checklist[3]}" "Configure Mirrorlist" "${country_name} (${country_code})")" 884 | echo " 4) $(mainmenu_item "${checklist[4]}" "Partition Scheme" "${partition_layout}: ${partition}(${filesystem}) swap(${swap_type})")" 885 | echo " 5) $(mainmenu_item "${checklist[5]}" "Install Base System")" 886 | echo " 6) $(mainmenu_item "${checklist[6]}" "Configure Fstab" "${fstab}")" 887 | echo " 7) $(mainmenu_item "${checklist[7]}" "Configure Hostname" "${host_name}")" 888 | echo " 8) $(mainmenu_item "${checklist[8]}" "Configure Timezone" "${ZONE}/${SUBZONE}")" 889 | echo " 9) $(mainmenu_item "${checklist[9]}" "Configure Hardware Clock" "${hwclock}")" 890 | echo "10) $(mainmenu_item "${checklist[10]}" "Configure Locale" "${LOCALE}")" 891 | echo "11) $(mainmenu_item "${checklist[11]}" "Configure Mkinitcpio")" 892 | echo "12) $(mainmenu_item "${checklist[12]}" "Install Bootloader" "${bootloader}")" 893 | echo "13) $(mainmenu_item "${checklist[13]}" "Root Password")" 894 | echo "" 895 | echo " d) Done" 896 | echo "" 897 | read_input_options 898 | for OPT in "${OPTIONS[@]}"; do 899 | case "$OPT" in 900 | 1) 901 | select_keymap 902 | checklist[1]=1 903 | ;; 904 | 2) 905 | select_editor 906 | checklist[2]=1 907 | ;; 908 | 3) 909 | configure_mirrorlist 910 | checklist[3]=1 911 | ;; 912 | 4) 913 | umount_partitions 914 | create_partition_scheme 915 | format_partitions 916 | checklist[4]=1 917 | ;; 918 | 5) 919 | install_base_system 920 | configure_keymap 921 | checklist[5]=1 922 | ;; 923 | 6) 924 | configure_fstab 925 | checklist[6]=1 926 | ;; 927 | 7) 928 | configure_hostname 929 | checklist[7]=1 930 | ;; 931 | 8) 932 | configure_timezone 933 | checklist[8]=1 934 | ;; 935 | 9) 936 | configure_hardwareclock 937 | checklist[9]=1 938 | ;; 939 | 10) 940 | configure_locale 941 | checklist[10]=1 942 | ;; 943 | 11) 944 | configure_mkinitcpio 945 | checklist[11]=1 946 | ;; 947 | 12) 948 | install_bootloader 949 | configure_bootloader 950 | checklist[12]=1 951 | ;; 952 | 13) 953 | root_password 954 | checklist[13]=1 955 | ;; 956 | "d") 957 | finish 958 | ;; 959 | *) 960 | invalid_option 961 | ;; 962 | esac 963 | done 964 | done 965 | #}}} 966 | -------------------------------------------------------------------------------- /lilo: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # FIX THIS ISSUES | NON-ACUTE 3 | #shellcheck disable=SC1001,SC1091,SC2001,SC2010,SC2015,SC2034,SC2104,SC2154 4 | #shellcheck disable=SC2154,SC2153,SC2155,SC2165,SC2167,SC2181,SC2207 5 | 6 | : 'ATTENTION!: 7 | -------------------------------------------------- 8 | | Created by helmuthdu | 9 | | Contributed by flexiondotorg | 10 | | Shellchecked by uniminin | 11 | | Formatted by molese | 12 | -------------------------------------------------- 13 | This program is free software: you can redistribute it and/or modify 14 | it under the terms of the GNU General Public License as published by 15 | the Free Software Foundation, either version 3 of the License, or 16 | (at your option) any later version. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program. If not, see . 25 | ------------------------------------------------------------------------ 26 | Run this script after your first boot with archlinux (as root) 27 | ' 28 | 29 | if [[ -f $(pwd)/sharedfuncs ]]; then 30 | source sharedfuncs 31 | else 32 | echo "missing file: sharedfuncs" 33 | exit 1 34 | fi 35 | 36 | #ARCHLINUX U INSTALL {{{ 37 | #WELCOME {{{ 38 | welcome() { 39 | clear 40 | echo -e "${Bold}Welcome to the Archlinux U Install script by helmuthdu${White}" 41 | print_line 42 | echo "Requirements:" 43 | echo "-> Archlinux installation" 44 | echo "-> Run script as root user" 45 | echo "-> Working internet connection" 46 | print_line 47 | echo "Script can be cancelled at any time with CTRL+C" 48 | print_line 49 | echo "http://www.github.com/helmuthdu/aui" 50 | print_line 51 | echo -e "\nBackups:" 52 | print_line 53 | # backup old configs 54 | [[ ! -f /etc/pacman.conf.aui ]] && cp -v /etc/pacman.conf /etc/pacman.conf.aui || echo "/etc/pacman.conf.aui" 55 | [[ -f /etc/ssh/sshd_config.aui ]] && echo "/etc/ssh/sshd_conf.aui" 56 | [[ -f /etc/sudoers.aui ]] && echo "/etc/sudoers.aui" 57 | pause_function 58 | echo "" 59 | } 60 | #}}} 61 | #LOCALE SELECTOR {{{ 62 | language_selector() { 63 | #AUTOMATICALLY DETECTS THE SYSTEM LOCALE {{{ 64 | #automatically detects the system language based on your locale 65 | LOCALE=$(locale | grep LANG | sed 's/LANG=//' | cut -c1-5) 66 | #KDE #{{{ 67 | if [[ $LOCALE == pt_BR || $LOCALE == en_GB || $LOCALE == zh_CN ]]; then 68 | LOCALE_KDE=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]') 69 | else 70 | LOCALE_KDE=$(echo "$LOCALE" | cut -d\_ -f1) 71 | fi 72 | #}}} 73 | #FIREFOX #{{{ 74 | if [[ $LOCALE == pt_BR || $LOCALE == pt_PT || $LOCALE == en_GB || $LOCALE == en_US || $LOCALE == es_AR || $LOCALE == es_CL || $LOCALE == es_ES || $LOCALE == zh_CN ]]; then 75 | LOCALE_FF=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 76 | else 77 | LOCALE_FF=$(echo "$LOCALE" | cut -d\_ -f1) 78 | fi 79 | #}}} 80 | #THUNDERBIRD #{{{ 81 | if [[ $LOCALE == pt_BR || $LOCALE == pt_PT || $LOCALE == en_US || $LOCALE == en_GB || $LOCALE == es_AR || $LOCALE == es_ES || $LOCALE == zh_CN ]]; then 82 | LOCALE_TB=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 83 | elif [[ $LOCALE == es_CL ]]; then 84 | LOCALE_TB="es-es" 85 | else 86 | LOCALE_TB=$(echo "$LOCALE" | cut -d\_ -f1) 87 | fi 88 | #}}} 89 | #HUNSPELL #{{{ 90 | if [[ $LOCALE == pt_BR ]]; then 91 | LOCALE_HS=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 92 | elif [[ $LOCALE == pt_PT ]]; then 93 | LOCALE_HS="pt_pt" 94 | else 95 | LOCALE_HS=$(echo "$LOCALE" | cut -d\_ -f1) 96 | fi 97 | #}}} 98 | #ASPELL #{{{ 99 | LOCALE_AS=$(echo "$LOCALE" | cut -d\_ -f1) 100 | #}}} 101 | #LIBREOFFICE #{{{ 102 | if [[ $LOCALE == pt_BR || $LOCALE == en_GB || $LOCALE == en_US || $LOCALE == zh_CN ]]; then 103 | LOCALE_LO=$(echo "$LOCALE" | sed 's/_/-/') 104 | else 105 | LOCALE_LO=$(echo "$LOCALE" | cut -d\_ -f1) 106 | fi 107 | #}}} 108 | #}}} 109 | print_title "LOCALE - https://wiki.archlinux.org/index.php/Locale" 110 | print_info "Locales are used in Linux to define which language the user uses. As the locales define the character sets being used as well, setting up the correct locale is especially important if the language contains non-ASCII characters." 111 | printf "%s" "Default system language: \"$LOCALE\" [Y/n]: " 112 | read -r OPTION 113 | case "$OPTION" in 114 | "n") 115 | while [[ $OPTION != y ]]; do 116 | setlocale 117 | read_input_text "Confirm locale ($LOCALE)" 118 | done 119 | sed -i '/'"${LOCALE}"'/s/^#//' /etc/locale.gen 120 | locale-gen 121 | localectl set-locale LANG="${LOCALE_UTF8}" 122 | #KDE #{{{ 123 | if [[ $LOCALE == pt_BR || $LOCALE == en_GB || $LOCALE == zh_CN ]]; then 124 | LOCALE_KDE=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]') 125 | else 126 | LOCALE_KDE=$(echo "$LOCALE" | cut -d\_ -f1) 127 | fi 128 | #}}} 129 | #FIREFOX #{{{ 130 | if [[ $LOCALE == pt_BR || $LOCALE == pt_PT || $LOCALE == en_GB || $LOCALE == en_US || $LOCALE == es_AR || $LOCALE == es_CL || $LOCALE == es_ES || $LOCALE == zh_CN ]]; then 131 | LOCALE_FF=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 132 | else 133 | LOCALE_FF=$(echo "$LOCALE" | cut -d\_ -f1) 134 | fi 135 | #}}} 136 | #THUNDERBIRD #{{{ 137 | if [[ $LOCALE == pt_BR || $LOCALE == pt_PT || $LOCALE == en_US || $LOCALE == en_GB || $LOCALE == es_AR || $LOCALE == es_ES || $LOCALE == zh_CN ]]; then 138 | LOCALE_TB=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 139 | elif [[ $LOCALE == es_CL ]]; then 140 | LOCALE_TB="es-es" 141 | else 142 | LOCALE_TB=$(echo "$LOCALE" | cut -d\_ -f1) 143 | fi 144 | #}}} 145 | #HUNSPELL #{{{ 146 | if [[ $LOCALE == pt_BR ]]; then 147 | LOCALE_HS=$(echo "$LOCALE" | tr '[:upper:]' '[:lower:]' | sed 's/_/-/') 148 | elif [[ $LOCALE == pt_PT ]]; then 149 | LOCALE_HS="pt_pt" 150 | else 151 | LOCALE_HS=$(echo "$LOCALE" | cut -d\_ -f1) 152 | fi 153 | #}}} 154 | #ASPELL #{{{ 155 | LOCALE_AS=$(echo "$LOCALE" | cut -d\_ -f1) 156 | #}}} 157 | #LIBREOFFICE #{{{ 158 | if [[ $LOCALE == pt_BR || $LOCALE == en_GB || $LOCALE == en_US || $LOCALE == zh_CN ]]; then 159 | LOCALE_LO=$(echo "$LOCALE" | sed 's/_/-/') 160 | else 161 | LOCALE_LO=$(echo "$LOCALE" | cut -d\_ -f1) 162 | fi 163 | #}}} 164 | ;; 165 | *) ;; 166 | 167 | esac 168 | } 169 | #}}} 170 | #SELECT/CREATE USER {{{ 171 | select_user() { 172 | #CREATE NEW USER {{{ 173 | create_new_user() { 174 | printf "%s" "Username: " 175 | read -r username 176 | username=$(echo "$username" | tr '[:upper:]' '[:lower:]') 177 | useradd -m -g users -G wheel -s /bin/bash "${username}" 178 | chfn "${username}" 179 | passwd "${username}" 180 | while [[ $? -ne 0 ]]; do 181 | passwd "${username}" 182 | done 183 | pause_function 184 | configure_user_account 185 | } 186 | #}}} 187 | #CONFIGURE USER ACCOUNT {{{ 188 | configure_user_account() { 189 | #BASHRC {{{ 190 | print_title "BASHRC - https://wiki.archlinux.org/index.php/Bashrc" 191 | bashrc_list=("Get helmuthdu .bashrc from github" "Vanilla .bashrc" "Get personal .bashrc from github") 192 | PS3="$prompt1" 193 | echo -e "Choose your .bashrc\n" 194 | select OPT in "${bashrc_list[@]}"; do 195 | case "$REPLY" in 196 | 1) 197 | package_install "git" 198 | package_install "colordiff" 199 | git clone https://github.com/helmuthdu/dotfiles 200 | cp dotfiles/.bashrc dotfiles/.dircolors dotfiles/.dircolors_256 dotfiles/.nanorc dotfiles/.yaourtrc ~/ 201 | cp dotfiles/.bashrc dotfiles/.dircolors dotfiles/.dircolors_256 dotfiles/.nanorc dotfiles/.yaourtrc /home/"${username}"/ 202 | rm -fr dotfiles 203 | ;; 204 | 2) 205 | cp /etc/skel/.bashrc /home/"${username}" 206 | ;; 207 | 3) 208 | package_install "git" 209 | printf "%s" "Enter your github username [ex: helmuthdu]: " 210 | read -r GITHUB_USER 211 | printf "%s" "Enter your github repository [ex: aui]: " 212 | read -r GITHUB_REPO 213 | git clone https://github.com/"$GITHUB_USER"/"$GITHUB_REPO" 214 | cp -R "$GITHUB_REPO"/.* /home/"${username}"/ 215 | rm -fr "$GITHUB_REPO" 216 | ;; 217 | *) 218 | invalid_option 219 | ;; 220 | esac 221 | [[ -n $OPT ]] && break 222 | done 223 | #}}} 224 | #EDITOR {{{ 225 | print_title "DEFAULT EDITOR" 226 | editors_list=("emacs" "nano" "vi" "vim" "neovim" "zile") 227 | PS3="$prompt1" 228 | echo -e "Select editor\n" 229 | select EDITOR in "${editors_list[@]}"; do 230 | if contains_element "$EDITOR" "${editors_list[@]}"; then 231 | if [[ $EDITOR == vim || $EDITOR == neovim ]]; then 232 | [[ $EDITOR == vim ]] && (! is_package_installed "gvim" && package_install "vim ctags") || package_install "neovim python2-neovim python-neovim xclip" 233 | #VIMRC {{{ 234 | if [[ ! -f /home/${username}/.vimrc ]]; then 235 | vimrc_list=("Get helmuthdu .vimrc from github" "Vanilla .vimrc" "Get personal .vimrc from github") 236 | PS3="$prompt1" 237 | echo -e "Choose your .vimrc\n" 238 | select OPT in "${vimrc_list[@]}"; do 239 | case "$REPLY" in 240 | 1) 241 | package_install "git" 242 | git clone https://github.com/helmuthdu/vim /home/"${username}"/.vim 243 | ln -sf /home/"${username}"/.vim/vimrc /home/"${username}"/.vimrc 244 | cp -R vim /home/"${username}"/.vim/fonts /home/"${username}"/.fonts 245 | mkdir /home/"${username}"/.vim/colors 246 | curl -fsSL -o /home/"${username}"/.vim/colors/tender.vim https://raw.githubusercontent.com/jacoborus/tender.vim/master/colors/tender.vim 247 | GRUVBOX_NEEDED=1 248 | ;; 249 | 3) 250 | package_install "git" 251 | printf "%s" "Enter your github username [ex: helmuthdu]: " 252 | read -r GITHUB_USER 253 | printf "%s" "Enter your github repository [ex: vim]: " 254 | read -r GITHUB_REPO 255 | git clone https://github.com/"$GITHUB_USER"/"$GITHUB_REPO" 256 | cp -R "$GITHUB_REPO"/.vim /home/"${username}"/ 257 | if [[ -f $GITHUB_REPO/vimrc ]]; then 258 | ln -sf /home/"${username}"/.vim/vimrc /home/"${username}"/.vimrc 259 | else 260 | ln -sf /home/"${username}"/.vim/.vimrc /home/"${username}"/.vimrc 261 | fi 262 | rm -fr "$GITHUB_REPO" 263 | ;; 264 | 2) 265 | echo "Nothing to do..." 266 | ;; 267 | *) 268 | invalid_option 269 | ;; 270 | esac 271 | [[ -n $OPT ]] && break 272 | done 273 | fi 274 | if [[ $EDITOR == neovim && ! -f /home/${username}/.config/nvim ]]; then 275 | mkdir ~/.config 276 | ln -s ~/.vim ~/.config/nvim 277 | ln -s ~/.vimrc ~/.config/nvim/init.vim 278 | fi 279 | #}}} 280 | elif [[ $EDITOR == emacs ]]; then 281 | package_install "emacs" 282 | #.emacs.d{{{ 283 | if [[ ! -d /home/${username}/.emacs.d && ! -f /home/${username}/.emacs ]]; then 284 | emacsd_list=("Spacemacs" "Centaur Emacs" "Vanilla .emacs.d" "Get personal .emacs.d from github") 285 | PS3="$prompt1" 286 | echo -e "Choose your .emacs.d\n" 287 | select OPT in "${emacsd_list[@]}"; do 288 | case "$REPLY" in 289 | 1) 290 | package_install "git" 291 | git clone https://github.com/syl20bnr/spacemacs /home/"${username}"/.emacs.d 292 | ;; 293 | 2) 294 | package_install "git" 295 | git clone --depth 1 https://github.com/seagle0128/.emacs.d.git /home/"${username}"/.emacs.d 296 | ;; 297 | 3) 298 | package_install "git" 299 | printf "%s" "Enter your github username [ex: helmuthdu]: " 300 | read -r GITHUB_USER 301 | printf "%s" "Enter your github repository [ex: vim]: " 302 | read -r GITHUB_REPO 303 | git clone https://github.com/"$GITHUB_USER"/"$GITHUB_REPO" /home/"${username}"/.emacs.d 304 | ;; 305 | 4) 306 | echo "Nothing to do..." 307 | ;; 308 | *) 309 | invalid_option 310 | ;; 311 | esac 312 | [[ -n $OPT ]] && break 313 | done 314 | fi 315 | #}}} 316 | else 317 | package_install "$EDITOR" 318 | fi 319 | break 320 | else 321 | invalid_option 322 | fi 323 | done 324 | #}}} 325 | chown -R "${username}":users /home/"${username}" 326 | } 327 | #}}} 328 | print_title "SELECT/CREATE USER - https://wiki.archlinux.org/index.php/Users_and_Groups" 329 | users_list=($(grep "/home" /etc/passwd | cut -d: -f1)) 330 | PS3="$prompt1" 331 | echo "Avaliable Users:" 332 | if [[ $((${#users_list[@]})) -gt 0 ]]; then 333 | print_warning "WARNING: THE SELECTED USER MUST HAVE SUDO PRIVILEGES" 334 | else 335 | echo "" 336 | fi 337 | select OPT in "${users_list[@]}" "Create new user"; do 338 | if [[ $OPT == "Create new user" ]]; then 339 | create_new_user 340 | elif contains_element "$OPT" "${users_list[@]}"; then 341 | username=$OPT 342 | else 343 | invalid_option 344 | fi 345 | [[ -n $OPT ]] && break 346 | done 347 | [[ ! -f /home/${username}/.bashrc ]] && configure_user_account 348 | if [[ -n "$http_proxy" ]]; then 349 | echo "proxy = $http_proxy" >/home/"${username}"/.curlrc 350 | chown "${username}":users /home/"${username}"/.curlrc 351 | fi 352 | } 353 | #}}} 354 | #CONFIGURE SUDO {{{ 355 | configure_sudo() { 356 | if ! is_package_installed "sudo"; then 357 | print_title "SUDO - https://wiki.archlinux.org/index.php/Sudo" 358 | package_install "sudo" 359 | fi 360 | #CONFIGURE SUDOERS {{{ 361 | if [[ ! -f /etc/sudoers.aui ]]; then 362 | cp -v /etc/sudoers /etc/sudoers.aui 363 | ## Uncomment to allow members of group wheel to execute any command 364 | sed -i '/%wheel ALL=(ALL) ALL/s/^#//' /etc/sudoers 365 | ## Same thing without a password (not secure) 366 | #sed -i '/%wheel ALL=(ALL) NOPASSWD: ALL/s/^#//' /etc/sudoers 367 | 368 | #This config is especially helpful for those using terminal multiplexers like screen, tmux, or ratpoison, and those using sudo from scripts/cronjobs: 369 | { 370 | echo "" 371 | echo 'Defaults !requiretty, !tty_tickets, !umask' 372 | echo 'Defaults visiblepw, path_info, insults, lecture=always' 373 | echo 'Defaults loglinelen=0, logfile =/var/log/sudo.log, log_year, log_host, syslog=auth' 374 | echo 'Defaults passwd_tries=3, passwd_timeout=1' 375 | echo 'Defaults env_reset, always_set_home, set_home, set_logname' 376 | echo 'Defaults !env_editor, editor="/usr/bin/vim:/usr/bin/vi:/usr/bin/nano"' 377 | echo 'Defaults timestamp_timeout=15' 378 | echo 'Defaults passprompt="[sudo] password for %u: "' 379 | echo 'Defaults lecture=never' 380 | } >>/etc/sudoers 381 | fi 382 | #}}} 383 | } 384 | #}}} 385 | #AUR HELPER {{{ 386 | choose_aurhelper() { 387 | print_title "AUR HELPER - https://wiki.archlinux.org/index.php/AUR_Helpers" 388 | print_info "AUR Helpers are written to make using the Arch User Repository more comfortable." 389 | print_warning "\tNone of these tools are officially supported by Arch devs." 390 | aurhelper=("trizen" "yay" "aurman" "aura" "pikaur") 391 | PS3="$prompt1" 392 | echo -e "Choose your default AUR helper to install\n" 393 | select OPT in "${aurhelper[@]}"; do 394 | case "$REPLY" in 395 | 1) 396 | if ! is_package_installed "trizen"; then 397 | package_install "base-devel git perl" 398 | aui_download_packages "trizen" 399 | if ! is_package_installed "trizen"; then 400 | echo "trizen not installed. EXIT now" 401 | pause_function 402 | exit 0 403 | fi 404 | fi 405 | AUR_PKG_MANAGER="trizen" 406 | ;; 407 | 2) 408 | if ! is_package_installed "yay"; then 409 | package_install "base-devel git go" 410 | pacman -D --asdeps go 411 | aui_download_packages "yay" 412 | if ! is_package_installed "yay"; then 413 | echo "yay not installed. EXIT now" 414 | pause_function 415 | exit 0 416 | fi 417 | fi 418 | AUR_PKG_MANAGER="yay" 419 | ;; 420 | 3) 421 | if ! is_package_installed "aurman"; then 422 | package_install "base-devel git expac python pyalpm python-requests python-feedparser python-regex python-dateutil" 423 | git clone https://github.com/polygamma/aurman.git 424 | python3 aurman/setup.py install 425 | rm -rf aurman 426 | if ! is_package_installed "aurman"; then 427 | echo "aurman not installed. EXIT now" 428 | pause_function 429 | exit 0 430 | fi 431 | fi 432 | AUR_PKG_MANAGER="aurman" 433 | ;; 434 | 4) 435 | if ! is_package_installed "aura"; then 436 | package_install "base-devel git stack" 437 | git clone https://github.com/fosskers/aura.git 438 | ( 439 | cd aura || exit 440 | stack install -- aura 441 | ) 442 | rm -rf aura 443 | if ! is_package_installed "aura"; then 444 | echo "aura not installed. EXIT now" 445 | pause_function 446 | exit 0 447 | fi 448 | fi 449 | AUR_PKG_MANAGER="aura" 450 | ;; 451 | 5) 452 | if ! is_package_installed "pikaur"; then 453 | package_install "base-devel git" 454 | git clone https://aur.archlinux.org/pikaur.git 455 | ( 456 | cd pikaur || exit 457 | makepkg -fsri 458 | ) 459 | rm -rf pikaur 460 | if ! is_package_installed "pikaur"; then 461 | echo "pikaur not installed. EXIT now" 462 | pause_function 463 | exit 0 464 | fi 465 | fi 466 | AUR_PKG_MANAGER="pikaur" 467 | ;; 468 | *) 469 | invalid_option 470 | ;; 471 | esac 472 | [[ -n $OPT ]] && break 473 | done 474 | pause_function 475 | } 476 | #}}} 477 | #AUTOMODE {{{ 478 | automatic_mode() { 479 | print_title "AUTOMODE" 480 | print_info "Create a custom install with all options pre-selected.\nUse this option with care." 481 | print_danger "\tUse this mode only if you already know all the option.\n\tYou won't be able to select anything later." 482 | read_input_text "Enable Automatic Mode" 483 | if [[ $OPTION == y ]]; then 484 | $EDITOR "${AUI_DIR}"/lilo.automode 485 | # shellcheck source=/root/aui/lilo.automode 486 | source "${AUI_DIR}"/lilo.automode 487 | echo -e "The installation will start now." 488 | pause_function 489 | AUTOMATIC_MODE=1 490 | fi 491 | } 492 | #}}} 493 | #CUSTOM REPOSITORIES {{{ 494 | add_custom_repositories() { 495 | print_title "CUSTOM REPOSITORIES - https://wiki.archlinux.org/index.php/Unofficial_User_Repositories" 496 | read_input_text "Add custom repositories" "$CUSTOMREPO" 497 | if [[ $OPTION == y ]]; then 498 | while true; do 499 | print_title "CUSTOM REPOSITORIES - https://wiki.archlinux.org/index.php/Unofficial_User_Repositories" 500 | echo " 1) \"Add new repository\"" 501 | echo "" 502 | echo " d) DONE" 503 | echo "" 504 | printf "%s" "$prompt1" OPTION 505 | case $OPTION in 506 | 1) 507 | printf "%s" "Repository Name [ex: custom]: " 508 | read -r repository_name 509 | printf "%s" "Repository Address [ex: file:///media/backup/Archlinux]: " 510 | read -r repository_addr 511 | add_repository "${repository_name}" "${repository_addr}" "Never" 512 | pause_function 513 | ;; 514 | "d") 515 | break 516 | ;; 517 | *) 518 | invalid_option 519 | ;; 520 | esac 521 | done 522 | fi 523 | } 524 | #}}} 525 | #BASIC SETUP {{{ 526 | install_basic_setup() { 527 | print_title "BASH TOOLS - https://wiki.archlinux.org/index.php/Bash" 528 | package_install "bc rsync mlocate bash-completion pkgstats arch-wiki-lite" 529 | pause_function 530 | print_title "(UN)COMPRESS TOOLS - https://wiki.archlinux.org/index.php/P7zip" 531 | package_install "zip unzip unrar p7zip lzop cpio" 532 | pause_function 533 | print_title "AVAHI - https://wiki.archlinux.org/index.php/Avahi" 534 | print_info "Avahi is a free Zero Configuration Networking (Zeroconf) implementation, including a system for multicast DNS/DNS-SD discovery. It allows programs to publish and discovers services and hosts running on a local network with no specific configuration." 535 | package_install "avahi nss-mdns" 536 | is_package_installed "avahi" && system_ctl enable avahi-daemon.service 537 | pause_function 538 | print_title "ALSA - https://wiki.archlinux.org/index.php/Alsa" 539 | print_info "The Advanced Linux Sound Architecture (ALSA) is a Linux kernel component intended to replace the original Open Sound System (OSSv3) for providing device drivers for sound cards." 540 | package_install "alsa-utils alsa-plugins" 541 | pause_function 542 | print_title "PULSEAUDIO - https://wiki.archlinux.org/index.php/Pulseaudio" 543 | print_info "PulseAudio is the default sound server that serves as a proxy to sound applications using existing kernel sound components like ALSA or OSS" 544 | package_install "pulseaudio pulseaudio-alsa" 545 | pause_function 546 | print_title "FAT/exFAT/F2FS - https://wiki.archlinux.org/index.php/File_Systems" 547 | print_info "A file system (or filesystem) is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device(s) which contain it. A file system organizes data in an efficient manner and is tuned to the specific characteristics of the device." 548 | package_install "dosfstools exfat-utils f2fs-tools fuse fuse-exfat mtpfs" 549 | pause_function 550 | print_title "SYSTEMD-TIMESYNCD - https://wiki.archlinux.org/index.php/Systemd-timesyncd" 551 | print_info "A file system (or filesystem) is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device(s) which contain it. A file system organizes data in an efficient manner and is tuned to the specific characteristics of the device." 552 | timedatectl set-ntp true 553 | pause_function 554 | } 555 | #}}} 556 | #SSH {{{ 557 | install_ssh() { 558 | print_title "SSH - https://wiki.archlinux.org/index.php/Ssh" 559 | print_info "Secure Shell (SSH) is a network protocol that allows data to be exchanged over a secure channel between two computers." 560 | read_input_text "Install ssh" "$SSH" 561 | if [[ $OPTION == y ]]; then 562 | package_install "openssh" 563 | system_ctl enable sshd 564 | [[ ! -f /etc/ssh/sshd_config.aui ]] && cp -v /etc/ssh/sshd_config /etc/ssh/sshd_config.aui 565 | #CONFIGURE SSHD_CONF #{{{ 566 | sed -i '/Port 22/s/^#//' /etc/ssh/sshd_config 567 | sed -i '/Protocol 2/s/^#//' /etc/ssh/sshd_config 568 | sed -i '/HostKey \/etc\/ssh\/ssh_host_rsa_key/s/^#//' /etc/ssh/sshd_config 569 | sed -i '/HostKey \/etc\/ssh\/ssh_host_dsa_key/s/^#//' /etc/ssh/sshd_config 570 | sed -i '/HostKey \/etc\/ssh\/ssh_host_ecdsa_key/s/^#//' /etc/ssh/sshd_config 571 | sed -i '/KeyRegenerationInterval/s/^#//' /etc/ssh/sshd_config 572 | sed -i '/ServerKeyBits/s/^#//' /etc/ssh/sshd_config 573 | sed -i '/SyslogFacility/s/^#//' /etc/ssh/sshd_config 574 | sed -i '/LogLevel/s/^#//' /etc/ssh/sshd_config 575 | sed -i '/LoginGraceTime/s/^#//' /etc/ssh/sshd_config 576 | sed -i '/PermitRootLogin/s/^#//' /etc/ssh/sshd_config 577 | sed -i '/HostbasedAuthentication no/s/^#//' /etc/ssh/sshd_config 578 | sed -i '/StrictModes/s/^#//' /etc/ssh/sshd_config 579 | sed -i '/RSAAuthentication/s/^#//' /etc/ssh/sshd_config 580 | sed -i '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config 581 | sed -i '/IgnoreRhosts/s/^#//' /etc/ssh/sshd_config 582 | sed -i '/PermitEmptyPasswords/s/^#//' /etc/ssh/sshd_config 583 | sed -i '/AllowTcpForwarding/s/^#//' /etc/ssh/sshd_config 584 | sed -i '/AllowTcpForwarding no/d' /etc/ssh/sshd_config 585 | sed -i '/X11Forwarding/s/^#//' /etc/ssh/sshd_config 586 | sed -i '/X11Forwarding/s/no/yes/' /etc/ssh/sshd_config 587 | sed -i -e '/\tX11Forwarding yes/d' /etc/ssh/sshd_config 588 | sed -i '/X11DisplayOffset/s/^#//' /etc/ssh/sshd_config 589 | sed -i '/X11UseLocalhost/s/^#//' /etc/ssh/sshd_config 590 | sed -i '/PrintMotd/s/^#//' /etc/ssh/sshd_config 591 | sed -i '/PrintMotd/s/yes/no/' /etc/ssh/sshd_config 592 | sed -i '/PrintLastLog/s/^#//' /etc/ssh/sshd_config 593 | sed -i '/TCPKeepAlive/s/^#//' /etc/ssh/sshd_config 594 | sed -i '/the setting of/s/^/#/' /etc/ssh/sshd_config 595 | sed -i '/RhostsRSAAuthentication and HostbasedAuthentication/s/^/#/' /etc/ssh/sshd_config 596 | #}}} 597 | pause_function 598 | fi 599 | } 600 | #}}} 601 | #NFS {{{ 602 | install_nfs() { 603 | print_title "NFS - https://wiki.archlinux.org/index.php/Nfs" 604 | print_info "NFS allowing a user on a client computer to access files over a network in a manner similar to how local storage is accessed." 605 | read_input_text "Install nfs" "$NFS" 606 | if [[ $OPTION == y ]]; then 607 | package_install "nfs-utils" 608 | system_ctl enable rpcbind 609 | system_ctl enable nfs-client.target 610 | system_ctl enable remote-fs.target 611 | pause_function 612 | fi 613 | } 614 | #}}} 615 | #ZSH {{{ 616 | install_zsh() { 617 | print_title "ZSH - https://wiki.archlinux.org/index.php/Zsh" 618 | print_info "Zsh is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. " 619 | read_input_text "Install zsh" "$ZSH" 620 | if [[ $OPTION == y ]]; then 621 | package_install "zsh" 622 | read_input_text "Install oh-my-zsh" "$OH_MY_ZSH" 623 | if [[ $OPTION == y ]]; then 624 | if [[ -f /home/${username}/.zshrc ]]; then 625 | read_input_text "Replace current .zshrc file" 626 | if [[ $OPTION == y ]]; then 627 | run_as_user "mv /home/${username}/.zshrc /home/${username}/.zshrc.bkp" 628 | run_as_user "sh -c \"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"" 629 | run_as_user "$EDITOR /home/${username}/.zshrc" 630 | fi 631 | else 632 | run_as_user "sh -c \"$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)\"" 633 | run_as_user "$EDITOR /home/${username}/.zshrc" 634 | fi 635 | fi 636 | pause_function 637 | fi 638 | } 639 | #}}} 640 | #FISH {{{ 641 | install_fish() { 642 | print_title "fish - https://wiki.archlinux.org/index.php/fish" 643 | print_info "fish is a friendly interactive shell and a commandline shell intended to be interactive and user-friendly. " 644 | read_input_text "Install fish" "$FISH" 645 | if [[ $OPTION == y ]]; then 646 | package_install "fish" 647 | read_input_text "Install oh-my-fish" "$OH_MY_FISH" 648 | if [[ $OPTION == y ]]; then 649 | run_as_user "curl -L https://get.oh-my.fish | fish" 650 | fi 651 | pause_function 652 | fi 653 | } 654 | #}}} 655 | #SAMBA {{{ 656 | install_samba() { 657 | print_title "SAMBA - https://wiki.archlinux.org/index.php/Samba" 658 | print_info "Samba is a re-implementation of the SMB/CIFS networking protocol, it facilitates file and printer sharing among Linux and Windows systems as an alternative to NFS." 659 | read_input_text "Install Samba" "$SAMBA" 660 | if [[ $OPTION == y ]]; then 661 | package_install "wget samba smbnetfs" 662 | [[ ! -f /etc/samba/smb.conf ]] && wget -q -O /etc/samba/smb.conf "https://git.samba.org/samba.git/?p=samba.git;a=blob_plain;f=examples/smb.conf.default;hb=HEAD" 663 | local CONFIG_SAMBA=$(grep usershare /etc/samba/smb.conf) 664 | if [[ -z $CONFIG_SAMBA ]]; then 665 | # configure usershare 666 | export USERSHARES_DIR="/var/lib/samba/usershare" 667 | export USERSHARES_GROUP="sambashare" 668 | mkdir -p ${USERSHARES_DIR} 669 | groupadd ${USERSHARES_GROUP} 670 | chown root:${USERSHARES_GROUP} ${USERSHARES_DIR} 671 | chmod 1770 ${USERSHARES_DIR} 672 | sed -i -e '/\[global\]/a\\n usershare path = /var/lib/samba/usershare\n usershare max shares = 100\n usershare allow guests = yes\n usershare owner only = False' /etc/samba/smb.conf 673 | sed -i -e '/\[global\]/a\\n socket options = IPTOS_LOWDELAY TCP_NODELAY SO_KEEPALIVE\n write cache size = 2097152\n use sendfile = yes\n' /etc/samba/smb.conf 674 | usermod -a -G ${USERSHARES_GROUP} "${username}" 675 | sed -i '/user_allow_other/s/^#//' /etc/fuse.conf 676 | modprobe fuse 677 | fi 678 | echo "Enter your new samba account password:" 679 | pdbedit -a -u "${username}" 680 | while [[ $? -ne 0 ]]; do 681 | pdbedit -a -u "${username}" 682 | done 683 | # enable services 684 | system_ctl enable smb.service 685 | system_ctl enable nmb.service 686 | pause_function 687 | fi 688 | } 689 | #}}} 690 | #READAHEAD {{{ 691 | enable_readahead() { 692 | print_title "Readahead - https://wiki.archlinux.org/index.php/Improve_Boot_Performance" 693 | print_info "Systemd comes with its own readahead implementation, this should in principle improve boot time. However, depending on your kernel version and the type of your hard drive, your mileage may vary (i.e. it might be slower)." 694 | read_input_text "Enable Readahead" "$READAHEAD" 695 | if [[ $OPTION == y ]]; then 696 | system_ctl enable systemd-readahead-collect 697 | system_ctl enable systemd-readahead-replay 698 | pause_function 699 | fi 700 | } 701 | #}}} 702 | #ZRAM {{{ 703 | install_zram() { 704 | print_title "ZRAM - https://wiki.archlinux.org/index.php/Maximizing_Performance" 705 | print_info "Zram creates a device in RAM and compresses it. If you use for swap means that part of the RAM can hold much more information but uses more CPU. Still, it is much quicker than swapping to a hard drive. If a system often falls back to swap, this could improve responsiveness. Zram is in mainline staging (therefore its not stable yet, use with caution)." 706 | read_input_text "Install Zram" "$ZRAM" 707 | if [[ $OPTION == y ]]; then 708 | aur_package_install "zramswap" 709 | system_ctl enable zramswap 710 | pause_function 711 | fi 712 | } 713 | #}}} 714 | #TLP {{{ 715 | install_tlp() { 716 | print_title "TLP - https://wiki.archlinux.org/index.php/Tlp" 717 | print_info "TLP is an advanced power management tool for Linux. It is a pure command line tool with automated background tasks and does not contain a GUI." 718 | read_input_text "Install TLP" "$TLP" 719 | if [[ $OPTION == y ]]; then 720 | package_install "tlp" 721 | system_ctl enable tlp.service 722 | system_ctl enable tlp-sleep.service 723 | system_ctl mask systemd-rfkill.service 724 | system_ctl mask systemd-rfkill.socket 725 | tlp start 726 | pause_function 727 | fi 728 | } 729 | #}}} 730 | #XORG {{{ 731 | install_xorg() { 732 | print_title "XORG - https://wiki.archlinux.org/index.php/Xorg" 733 | print_info "Xorg is the public, open-source implementation of the X window system version 11." 734 | echo "Installing X-Server (req. for Desktopenvironment, GPU Drivers, Keyboardlayout,...)" 735 | package_install "xorg-server xorg-apps xorg-xinit xorg-xkill xorg-xinput xf86-input-libinput" 736 | package_install "mesa" 737 | modprobe uinput 738 | pause_function 739 | } 740 | #}}} 741 | #WAYLAND {{{ 742 | install_wayland() { 743 | print_title "WAYLAND - https://wiki.archlinux.org/index.php/Wayland" 744 | print_info "Wayland is a protocol for a compositing window manager to talk to its clients, as well as a library implementing the protocol. " 745 | package_install "weston xorg-server-xwayland" 746 | pause_function 747 | } 748 | #}}} 749 | #FONT CONFIGURATION {{{ 750 | font_config() { 751 | print_title "FONTS CONFIGURATION - https://wiki.archlinux.org/index.php/Font_Configuration" 752 | print_info "Fontconfig is a library designed to provide a list of available fonts to applications, and also for configuration for how fonts get rendered." 753 | pacman -S --asdeps --needed cairo fontconfig freetype2 754 | pause_function 755 | } 756 | #}}} 757 | #VIDEO CARDS {{{ 758 | create_ramdisk_environment() { 759 | if [ "$(ls /boot | grep hardened -c)" -gt "0" ]; then 760 | mkinitcpio -p linux-hardened 761 | elif [ "$(ls /boot | grep lts -c)" -gt "0" ]; then 762 | mkinitcpio -p linux-lts 763 | elif [ "$(ls /boot | grep zen -c)" -gt "0" ]; then 764 | mkinitcpio -p linux-zen 765 | else 766 | mkinitcpio -p linux 767 | fi 768 | } 769 | install_video_cards() { 770 | package_install "dmidecode" 771 | print_title "VIDEO CARD" 772 | check_vga 773 | #Virtualbox {{{ 774 | if [[ ${VIDEO_DRIVER} == virtualbox ]]; then 775 | if [ "$(lspci | grep 'VMware SVGA' -c)" -gt "0" ]; then 776 | package_install "xf86-video-vmware" 777 | fi 778 | if [ "$(ls /boot | grep hardened -c)" -gt "0" ] || [ "$(ls /boot | grep lts -c)" -gt "0" ] || [ "$(ls /boot | grep zen -c)" -gt "0" ]; then 779 | package_install "virtualbox-guest-utils mesa-libgl" 780 | else 781 | package_install "virtualbox-guest-utils mesa-libgl" 782 | fi 783 | add_module "vboxguest vboxsf vboxvideo" "virtualbox-guest" 784 | add_user_to_group "${username}" vboxsf 785 | system_ctl enable vboxservice 786 | create_ramdisk_environment 787 | #}}} 788 | #VMware {{{ 789 | elif [[ ${VIDEO_DRIVER} == vmware ]]; then 790 | package_install "xf86-video-vmware xf86-input-vmmouse" 791 | if [ "$(ls /boot | grep hardened -c)" -gt "0" ] || [ "$(ls /boot | grep lts -c)" -gt "0" ] || [ "$(ls /boot | grep zen -c)" -gt "0" ]; then 792 | aur_package_install "open-vm-tools-dkms" 793 | else 794 | package_install "open-vm-tools" 795 | fi 796 | cat /proc/version >/etc/arch-release 797 | system_ctl enable vmtoolsd 798 | create_ramdisk_environment 799 | #}}} 800 | #Optimus {{{ 801 | elif [[ ${VIDEO_DRIVER} == optimus ]]; then 802 | XF86_DRIVERS=$(pacman -Qe | grep xf86-video | awk '{print $1}') 803 | [[ -n $XF86_DRIVERS ]] && pacman -Rcsn "$XF86_DRIVERS" 804 | read_input_text "Use NVIDIA PRIME Render Offload instead of Bumblebee?" "$BUMBLEBEE" 805 | if [[ $OPTION == y ]]; then 806 | package_install "nvidia nvidia-utils libglvnd nvidia-prime" 807 | package_install "mesa mesa-libgl libvdpau-va-gl" 808 | [[ ${ARCHI} == x86_64 ]] && pacman -S --needed lib32-virtualgl lib32-nvidia-utils 809 | replace_line '*options nouveau modeset=1' '#options nouveau modeset=1' /etc/modprobe.d/modprobe.conf 810 | replace_line '*MODULES="nouveau"' '#MODULES="nouveau"' /etc/mkinitcpio.conf 811 | create_ramdisk_environment 812 | else 813 | pacman -S --needed xf86-video-intel bumblebee nvidia 814 | [[ ${ARCHI} == x86_64 ]] && pacman -S --needed lib32-virtualgl lib32-nvidia-utils 815 | replace_line '*options nouveau modeset=1' '#options nouveau modeset=1' /etc/modprobe.d/modprobe.conf 816 | replace_line '*MODULES="nouveau"' '#MODULES="nouveau"' /etc/mkinitcpio.conf 817 | create_ramdisk_environment 818 | add_user_to_group "${username}" bumblebee 819 | fi 820 | #}}} 821 | #NVIDIA {{{ 822 | elif [[ ${VIDEO_DRIVER} == nvidia ]]; then 823 | XF86_DRIVERS=$(pacman -Qe | grep xf86-video | awk '{print $1}') 824 | [[ -n $XF86_DRIVERS ]] && pacman -Rcsn "$XF86_DRIVERS" 825 | if [ "$(ls /boot | grep hardened -c)" -gt "0" ] || [ "$(ls /boot | grep lts -c)" -gt "0" ] || [ "$(ls /boot | grep zen -c)" -gt "0" ]; then 826 | package_install "nvidia-dkms nvidia-utils libglvnd" 827 | echo "Do not forget to make a mkinitcpio every time you updated the nvidia driver!" 828 | else 829 | package_install "nvidia nvidia-utils libglvnd" 830 | fi 831 | [[ ${ARCHI} == x86_64 ]] && pacman -S --needed lib32-nvidia-utils 832 | replace_line '*options nouveau modeset=1' '#options nouveau modeset=1' /etc/modprobe.d/modprobe.conf 833 | replace_line '*MODULES="nouveau"' '#MODULES="nouveau"' /etc/mkinitcpio.conf 834 | create_ramdisk_environment 835 | nvidia-xconfig --add-argb-glx-visuals --allow-glx-with-composite --composite --render-accel -o /etc/X11/xorg.conf.d/20-nvidia.conf 836 | #}}} 837 | #Nouveau [NVIDIA] {{{ 838 | elif [[ ${VIDEO_DRIVER} == nouveau ]]; then 839 | is_package_installed "nvidia" && pacman -Rdds --noconfirm nvidia{,-utils} 840 | [[ ${ARCHI} == x86_64 ]] && is_package_installed "lib32-nvidia-utils" && pacman -Rdds --noconfirm lib32-nvidia-utils 841 | [[ -f /etc/X11/xorg.conf.d/20-nvidia.conf ]] && rm /etc/X11/xorg.conf.d/20-nvidia.conf 842 | package_install "xf86-video-${VIDEO_DRIVER} mesa-libgl libvdpau-va-gl" 843 | replace_line '#*options nouveau modeset=1' 'options nouveau modeset=1' /etc/modprobe.d/modprobe.conf 844 | replace_line '#*MODULES="nouveau"' 'MODULES="nouveau"' /etc/mkinitcpio.conf 845 | create_ramdisk_environment 846 | #}}} 847 | #ATI {{{ 848 | elif [[ ${VIDEO_DRIVER} == ati ]]; then 849 | [[ -f /etc/X11/xorg.conf.d/20-radeon.conf ]] && rm /etc/X11/xorg.conf.d/20-radeon.conf 850 | [[ -f /etc/X11/xorg.conf ]] && rm /etc/X11/xorg.conf 851 | package_install "xf86-video-${VIDEO_DRIVER} mesa-libgl mesa-vdpau libvdpau-va-gl" 852 | add_module "radeon" "ati" 853 | create_ramdisk_environment 854 | #}}} 855 | #AMDGPU {{{ 856 | elif [[ ${VIDEO_DRIVER} == amdgpu ]]; then 857 | [[ -f /etc/X11/xorg.conf.d/20-radeon.conf ]] && rm /etc/X11/xorg.conf.d/20-radeon.conf 858 | [[ -f /etc/X11/xorg.conf ]] && rm /etc/X11/xorg.conf 859 | package_install "xf86-video-${VIDEO_DRIVER} vulkan-radeon mesa-libgl mesa-vdpau libvdpau-va-gl" 860 | add_module "amdgpu radeon" "ati" 861 | create_ramdisk_environment 862 | #}}} 863 | #Intel {{{ 864 | elif [[ ${VIDEO_DRIVER} == intel ]]; then 865 | package_install "xf86-video-${VIDEO_DRIVER} mesa-libgl libvdpau-va-gl" 866 | #}}} 867 | #Vesa {{{ 868 | else 869 | package_install "xf86-video-${VIDEO_DRIVER} mesa-libgl libvdpau-va-gl" 870 | fi 871 | #}}} 872 | if [[ ${ARCHI} == x86_64 ]]; then 873 | is_package_installed "mesa-libgl" && package_install "lib32-mesa-libgl" 874 | is_package_installed "mesa-vdpau" && package_install "lib32-mesa-vdpau" 875 | fi 876 | if is_package_installed "libvdpau-va-gl"; then 877 | add_line "export VDPAU_DRIVER=va_gl" "/etc/profile" 878 | fi 879 | pause_function 880 | } 881 | #}}} 882 | #CUPS {{{ 883 | install_cups() { 884 | print_title "CUPS - https://wiki.archlinux.org/index.php/Cups" 885 | print_info "CUPS is the standards-based, open source printing system developed by Apple Inc. for Mac OS X and other UNIX-like operating systems." 886 | read_input_text "Install CUPS (aka Common Unix Printing System)" "$CUPS" 887 | if [[ $OPTION == y ]]; then 888 | package_install "cups cups-pdf" 889 | package_install "gutenprint ghostscript gsfonts foomatic-db foomatic-db-engine foomatic-db-nonfree foomatic-db-ppds foomatic-db-nonfree-ppds foomatic-db-gutenprint-ppds" 890 | system_ctl enable org.cups.cupsd.service 891 | pause_function 892 | fi 893 | } 894 | #}}} 895 | #ADDITIONAL FIRMWARE {{{ 896 | install_additional_firmwares() { 897 | print_title "INSTALL ADDITIONAL FIRMWARES" 898 | read_input_text "Install additional firmwares [Audio,Bluetooth,Scanner,Wireless]" "$FIRMWARE" 899 | if [[ $OPTION == y ]]; then 900 | while true; do 901 | print_title "INSTALL ADDITIONAL FIRMWARES" 902 | echo " 1) $(menu_item "aic94xx-firmware") $AUR" 903 | echo " 2) $(menu_item "alsa-firmware")" 904 | echo " 3) $(menu_item "b43-firmware") $AUR" 905 | echo " 4) $(menu_item "b43-firmware-legacy") $AUR" 906 | echo " 5) $(menu_item "bluez-firmware") [Broadcom BCM203x/STLC2300 Bluetooth]" 907 | echo " 6) $(menu_item "broadcom-wl-dkms")" 908 | echo " 7) $(menu_item "ipw2100-fw")" 909 | echo " 8) $(menu_item "ipw2200-fw")" 910 | echo " 9) $(menu_item "libffado") [Fireware Audio Devices]" 911 | echo "10) $(menu_item "libmtp") [Android Devices]" 912 | echo "11) $(menu_item "libraw1394") [IEEE1394 Driver]" 913 | echo "12) $(menu_item "wd719x-firmware") $AUR" 914 | echo "13) $(menu_item "upd72020x-fw") [Renesas USB3.0 Driver] $AUR" 915 | echo "" 916 | echo " d) DONE" 917 | echo "" 918 | FIRMWARE_OPTIONS+=" d" 919 | read_input_options "$FIRMWARE_OPTIONS" 920 | for OPT in "${OPTIONS[@]}"; do 921 | case "$OPT" in 922 | 1) 923 | aur_package_install "aic94xx-firmware" 924 | ;; 925 | 2) 926 | package_install "alsa-firmware" 927 | ;; 928 | 3) 929 | aur_package_install "b43-firmware" 930 | ;; 931 | 4) 932 | aur_package_install "b43-firmware-legacy" 933 | ;; 934 | 5) 935 | package_install "bluez-firmware" 936 | ;; 937 | 6) 938 | package_install "broadcom-wl-dkms" 939 | ;; 940 | 7) 941 | package_install "ipw2100-fw" 942 | ;; 943 | 8) 944 | package_install "ipw2200-fw" 945 | ;; 946 | 9) 947 | package_install "libffado" 948 | ;; 949 | 10) 950 | package_install "libmtp" 951 | package_install "android-udev" 952 | ;; 953 | 11) 954 | package_install "libraw1394" 955 | ;; 956 | 12) 957 | aur_package_install "wd719x-firmware" 958 | ;; 959 | 13) 960 | aur_package_install "upd72020x-fw" 961 | ;; 962 | "d") 963 | break 964 | ;; 965 | *) 966 | invalid_option 967 | ;; 968 | esac 969 | done 970 | source sharedfuncs_elihw 971 | create_ramdisk_environment 972 | done 973 | fi 974 | } 975 | #}}} 976 | #DESKTOP ENVIRONMENT {{{ 977 | install_desktop_environment() { 978 | install_icon_theme() { #{{{ 979 | while true; do 980 | print_title "GNOME ICONS" 981 | echo " 1) $(menu_item "arc-icon-theme")" 982 | echo " 2) $(menu_item "adwaita-icon-theme-git") $AUR" 983 | echo " 3) $(menu_item "emerald-icon-theme-git") $AUR" 984 | echo " 4) $(menu_item "la-capitaine-icon-theme-git") $AUR" 985 | echo " 5) $(menu_item "numix-icon-theme-git") $AUR" 986 | echo " 6) $(menu_item "paper-icon-theme-git") $AUR" 987 | echo " 7) $(menu_item "papirus-icon-theme-git") $AUR" 988 | echo " 8) $(menu_item "pop-icon-theme-git") $AUR" 989 | echo " 9) $(menu_item "solus-icon-theme-git") $AUR" 990 | echo "10) $(menu_item "yaru-icon-theme-git") $AUR" 991 | echo "" 992 | echo " b) BACK" 993 | echo "" 994 | ICONS_THEMES+=" b" 995 | read_input_options "$ICONS_THEMES" 996 | for OPT in "${OPTIONS[@]}"; do 997 | case "$OPT" in 998 | 1) 999 | package_install "arc-icon-theme elementary-icon-theme" 1000 | ;; 1001 | 2) 1002 | aur_package_install "adwaita-icon-theme-git" 1003 | ;; 1004 | 3) 1005 | aur_package_install "emerald-icon-theme-git" 1006 | ;; 1007 | 4) 1008 | aur_package_install "la-capitaine-icon-theme-git" 1009 | ;; 1010 | 5) 1011 | aur_package_install "numix-icon-theme-git numix-circle-icon-theme-git" 1012 | ;; 1013 | 6) 1014 | aur_package_install "paper-icon-theme-git" 1015 | ;; 1016 | 7) 1017 | aur_package_install "papirus-icon-theme-git" 1018 | ;; 1019 | 8) 1020 | aur_package_install "pop-icon-theme-git" 1021 | ;; 1022 | 9) 1023 | aur_package_install "solus-icon-theme-git" 1024 | ;; 1025 | 10) 1026 | aur_package_install "yaru-icon-theme-git" 1027 | ;; 1028 | "b") 1029 | break 1030 | ;; 1031 | *) 1032 | invalid_option 1033 | ;; 1034 | esac 1035 | done 1036 | source sharedfuncs_elihw 1037 | done 1038 | } #}}} 1039 | install_gtk_theme() { #{{{ 1040 | while true; do 1041 | print_title "GTK2/GTK3 THEMES" 1042 | echo " 1) $(menu_item "arc-gtk-theme")" 1043 | echo " 2) $(menu_item "abrus-gtk-theme-git") $AUR" 1044 | echo " 3) $(menu_item "acid-gtk-theme") $AUR" 1045 | echo " 4) $(menu_item "adapta-gtk-theme-git") $AUR" 1046 | echo " 5) $(menu_item "amber-theme-git") $AUR" 1047 | echo " 6) $(menu_item "candy-gtk-theme") $AUR" 1048 | echo " 7) $(menu_item "evopop-gtk-theme-git") $AUR" 1049 | echo " 8) $(menu_item "flat-remix-gtk") $AUR" 1050 | echo " 9) $(menu_item "zuki-themes-git") $AUR" 1051 | echo "10) $(menu_item "zukitwo-themes-git") $AUR" 1052 | echo "" 1053 | echo " b) BACK" 1054 | echo "" 1055 | GTK_THEMES+=" b" 1056 | read_input_options "$GTK_THEMES" 1057 | for OPT in "${OPTIONS[@]}"; do 1058 | case "$OPT" in 1059 | 1) 1060 | package_install "arc-gtk-theme" 1061 | ;; 1062 | 2) 1063 | aur_package_install "abrus-gtk-theme-git" 1064 | ;; 1065 | 3) 1066 | aur_package_install "acid-gtk-theme" 1067 | ;; 1068 | 4) 1069 | aur_package_install "adapta-gtk-theme-git" 1070 | ;; 1071 | 5) 1072 | aur_package_install "amber-theme-git" 1073 | ;; 1074 | 6) 1075 | aur_package_install "candy-gtk-theme" 1076 | ;; 1077 | 7) 1078 | aur_package_install "evopop-gtk-theme-git" 1079 | ;; 1080 | 8) 1081 | aur_package_install "flat-remix-gtk" 1082 | ;; 1083 | 9) 1084 | aur_package_install "zuki-themes-git" 1085 | ;; 1086 | 10) 1087 | aur_package_install "zukitwo-themes-git" 1088 | ;; 1089 | "b") 1090 | break 1091 | ;; 1092 | *) 1093 | invalid_option 1094 | ;; 1095 | esac 1096 | done 1097 | source sharedfuncs_elihw 1098 | done 1099 | } #}}} 1100 | install_display_manager() { #{{{ 1101 | while true; do 1102 | print_title "DISPLAY MANAGER - https://wiki.archlinux.org/index.php/Display_Manager" 1103 | print_info "A display manager, or login manager, is a graphical interface screen that is displayed at the end of the boot process in place of the default shell." 1104 | echo " 1) $(menu_item "entrance-git" "Entrance") $AUR" 1105 | echo " 2) $(menu_item "gdm" "GDM")" 1106 | echo " 3) $(menu_item "lightdm" "LightDM")" 1107 | echo " 4) $(menu_item "sddm" "SDDM")" 1108 | echo " 5) $(menu_item "slim" "Slim")" 1109 | echo " 6) $(menu_item "lxdm" "lxdm")" 1110 | echo " 7) $(menu_item "lxdm-gtk3" "lxdm-gtk3")" 1111 | echo "" 1112 | echo " b) BACK|SKIP" 1113 | echo "" 1114 | DISPLAY_MANAGER+=" b" 1115 | read_input_options "$DISPLAY_MANAGER" 1116 | for OPT in "${OPTIONS[@]}"; do 1117 | case "$OPT" in 1118 | 1) 1119 | aur_package_install "entrance-git" 1120 | system_ctl enable entrance 1121 | ;; 1122 | 2) 1123 | package_install "gdm" 1124 | system_ctl enable gdm 1125 | ;; 1126 | 3) 1127 | if [[ ${KDE} -eq 1 ]]; then 1128 | package_install "lightdm lightdm-kde-greeter" 1129 | else 1130 | package_install "lightdm lightdm-gtk-greeter" 1131 | fi 1132 | system_ctl enable lightdm 1133 | ;; 1134 | 4) 1135 | package_install "sddm sddm-kcm" 1136 | system_ctl enable sddm 1137 | sddm --example-config >/etc/sddm.conf 1138 | sed -i 's/Current=/Current=breeze/' /etc/sddm.conf 1139 | sed -i 's/CursorTheme=/CursorTheme=breeze_cursors/' /etc/sddm.conf 1140 | sed -i 's/Numlock=none/Numlock=on/' /etc/sddm.conf 1141 | ;; 1142 | 5) 1143 | package_install "slim" 1144 | system_ctl enable slim 1145 | ;; 1146 | 6) 1147 | package_install "lxdm" 1148 | system_ctl enable lxdm 1149 | ;; 1150 | 7) 1151 | package_install "lxdm-gtk3" 1152 | system_ctl enable lxdm 1153 | ;; 1154 | "b") 1155 | break 1156 | ;; 1157 | *) 1158 | invalid_option 1159 | ;; 1160 | esac 1161 | done 1162 | source sharedfuncs_elihw 1163 | done 1164 | } #}}} 1165 | install_themes() { #{{{ 1166 | while true; do 1167 | print_title "$1 THEMES" 1168 | echo " 1) $(menu_item "arc-icon-theme" "Icons Themes")" 1169 | echo " 2) $(menu_item "arc-gtk-theme" "GTK Themes")" 1170 | echo "" 1171 | echo " d) DONE" 1172 | echo "" 1173 | THEMES_OPTIONS+=" d" 1174 | read_input_options "$THEMES_OPTIONS" 1175 | for OPT in "${OPTIONS[@]}"; do 1176 | case "$OPT" in 1177 | 1) 1178 | install_icon_theme 1179 | OPT=1 1180 | ;; 1181 | 2) 1182 | install_gtk_theme 1183 | OPT=2 1184 | ;; 1185 | "d") 1186 | break 1187 | ;; 1188 | *) 1189 | invalid_option 1190 | ;; 1191 | esac 1192 | done 1193 | source sharedfuncs_elihw 1194 | done 1195 | } #}}} 1196 | install_misc_apps() { #{{{ 1197 | while true; do 1198 | print_title "$1 ESSENTIAL APPS" 1199 | echo " 1) $(menu_item "entrance-git gdm lightdm sddm" "Display Manager") $AUR" 1200 | echo " 2) $(menu_item "dmenu")" 1201 | echo " 3) $(menu_item "viewnior")" 1202 | echo " 4) $(menu_item "gmrun")" 1203 | echo " 5) $(menu_item "rxvt-unicode")" 1204 | echo " 6) $(menu_item "squeeze-git") $AUR" 1205 | echo " 7) $(menu_item "thunar")" 1206 | echo " 8) $(menu_item "tint2")" 1207 | echo " 9) $(menu_item "volwheel")" 1208 | echo "10) $(menu_item "xfburn")" 1209 | echo "11) $(menu_item "xcompmgr")" 1210 | echo "12) $(menu_item "zathura")" 1211 | echo "13) $(menu_item "speedtest-cli")" 1212 | echo "" 1213 | echo " d) DONE" 1214 | echo "" 1215 | MISCAPPS+=" d" 1216 | read_input_options "$MISCAPPS" 1217 | for OPT in "${OPTIONS[@]}"; do 1218 | case "$OPT" in 1219 | 1) 1220 | install_display_manager 1221 | OPT=1 1222 | ;; 1223 | 2) 1224 | package_install "dmenu" 1225 | ;; 1226 | 3) 1227 | package_install "viewnior" 1228 | ;; 1229 | 4) 1230 | package_install "gmrun" 1231 | ;; 1232 | 5) 1233 | package_install "rxvt-unicode" 1234 | ;; 1235 | 6) 1236 | aur_package_install "squeeze-git" 1237 | ;; 1238 | 7) 1239 | package_install "thunar tumbler" 1240 | ;; 1241 | 8) 1242 | package_install "tint2" 1243 | ;; 1244 | 9) 1245 | package_install "volwheel" 1246 | ;; 1247 | 10) 1248 | package_install "xfburn" 1249 | ;; 1250 | 11) 1251 | package_install "xcompmgr transset-df" 1252 | ;; 1253 | 12) 1254 | package_install "zathura" 1255 | ;; 1256 | 13) 1257 | package_install "speedtest-cli" 1258 | ;; 1259 | "d") 1260 | break 1261 | ;; 1262 | *) 1263 | invalid_option 1264 | ;; 1265 | esac 1266 | done 1267 | source sharedfuncs_elihw 1268 | done 1269 | } #}}} 1270 | 1271 | print_title "DESKTOP ENVIRONMENT|WINDOW MANAGER" 1272 | print_info "A DE provide a complete GUI for a system by bundling together a variety of X clients written using a common widget toolkit and set of libraries.\n\nA window manager is one component of a system's graphical user interface." 1273 | 1274 | echo -e "Select your DE or WM:\n" 1275 | echo " --- DE --- --- WM ---" 1276 | echo " 1) Cinnamon 12) Awesome" 1277 | echo " 2) Deepin 13) Fluxbox" 1278 | echo " 3) Enlightenment 14) i3" 1279 | echo " 4) GNOME 15) i3-Gaps" 1280 | echo " 5) KDE 16) OpenBox" 1281 | echo " 6) LXQT 17) Xmonad" 1282 | echo " 7) Mate" 1283 | echo " 8) XFCE" 1284 | echo " 9) Budgie" 1285 | echo " 10) UKUI" 1286 | echo " 11) Pantheon" 1287 | echo "" 1288 | echo " b) BACK" 1289 | read_input "$DESKTOPENV" 1290 | case "$OPTION" in 1291 | 1) 1292 | #CINNAMON {{{ 1293 | print_title "CINNAMON - https://wiki.archlinux.org/index.php/Cinnamon" 1294 | print_info "Cinnamon is a fork of GNOME Shell, initially developed by Linux Mint. It attempts to provide a more traditional user environment based on the desktop metaphor, like GNOME 2. Cinnamon uses Muffin, a fork of the GNOME 3 window manager Mutter, as its window manager." 1295 | package_install "cinnamon nemo-fileroller nemo-preview" 1296 | # Cinnamon does not include the following: a screenshot utility, editor, terminal... Hence installing some default choices explicitly. 1297 | package_install "gnome-screenshot gedit gnome-terminal gnome-control-center gnome-system-monitor gnome-power-manager" 1298 | # Suggested by https://bbs.archlinux.org/viewtopic.php?id=185123 1299 | aur_package_install "mintlocale" 1300 | # config xinitrc 1301 | config_xinitrc "cinnamon-session" 1302 | CINNAMON=1 1303 | pause_function 1304 | install_display_manager 1305 | install_themes "CINNAMON" 1306 | ;; 1307 | #}}} 1308 | 2) 1309 | #DEEPIN {{{ 1310 | print_title "DEEPIN - https://wiki.archlinux.org/index.php/Deepin_Desktop_Environment" 1311 | print_info "The desktop interface and apps feature an intuitive and elegant design. Moving around, sharing and searching etc. has become simply a joyful experience." 1312 | package_install "deepin deepin-extra lightdm-gtk-greeter" 1313 | # config xinitrc 1314 | config_xinitrc "startdde" 1315 | #Tweaks 1316 | pause_function 1317 | system_ctl enable lightdm 1318 | sed -i 's/#greeter-session=example-gtk-gnome/greeter-session=lightdm-deepin-greeter/' /etc/lightdm/lightdm.conf 1319 | ;; 1320 | #}}} 1321 | 3) 1322 | #ENLIGHTENMENT {{{ 1323 | print_title "ENLIGHTENMENT - http://wiki.archlinux.org/index.php/Enlightenment" 1324 | print_info "Enlightenment, also known simply as E, is a stacking window manager for the X Window System which can be used alone or in conjunction with a desktop environment such as GNOME or KDE. Enlightenment is often used as a substitute for a full desktop environment." 1325 | package_install "enlightenment terminology" 1326 | package_install "leafpad epdfview" 1327 | package_install "lxappearance" 1328 | # config xinitrc 1329 | config_xinitrc "enlightenment_start" 1330 | pause_function 1331 | install_misc_apps "Enlightenment" 1332 | install_themes "Enlightenment" 1333 | ;; 1334 | #}}} 1335 | 4) 1336 | #GNOME {{{ 1337 | print_title "GNOME - https://wiki.archlinux.org/index.php/GNOME" 1338 | print_info "GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software. It is an international project that includes creating software development frameworks, selecting application software for the desktop, and working on the programs that manage application launching, file handling, and window and task management." 1339 | package_install "gnome gnome-extra gnome-software gnome-initial-setup" 1340 | package_install "deja-dup gedit-plugins gpaste gnome-tweak-tool gnome-power-manager" 1341 | package_install "nautilus-share" 1342 | # remove gnome games 1343 | package_remove "aisleriot atomix four-in-a-row five-or-more gnome-2048 gnome-chess gnome-klotski gnome-mahjongg gnome-mines gnome-nibbles gnome-robots gnome-sudoku gnome-tetravex gnome-taquin swell-foop hitori iagno quadrapassel lightsoff tali" 1344 | # config xinitrc 1345 | config_xinitrc "gnome-session" 1346 | GNOME=1 1347 | pause_function 1348 | install_themes "GNOME" 1349 | #Gnome Display Manager (a reimplementation of xdm) 1350 | system_ctl enable gdm 1351 | ;; 1352 | #}}} 1353 | 5) 1354 | #KDE {{{ 1355 | print_title "KDE - https://wiki.archlinux.org/index.php/KDE" 1356 | print_info "KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems. It is known for its Plasma Desktop, a desktop environment provided as the default working environment on many Linux distributions." 1357 | package_install "plasma kf5 sddm" 1358 | package_install "ark dolphin dolphin-plugins kaccounts-providers kio-extras kdeconnect sshfs quota-tools gwenview kipi-plugins kwrite kcalc konsole spectacle okular sweeper kwalletmanager packagekit-qt5" 1359 | is_package_installed "cups" && package_install "print-manager" 1360 | [[ $LOCALE != en_US ]] && package_install "kde-l10n-$LOCALE_KDE" 1361 | # config xinitrc 1362 | config_xinitrc "startkde" 1363 | pause_function 1364 | #KDE CUSTOMIZATION {{{ 1365 | while true; do 1366 | print_title "KDE CUSTOMIZATION" 1367 | echo " 1) $(menu_item "choqok")" 1368 | echo " 2) $(menu_item "digikam")" 1369 | echo " 3) $(menu_item "k3b")" 1370 | echo " 4) $(menu_item "kvantum") $AUR" 1371 | echo " 5) $(menu_item "latte-dock")" 1372 | echo " 6) $(menu_item "skrooge")" 1373 | echo " 7) $(menu_item "yakuake")" 1374 | echo "" 1375 | echo " d) DONE" 1376 | echo "" 1377 | KDE_OPTIONS+=" d" 1378 | read_input_options "$KDE_OPTIONS" 1379 | for OPT in "${OPTIONS[@]}"; do 1380 | case "$OPT" in 1381 | 1) 1382 | package_install "choqok" 1383 | ;; 1384 | 2) 1385 | package_install "digikam" 1386 | ;; 1387 | 3) 1388 | package_install "k3b cdrdao dvd+rw-tools" 1389 | ;; 1390 | 4) 1391 | aur_package_install "kvantum-qt5-git" 1392 | ;; 1393 | 5) 1394 | package_install "latte-dock" 1395 | ;; 1396 | 6) 1397 | package_install "skrooge" 1398 | ;; 1399 | 7) 1400 | package_install "yakuake" 1401 | ;; 1402 | "d") 1403 | break 1404 | ;; 1405 | *) 1406 | invalid_option 1407 | ;; 1408 | esac 1409 | done 1410 | source sharedfuncs_elihw 1411 | done 1412 | #}}} 1413 | system_ctl enable sddm 1414 | sddm --example-config >/etc/sddm.conf 1415 | sed -i 's/Current=/Current=breeze/' /etc/sddm.conf 1416 | sed -i 's/CursorTheme=/CursorTheme=breeze_cursors/' /etc/sddm.conf 1417 | sed -i 's/Numlock=none/Numlock=on/' /etc/sddm.conf 1418 | KDE=1 1419 | ;; 1420 | #}}} 1421 | 6) 1422 | #LXQT {{{ 1423 | print_title "LXQT - http://wiki.archlinux.org/index.php/lxqt" 1424 | print_info "LXQt is the Qt port and the upcoming version of LXDE, the Lightweight Desktop Environment. It is the product of the merge between the LXDE-Qt and the Razor-qt projects: A lightweight, modular, blazing-fast and user-friendly desktop environment." 1425 | package_install "lxqt openbox breeze-icons" 1426 | package_install "leafpad epdfview" 1427 | mkdir -p /home/"${username}"/.config/lxqt 1428 | cp /etc/xdg/lxqt/* /home/"${username}"/.config/lxqt 1429 | mkdir -p /home/"${username}"/.config/openbox/ 1430 | cp /etc/xdg/openbox/{menu.xml,rc.xml,autostart} /home/"${username}"/.config/openbox/ 1431 | chown -R "${username}":users /home/"${username}"/.config 1432 | # config xinitrc 1433 | config_xinitrc "startlxqt" 1434 | pause_function 1435 | install_misc_apps "LXQT" 1436 | install_themes "LXQT" 1437 | KDE=1 1438 | ;; 1439 | #}}} 1440 | 7) 1441 | #MATE {{{ 1442 | print_title "MATE - https://wiki.archlinux.org/index.php/Mate" 1443 | print_info "The MATE Desktop Environment is a fork of GNOME 2 that aims to provide an attractive and intuitive desktop to Linux users using traditional metaphors." 1444 | package_install "mate mate-extra" 1445 | # config xinitrc 1446 | config_xinitrc "mate-session" 1447 | pause_function 1448 | install_display_manager 1449 | install_themes "MATE" 1450 | ;; 1451 | #}}} 1452 | 8) 1453 | #XFCE {{{ 1454 | print_title "XFCE - https://wiki.archlinux.org/index.php/Xfce" 1455 | print_info "Xfce is a free software desktop environment for Unix and Unix-like platforms, such as Linux, Solaris, and BSD. It aims to be fast and lightweight, while still being visually appealing and easy to use." 1456 | package_install "xfce4 xfce4-goodies xarchiver mupdf" 1457 | # config xinitrc 1458 | config_xinitrc "startxfce4" 1459 | pause_function 1460 | install_display_manager 1461 | install_themes "XFCE" 1462 | ;; 1463 | #}}} 1464 | 9) 1465 | #BUDGIE {{{ 1466 | print_title "BUDGIE - https://wiki.archlinux.org/index.php/Budgie_Desktop" 1467 | print_info "Budgie is the default desktop of Solus Operating System, written from scratch. Besides a more modern design, Budgie can emulate the look and feel of the GNOME 2 desktop." 1468 | package_install "gnome gnome-extra gnome-software gnome-initial-setup telepathy" 1469 | package_install "deja-dup gedit-plugins gpaste gnome-tweak-tool gnome-power-manager" 1470 | package_install "budgie-desktop" 1471 | package_install "nautilus-share" 1472 | # remove gnome games 1473 | package_remove "aisleriot atomix four-in-a-row five-or-more gnome-2048 gnome-chess gnome-klotski gnome-mahjongg gnome-mines gnome-nibbles gnome-robots gnome-sudoku gnome-tetravex gnome-taquin swell-foop hitori iagno quadrapassel lightsoff" 1474 | # config xinitrc 1475 | config_xinitrc "export XDG_CURRENT_DESKTOP=Budgie:GNOME \n budgie-desktop" 1476 | GNOME=1 1477 | pause_function 1478 | install_themes "GNOME" 1479 | #Gnome Display Manager (a reimplementation of xdm) 1480 | system_ctl enable gdm 1481 | ;; 1482 | #}}} 1483 | 10) 1484 | #UKUI {{{ 1485 | print_title "UKUI - https://wiki.archlinux.org/index.php/UKUI" 1486 | print_info "UKUI is a lightweight Linux desktop environment, developed based on GTK and Qt. UKUI is the default desktop environment for Ubuntu kylin." 1487 | package_install "ukui xorg-server" 1488 | # config xinitrc 1489 | config_xinitrc "ukui-session" 1490 | pause_function 1491 | #Light Display Manager 1492 | system_ctl enable lightdm 1493 | ;; 1494 | #}}} 1495 | 11) 1496 | #Pantheon {{{ 1497 | print_title "Pantheon - https://wiki.archlinux.org/title/Pantheon" 1498 | print_info "Pantheon is the desktop environment of elementary OS. It is written in Vala, using GTK 3 and Granite." 1499 | package_install "pantheon pantheon-print xorg-server" 1500 | aur_package_install "switchboard-plug-pantheon-tweaks-git" 1501 | # config xinitrc 1502 | config_xinitrc "io.elementary.wingpanel & \n plank & \n exec gala" 1503 | pause_function 1504 | #Light Display Manager 1505 | system_ctl enable lightdm 1506 | sed -i 's/#greeter-session=example-gtk-gnome/greeter-session=lightdm-pantheon-greeter/' /etc/lightdm/lightdm.conf 1507 | ;; 1508 | #}}} 1509 | 12) 1510 | #AWESOME {{{ 1511 | print_title "AWESOME - http://wiki.archlinux.org/index.php/Awesome" 1512 | print_info "awesome is a highly configurable, next generation framework window manager for X. It is very fast, extensible and licensed under the GNU GPLv2 license." 1513 | package_install "awesome" 1514 | package_install "lxappearance" 1515 | package_install "leafpad epdfview nitrogen" 1516 | if [[ ! -d /home/${username}/.config/awesome/ ]]; then 1517 | mkdir -p /home/"${username}"/.config/awesome/ 1518 | cp /etc/xdg/awesome/rc.lua /home/"${username}"/.config/awesome/ 1519 | chown -R "${username}":users /home/"${username}"/.config 1520 | fi 1521 | # config xinitrc 1522 | config_xinitrc "awesome" 1523 | pause_function 1524 | install_misc_apps "AWESOME" 1525 | install_themes "AWESOME" 1526 | ;; 1527 | #}}} 1528 | 13) 1529 | #FLUXBOX {{{ 1530 | print_title "FLUXBOX - http://wiki.archlinux.org/index.php/Fluxbox" 1531 | print_info "Fluxbox is yet another window manager for X11. It is based on the (now abandoned) Blackbox 0.61.1 code, but with significant enhancements and continued development. Fluxbox is very light on resources and fast, yet provides interesting window management tools such as tabbing and grouping." 1532 | package_install "fluxbox menumaker" 1533 | package_install "lxappearance" 1534 | package_install "leafpad epdfview" 1535 | # config xinitrc 1536 | config_xinitrc "startfluxbox" 1537 | install_misc_apps "FLUXBOX" 1538 | install_themes "FLUXBOX" 1539 | pause_function 1540 | ;; 1541 | #}}} 1542 | 14) 1543 | #I3 {{{ 1544 | print_title "i3 - https://wiki.archlinux.org/index.php/I3" 1545 | print_info "i3 is a dynamic tiling window manager inspired by wmii that is primarily targeted at developers and advanced users. The stated goals for i3 include clear documentation, proper multi-monitor support, a tree structure for windows, and different modes like in vim." 1546 | package_install "i3-wm" 1547 | package_install "dmenu" 1548 | # config xinitrc 1549 | config_xinitrc "i3" 1550 | pause_function 1551 | install_misc_apps "i3" 1552 | install_themes "i3" 1553 | ;; 1554 | #}}} 1555 | 15) 1556 | #I3-Gaps {{{ 1557 | print_title "i3 - https://wiki.archlinux.org/index.php/I3" 1558 | print_info "i3-gaps is a fork of i3wm, a tiling window manager for X11 with more features, such as gaps between windows." 1559 | package_install "i3-gaps" 1560 | install_misc_apps "i3" 1561 | install_themes "i3" 1562 | # config xinitrc 1563 | config_xinitrc "i3" 1564 | pause_function 1565 | #i3-GAPS CUSTOMIZATION {{{ 1566 | while true; do 1567 | print_title "i3-GAPS CUSTOMIZATION" 1568 | echo " 1) $(menu_item "arandr")" 1569 | echo " 2) $(menu_item "bashtop")" 1570 | echo " 3) $(menu_item "cava") $AUR" 1571 | echo " 4) $(menu_item "cmus")" 1572 | echo " 5) $(menu_item "dmenu")" 1573 | echo " 6) $(menu_item "dunst")" 1574 | echo " 7) $(menu_item "excalibar") $AUR" 1575 | echo " 8) $(menu_item "feh")" 1576 | echo " 9) $(menu_item "picom")" 1577 | echo "10) $(menu_item "polybar") $AUR" 1578 | echo "11) $(menu_item "qutebrowser")" 1579 | echo "12) $(menu_item "ranger")" 1580 | echo "13) $(menu_item "rofi")" 1581 | echo "14) $(menu_item "rxvt-unicode")" 1582 | echo "" 1583 | echo " d) DONE" 1584 | echo "" 1585 | GAPS_OPTIONS+=" d" 1586 | read_input_options "$GAPS_OPTIONS" 1587 | for OPT in "${OPTIONS[@]}"; do 1588 | case "$OPT" in 1589 | 1) 1590 | package_install "arandr" 1591 | ;; 1592 | 2) 1593 | package_install "bashtop" 1594 | ;; 1595 | 3) 1596 | aur_package_install "cava" 1597 | ;; 1598 | 4) 1599 | package_install "cmus" 1600 | ;; 1601 | 5) 1602 | package_install "dmenu" 1603 | ;; 1604 | 6) 1605 | package_install "dunst" 1606 | ;; 1607 | 7) 1608 | aur_package_install "excalibar-git" 1609 | ;; 1610 | 8) 1611 | package_install "feh" 1612 | ;; 1613 | 9) 1614 | package_install "picom" 1615 | ;; 1616 | 10) 1617 | aur_package_install "polybar" 1618 | ;; 1619 | 11) 1620 | package_install "qutebrowser" 1621 | ;; 1622 | 12) 1623 | package_install "ranger" 1624 | ;; 1625 | 13) 1626 | package_install "rofi" 1627 | ;; 1628 | 14) 1629 | package_install "rxvt-unicode" 1630 | ;; 1631 | "d") 1632 | break 1633 | ;; 1634 | *) 1635 | invalid_option 1636 | ;; 1637 | esac 1638 | done 1639 | source sharedfuncs_elihw 1640 | done 1641 | ;; 1642 | #}}} 1643 | 16) 1644 | #OPENBOX {{{ 1645 | print_title "OPENBOX - http://wiki.archlinux.org/index.php/Openbox" 1646 | print_info "Openbox is a lightweight and highly configurable window manager with extensive standards support." 1647 | package_install "openbox obconf obmenu menumaker" 1648 | package_install "lxappearance" 1649 | package_install "leafpad epdfview nitrogen" 1650 | mkdir -p /home/"${username}"/.config/openbox/ 1651 | cp /etc/xdg/openbox/{menu.xml,rc.xml,autostart} /home/"${username}"/.config/openbox/ 1652 | chown -R "${username}":users /home/"${username}"/.config 1653 | # config xinitrc 1654 | config_xinitrc "openbox-session" 1655 | pause_function 1656 | install_misc_apps "OPENBOX" 1657 | install_themes "OPENBOX" 1658 | ;; 1659 | #}}} 1660 | 17) 1661 | #XMONAD {{{ 1662 | print_title "XMONAD - http://wiki.archlinux.org/index.php/Xmonad" 1663 | print_info "xmonad is a tiling window manager for X. Windows are arranged automatically to tile the screen without gaps or overlap, maximizing screen use. Window manager features are accessible from the keyboard: a mouse is optional." 1664 | package_install "xmonad xmonad-contrib" 1665 | # config xinitrc 1666 | config_xinitrc "xmonad" 1667 | pause_function 1668 | install_misc_apps "XMONAD" 1669 | install_themes "XMONAD" 1670 | ;; 1671 | #}}} 1672 | "b") ;; 1673 | 1674 | *) 1675 | invalid_option 1676 | install_desktop_environment 1677 | ;; 1678 | esac 1679 | #COMMON PKGS {{{ 1680 | #MTP SUPPORT {{{ 1681 | if is_package_installed "libmtp"; then 1682 | package_install "gvfs-mtp" 1683 | fi 1684 | #}}} 1685 | if [[ ${KDE} -eq 0 ]]; then 1686 | package_install "gvfs gvfs-goa gvfs-afc gvfs-mtp gvfs-google" 1687 | package_install "xdg-user-dirs-gtk" 1688 | package_install "pavucontrol" 1689 | package_install "ttf-bitstream-vera ttf-dejavu" 1690 | aur_package_install "gnome-defaults-list" 1691 | is_package_installed "cups" && package_install "system-config-printer gtk3-print-backends" 1692 | is_package_installed "samba" && package_install "gvfs-smb" 1693 | fi 1694 | #}}} 1695 | #COMMON CONFIG {{{ 1696 | # speed up application startup 1697 | mkdir -p ~/.compose-cache 1698 | # D-Bus interface for user account query and manipulation 1699 | system_ctl enable accounts-daemon 1700 | # Improvements 1701 | add_line "fs.inotify.max_user_watches = 524288" "/etc/sysctl.d/99-sysctl.conf" 1702 | #}}} 1703 | } 1704 | #}}} 1705 | #CONNMAN/NETWORKMANAGER/WICD {{{ 1706 | install_nm_wicd() { 1707 | print_title "NETWORK MANAGER" 1708 | echo " 1) Networkmanager" 1709 | echo " 2) Wicd" 1710 | echo " 3) ConnMan" 1711 | echo "" 1712 | echo " n) NONE" 1713 | echo "" 1714 | read_input "$NETWORKMANAGER" 1715 | case "$OPTION" in 1716 | 1) 1717 | print_title "NETWORKMANAGER - https://wiki.archlinux.org/index.php/Networkmanager" 1718 | print_info "NetworkManager is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks." 1719 | package_install "networkmanager dnsmasq networkmanager-openconnect networkmanager-openvpn networkmanager-pptp networkmanager-vpnc" 1720 | if [[ ${KDE} -eq 1 ]]; then 1721 | package_install "plasma-nm" 1722 | elif [[ ${GNOME} -eq 0 ]]; then 1723 | package_install "network-manager-applet nm-connection-editor gnome-keyring" 1724 | fi 1725 | # network management daemon 1726 | system_ctl enable NetworkManager.service 1727 | pause_function 1728 | ;; 1729 | 2) 1730 | print_title "WICD - https://wiki.archlinux.org/index.php/Wicd" 1731 | print_info "Wicd is a network connection manager that can manage wireless and wired interfaces, similar and an alternative to NetworkManager." 1732 | if [[ ${KDE} -eq 1 ]]; then 1733 | echo "KDE unsupported. Installing CLI and curses versions only." 1734 | package_install "wicd" 1735 | else 1736 | package_install "wicd wicd-gtk" 1737 | fi 1738 | # WICD daemon 1739 | system_ctl enable wicd.service 1740 | pause_function 1741 | ;; 1742 | 3) 1743 | print_title "CONNMAN - https://wiki.archlinux.org/index.php/Connman" 1744 | print_info "ConnMan is an alternative to NetworkManager and Wicd and was created by Intel and the Moblin project for use with embedded devices." 1745 | package_install "connman" 1746 | # ConnMan daemon 1747 | system_ctl enable connman.service 1748 | pause_function 1749 | ;; 1750 | esac 1751 | } 1752 | #}}} 1753 | #USB 3G MODEM {{{ 1754 | install_usb_modem() { 1755 | print_title "USB 3G MODEM - https://wiki.archlinux.org/index.php/USB_3G_Modem" 1756 | print_info "A number of mobile telephone networks around the world offer mobile internet connections over UMTS (or EDGE or GSM) using a portable USB modem device." 1757 | read_input_text "Install usb 3G modem support" "$USBMODEM" 1758 | if [[ $OPTION == y ]]; then 1759 | package_install "usbutils usb_modeswitch" 1760 | if is_package_installed "networkmanager"; then 1761 | package_install "modemmanager" 1762 | [[ ${KDE} -eq 1 ]] && package_install "modemmanager-qt" 1763 | system_ctl enable ModemManager.service 1764 | else 1765 | package_install "wvdial" 1766 | fi 1767 | pause_function 1768 | fi 1769 | } 1770 | #}}} 1771 | #BLUETOOTH {{{ 1772 | install_bluetooth() { 1773 | print_title "BLUETOOTH - https://wiki.archlinux.org/index.php/Bluetooth" 1774 | print_info "Bluetooth is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is BlueZ" 1775 | read_input_text "Install bluetooth support" "$BLUETOOTH" 1776 | if [[ $OPTION == y ]]; then 1777 | package_install "bluez bluez-utils" 1778 | system_ctl enable bluetooth.service 1779 | pause_function 1780 | fi 1781 | } 1782 | #}}} 1783 | #ACCESSORIES {{{ 1784 | install_accessories_apps() { 1785 | while true; do 1786 | print_title "ACCESSORIES APPS" 1787 | echo " 1) $(menu_item "albert")" 1788 | echo " 2) $(menu_item "catfish")" 1789 | echo " 3) $(menu_item "conky-lua") $AUR" 1790 | echo " 4) $(menu_item "enpass-bin") $AUR" 1791 | echo " 5) $(menu_item "flameshot")" 1792 | echo " 6) $(menu_item "keepass")" 1793 | echo " 7) $(menu_item "pamac-aur" "Pamac") $AUR" 1794 | echo " 8) $(menu_item "shutter hotshots" "$([[ ${KDE} -eq 1 ]] && echo "Hotshots" || echo "Shutter")")" 1795 | echo " 9) $(menu_item "synapse")" 1796 | echo "10) $(menu_item "terminator")" 1797 | echo "11) $(menu_item "tilix-bin") $AUR" 1798 | echo "" 1799 | echo " b) BACK" 1800 | echo "" 1801 | ACCESSORIES_OPTIONS+=" b" 1802 | read_input_options "$ACCESSORIES_OPTIONS" 1803 | for OPT in "${OPTIONS[@]}"; do 1804 | case "$OPT" in 1805 | 1) 1806 | package_install "albert" 1807 | ;; 1808 | 2) 1809 | package_install "catfish" 1810 | ;; 1811 | 3) 1812 | aur_package_install "conky-lua" 1813 | package_install "lm_sensors" 1814 | sensors-detect --auto 1815 | ;; 1816 | 4) 1817 | aur_package_install "enpass-bin" 1818 | ;; 1819 | 5) 1820 | package_install "flameshot" 1821 | ;; 1822 | 6) 1823 | package_install "keepass" 1824 | ;; 1825 | 7) 1826 | aur_package_install "pamac-aur" 1827 | ;; 1828 | 8) 1829 | if [[ ${KDE} -eq 1 ]]; then 1830 | aur_package_install "hotshots" 1831 | else 1832 | aur_package_install "shutter" 1833 | fi 1834 | ;; 1835 | 9) 1836 | package_install "synapse" 1837 | ;; 1838 | 10) 1839 | package_install "terminator" 1840 | ;; 1841 | 11) 1842 | aur_package_install "tilix-bin" 1843 | ;; 1844 | "b") 1845 | break 1846 | ;; 1847 | *) 1848 | invalid_option 1849 | ;; 1850 | esac 1851 | done 1852 | source sharedfuncs_elihw 1853 | done 1854 | } 1855 | #}}} 1856 | #DEVELOPEMENT {{{ 1857 | install_development_apps() { 1858 | while true; do 1859 | print_title "DEVELOPMENT APPS" 1860 | echo " 1) $(menu_item "atom" "Atom")" 1861 | echo " 2) $(menu_item "emacs")" 1862 | echo " 3) $(menu_item "gvim")" 1863 | echo " 4) $(menu_item "meld")" 1864 | echo " 5) $(menu_item "sublime-merge") $AUR" 1865 | echo " 6) $(menu_item "sublime-text2" "Sublime Text 2") $AUR" 1866 | echo " 7) $(menu_item "sublime-text-dev" "Sublime Text 3") $AUR" 1867 | echo " 8) $(menu_item "android-studio" "Android Studio") $AUR" 1868 | echo " 9) $(menu_item "jetbrains-toolbox" "Jetbrains Toolbox") $AUR" 1869 | echo "10) $(menu_item "intellij-idea-community-edition" "IntelliJ IDEA Community Edition")" 1870 | echo "11) $(menu_item "intellij-idea-ultimate-edition" "IntelliJ IDEA Ultimate Edition") $AUR" 1871 | echo "12) $(menu_item "micro") $AUR" 1872 | echo "13) $(menu_item "monodevelop")" 1873 | echo "14) $(menu_item "qtcreator")" 1874 | echo "15) $(menu_item "mysql-workbench" "MySQL Workbench") $AUR" 1875 | echo "16) $(menu_item "jdk8-openjdk" "OpenJDK 8")" 1876 | echo "17) $(menu_item "jdk9-openjdk" "OpenJDK 9")" 1877 | echo "18) $(menu_item "jdk10-openjdk" "OpenJDK 10")" 1878 | echo "19) $(menu_item "jdk" "Oracle JDK") $AUR" 1879 | echo "20) $(menu_item "nodejs")" 1880 | echo "21) $(menu_item "visual-studio-code-bin" "Visual Studio Code") $AUR" 1881 | echo "22) $(menu_item "gitg")" 1882 | echo "23) $(menu_item "kdiff3")" 1883 | echo "24) $(menu_item "regexxer")" 1884 | echo "25) $(menu_item "postman-bin" "Postman") $AUR" 1885 | echo "26) $(menu_item "gitkraken" "Gitkraken") $AUR" 1886 | echo "27) $(menu_item "freecad" "FreeCad") $AUR" 1887 | echo "" 1888 | echo " b) BACK" 1889 | echo "" 1890 | DEVELOPMENT_OPTIONS+=" b" 1891 | read_input_options "$DEVELOPMENT_OPTIONS" 1892 | for OPT in "${OPTIONS[@]}"; do 1893 | case "$OPT" in 1894 | 1) 1895 | package_install "atom" 1896 | ;; 1897 | 2) 1898 | package_install "emacs" 1899 | ;; 1900 | 3) 1901 | package_remove "vim" 1902 | package_install "gvim ctags" 1903 | ;; 1904 | 4) 1905 | package_install "meld" 1906 | ;; 1907 | 5) 1908 | aur_package_install "sublime-merge" 1909 | ;; 1910 | 6) 1911 | aur_package_install "sublime-text2" 1912 | ;; 1913 | 7) 1914 | aur_package_install "sublime-text-dev" 1915 | ;; 1916 | 8) 1917 | aur_package_install "android-sdk android-sdk-platform-tools android-sdk-build-tools android-platform" 1918 | add_user_to_group "${username}" sdkusers 1919 | chown -R :sdkusers /opt/android-sdk/ 1920 | chmod -R g+w /opt/android-sdk/ 1921 | add_line "export ANDROID_HOME=/opt/android-sdk" "/home/${username}/.bashrc" 1922 | aur_package_install "android-studio" 1923 | ;; 1924 | 9) 1925 | aur_package_install "jetbrains-toolbox" 1926 | ;; 1927 | 10) 1928 | package_install "intellij-idea-community-edition" 1929 | ;; 1930 | 11) 1931 | aur_package_install "intellij-idea-ultimate-edition" 1932 | ;; 1933 | 12) 1934 | aur_package_install "micro" 1935 | ;; 1936 | 13) 1937 | package_install "monodevelop monodevelop-debugger-gdb" 1938 | ;; 1939 | 14) 1940 | package_install "qtcreator" 1941 | ;; 1942 | 15) 1943 | aur_package_install "mysql-workbench" 1944 | ;; 1945 | 16) 1946 | package_remove "jdk" 1947 | package_install "jdk8-openjdk" 1948 | ;; 1949 | 17) 1950 | package_remove "jdk" 1951 | package_install "jdk9-openjdk" 1952 | ;; 1953 | 18) 1954 | package_remove "jdk" 1955 | package_install "jdk10-openjdk" 1956 | ;; 1957 | 19) 1958 | package_remove "jre{7,8,9,10}-openjdk" 1959 | package_remove "jdk{7,8,9,10}-openjdk" 1960 | aur_package_install "jdk" 1961 | ;; 1962 | 20) 1963 | package_install "nodejs" 1964 | ;; 1965 | 21) 1966 | aur_package_install "visual-studio-code-bin" 1967 | ;; 1968 | 22) 1969 | aur_package_install "gitg" 1970 | aur_package_install "qgit" 1971 | ;; 1972 | 23) 1973 | aur_package_install "kdiff3" 1974 | ;; 1975 | 24) 1976 | aur_package_install "regexxer" 1977 | ;; 1978 | 25) 1979 | aur_package_install "postman-bin" 1980 | ;; 1981 | 26) 1982 | aur_package_install "gitkraken" 1983 | ;; 1984 | 27) 1985 | aur_package_install "freecad" 1986 | ;; 1987 | "b") 1988 | break 1989 | ;; 1990 | *) 1991 | invalid_option 1992 | ;; 1993 | esac 1994 | done 1995 | source sharedfuncs_elihw 1996 | done 1997 | } 1998 | #}}} 1999 | #OFFICE {{{ 2000 | install_office_apps() { 2001 | while true; do 2002 | print_title "OFFICE APPS" 2003 | echo " 1) $(menu_item "goffice calligra-libs" "$([[ ${KDE} -eq 1 ]] && echo "Caligra" || echo "Abiword + Gnumeric")")" 2004 | echo " 2) $(menu_item "calibre")" 2005 | echo " 3) $(menu_item "goldendict")" 2006 | echo " 4) $(menu_item "homebank")" 2007 | echo " 5) $(menu_item "texlive-core" "latex")" 2008 | echo " 6) $(menu_item "libreoffice-fresh" "LibreOffice")" 2009 | echo " 7) $(menu_item "lyx")" 2010 | echo " 8) $(menu_item "ocrfeeder")" 2011 | echo " 9) $(menu_item "tellico")" 2012 | echo "10) $(menu_item "typora")" 2013 | echo "11) $(menu_item "xmind")" 2014 | echo "" 2015 | echo " b) BACK" 2016 | echo "" 2017 | OFFICE_OPTIONS+=" b" 2018 | read_input_options "$OFFICE_OPTIONS" 2019 | for OPT in "${OPTIONS[@]}"; do 2020 | case "$OPT" in 2021 | 1) 2022 | if [[ ${KDE} -eq 1 ]]; then 2023 | package_install "calligra" 2024 | else 2025 | package_install "gnumeric abiword abiword-plugins" 2026 | fi 2027 | package_install "hunspell hunspell-$LOCALE_HS" 2028 | package_install "aspell aspell-$LOCALE_AS" 2029 | ;; 2030 | 2) 2031 | package_install "calibre" 2032 | ;; 2033 | 3) 2034 | package_install "goldendict" 2035 | ;; 2036 | 4) 2037 | package_install "homebank" 2038 | ;; 2039 | 5) 2040 | package_install "texlive-most" 2041 | if [[ $LOCALE == pt_BR ]]; then 2042 | aur_package_install "abntex" 2043 | fi 2044 | ;; 2045 | 6) 2046 | print_title "LIBREOFFICE - https://wiki.archlinux.org/index.php/LibreOffice" 2047 | package_install "libreoffice-fresh" 2048 | [[ $LOCALE != en_US ]] && package_install "libreoffice-fresh-$LOCALE_LO" 2049 | package_install "hunspell hunspell-$LOCALE_HS" 2050 | package_install "aspell aspell-$LOCALE_AS" 2051 | ;; 2052 | 7) 2053 | package_install "lyx" 2054 | ;; 2055 | 8) 2056 | package_install "ocrfeeder tesseract gocr" 2057 | package_install "aspell aspell-$LOCALE_AS" 2058 | ;; 2059 | 9) 2060 | package_install "tellico" 2061 | ;; 2062 | 10) 2063 | package_install "typora" 2064 | ;; 2065 | 11) 2066 | package_install "xmind" 2067 | ;; 2068 | "b") 2069 | break 2070 | ;; 2071 | *) 2072 | invalid_option 2073 | ;; 2074 | esac 2075 | done 2076 | source sharedfuncs_elihw 2077 | done 2078 | } 2079 | #}}} 2080 | #SYSTEM TOOLS {{{ 2081 | install_system_apps() { 2082 | while true; do 2083 | print_title "SYSTEM TOOLS APPS" 2084 | echo " 1) $(menu_item "clamav" "Clamav Antivirus")" 2085 | echo " 2) $(menu_item "cockpit") $AUR" 2086 | echo " 3) $(menu_item "webmin") $AUR" 2087 | echo " 4) $(menu_item "docker")" 2088 | echo " 5) $(menu_item "firewalld")" 2089 | echo " 6) $(menu_item "gparted")" 2090 | echo " 7) $(menu_item "grsync")" 2091 | echo " 8) $(menu_item "hosts-update") $AUR" 2092 | echo " 9) $(menu_item "htop")" 2093 | echo "10) $(menu_item "stacer") $AUR" 2094 | echo "11) $(menu_item "gotop") $AUR" 2095 | echo "12) $(menu_item "ufw")" 2096 | echo "13) $(menu_item "unified-remote-server" "Unified Remote") $AUR" 2097 | echo "14) $(menu_item "virtualbox")" 2098 | echo "15) $(menu_item "wine")" 2099 | echo "16) $(menu_item "netdata")" 2100 | echo "17) $(menu_item "nload")" 2101 | echo "18) $(menu_item "vmware-workstation12" "VMware Workstation 12") $AUR" 2102 | echo "" 2103 | echo " b) BACK" 2104 | echo "" 2105 | SYSTEMTOOLS_OPTIONS+=" b" 2106 | read_input_options "$SYSTEMTOOLS_OPTIONS" 2107 | for OPT in "${OPTIONS[@]}"; do 2108 | case "$OPT" in 2109 | 1) 2110 | package_install "clamav" 2111 | cp /etc/clamav/clamd.conf.sample /etc/clamav/clamd.conf 2112 | cp /etc/clamav/freshclam.conf.sample /etc/clamav/freshclam.conf 2113 | sed -i '/Example/d' /etc/clamav/freshclam.conf 2114 | sed -i '/Example/d' /etc/clamav/clamd.conf 2115 | system_ctl enable clamd 2116 | freshclam 2117 | ;; 2118 | 2) 2119 | aur_package_install "cockpit storaged linux-user-chroot ostree" 2120 | ;; 2121 | 3) 2122 | aur_package_install "webmin" 2123 | ;; 2124 | 4) 2125 | package_install "docker" 2126 | add_user_to_group "${username}" docker 2127 | ;; 2128 | 5) 2129 | is_package_installed "ufw" && package_remove "ufw" 2130 | is_package_installed "firewalld" && package_remove "firewalld" 2131 | package_install "firewalld" 2132 | system_ctl enable firewalld 2133 | ;; 2134 | 6) 2135 | package_install "gparted" 2136 | ;; 2137 | 7) 2138 | package_install "grsync" 2139 | ;; 2140 | 8) 2141 | aur_package_install "hosts-update" 2142 | hosts-update 2143 | ;; 2144 | 9) 2145 | package_install "htop" 2146 | ;; 2147 | 10) 2148 | aur_package_install "stacer" 2149 | ;; 2150 | 11) 2151 | aur_package_install "gotop-bin" 2152 | ;; 2153 | 12) 2154 | print_title "UFW - https://wiki.archlinux.org/index.php/Ufw" 2155 | print_info "Ufw stands for Uncomplicated Firewall, and is a program for managing a netfilter firewall. It provides a command line interface and aims to be uncomplicated and easy to use." 2156 | is_package_installed "firewalld" && package_remove "firewalld" 2157 | package_install "ufw gufw" 2158 | system_ctl enable ufw.service 2159 | ;; 2160 | 13) 2161 | aur_package_install "unified-remote-server" 2162 | system_ctl enable urserver.service 2163 | ;; 2164 | 14) 2165 | #Make sure we are not a VirtualBox Guest 2166 | VIRTUALBOX_GUEST=$(dmidecode --type 1 | grep VirtualBox) 2167 | if [[ -z ${VIRTUALBOX_GUEST} ]]; then 2168 | package_install "virtualbox virtualbox-host-dkms virtualbox-guest-iso linux-headers" 2169 | aur_package_install "virtualbox-ext-oracle" 2170 | add_user_to_group "${username}" vboxusers 2171 | modprobe vboxdrv vboxnetflt 2172 | else 2173 | cecho "${BBlue}[${Reset}${Bold}!${BBlue}]${Reset} VirtualBox was not installed as we are a VirtualBox guest." 2174 | fi 2175 | ;; 2176 | 15) 2177 | package_install "icoutils wine wine_gecko wine-mono winetricks" 2178 | ;; 2179 | 16) 2180 | package_install "netdata" 2181 | system_ctl enable netdata.service 2182 | ;; 2183 | 17) 2184 | package_install "nload" 2185 | ;; 2186 | 18) 2187 | aur_package_install "vmware-workstation12" 2188 | ;; 2189 | "b") 2190 | break 2191 | ;; 2192 | *) 2193 | invalid_option 2194 | ;; 2195 | esac 2196 | done 2197 | source sharedfuncs_elihw 2198 | done 2199 | } 2200 | #}}} 2201 | #GRAPHICS {{{ 2202 | install_graphics_apps() { 2203 | while true; do 2204 | print_title "GRAPHICS APPS" 2205 | echo " 1) $(menu_item "blender")" 2206 | echo " 2) $(menu_item "gimp")" 2207 | echo " 3) $(menu_item "gthumb")" 2208 | echo " 4) $(menu_item "inkscape")" 2209 | echo " 5) $(menu_item "krita")" 2210 | echo " 6) $(menu_item "mcomix")" 2211 | echo " 7) $(menu_item "mypaint")" 2212 | echo " 8) $(menu_item "pencil" "Pencil Prototyping Tool") $AUR" 2213 | echo " 9) $(menu_item "scribus")" 2214 | echo "10) $(menu_item "shotwell")" 2215 | echo "11) $(menu_item "simple-scan")" 2216 | echo "12) $(menu_item "yacreader")" 2217 | echo "" 2218 | echo " b) BACK" 2219 | echo "" 2220 | GRAPHICS_OPTIONS+=" b" 2221 | read_input_options "$GRAPHICS_OPTIONS" 2222 | for OPT in "${OPTIONS[@]}"; do 2223 | case "$OPT" in 2224 | 1) 2225 | package_install "blender" 2226 | ;; 2227 | 2) 2228 | package_install "gimp" 2229 | ;; 2230 | 3) 2231 | package_install "gthumb" 2232 | ;; 2233 | 4) 2234 | package_install "inkscape python2-numpy python-lxml" 2235 | ;; 2236 | 5) 2237 | package_install "krita" 2238 | ;; 2239 | 6) 2240 | package_install "mcomix" 2241 | ;; 2242 | 7) 2243 | package_install "mypaint" 2244 | ;; 2245 | 8) 2246 | aur_package_install "pencil" 2247 | ;; 2248 | 9) 2249 | package_install "scribus" 2250 | ;; 2251 | 10) 2252 | package_install "shotwell" 2253 | ;; 2254 | 11) 2255 | package_install "simple-scan" 2256 | ;; 2257 | 12) 2258 | package_install "yacreader" 2259 | ;; 2260 | "b") 2261 | break 2262 | ;; 2263 | *) 2264 | invalid_option 2265 | ;; 2266 | esac 2267 | done 2268 | source sharedfuncs_elihw 2269 | done 2270 | } 2271 | #}}} 2272 | #INTERNET {{{ 2273 | install_internet_apps() { 2274 | while true; do 2275 | print_title "INTERNET APPS" 2276 | echo " 1) Browser" 2277 | echo " 2) Download|Fileshare" 2278 | echo " 3) Email|RSS" 2279 | echo " 4) Instant Messaging|IRC" 2280 | echo " 5) Mapping Tools" 2281 | echo " 6) VNC|Desktop Share" 2282 | echo "" 2283 | echo " b) BACK" 2284 | echo "" 2285 | INTERNET_OPTIONS+=" b" 2286 | read_input_options "$INTERNET_OPTIONS" 2287 | for OPT in "${OPTIONS[@]}"; do 2288 | case "$OPT" in 2289 | 1) 2290 | #BROWSER {{{ 2291 | while true; do 2292 | print_title "BROWSER" 2293 | echo " 1) $(menu_item "google-chrome" "Chrome") $AUR" 2294 | echo " 2) $(menu_item "chromium")" 2295 | echo " 3) $(menu_item "firefox")" 2296 | echo " 4) $(menu_item "midori konqueror" "$([[ ${KDE} -eq 1 ]] && echo "Konqueror" || echo "Midori")")" 2297 | echo " 5) $(menu_item "opera")" 2298 | echo " 6) $(menu_item "vivaldi") $AUR" 2299 | echo " 7) $(menu_item "tor browser") $AUR" 2300 | echo " 8) $(menu_item "brave browser") $AUR" 2301 | echo "" 2302 | echo " b) BACK" 2303 | echo "" 2304 | BROWSERS_OPTIONS+=" b" 2305 | read_input_options "$BROWSERS_OPTIONS" 2306 | for OPT in "${OPTIONS[@]}"; do 2307 | case "$OPT" in 2308 | 1) 2309 | aur_package_install "google-chrome" 2310 | ;; 2311 | 2) 2312 | package_install "chromium" 2313 | ;; 2314 | 3) 2315 | package_install "firefox firefox-i18n-$LOCALE_FF" 2316 | ;; 2317 | 4) 2318 | if [[ ${KDE} -eq 1 ]]; then 2319 | package_install "konqueror" 2320 | else 2321 | package_install "midori" 2322 | fi 2323 | ;; 2324 | 5) 2325 | package_install "opera" 2326 | ;; 2327 | 6) 2328 | aur_package_install "vivaldi" 2329 | ;; 2330 | 7) 2331 | aur_package_install "tor-browser" 2332 | ;; 2333 | 8) 2334 | aur_package_install "brave-browser" 2335 | ;; 2336 | "b") 2337 | break 2338 | ;; 2339 | *) 2340 | invalid_option 2341 | ;; 2342 | esac 2343 | done 2344 | source sharedfuncs_elihw 2345 | done 2346 | #}}} 2347 | OPT=1 2348 | ;; 2349 | 2) 2350 | #DOWNLOAD|FILESHARE {{{ 2351 | while true; do 2352 | print_title "DOWNLOAD|FILESHARE" 2353 | echo " 1) $(menu_item "deluge")" 2354 | echo " 2) $(menu_item "dropbox") $AUR" 2355 | echo " 3) $(menu_item "flareget") $AUR" 2356 | echo " 4) $(menu_item "freedownloadmanager") $AUR" 2357 | echo " 5) $(menu_item "google-drive-ocamlfuse", "Google Drive OCamlFuse") $AUR" 2358 | echo " 6) $(menu_item "jdownloader") $AUR" 2359 | echo " 7) $(menu_item "qbittorrent")" 2360 | echo " 8) $(menu_item "nitroshare") $AUR" 2361 | echo " 9) $(menu_item "rslsync" "Resilio Sync") $AUR" 2362 | echo "10) $(menu_item "sparkleshare")" 2363 | echo "11) $(menu_item "spideroak-one") $AUR" 2364 | echo "12) $(menu_item "tixati") $AUR" 2365 | echo "13) $(menu_item "transmission-qt transmission-gtk" "Transmission")" 2366 | echo "14) $(menu_item "uget")" 2367 | echo "15) $(menu_item "youtube-dl")" 2368 | echo "16) $(menu_item "megasync")" 2369 | echo "17) $(menu_item "extreme download manager") $AUR" 2370 | echo "" 2371 | echo " b) BACK" 2372 | echo "" 2373 | DOWNLOAD_OPTIONS+=" b" 2374 | read_input_options "$DOWNLOAD_OPTIONS" 2375 | for OPT in "${OPTIONS[@]}"; do 2376 | case "$OPT" in 2377 | 1) 2378 | package_install "deluge" 2379 | ;; 2380 | 2) 2381 | aur_package_install "dropbox" 2382 | ;; 2383 | 3) 2384 | aur_package_install "flareget" 2385 | ;; 2386 | 4) 2387 | aur_package_install "freedownloadmanager" 2388 | ;; 2389 | 5) 2390 | aur_package_install "google-drive-ocamlfuse" 2391 | ;; 2392 | 6) 2393 | aur_package_install "jdownloader" 2394 | ;; 2395 | 7) 2396 | package_install "qbittorrent" 2397 | ;; 2398 | 8) 2399 | package_install "nitroshare" 2400 | ;; 2401 | 9) 2402 | aur_package_install "rslsync" 2403 | ;; 2404 | 10) 2405 | package_install "sparkleshare" 2406 | ;; 2407 | 11) 2408 | aur_package_install "spideroak" 2409 | ;; 2410 | 12) 2411 | aur_package_install "tixati" 2412 | ;; 2413 | 13) 2414 | if [[ ${KDE} -eq 1 ]]; then 2415 | package_install "transmission-qt" 2416 | else 2417 | package_install "transmission-gtk" 2418 | fi 2419 | if [[ -f /home/${username}/.config/transmission/settings.json ]]; then 2420 | replace_line '"blocklist-enabled": false' '"blocklist-enabled": true' /home/"${username}"/.config/transmission/settings.json 2421 | replace_line "www\.example\.com\/blocklist" "list\.iblocklist\.com\/\?list=bt_level1&fileformat=p2p&archiveformat=gz" /home/"${username}"/.config/transmission/settings.json 2422 | fi 2423 | ;; 2424 | 14) 2425 | package_install "uget" 2426 | ;; 2427 | 15) 2428 | package_install "youtube-dl" 2429 | ;; 2430 | 16) 2431 | aur_package_install "megasync" 2432 | ;; 2433 | 17) 2434 | aur_package_install "xdman" 2435 | ;; 2436 | "b") 2437 | break 2438 | ;; 2439 | *) 2440 | invalid_option 2441 | ;; 2442 | esac 2443 | done 2444 | source sharedfuncs_elihw 2445 | done 2446 | #}}} 2447 | OPT=2 2448 | ;; 2449 | 3) 2450 | #EMAIL {{{ 2451 | while true; do 2452 | print_title "EMAIL|RSS" 2453 | echo " 1) $(menu_item "liferea")" 2454 | echo " 2) $(menu_item "thunderbird")" 2455 | echo "" 2456 | echo " b) BACK" 2457 | echo "" 2458 | EMAIL_OPTIONS+=" b" 2459 | read_input_options "$EMAIL_OPTIONS" 2460 | for OPT in "${OPTIONS[@]}"; do 2461 | case "$OPT" in 2462 | 1) 2463 | package_install "liferea" 2464 | ;; 2465 | 2) 2466 | package_install "thunderbird" 2467 | [[ "$LOCALE_TB" != en_US ]] && package_install "thunderbird-i18n-$LOCALE_TB" 2468 | ;; 2469 | "b") 2470 | break 2471 | ;; 2472 | *) 2473 | invalid_option 2474 | ;; 2475 | esac 2476 | done 2477 | source sharedfuncs_elihw 2478 | done 2479 | #}}} 2480 | OPT=3 2481 | ;; 2482 | 4) 2483 | #IM|IRC {{{ 2484 | while true; do 2485 | print_title "IM - INSTANT MESSAGING" 2486 | echo " 1) $(menu_item "hexchat konversation" "$([[ ${KDE} -eq 1 ]] && echo "Konversation" || echo "Hexchat")")" 2487 | echo " 2) $(menu_item "irssi")" 2488 | echo " 3) $(menu_item "pidgin")" 2489 | echo " 4) $(menu_item "element-desktop")" 2490 | echo " 5) $(menu_item "skypeforlinux-stable-bin" "Skype Stable") $AUR" 2491 | echo " 6) $(menu_item "skypeforlinux-preview-bin" "Skype Preview") $AUR" 2492 | echo " 7) $(menu_item "teamspeak3")" 2493 | echo " 8) $(menu_item "viber") $AUR" 2494 | echo " 9) $(menu_item "telegram-desktop")" 2495 | echo "10) $(menu_item "qtox")" 2496 | echo "11) $(menu_item "discord")" 2497 | echo "12) $(menu_item "slack") $AUR" 2498 | echo "13) $(menu_item "vk-messenger") $AUR" 2499 | echo "14) $(menu_item "zoom") $AUR" 2500 | echo "" 2501 | echo " b) BACK" 2502 | echo "" 2503 | IM_OPTIONS+=" b" 2504 | read_input_options "$IM_OPTIONS" 2505 | for OPT in "${OPTIONS[@]}"; do 2506 | case "$OPT" in 2507 | 1) 2508 | if [[ ${KDE} -eq 1 ]]; then 2509 | package_install "konversation" 2510 | else 2511 | package_install "hexchat" 2512 | fi 2513 | ;; 2514 | 2) 2515 | package_install "irssi" 2516 | ;; 2517 | 3) 2518 | package_install "pidgin" 2519 | ;; 2520 | 4) 2521 | package_install "element-desktop" 2522 | ;; 2523 | 5) 2524 | aur_package_install "skypeforlinux-stable-bin" 2525 | ;; 2526 | 6) 2527 | aur_package_install "skypeforlinux-preview-bin" 2528 | ;; 2529 | 7) 2530 | package_install "teamspeak3" 2531 | ;; 2532 | 8) 2533 | aur_package_install "viber" 2534 | ;; 2535 | 9) 2536 | package_install "telegram-desktop" 2537 | ;; 2538 | 10) 2539 | package_install "qtox" 2540 | ;; 2541 | 11) 2542 | package_install "discord" 2543 | ;; 2544 | 12) 2545 | aur_package_install "slack-desktop" 2546 | ;; 2547 | 13) 2548 | aur_package_install "vk-messanger" 2549 | ;; 2550 | 14) 2551 | aur_package_install "zoom" 2552 | ;; 2553 | "b") 2554 | break 2555 | ;; 2556 | *) 2557 | invalid_option 2558 | ;; 2559 | esac 2560 | done 2561 | source sharedfuncs_elihw 2562 | done 2563 | #}}} 2564 | OPT=4 2565 | ;; 2566 | 5) 2567 | #MAPPING {{{ 2568 | while true; do 2569 | print_title "MAPPING TOOLS" 2570 | echo " 1) $(menu_item "google-earth") $AUR" 2571 | echo " 2) $(menu_item "qgis" "QGIS") $AUR" 2572 | echo "" 2573 | echo " b) BACK" 2574 | echo "" 2575 | MAPPING_OPTIONS+=" b" 2576 | read_input_options "$MAPPING_OPTIONS" 2577 | for OPT in "${OPTIONS[@]}"; do 2578 | case "$OPT" in 2579 | 1) 2580 | aur_package_install "google-earth" 2581 | ;; 2582 | 2) 2583 | aur_package_install "qgis" 2584 | ;; 2585 | "b") 2586 | break 2587 | ;; 2588 | *) 2589 | invalid_option 2590 | ;; 2591 | esac 2592 | done 2593 | source sharedfuncs_elihw 2594 | done 2595 | #}}} 2596 | OPT=5 2597 | ;; 2598 | 6) 2599 | #DESKTOP SHARE {{{ 2600 | while true; do 2601 | print_title "DESKTOP SHARE" 2602 | echo " 1) $(menu_item "anydesk") $AUR" 2603 | echo " 2) $(menu_item "remmina")" 2604 | echo " 3) $(menu_item "teamviewer") $AUR" 2605 | echo "" 2606 | echo " b) BACK" 2607 | echo "" 2608 | VNC_OPTIONS+=" b" 2609 | read_input_options "$VNC_OPTIONS" 2610 | for OPT in "${OPTIONS[@]}"; do 2611 | case "$OPT" in 2612 | 1) 2613 | aur_package_install "anydesk" 2614 | ;; 2615 | 2) 2616 | package_install "remmina" 2617 | ;; 2618 | 3) 2619 | aur_package_install "teamviewer" 2620 | ;; 2621 | "b") 2622 | break 2623 | ;; 2624 | *) 2625 | invalid_option 2626 | ;; 2627 | esac 2628 | done 2629 | source sharedfuncs_elihw 2630 | done 2631 | #}}} 2632 | OPT=6 2633 | ;; 2634 | "b") 2635 | break 2636 | ;; 2637 | *) 2638 | invalid_option 2639 | ;; 2640 | esac 2641 | done 2642 | source sharedfuncs_elihw 2643 | done 2644 | } 2645 | #}}} 2646 | #AUDIO {{{ 2647 | install_audio_apps() { 2648 | while true; do 2649 | print_title "AUDIO APPS" 2650 | echo " 1) Players" 2651 | echo " 2) Editors|Tools" 2652 | echo " 3) Codecs" 2653 | echo "" 2654 | echo " b) BACK" 2655 | echo "" 2656 | AUDIO_OPTIONS+=" b" 2657 | read_input_options "$AUDIO_OPTIONS" 2658 | for OPT in "${OPTIONS[@]}"; do 2659 | case "$OPT" in 2660 | 1) 2661 | #PLAYERS {{{ 2662 | while true; do 2663 | print_title "AUDIO PLAYERS" 2664 | echo " 1) $(menu_item "amarok")" 2665 | echo " 2) $(menu_item "audacious")" 2666 | echo " 3) $(menu_item "clementine")" 2667 | echo " 4) $(menu_item "deadbeef")" 2668 | echo " 5) $(menu_item "guayadeque") $AUR" 2669 | echo " 6) $(menu_item "lollypop") $AUR" 2670 | echo " 7) $(menu_item "musique") $AUR" 2671 | echo " 8) $(menu_item "pragha")" 2672 | echo " 9) $(menu_item "rhythmbox")" 2673 | echo "10) $(menu_item "spotify") $AUR" 2674 | echo "11) $(menu_item "timidity++") $AUR" 2675 | echo "12) $(menu_item "quodlibet")" 2676 | echo "" 2677 | echo " b) BACK" 2678 | echo "" 2679 | AUDIO_PLAYER_OPTIONS+=" b" 2680 | read_input_options "$AUDIO_PLAYER_OPTIONS" 2681 | for OPT in "${OPTIONS[@]}"; do 2682 | case "$OPT" in 2683 | 1) 2684 | package_install "amarok" 2685 | ;; 2686 | 2) 2687 | package_install "audacious audacious-plugins" 2688 | ;; 2689 | 3) 2690 | package_install "clementine" 2691 | ;; 2692 | 4) 2693 | package_install "deadbeef" 2694 | ;; 2695 | 5) 2696 | aur_package_install "guayadeque" 2697 | ;; 2698 | 6) 2699 | aur_package_install "lollypop" 2700 | ;; 2701 | 7) 2702 | aur_package_install "musique" 2703 | ;; 2704 | 8) 2705 | package_install "pragha" 2706 | ;; 2707 | 9) 2708 | package_install "rhythmbox grilo grilo-plugins libgpod libdmapsharing gnome-python python-mako" 2709 | ;; 2710 | 10) 2711 | aur_package_install "spotify ffmpeg-compat ffmpeg-compat-57" 2712 | ;; 2713 | 11) 2714 | aur_package_install "timidity++ fluidr3" 2715 | echo -e 'soundfont /usr/share/soundfonts/fluidr3/FluidR3GM.SF2' >>/etc/timidity++/timidity.cfg 2716 | ;; 2717 | 12) 2718 | package_install "quodlibet" 2719 | ;; 2720 | "b") 2721 | break 2722 | ;; 2723 | *) 2724 | invalid_option 2725 | ;; 2726 | esac 2727 | done 2728 | source sharedfuncs_elihw 2729 | done 2730 | #}}} 2731 | OPT=1 2732 | ;; 2733 | 2) 2734 | #EDITORS {{{ 2735 | while true; do 2736 | print_title "AUDIO EDITORS|TOOLS" 2737 | echo " 1) $(menu_item "audacity")" 2738 | echo " 2) $(menu_item "easytag")" 2739 | echo " 3) $(menu_item "ocenaudio-bin") $AUR" 2740 | echo " 4) $(menu_item "soundconverter soundkonverter" "$([[ ${KDE} -eq 1 ]] && echo "Soundkonverter" || echo "Soundconverter")")" 2741 | echo "" 2742 | echo " b) BACK" 2743 | echo "" 2744 | AUDIO_EDITOR_OPTIONS+=" b" 2745 | read_input_options "$AUDIO_EDITOR_OPTIONS" 2746 | for OPT in "${OPTIONS[@]}"; do 2747 | case "$OPT" in 2748 | 1) 2749 | package_install "audacity" 2750 | ;; 2751 | 2) 2752 | package_install "easytag" 2753 | ;; 2754 | 3) 2755 | aur_package_install "ocenaudio-bin" 2756 | ;; 2757 | 4) 2758 | if [[ ${KDE} -eq 1 ]]; then 2759 | package_install "soundkonverter" 2760 | else 2761 | package_install "soundconverter" 2762 | fi 2763 | ;; 2764 | "b") 2765 | break 2766 | ;; 2767 | *) 2768 | invalid_option 2769 | ;; 2770 | esac 2771 | done 2772 | source sharedfuncs_elihw 2773 | done 2774 | #}}} 2775 | OPT=2 2776 | ;; 2777 | 3) 2778 | package_install "gst-plugins-base gst-plugins-base-libs gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav" 2779 | [[ ${KDE} -eq 1 ]] && package_install "phonon-qt5-gstreamer" 2780 | # Use the 'standard' preset by default. This preset should generally be 2781 | # transparent to most people on most music and is already quite high in quality. 2782 | # The resulting bitrate should be in the 170-210kbps range, according to music 2783 | # complexity. 2784 | run_as_user "gconftool-2 --type string --set /system/gstreamer/0.10/audio/profiles/mp3/pipeline \audio/x-raw-int,rate=44100,channels=2 ! lame name=enc preset=1001 ! id3v2mux\"" 2785 | ;; 2786 | "b") 2787 | break 2788 | ;; 2789 | *) 2790 | invalid_option 2791 | ;; 2792 | esac 2793 | done 2794 | source sharedfuncs_elihw 2795 | done 2796 | } 2797 | #}}} 2798 | #VIDEO {{{ 2799 | install_video_apps() { 2800 | while true; do 2801 | print_title "VIDEO APPS" 2802 | echo " 1) Players" 2803 | echo " 2) Editors|Tools" 2804 | echo " 3) Codecs" 2805 | echo "" 2806 | echo " b) BACK" 2807 | echo "" 2808 | VIDEO_OPTIONS+=" b" 2809 | read_input_options "$VIDEO_OPTIONS" 2810 | for OPT in "${OPTIONS[@]}"; do 2811 | case "$OPT" in 2812 | 1) 2813 | #PLAYERS {{{ 2814 | while true; do 2815 | print_title "VIDEO PLAYERS" 2816 | echo " 1) $(menu_item "gnome-mplayer")" 2817 | echo " 2) $(menu_item "livestreamer")" 2818 | echo " 3) $(menu_item "minitube")" 2819 | echo " 4) $(menu_item "mpv")" 2820 | echo " 5) $(menu_item "smplayer")" 2821 | echo " 6) $(menu_item "parole")" 2822 | echo " 7) $(menu_item "plex-media-server" "Plex") $AUR" 2823 | echo " 8) $(menu_item "popcorntime-ce") $AUR" 2824 | echo " 9) $(menu_item "vlc")" 2825 | echo " 10) $(menu_item "kodi")" 2826 | echo "" 2827 | echo " b) BACK" 2828 | echo "" 2829 | VIDEO_PLAYER_OPTIONS+=" b" 2830 | read_input_options "$VIDEO_PLAYER_OPTIONS" 2831 | for OPT in "${OPTIONS[@]}"; do 2832 | case "$OPT" in 2833 | 1) 2834 | package_install "gnome-mplayer" 2835 | ;; 2836 | 2) 2837 | package_install "livestreamer" 2838 | ;; 2839 | 3) 2840 | package_install "minitube" 2841 | ;; 2842 | 4) 2843 | package_install "mpv" 2844 | ;; 2845 | 5) 2846 | package_install "smplayer" 2847 | ;; 2848 | 6) 2849 | package_install "parole" 2850 | ;; 2851 | 7) 2852 | aur_package_install "plex-media-server" 2853 | system_ctl enable plexmediaserver.service 2854 | ;; 2855 | 8) 2856 | aur_package_install "popcorntime-ce" 2857 | ;; 2858 | 9) 2859 | package_install "vlc" 2860 | ;; 2861 | 10) 2862 | package_install "kodi" 2863 | add_user_to_group "${username}" kodi 2864 | ;; 2865 | "b") 2866 | break 2867 | ;; 2868 | *) 2869 | invalid_option 2870 | ;; 2871 | esac 2872 | done 2873 | source sharedfuncs_elihw 2874 | done 2875 | #}}} 2876 | OPT=1 2877 | ;; 2878 | 2) 2879 | #EDITORS {{{ 2880 | while true; do 2881 | print_title "VIDEO EDITORS|TOOLS" 2882 | echo " 1) $(menu_item "arista") $AUR" 2883 | echo " 2) $(menu_item "avidemux-gtk avidemux-qt" "Avidemux")" 2884 | echo " 3) $(menu_item "filebot") $AUR" 2885 | echo " 4) $(menu_item "handbrake")" 2886 | echo " 5) $(menu_item "kdenlive")" 2887 | echo " 6) $(menu_item "lwks" "Lightworks") $AUR" 2888 | echo " 7) $(menu_item "openshot")" 2889 | echo " 8) $(menu_item "pitivi")" 2890 | echo " 9) $(menu_item "transmageddon")" 2891 | echo "" 2892 | echo " b) BACK" 2893 | echo "" 2894 | VIDEO_EDITOR_OPTIONS+=" b" 2895 | read_input_options "$VIDEO_EDITOR_OPTIONS" 2896 | for OPT in "${OPTIONS[@]}"; do 2897 | case "$OPT" in 2898 | 1) 2899 | aur_package_install "arista" 2900 | ;; 2901 | 2) 2902 | if [[ ${KDE} -eq 1 ]]; then 2903 | package_install "avidemux-qt" 2904 | else 2905 | package_install "avidemux-gtk" 2906 | fi 2907 | ;; 2908 | 3) 2909 | aur_package_install "filebot" 2910 | ;; 2911 | 4) 2912 | package_install "handbrake" 2913 | ;; 2914 | 5) 2915 | package_install "kdenlive" 2916 | ;; 2917 | 6) 2918 | aur_package_install "lwks" 2919 | ;; 2920 | 7) 2921 | package_install "openshot" 2922 | ;; 2923 | 8) 2924 | package_install "pitivi frei0r-plugins" 2925 | ;; 2926 | 9) 2927 | package_install "transmageddon" 2928 | ;; 2929 | "b") 2930 | break 2931 | ;; 2932 | *) 2933 | invalid_option 2934 | ;; 2935 | esac 2936 | done 2937 | source sharedfuncs_elihw 2938 | done 2939 | #}}} 2940 | OPT=2 2941 | ;; 2942 | 3) 2943 | package_install "libdvdnav libdvdcss cdrdao cdrtools ffmpeg ffmpegthumbnailer ffmpegthumbs" 2944 | if [[ ${KDE} -eq 1 ]]; then 2945 | package_install "kdegraphics-thumbnailers" 2946 | fi 2947 | ;; 2948 | "b") 2949 | break 2950 | ;; 2951 | *) 2952 | invalid_option 2953 | ;; 2954 | esac 2955 | done 2956 | source sharedfuncs_elihw 2957 | done 2958 | } 2959 | #}}} 2960 | #GAMES {{{ 2961 | install_games() { 2962 | while true; do 2963 | print_title "GAMES - https://wiki.archlinux.org/index.php/Games" 2964 | echo " 1) 0AD" 2965 | echo " 2) PlayOnLinux" 2966 | echo " 3) Steam" 2967 | echo " 4) Lutris" 2968 | echo " 5) Mindustry $AUR" 2969 | echo " 6) Minecraft $AUR" 2970 | echo " 7) Minetest" 2971 | echo " 8) Openra" 2972 | echo " 9) OSU!-Lazer $AUR" 2973 | echo "10) Wesnoth" 2974 | echo "11) Xonotic" 2975 | echo "" 2976 | echo " b) BACK" 2977 | echo "" 2978 | GAMES_OPTIONS+=" b" 2979 | read_input_options "$GAMES_OPTIONS" 2980 | for OPT in "${OPTIONS[@]}"; do 2981 | case "$OPT" in 2982 | 1) 2983 | package_install "0ad" 2984 | OPT=1 2985 | ;; 2986 | 2) 2987 | package_install "playonlinux" 2988 | OPT=2 2989 | ;; 2990 | 3) 2991 | package_install "steam" 2992 | OPT=3 2993 | ;; 2994 | 4) 2995 | package_install "lutris" 2996 | OPT=4 2997 | ;; 2998 | 5) 2999 | aur_package_install "mindustry" 3000 | OPT=5 3001 | ;; 3002 | 6) 3003 | aur_package_install "minecraft" 3004 | OPT=6 3005 | ;; 3006 | 7) 3007 | package_install "minetest" 3008 | OPT=7 3009 | ;; 3010 | 8) 3011 | package_install "openra" 3012 | OPT=8 3013 | ;; 3014 | 9) 3015 | aur_package_install "osu-lazer" 3016 | OPT=9 3017 | ;; 3018 | 10) 3019 | package_install "wesnoth" 3020 | OPT=10 3021 | ;; 3022 | 11) 3023 | package_install "xonotic" 3024 | OPT=11 3025 | ;; 3026 | "b") 3027 | break 3028 | ;; 3029 | *) 3030 | invalid_option 3031 | ;; 3032 | esac 3033 | done 3034 | source sharedfuncs_elihw 3035 | done 3036 | } 3037 | #}}} 3038 | #WEBSERVER {{{ 3039 | install_web_server() { 3040 | install_adminer() { #{{{ 3041 | aur_package_install "adminer" 3042 | local ADMINER=$(grep Adminer /etc/httpd/conf/httpd.conf) 3043 | [[ -z $ADMINER ]] && echo -e '\n# Adminer Configuration\nInclude conf/extra/httpd-adminer.conf' >>/etc/httpd/conf/httpd.conf 3044 | } #}}} 3045 | 3046 | install_mariadb() { #{{{ 3047 | package_install "mariadb" 3048 | /usr/bin/mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql 3049 | system_ctl enable mysqld.service 3050 | systemctl start mysqld.service 3051 | /usr/bin/mysql_secure_installation 3052 | } #}}} 3053 | 3054 | install_postgresql() { #{{{ 3055 | package_install "postgresql" 3056 | mkdir -p /var/lib/postgres 3057 | chown -R postgres:postgres /var/lib/postgres 3058 | systemd-tmpfiles --create postgresql.conf 3059 | echo "Enter your new postgres account password:" 3060 | passwd postgres 3061 | while [[ $? -ne 0 ]]; do 3062 | passwd postgres 3063 | done 3064 | su - postgres -c "initdb --locale ${LOCALE}.UTF-8 -D /var/lib/postgres/data" 3065 | system_ctl enable postgresql.service 3066 | system_ctl start postgresql.service 3067 | read_input_text "Install Postgis + Pgrouting" "$POSTGIS" 3068 | [[ $OPTION == y ]] && install_gis_extension 3069 | } #}}} 3070 | 3071 | install_gis_extension() { #{{{ 3072 | package_install "postgis" 3073 | aur_package_install "pgrouting" 3074 | } #}}} 3075 | 3076 | configure_php() { #{{{ 3077 | if [[ -f /etc/php/php.ini.pacnew ]]; then 3078 | mv -v /etc/php/php.ini /etc/php/php.ini.pacold 3079 | mv -v /etc/php/php.ini.pacnew /etc/php/php.ini 3080 | rm -v /etc/php/php.ini.aui 3081 | fi 3082 | [[ -f /etc/php/php.ini.aui ]] && echo "/etc/php/php.ini.aui" || cp -v /etc/php/php.ini /etc/php/php.ini.aui 3083 | if [[ $1 == mariadb ]]; then 3084 | sed -i '/mysqli.so/s/^;//' /etc/php/php.ini 3085 | sed -i '/mysql.so/s/^;//' /etc/php/php.ini 3086 | sed -i '/skip-networking/s/^/#/' /etc/mysql/my.cnf 3087 | else 3088 | sed -i '/pgsql.so/s/^;//' /etc/php/php.ini 3089 | fi 3090 | sed -i '/mcrypt.so/s/^;//' /etc/php/php.ini 3091 | sed -i '/gd.so/s/^;//' /etc/php/php.ini 3092 | sed -i '/display_errors=/s/off/on/' /etc/php/php.ini 3093 | } #}}} 3094 | 3095 | configure_php_apache() { #{{{ 3096 | if [[ -f /etc/httpd/conf/httpd.conf.pacnew ]]; then 3097 | mv -v /etc/httpd/conf/httpd.conf.pacnew /etc/httpd/conf/httpd.conf 3098 | rm -v /etc/httpd/conf/httpd.conf.aui 3099 | fi 3100 | [[ -f /etc/httpd/conf/httpd.conf.aui ]] && echo "/etc/httpd/conf/httpd.conf.aui" || cp -v /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.aui 3101 | local IS_DISABLED=$(grep php5_module.conf /etc/httpd/conf/httpd.conf) 3102 | if [[ -z $IS_DISABLED ]]; then 3103 | echo -e 'application/x-httpd-php5 php php5' >>/etc/httpd/conf/mime.types 3104 | sed -i '/LoadModule dir_module modules\/mod_dir.so/a\LoadModule php5_module modules\/libphp5.so' /etc/httpd/conf/httpd.conf 3105 | echo -e '\n# Use for PHP 5.x:\nInclude conf/extra/php5_module.conf\n\nAddHandler php5-script php' >>/etc/httpd/conf/httpd.conf 3106 | # libphp5.so included with php-apache does not work with mod_mpm_event (FS#39218). You'll have to use mod_mpm_prefork instead 3107 | replace_line 'LoadModule mpm_event_module modules/mod_mpm_event.so' 'LoadModule mpm_prefork_module modules/mod_mpm_prefork.so' /etc/httpd/conf/httpd.conf 3108 | replace_line 'DirectoryIndex\ index.html' 'DirectoryIndex\ index.html\ index.php' /etc/httpd/conf/httpd.conf 3109 | fi 3110 | } #}}} 3111 | 3112 | configure_php_nginx() { #{{{ 3113 | if [[ -f /etc/nginx/nginx.conf.pacnew ]]; then 3114 | mv -v /etc/nginx/nginx.conf.pacnew /etc/nginx/nginx.conf 3115 | rm -v /etc/nginx/nginx.conf.aui 3116 | fi 3117 | [[ -f /etc/nginx/nginx.conf.aui ]] && cp -v /etc/nginx/nginx.conf.aui /etc/nginx/nginx.conf || cp -v /etc/nginx/nginx.conf /etc/nginx/nginx.conf.aui 3118 | sed -i -e '/location ~ \.php$ {/,/}/d' /etc/nginx/nginx.conf 3119 | sed -i -e '/pass the PHP/a\ #\n location ~ \.php$ {\n fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;\n fastcgi_index index.php;\n root /srv/http;\n include fastcgi.conf;\n }' /etc/nginx/nginx.conf 3120 | } #}}} 3121 | 3122 | create_sites_folder() { #{{{ 3123 | [[ ! -f /etc/httpd/conf/extra/httpd-userdir.conf.aui ]] && cp -v /etc/httpd/conf/extra/httpd-userdir.conf /etc/httpd/conf/extra/httpd-userdir.conf.aui 3124 | replace_line 'public_html' 'Sites' /etc/httpd/conf/extra/httpd-userdir.conf 3125 | su - "${username}" -c "mkdir -p ~/Sites" 3126 | su - "${username}" -c "chmod o+x ~/ && chmod -R o+x ~/Sites" 3127 | print_line 3128 | echo "The folder \"Sites\" has been created in your home" 3129 | echo "You can access your projects at \"http://localhost/~username\"" 3130 | pause_function 3131 | } #}}} 3132 | 3133 | print_title "WEB SERVER - https://wiki.archlinux.org/index.php/LAMP|LAPP" 3134 | print_info "*Adminer is installed by default in all options" 3135 | echo " 1) LAMP - APACHE, MariaDB & PHP" 3136 | echo " 2) LAPP - APACHE, POSTGRESQL & PHP" 3137 | echo " 3) LEMP - NGINX, MariaDB & PHP" 3138 | echo " 4) LEPP - NGINX, POSTGRESQL & PHP" 3139 | echo "" 3140 | echo " b) BACK" 3141 | echo "" 3142 | read_input "$WEBSERVER" 3143 | case "$OPTION" in 3144 | 1) 3145 | package_install "apache php php-apache php-mcrypt php-gd" 3146 | install_mariadb 3147 | install_adminer 3148 | system_ctl enable httpd.service 3149 | configure_php_apache 3150 | configure_php "mariadb" 3151 | create_sites_folder 3152 | ;; 3153 | 2) 3154 | package_install "apache php php-apache php-pgsql php-gd" 3155 | install_postgresql 3156 | install_adminer 3157 | system_ctl enable httpd.service 3158 | configure_php_apache 3159 | configure_php "postgresql" 3160 | create_sites_folder 3161 | ;; 3162 | 3) 3163 | package_install "nginx php php-mcrypt php-fpm" 3164 | install_mariadb 3165 | system_ctl enable nginx.service 3166 | system_ctl enable php-fpm.service 3167 | configure_php_nginx 3168 | configure_php "mariadb" 3169 | ;; 3170 | 4) 3171 | package_install "nginx php php-fpm php-pgsql" 3172 | install_postgresql 3173 | system_ctl enable nginx.service 3174 | system_ctl enable php-fpm.service 3175 | configure_php_nginx 3176 | configure_php "postgresql" 3177 | ;; 3178 | esac 3179 | } 3180 | #}}} 3181 | #FONTS {{{ 3182 | install_fonts() { 3183 | while true; do 3184 | print_title "FONTS - https://wiki.archlinux.org/index.php/Fonts" 3185 | echo " 1) $(menu_item "ttf-dejavu")" 3186 | echo " 2) $(menu_item "ttf-fira-code") $AUR" 3187 | echo " 3) $(menu_item "ttf-google-fonts-git") $AUR" 3188 | echo " 4) $(menu_item "ttf-liberation")" 3189 | echo " 5) $(menu_item "ttf-bitstream-vera")" 3190 | echo " 6) $(menu_item "ttf-hack")" 3191 | echo " 7) $(menu_item "ttf-mac-fonts") $AUR" 3192 | echo " 8) $(menu_item "ttf-ms-fonts") $AUR" 3193 | echo " 9) $(menu_item "wqy-microhei") (Chinese/Japanese/Korean Support)" 3194 | echo "10) $(menu_item "noto-fonts-cjk") (Chinese/Japanese/Korean Support)" 3195 | echo "11) $(menu_item "nerd-fonts-complete") $AUR" 3196 | echo "12) $(menu_item "yanc-font") $AUR" 3197 | echo "" 3198 | echo " b) BACK" 3199 | echo "" 3200 | FONTS_OPTIONS+=" b" 3201 | read_input_options "$FONTS_OPTIONS" 3202 | for OPT in "${OPTIONS[@]}"; do 3203 | case "$OPT" in 3204 | 1) 3205 | package_install "ttf-dejavu" 3206 | ;; 3207 | 2) 3208 | aur_package_install "ttf-fira-code" 3209 | ;; 3210 | 3) 3211 | package_remove "ttf-droid" 3212 | package_remove "ttf-roboto" 3213 | package_remove "ttf-ubuntu-font-family" 3214 | package_remove "otf-oswald-ib" 3215 | aur_package_install "ttf-google-fonts-git" 3216 | ;; 3217 | 4) 3218 | package_install "ttf-liberation" 3219 | ;; 3220 | 5) 3221 | package_install "ttf-bitstream-vera" 3222 | ;; 3223 | 6) 3224 | package_install "ttf-hack" 3225 | ;; 3226 | 7) 3227 | aur_package_install "ttf-mac-fonts" 3228 | ;; 3229 | 8) 3230 | aur_package_install "ttf-ms-fonts" 3231 | ;; 3232 | 9) 3233 | package_install "wqy-microhei" 3234 | ;; 3235 | 10) 3236 | package_install "noto-fonts-cjk" 3237 | ;; 3238 | 11) 3239 | aur_package_install "nerd-fonts-complete" 3240 | ;; 3241 | 12) 3242 | aur_package_install "yanc-font" 3243 | ;; 3244 | "b") 3245 | break 3246 | ;; 3247 | *) 3248 | invalid_option 3249 | ;; 3250 | esac 3251 | done 3252 | source sharedfuncs_elihw 3253 | done 3254 | } 3255 | #}}} 3256 | #IME INPUT TOOLS {{{ 3257 | choose_ime_m17n() { 3258 | while true; do 3259 | print_title "INTERNATIONALIZATION - https://wiki.archlinux.org/index.php/Internationalization" 3260 | echo " 1) $(menu_item "fcitx")" 3261 | echo " 2) $(menu_item "ibus")" 3262 | echo "" 3263 | echo " b) BACK" 3264 | echo "" 3265 | IME_OPTIONS+=" b" 3266 | read_input_options "IME_OPTIONS" 3267 | for OPT in "${OPTIONS[@]}"; do 3268 | case "$OPT" in 3269 | 1) 3270 | package_install "fcitx" 3271 | package_install "fcitx-m17n" 3272 | package_install "fcitx-qt4" 3273 | package_install "fcitx-qt5" 3274 | package_install "fcitx-gtk2" 3275 | package_install "fcitx-gtk3" 3276 | package_install "kcm-fcitx" 3277 | package_install "fcitx-configtool" 3278 | echo -e '#!/bin/sh\n\n\n# Identify fcitx as a input module for both GTK and QT apps\nXMODIFIERS=@im=fcitx\nGTK_IM_MODULE=fcitx\nQT_IM_MODULE=fcitx\n\nexport XMODIFIERS GTK_IM_MODULE QT_IM_MODULE\necho we set XMODIFIERS GTK_IM_MODULE QT_IM_MODULE in profile.d\n' >/etc/profile.d/ime.sh 3279 | # echo -e '#!/bin/sh\n\n\n# Identify fcitx as a input module for both GTK and QT apps\nXMODIFIERS=@im=fcitx\nGTK_IM_MODULE=fcitx\nQT_IM_MODULE=fcitx\n\nexport XMODIFIERS GTK_IM_MODULE QT_IM_MODULE\necho we set XMODIFIERS GTK_IM_MODULE QT_IM_MODULE in xprofile\n' > /etc/xprofile 3280 | ;; 3281 | 2) 3282 | package_install "ibus" 3283 | package_install "ibus-m17n" 3284 | package_install "ibus-qt" 3285 | echo -e '#!/bin/sh\n\n\n# Identify ibus as a input module for both GTK and QT apps\nXMODIFIERS=@im=ibus\nGTK_IM_MODULE=ibus\nQT_IM_MODULE=ibus\n\nexport XMODIFIERS GTK_IM_MODULE QT_IM_MODULE\necho we set XMODIFIERS GTK_IM_MODULE QT_IM_MODULE in profile.d\n' >/etc/profile.d/ime.sh 3286 | ;; 3287 | "b") 3288 | break 3289 | ;; 3290 | *) 3291 | invalid_option 3292 | ;; 3293 | esac 3294 | done 3295 | source sharedfuncs_elihw 3296 | done 3297 | } 3298 | #}}} 3299 | #CLEAN ORPHAN PACKAGES {{{ 3300 | clean_orphan_packages() { 3301 | print_title "CLEAN ORPHAN PACKAGES" 3302 | pacman -Rsc --noconfirm "$(pacman -Qqdt)" 3303 | #pacman -Sc --noconfirm 3304 | pacman-optimize 3305 | } 3306 | #}}} 3307 | #RECONFIGURE SYSTEM {{{ 3308 | reconfigure_system() { 3309 | print_title "HOSTNAME - https://wiki.archlinux.org/index.php/HOSTNAME" 3310 | print_info "A host name is a unique name created to identify a machine on a network.Host names are restricted to alphanumeric characters.\nThe hyphen (-) can be used, but a host name cannot start or end with it. Length is restricted to 63 characters." 3311 | printf "%s" "Hostname [ex: archlinux]: " 3312 | read -r HN 3313 | hostnamectl set-hostname "$HN" 3314 | 3315 | print_title "TIMEZONE - https://wiki.archlinux.org/index.php/Timezone" 3316 | print_info "In an operating system the time (clock) is determined by four parts: Time value, Time standard, Time Zone, and DST (Daylight Saving Time if applicable)." 3317 | OPTION=n 3318 | while [[ $OPTION != y ]]; do 3319 | settimezone 3320 | read_input_text "Confirm timezone ($ZONE/$SUBZONE)" 3321 | done 3322 | timedatectl set-timezone "${ZONE}"/"${SUBZONE}" 3323 | 3324 | print_title "HARDWARE CLOCK TIME - https://wiki.archlinux.org/index.php/Internationalization" 3325 | print_info "This is set in /etc/adjtime. Set the hardware clock mode uniformly between your operating systems on the same machine. Otherwise, they will overwrite the time and cause clock shifts (which can cause time drift correction to be miscalibrated)." 3326 | hwclock_list=('UTC' 'Localtime') 3327 | PS3="$prompt1" 3328 | select OPT in "${hwclock_list[@]}"; do 3329 | case "$REPLY" in 3330 | 1) 3331 | timedatectl set-local-rtc false 3332 | ;; 3333 | 2) 3334 | timedatectl set-local-rtc true 3335 | ;; 3336 | *) invalid_option ;; 3337 | esac 3338 | [[ -n $OPT ]] && break 3339 | done 3340 | timedatectl set-ntp true 3341 | } 3342 | #}}} 3343 | #EXTRA {{{ 3344 | install_extra() { 3345 | while true; do 3346 | print_title "EXTRA" 3347 | echo " 1) $(menu_item "profile-sync-daemon") $AUR" 3348 | echo "" 3349 | echo " b) BACK" 3350 | echo "" 3351 | EXTRA_OPTIONS+=" b" 3352 | read_input_options "$EXTRA_OPTIONS" 3353 | for OPT in "${OPTIONS[@]}"; do 3354 | case "$OPT" in 3355 | 1) 3356 | aur_package_install "profile-sync-daemon" 3357 | run_as_user "psd" 3358 | run_as_user "$EDITOR /home/${username}/.config/psd/psd.conf" 3359 | run_as_user "systemctl --user enable psd.service" 3360 | ;; 3361 | "b") 3362 | break 3363 | ;; 3364 | *) 3365 | invalid_option 3366 | ;; 3367 | esac 3368 | done 3369 | source sharedfuncs_elihw 3370 | done 3371 | } 3372 | #}}} 3373 | #FINISH {{{ 3374 | finish() { 3375 | print_title "WARNING: PACKAGES INSTALLED FROM AUR" 3376 | print_danger "List of packages not officially supported that may kill your cat:" 3377 | pause_function 3378 | AUR_PKG_LIST="${AUI_DIR}/aur_pkg_list.log" 3379 | pacman -Qm | awk '{print $1}' >"$AUR_PKG_LIST" 3380 | less "$AUR_PKG_LIST" 3381 | print_title "INSTALL COMPLETED" 3382 | echo -e "Thanks for using the Archlinux Ultimate Install script by helmuthdu\n" 3383 | #REBOOT 3384 | printf "%s" "Reboot your system [y/N]: " 3385 | read -r OPTION 3386 | [[ $OPTION == y ]] && reboot 3387 | exit 0 3388 | } 3389 | #}}} 3390 | 3391 | welcome 3392 | check_root 3393 | check_archlinux 3394 | check_hostname 3395 | check_connection 3396 | check_pacman_blocked 3397 | check_multilib 3398 | pacman_key 3399 | system_update 3400 | language_selector 3401 | configure_sudo 3402 | select_user 3403 | choose_aurhelper 3404 | automatic_mode 3405 | 3406 | if is_package_installed "kdebase-workspace"; then KDE=1; fi 3407 | 3408 | while true; do 3409 | print_title "ARCHLINUX INSTALL - https://github.com/helmuthdu/aui" 3410 | print_warning "USERNAME: ${username}" 3411 | echo " 1) $(mainmenu_item "${checklist[1]}" "Basic Setup")" 3412 | echo " 2) $(mainmenu_item "${checklist[2]}" "Desktop Environment|Window Manager")" 3413 | echo " 3) $(mainmenu_item "${checklist[3]}" "Accessories Apps")" 3414 | echo " 4) $(mainmenu_item "${checklist[4]}" "Development Apps")" 3415 | echo " 5) $(mainmenu_item "${checklist[5]}" "Office Apps")" 3416 | echo " 6) $(mainmenu_item "${checklist[6]}" "System Apps")" 3417 | echo " 7) $(mainmenu_item "${checklist[7]}" "Graphics Apps")" 3418 | echo " 8) $(mainmenu_item "${checklist[8]}" "Internet Apps")" 3419 | echo " 9) $(mainmenu_item "${checklist[9]}" "Audio Apps")" 3420 | echo "10) $(mainmenu_item "${checklist[10]}" "Video Apps")" 3421 | echo "11) $(mainmenu_item "${checklist[11]}" "Games")" 3422 | echo "12) $(mainmenu_item "${checklist[12]}" "Web server")" 3423 | echo "13) $(mainmenu_item "${checklist[13]}" "Fonts")" 3424 | echo "14) $(mainmenu_item "${checklist[14]}" "Internationalization")" 3425 | echo "15) $(mainmenu_item "${checklist[15]}" "Extra")" 3426 | echo "16) $(mainmenu_item "${checklist[16]}" "Clean Orphan Packages")" 3427 | echo "17) $(mainmenu_item "${checklist[17]}" "Reconfigure System")" 3428 | echo "" 3429 | echo " q) Quit" 3430 | echo "" 3431 | MAINMENU+=" q" 3432 | read_input_options "$MAINMENU" 3433 | for OPT in "${OPTIONS[@]}"; do 3434 | case "$OPT" in 3435 | 1) 3436 | add_custom_repositories 3437 | install_basic_setup 3438 | install_zsh 3439 | install_fish 3440 | install_ssh 3441 | install_nfs 3442 | install_samba 3443 | install_tlp 3444 | enable_readahead 3445 | install_zram 3446 | install_video_cards 3447 | install_xorg 3448 | install_wayland 3449 | font_config 3450 | install_cups 3451 | install_additional_firmwares 3452 | checklist[1]=1 3453 | ;; 3454 | 2) 3455 | if [[ checklist[1] -eq 0 ]]; then 3456 | print_danger "\nWARNING: YOU MUST RUN THE BASIC SETUP FIRST" 3457 | read_input_text "Are you sure you want to continue?" 3458 | [[ $OPTION != y ]] && continue 3459 | fi 3460 | install_desktop_environment 3461 | install_nm_wicd 3462 | install_usb_modem 3463 | install_bluetooth 3464 | checklist[2]=1 3465 | ;; 3466 | 3) 3467 | install_accessories_apps 3468 | checklist[3]=1 3469 | ;; 3470 | 4) 3471 | install_development_apps 3472 | checklist[4]=1 3473 | ;; 3474 | 5) 3475 | install_office_apps 3476 | checklist[5]=1 3477 | ;; 3478 | 6) 3479 | install_system_apps 3480 | checklist[6]=1 3481 | ;; 3482 | 7) 3483 | install_graphics_apps 3484 | checklist[7]=1 3485 | ;; 3486 | 8) 3487 | install_internet_apps 3488 | checklist[8]=1 3489 | ;; 3490 | 9) 3491 | install_audio_apps 3492 | checklist[9]=1 3493 | ;; 3494 | 10) 3495 | install_video_apps 3496 | checklist[10]=1 3497 | ;; 3498 | 11) 3499 | install_games 3500 | checklist[11]=1 3501 | ;; 3502 | 12) 3503 | install_web_server 3504 | checklist[12]=1 3505 | ;; 3506 | 13) 3507 | install_fonts 3508 | checklist[13]=1 3509 | ;; 3510 | 14) 3511 | choose_ime_m17n 3512 | checklist[14]=1 3513 | ;; 3514 | 15) 3515 | install_extra 3516 | checklist[15]=1 3517 | ;; 3518 | 16) 3519 | clean_orphan_packages 3520 | checklist[16]=1 3521 | ;; 3522 | 17) 3523 | print_danger "\nWARNING: THIS OPTION WILL RECONFIGURE THINGS LIKE HOSTNAME, TIMEZONE, CLOCK..." 3524 | read_input_text "Are you sure you want to continue?" 3525 | [[ $OPTION != y ]] && continue 3526 | reconfigure_system 3527 | checklist[17]=1 3528 | ;; 3529 | "q") 3530 | finish 3531 | ;; 3532 | *) 3533 | invalid_option 3534 | ;; 3535 | esac 3536 | done 3537 | done 3538 | #}}} 3539 | -------------------------------------------------------------------------------- /lilo.automode: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #shellcheck disable=SC2034 3 | 4 | : 'ATTENTION!: 5 | -------------------------------------------------- 6 | | Created by helmuthdu | 7 | | Shellchecked by uniminin | 8 | | Formatted by molese | 9 | -------------------------------------------------- 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | ------------------------------------------------------------------------------- 23 | ' 24 | 25 | #MAINMENU {{{ 26 | # 1) Basic Setup 27 | # 2) Desktop Environment 28 | # 3) Accessories Apps 29 | # 4) Development Apps 30 | # 5) Office Apps 31 | # 6) System Apps 32 | # 7) Graphics Apps 33 | # 8) Internet Apps 34 | # 9) Audio Apps 35 | # 10) Video Apps 36 | # 11) Games 37 | # 12) Web server 38 | # 13) Fonts 39 | # 14) Internationalization 40 | # 15) Extra 41 | # 16) Clean Orphan Packages 42 | MAINMENU="1-13" 43 | #}}} 44 | #BASIC SETUP {{{ 45 | CUPS="y" 46 | CUSTOMREPO="n" # Add custom repositories 47 | FIRMWARE="n" # Install custom firmwares 48 | NFS="n" 49 | READAHEAD="n" 50 | SAMBA="n" 51 | SSH="n" 52 | TLP="n" # Laptop Power Manager 53 | ZRAM="n" 54 | ZSH="n" 55 | OH_MY_ZSH="n" 56 | BETTER_VIDEO_DRIVER="y" # NVIDIA/AMDGPU 57 | BUMBLEBEE="y" # Optimus, use Bumblebee instead of NVIDIA PRIME Render Offload 58 | FONTCONFIG="y" 59 | #}}} 60 | #ADDITIONAL FIRMWARE {{{ 61 | # 1) aic94xx-firmware 62 | # 2) alsa-firmware 63 | # 3) b43-firmware 64 | # 4) b43-firmware-legacy 65 | # 5) bluez-firmware 66 | # 6) broadcom-wl-dkms 67 | # 7) ipw2100-fw 68 | # 8) ipw2200-fw 69 | # 9) libffado [Firmware Audio Devices] 70 | # 10) libmtp [Android Devices] 71 | # 11) libraw1394 [IEE1394 Driver] 72 | # 12) wd719x-firmware 73 | # 13) upd72020x-fw [Renesas USB3.0 Driver] 74 | FIRMWARE_OPTIONS="" 75 | #}}} 76 | #}}} 77 | #DESKTOP ENVIRONMENT|WINDOW MANAGER {{{ 78 | # 1) Cinnamon 79 | # 2) Deepin 80 | # 3) Enlightenment 81 | # 4) GNOME 82 | # 5) KDE 83 | # 6) LXQT 84 | # 7) Mate 85 | # 8) XFCE 86 | # 9) Budgie 87 | # 10) UKUI 88 | # 11) Pantheon 89 | # 12) Awesome 90 | # 13) Fluxbox 91 | # 14) i3 92 | # 15) i3-Gaps 93 | # 16) OpenBox 94 | # 17) Xmonad 95 | DESKTOPENV="4" 96 | #KDE {{{ 97 | # 1) Choqok 98 | # 2) Digikam 99 | # 3) K3b 100 | # 4) kvantum 101 | # 5) latte-dock 102 | # 6) Skrooge 103 | # 7) Yakuake 104 | KDE_OPTIONS="1 2 3 6 7" 105 | #}}} 106 | #ESSENTIAL APPS [Enlightenment,LXDE,Awesome,Fluxbox,OpenBox] {{{ 107 | # 1) Display Manager 108 | # 2) Dmenu 109 | # 3) Viewnior 110 | # 4) Gmrun 111 | # 5) rxvt-unicode 112 | # 6) Squeeze 113 | # 7) Thunar 114 | # 8) Tint2 115 | # 9) Volwheel 116 | # 10) Xfburn 117 | # 11) Xcompmgr 118 | # 12) Zathura 119 | # 13) speedtest-cli 120 | MISCAPPS="1 3" 121 | #}}} 122 | #DISPLAY MANAGER {{{ 123 | # 1) Entrance 124 | # 2) GDM 125 | # 3) LightDM 126 | # 4) SDDM 127 | # 5) Slim 128 | # 6) lxdm 129 | # 7) lxdm-gtk 130 | DISPLAY_MANAGER="3" 131 | #}}} 132 | # 1) Icons Themes 133 | # 2) GTK2|GTK3 Themes 134 | THEMES_OPTIONS="1 2" 135 | #ICONS THEMES {{{ 136 | # 1) Arc 137 | # 2) Adwaita 138 | # 3) Emerald 139 | # 4) la-capitaine 140 | # 5) Numix 141 | # 6) Paper 142 | # 7) Papirus 143 | # 8) Pop 144 | # 9) Solus 145 | # 10) Yaru 146 | ICONS_THEMES="7" 147 | #}}} 148 | #GTK THEMES {{{ 149 | # 1) Arc 150 | # 2) Abrus 151 | # 3) Acid 152 | # 4) Adapta 153 | # 5) Amber 154 | # 6) Candy 155 | # 7) Evopop 156 | # 8) Flat-Remix 157 | # 9) Zuki 158 | # 10) Zukitwo 159 | GTK_THEMES="1" 160 | #}}} 161 | #}}} 162 | #NETWORK MANAGER {{{ 163 | # 1) NetworkManager 164 | # 2) Wicd 165 | # 3) ConnMan 166 | # n) None 167 | NETWORKMANAGER="1" 168 | USBMODEM="y" #USB 3G MODEM SUPPORT 169 | BLUETOOTH="y" #BLUETOOTH SUPPORT 170 | #}}} 171 | #ACCESSORIES {{{ 172 | # 1) Albert 173 | # 2) Catfish 174 | # 3) Conky 175 | # 4) Enpass 176 | # 5) flameshot 177 | # 6) keepass 178 | # 7) Pamac 179 | # 8) Shutter| Hotshots 180 | # 9) Synapse 181 | # 10) Terminator 182 | # 11) Tilix 183 | ACCESSORIES_OPTIONS="4 11" 184 | #}}} 185 | #DEVELOPEMENT {{{ 186 | # 1) Atom 187 | # 2) Emacs 188 | # 3) Gvim 189 | # 4) Meld 190 | # 5) Sublime Merge 191 | # 6) Sublime Text 2 192 | # 7) Sublime Text 3 193 | # 8) Android Studio 194 | # 9) Jetbrains Toolbox 195 | # 10) IntelliJ IDEA 196 | # 11) IntelliJ IDEA Ultimate Edition 197 | # 12) Micro 198 | # 13) Monodevelop 199 | # 14) QT Creator 200 | # 15) MySQL Workbench 201 | # 16) OpenJDK 8 202 | # 17) OpenJDK 9 203 | # 18) OpenJDK 10 204 | # 19) OracleJDK 205 | # 20) NodeJS 206 | # 21) Microsoft Visual Studio Code 207 | # 22) Git GUI-s 208 | # 23) kdiff3 209 | # 24) Regexxer 210 | # 25) Postman 211 | # 26) Gitkraken 212 | # 27) FreeCad 213 | DEVELOPMENT_OPTIONS="18" 214 | #}}} 215 | #OFFICE {{{ 216 | # 1) Abiword+Gnumeric|Calligra 217 | # 2) Calibre 218 | # 3) Goldendict 219 | # 4) Homebank 220 | # 5) Latex 221 | # 6) LibreOffice 222 | # 7) Lyx 223 | # 8) OCRFeeder 224 | # 9) Tellico 225 | # 10) Typora 226 | # 11) Xmind 227 | OFFICE_OPTIONS="6" 228 | #}}} 229 | #SYSTEM TOOLS {{{ 230 | # 1) ClamAV 231 | # 2) Cockpit 232 | # 3) Webmin 233 | # 4) Docker 234 | # 5) FirewallD 235 | # 6) Gparted 236 | # 7) Grsync 237 | # 8) Hosts Update 238 | # 9) Htop 239 | # 10) Stacer 240 | # 11) Gotop 241 | # 12) UFW 242 | # 13) Unified Remote 243 | # 14) Virtualbox 244 | # 15) Wine 245 | # 16) netdata 246 | # 17) nload 247 | # 18) vmware-workstation 12 248 | SYSTEMTOOLS_OPTIONS="12 14" 249 | #}}} 250 | #GRAPHICS {{{ 251 | # 1) Blender 252 | # 2) Gimp 253 | # 3) Gthumb 254 | # 4) Inkscape 255 | # 5) Krita 256 | # 6) MComix 257 | # 7) Mypaint 258 | # 8) Pencil 259 | # 9) Scribus 260 | # 10) Shotwell 261 | # 11) Simple Scan 262 | # 12) YACReader 263 | GRAPHICS_OPTIONS="2 3 4 6 10" 264 | #}}} 265 | #INTERNET {{{ 266 | # 1) Browser 267 | # 2) Download|Fileshare 268 | # 3) Email|RSS 269 | # 4) Instant Messaging|IRC 270 | # 5) Mapping Tools 271 | # 6) VNC|Desktop Share 272 | INTERNET_OPTIONS="1-6" 273 | #BROWSER {{{ 274 | # 1) Chrome 275 | # 2) Chromium 276 | # 3) Firefox 277 | # 4) Midori|Konqueror 278 | # 5) Opera 279 | # 6) Vivaldi 280 | # 7) Tor-browser 281 | # 8) Brave 282 | BROWSERS_OPTIONS="3" 283 | #}}} 284 | #DOWNLOAD|FILESHARE {{{ 285 | # 1) Deluge 286 | # 2) Dropbox 287 | # 3) Flareget 288 | # 4) free Download Manager 289 | # 5) Google Drive OCamlFuse 290 | # 6) Jdownloader 291 | # 7) qBittorrent 292 | # 8) Nitroshare 293 | # 9) Resilio Sync 294 | # 10) Sparkleshare 295 | # 11) Spideroak 296 | # 12) Tixati 297 | # 13) Transmission 298 | # 14) uGet 299 | # 15) Youtube-dl 300 | # 16) Megasync 301 | # 17) Extreme Download Manager 302 | DOWNLOAD_OPTIONS="13" 303 | #}}} 304 | #EMAIL|RSS {{{ 305 | # 1) Liferea 306 | # 2) Thunderbird 307 | EMAIL_OPTIONS="" 308 | #}}} 309 | #IM|IRC {{{ 310 | # 1) HexChat|Konversation 311 | # 2) Irssi 312 | # 3) Pidgin 313 | # 4) Riot 314 | # 5) Skype Stable 315 | # 6) Skype Preview 316 | # 7) Teamspeak 317 | # 8) Viber 318 | # 9) Telegram Desktop 319 | # 10) qTox 320 | # 11) Discord 321 | # 12) Slack 322 | # 13) VK Messanger 323 | # 14) Zoom.us 324 | IM_OPTIONS="5" 325 | #}}} 326 | #MAPPING {{{ 327 | # 1) Anydesk 328 | # 2) Google Earth 329 | # 3) QGIS 330 | MAPPING_OPTIONS="" 331 | #}}} 332 | #VNC|Desktop Share {{{ 333 | # 1) Remmina 334 | # 2) Teamviewer 335 | VNC_OPTIONS="" 336 | #}}} 337 | #}}} 338 | #AUDIO {{{ 339 | # 1) Players 340 | # 2) Editors|Tools 341 | # 3) Codecs 342 | AUDIO_OPTIONS="1-3" 343 | #PLAYERS {{{ 344 | # 1) Amarok 345 | # 2) Audacious 346 | # 3) Clementine 347 | # 4) Deadbeef 348 | # 5) Guayadeque 349 | # 6) lollypop 350 | # 7) Musique 351 | # 8) Pragha 352 | # 9) Rhythmbox 353 | # 10) Spotify 354 | # 11) Timidity++ 355 | # 12) quodlibet 356 | AUDIO_PLAYER_OPTIONS="9" 357 | #}}} 358 | #EDITORS|TOOLS {{{ 359 | # 1) Audacity 360 | # 2) Easytag 361 | # 3) OcenAudio 362 | # 4) Soundconverter|Soundkonverter 363 | AUDIO_EDITOR_OPTIONS="2" 364 | #}}} 365 | #}}} 366 | #VIDEO {{{ 367 | # 1) Players 368 | # 2) Editors|Tools 369 | # 3) Codecs 370 | VIDEO_OPTIONS="1-3" 371 | #PLAYERS {{{ 372 | # 1) Gnome Mplayer 373 | # 2) LiveStreamer 374 | # 3) Minitube 375 | # 4) MPV 376 | # 5) Smplayer 377 | # 6) Parole 378 | # 7) Plex 379 | # 8) Popcorn Time 380 | # 9) VLC 381 | # 10) Kodi 382 | VIDEO_PLAYER_OPTIONS="8" 383 | #}}} 384 | #EDITORS|TOOLS {{{ 385 | # 1) Arista 386 | # 2) Avidemux 387 | # 3) Filebot 388 | # 4) Handbrake 389 | # 5) Kdenlive 390 | # 6) Lightworks 391 | # 7) Openshot 392 | # 8) Pitivi 393 | # 9) Transmageddon 394 | VIDEO_EDITOR_OPTIONS="8" 395 | #}}} 396 | #}}} 397 | #GAMES {{{ 398 | # 1) Desura 399 | # 2) PlayOnLinux 400 | # 3) Steam 401 | # 4) Minecraft 402 | # 5) OSU!LAZER 403 | GAMES_OPTIONS="" 404 | #}}} 405 | #WEBSERVER {{{ 406 | # 1) LAMP - APACHE, MariaDB & PHP 407 | # 2) LAPP - APACHE, POSTGRESQL & PHP 408 | # 3) LEMP - NGINX, MariaDB & PHP 409 | # 4) LEPP - NGINX, POSTGRESQL & PHP 410 | WEBSERVER="4" 411 | POSTGIS="n" 412 | #}}} 413 | #FONTS {{{ 414 | # 1) ttf-dejavu 415 | # 2) ttf-fira-code 416 | # 3) ttf-google-webfonts 417 | # 4) ttf-liberation 418 | # 5) ttf-bitstream-vera 419 | # 6) ttf-hack 420 | # 7) ttf-mac-fonts 421 | # 8) ttf-ms-fonts 422 | # 9) wqy-microhei 423 | # 10) noto-fonts-cjk 424 | # 11) nerd-fonts-complete 425 | # 12) Yanc 426 | FONTS_OPTIONS="1-9" 427 | #}}} 428 | #IME INPUT TOOLS {{{ 429 | # 1) fcitx 430 | # 2) ibus 431 | IME_OPTIONS="" 432 | #}}} 433 | #EXTRA {{{ 434 | # 1) Profile Sync 435 | EXTRA_OPTIONS="" 436 | #}}} 437 | -------------------------------------------------------------------------------- /sharedfuncs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # FIX THIS ISSUES | NON-ACUTE 3 | #shellcheck disable=SC1091,SC2001,SC2015,SC2034,SC2126,SC2154 4 | #shellcheck disable=SC2154,SC2155,SC2181,SC2207,SC2143,SC2162 5 | 6 | : 'ATTENTION!: 7 | -------------------------------------------------- 8 | | Created by helmuthdu | 9 | | Shellchecked by uniminin | 10 | | Formatted by molese | 11 | -------------------------------------------------- 12 | This program is free software: you can redistribute it and/or modify 13 | it under the terms of the GNU General Public License as published by 14 | the Free Software Foundation, either version 3 of the License, or 15 | (at your option) any later version. 16 | 17 | This program is distributed in the hope that it will be useful, 18 | but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | GNU General Public License for more details. 21 | 22 | You should have received a copy of the GNU General Public License 23 | along with this program. If not, see . 24 | ------------------------------------------------------------------------ 25 | Run this script after your first boot with archlinux (as root) 26 | ' 27 | 28 | #GLOBAL VARIABLES {{{ 29 | checklist=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0) 30 | # COLORS {{{ 31 | Bold=$(tput bold) 32 | Underline=$(tput sgr 0 1) 33 | Reset=$(tput sgr0) 34 | # Regular Colors 35 | Red=$(tput setaf 1) 36 | Green=$(tput setaf 2) 37 | Yellow=$(tput setaf 3) 38 | Blue=$(tput setaf 4) 39 | Purple=$(tput setaf 5) 40 | Cyan=$(tput setaf 6) 41 | White=$(tput setaf 7) 42 | # Bold 43 | BRed=${Bold}${Red} 44 | BGreen=${Bold}${Green} 45 | BYellow=${Bold}${Yellow} 46 | BBlue=${Bold}${Blue} 47 | BPurple=${Bold}${Purple} 48 | BCyan=${Bold}${Cyan} 49 | BWhite=${Bold}${White} 50 | #}}} 51 | # PROMPT {{{ 52 | prompt1="Enter your option: " 53 | prompt2="Enter n° of options (ex: 1 2 3 or 1-3): " 54 | prompt3="You have to manually enter the following commands, then press ${BYellow}ctrl+d${Reset} or type ${BYellow}exit${Reset}:" 55 | #}}} 56 | # EDITOR {{{ 57 | AUTOMATIC_MODE=0 58 | if [[ -f /usr/bin/vim ]]; then 59 | EDITOR="vim" 60 | elif [[ -z $EDITOR ]]; then 61 | EDITOR="nano" 62 | fi 63 | #}}} 64 | # DESKTOP ENVIRONMENT{{{ 65 | CINNAMON=0 66 | GNOME=0 67 | KDE=0 68 | #}}} 69 | # MOUNTPOINTS {{{ 70 | EFI_MOUNTPOINT="/boot" 71 | ROOT_MOUNTPOINT="/dev/sda1" 72 | BOOT_MOUNTPOINT="/dev/sda" 73 | MOUNTPOINT="/mnt" 74 | #}}} 75 | ARCHI=$(uname -m) # ARCHITECTURE 76 | UEFI=0 77 | LVM=0 78 | LUKS=0 79 | LUKS_DISK="sda2" 80 | AUR=$(echo -e "(${BPurple}aur${Reset})") 81 | EXTERNAL=$(echo -e "(${BYellow}external${Reset})") 82 | AUI_DIR=$(pwd) #CURRENT DIRECTORY 83 | [[ $1 == -v || $1 == --verbose ]] && VERBOSE_MODE=1 || VERBOSE_MODE=0 # VERBOSE MODE 84 | LOG="${AUI_DIR}/$(basename "${0}").log" # LOG FILE 85 | [[ -f $LOG ]] && rm -f "$LOG" 86 | PKG="" 87 | PKG_FAIL="${AUI_DIR}/$(basename "${0}")_fail_install.log" 88 | [[ -f $PKG_FAIL ]] && rm -f "$PKG_FAIL" 89 | XPINGS=0 # CONNECTION CHECK 90 | SPIN="/-\|" #SPINNER POSITION 91 | AUTOMATIC_MODE=0 92 | TRIM=0 93 | #}}} 94 | #COMMON FUNCTIONS {{{ 95 | error_msg() { #{{{ 96 | local _msg="${1}" 97 | echo -e "${_msg}" 98 | exit 1 99 | } #}}} 100 | cecho() { #{{{ 101 | echo -e "$1" 102 | echo -e "$1" >>"$LOG" 103 | tput sgr0 104 | } #}}} 105 | ncecho() { #{{{ 106 | echo -ne "$1" 107 | echo -ne "$1" >>"$LOG" 108 | tput sgr0 109 | } #}}} 110 | spinny() { #{{{ 111 | echo -ne "\b${SPIN:i++%${#SPIN}:1}" 112 | } #}}} 113 | progress() { #{{{ 114 | ncecho " " 115 | while true; do 116 | kill -0 "$pid" &>/dev/null 117 | if [[ $? == 0 ]]; then 118 | spinny 119 | sleep 0.25 120 | else 121 | ncecho "\b\b" 122 | wait "$pid" 123 | retcode=$? 124 | echo -ne "$pid's retcode: $retcode" >>"$LOG" 125 | if [[ $retcode == 0 ]] || [[ $retcode == 255 ]]; then 126 | cecho success 127 | else 128 | cecho failed 129 | echo -e "$PKG" >>"$PKG_FAIL" 130 | tail -n 15 "$LOG" 131 | fi 132 | break 133 | fi 134 | done 135 | } #}}} 136 | check_boot_system() { #{{{ 137 | if [[ "$(cat /sys/class/dmi/id/sys_vendor)" == 'Apple Inc.' ]] || [[ "$(cat /sys/class/dmi/id/sys_vendor)" == 'Apple Computer, Inc.' ]]; then 138 | modprobe -r -q efivars || true # if MAC 139 | else 140 | modprobe -q efivarfs # all others 141 | fi 142 | if [[ -d "/sys/firmware/efi/" ]]; then 143 | ## Mount efivarfs if it is not already mounted 144 | if (mount | grep /sys/firmware/efi/efivars); then 145 | mount -t efivarfs efivarfs /sys/firmware/efi/efivars 146 | fi 147 | UEFI=1 148 | echo "UEFI Mode detected" 149 | else 150 | UEFI=0 151 | echo "BIOS Mode detected" 152 | fi 153 | } 154 | #}}} 155 | check_trim() { #{{{ 156 | [[ -n $(hdparm -I /dev/sda | grep TRIM 2>/dev/null) ]] && TRIM=1 157 | } 158 | #}}} 159 | check_root() { #{{{ 160 | if [[ "$(id -u)" != "0" ]]; then 161 | error_msg "ERROR! You must execute the script as the 'root' user." 162 | fi 163 | } #}}} 164 | check_user() { #{{{ 165 | if [[ "$(id -u)" == "0" ]]; then 166 | error_msg "ERROR! You must execute the script as a normal user." 167 | fi 168 | } #}}} 169 | check_archlinux() { #{{{ 170 | if [[ ! -e /etc/arch-release ]]; then 171 | error_msg "ERROR! You must execute the script on Arch Linux." 172 | fi 173 | } #}}} 174 | check_hostname() { #{{{ 175 | if [[ $(echo "${HOSTNAME}" | sed 's/ //g') == "" ]]; then 176 | error_msg "ERROR! Hostname is not configured." 177 | fi 178 | } #}}} 179 | check_pacman_blocked() { #{{{ 180 | if [[ -f /var/lib/pacman/db.lck ]]; then 181 | error_msg "ERROR! Pacman is blocked. \nIf not running remove /var/lib/pacman/db.lck." 182 | fi 183 | } #}}} 184 | check_domainname() { #{{{ 185 | local _domainname=$(echo "${HOSTNAME}" | cut -d'.' -f2- | sed 's/ //g') 186 | 187 | # no domain name. Keep looking... 188 | if [[ "${_domainname}" == "" ]]; then 189 | _domainname=$(grep domain /etc/resolv.conf | sed 's/domain //g' | sed 's/ //g') 190 | fi 191 | 192 | # not founded... 193 | if [[ "${_domainname}" == "" ]]; then 194 | error_msg "ERROR! Domain name is not configured." 195 | fi 196 | } #}}} 197 | check_connection() { #{{{ 198 | XPINGS=$((XPINGS + 1)) 199 | connection_test() { 200 | ping -q -w 1 -c 1 "$(ip r | grep default | awk 'NR==1 {print $3}')" &>/dev/null && return 1 || return 0 201 | } 202 | WIRED_DEV=$(ip link | grep "ens\|eno\|enp" | awk '{print $2}' | sed 's/://' | sed '1!d') 203 | WIRELESS_DEV=$(ip link | grep wlp | awk '{print $2}' | sed 's/://' | sed '1!d') 204 | if connection_test; then 205 | print_warning "ERROR! Connection not Found." 206 | print_info "Network Setup" 207 | local _connection_opts=("Wired Automatic" "Wired Manual" "Wireless" "Configure Proxy" "Skip") 208 | PS3="$prompt1" 209 | select CONNECTION_TYPE in "${_connection_opts[@]}"; do 210 | case "$REPLY" in 211 | 1) 212 | systemctl start dhcpcd@"${WIRED_DEV}".service 213 | break 214 | ;; 215 | 2) 216 | systemctl stop dhcpcd@"${WIRED_DEV}".service 217 | printf "%s" "IP Address: " 218 | read -r IP_ADDR 219 | printf "%s" "Submask: " 220 | read -r SUBMASK 221 | printf "%s" "Gateway: " 222 | read -r GATEWAY 223 | ip link set "${WIRED_DEV}" up 224 | ip addr add "${IP_ADDR}"/"${SUBMASK}" dev "${WIRED_DEV}" 225 | ip route add default via "${GATEWAY}" 226 | $EDITOR /etc/resolv.conf 227 | break 228 | ;; 229 | 3) 230 | wifi-menu "${WIRELESS_DEV}" 231 | break 232 | ;; 233 | 4) 234 | printf "%s" "Enter your proxy e.g. protocol://adress:port: " 235 | read -r OPTION 236 | export http_proxy=$OPTION 237 | export https_proxy=$OPTION 238 | export ftp_proxy=$OPTION 239 | echo "proxy = $OPTION" >~/.curlrc 240 | break 241 | ;; 242 | 5) 243 | break 244 | ;; 245 | *) 246 | invalid_option 247 | ;; 248 | esac 249 | done 250 | if [[ $XPINGS -gt 2 ]]; then 251 | print_warning "Can't establish connection. exiting..." 252 | exit 1 253 | fi 254 | [[ $REPLY -ne 5 ]] && check_connection 255 | fi 256 | } #}}} 257 | check_vga() { #{{{ 258 | # Determine video chipset - only Intel, ATI and nvidia are supported by this script 259 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Detecting video chipset " 260 | local _vga=$(lspci | grep VGA | tr "[:upper:]" "[:lower:]") 261 | local _vga_length=$(lspci | grep VGA | wc -l) 262 | 263 | if [[ -n $(dmidecode --type 1 | grep VirtualBox) ]]; then 264 | cecho Virtualbox 265 | VIDEO_DRIVER="virtualbox" 266 | elif [[ -n $(dmidecode --type 1 | grep VMware) ]]; then 267 | cecho VMware 268 | VIDEO_DRIVER="vmware" 269 | elif [[ $_vga_length -eq 2 ]] && [[ -n $(echo "${_vga}" | grep "nvidia") || -f /sys/kernel/debug/dri/0/vbios.rom ]]; then 270 | cecho Optimus 271 | VIDEO_DRIVER="optimus" 272 | elif [[ -n $(echo "${_vga}" | grep "nvidia") || -f /sys/kernel/debug/dri/0/vbios.rom ]]; then 273 | cecho Nvidia 274 | read_input_text "Install NVIDIA proprietary driver" "$BETTER_VIDEO_DRIVER" 275 | if [[ $OPTION == y ]]; then 276 | VIDEO_DRIVER="nvidia" 277 | else 278 | VIDEO_DRIVER="nouveau" 279 | fi 280 | elif [[ -n $(echo "${_vga}" | grep "advanced micro devices") || -f /sys/kernel/debug/dri/0/radeon_pm_info || -f /sys/kernel/debug/dri/0/radeon_sa_info ]]; then 281 | cecho AMD/ATI 282 | read_input_text "Install AMDGPU driver" "$BETTER_VIDEO_DRIVER" 283 | if [[ $OPTION == y ]]; then 284 | VIDEO_DRIVER="amdgpu" 285 | else 286 | VIDEO_DRIVER="ati" 287 | fi 288 | elif [[ -n $(echo "${_vga}" | grep "intel corporation") || -f /sys/kernel/debug/dri/0/i915_capabilities ]]; then 289 | cecho Intel 290 | VIDEO_DRIVER="intel" 291 | else 292 | cecho VESA 293 | VIDEO_DRIVER="vesa" 294 | fi 295 | OPTION="y" 296 | [[ $VIDEO_DRIVER == intel || $VIDEO_DRIVER == vesa ]] && read -p "Confirm video driver: $VIDEO_DRIVER [Y/n]" OPTION 297 | if [[ $OPTION == n ]]; then 298 | printf "%s" "Type your video driver [ex: sis, fbdev, modesetting]: " 299 | read -r VIDEO_DRIVER 300 | fi 301 | } #}}} 302 | read_input() { #{{{ 303 | if [[ $AUTOMATIC_MODE -eq 1 ]]; then 304 | OPTION=$1 305 | else 306 | printf "%s" "$prompt1" 307 | read -r OPTION 308 | fi 309 | } #}}} 310 | read_input_text() { #{{{ 311 | if [[ $AUTOMATIC_MODE -eq 1 ]]; then 312 | OPTION=$2 313 | else 314 | printf "%s" "$1 [y/N]: " 315 | read -r OPTION 316 | echo "" 317 | fi 318 | OPTION=$(echo "$OPTION" | tr '[:upper:]' '[:lower:]') 319 | } #}}} 320 | read_input_options() { #{{{ 321 | local line 322 | local packages 323 | if [[ $AUTOMATIC_MODE -eq 1 ]]; then 324 | array=("$1") 325 | else 326 | printf "%s" "$prompt2" 327 | read -r OPTION 328 | IFS=' ' read -r -a array <<<"${OPTION}" 329 | fi 330 | for line in "${array[@]/,/ }"; do 331 | if [[ ${line/-/} != "$line" ]]; then 332 | for ((i = ${line%-*}; i <= ${line#*-}; i++)); do 333 | packages+=("$i") 334 | done 335 | else 336 | packages+=("$line") 337 | fi 338 | done 339 | OPTIONS=("${packages[@]}") 340 | } #}}} 341 | print_line() { #{{{ 342 | printf "%$(tput cols)s\n" | tr ' ' '-' 343 | } #}}} 344 | print_title() { #{{{ 345 | clear 346 | print_line 347 | echo -e "# ${Bold}$1${Reset}" 348 | print_line 349 | echo "" 350 | } #}}} 351 | print_info() { #{{{ 352 | #Console width number 353 | T_COLS=$(tput cols) 354 | echo -e "${Bold}$1${Reset}\n" | fold -sw $((T_COLS - 18)) | sed 's/^/\t/' 355 | } #}}} 356 | print_warning() { #{{{ 357 | T_COLS=$(tput cols) 358 | echo -e "${BYellow}$1${Reset}\n" | fold -sw $((T_COLS - 1)) 359 | } #}}} 360 | print_danger() { #{{{ 361 | T_COLS=$(tput cols) 362 | echo -e "${BRed}$1${Reset}\n" | fold -sw $((T_COLS - 1)) 363 | } #}}} 364 | start_module() { #{{{ 365 | modprobe "$1" 366 | } #}}} 367 | add_module() { #{{{ 368 | for module in $1; do 369 | #check if the name of the module can be the same of the module or the given name 370 | [[ $# -lt 2 ]] && local _module_name="$module" || local _module_name="$2" 371 | local _has_module=$(grep "$module" /etc/modules-load.d/"${_module_name}".conf 2>&1) 372 | [[ -z $_has_module ]] && echo "$module" >>/etc/modules-load.d/"${_module_name}".conf 373 | start_module "$module" 374 | done 375 | } #}}} 376 | add_repository() { #{{{ 377 | local _repo=${1} 378 | local _url=${2} 379 | [[ -n ${3} ]] && local _siglevel="\nSigLevel = ${3}" || local _siglevel="" 380 | 381 | local _check_repo=$(grep -F "${_repo}" /etc/pacman.conf) 382 | if [[ -z $_check_repo ]]; then 383 | echo -e "\n[${_repo}]${_siglevel}\nServer = ${_url}" >>/etc/pacman.conf 384 | system_update 385 | fi 386 | } #}}} 387 | check_multilib() { #{{{ 388 | # this option will avoid any problem with packages install 389 | if [[ $ARCHI == x86_64 ]]; then 390 | local _has_multilib=$(grep -n "\[multilib\]" /etc/pacman.conf | cut -f1 -d:) 391 | if [[ -z $_has_multilib ]]; then 392 | echo -e "\n[multilib]\nInclude = /etc/pacman.d/mirrorlist" >>/etc/pacman.conf 393 | echo -e '\nMultilib repository added into pacman.conf file' 394 | else 395 | sed -i "${_has_multilib}s/^#//" /etc/pacman.conf 396 | local _has_multilib=$((_has_multilib + 1)) 397 | sed -i "${_has_multilib}s/^#//" /etc/pacman.conf 398 | fi 399 | fi 400 | } #}}} 401 | add_key() { #{{{ 402 | pacman-key -r "$1" 403 | pacman-key --lsign-key "$1" 404 | } #}}} 405 | add_key_user() { #{{{ 406 | su - "${username}" -c "gpg --recv-keys --keyserver $1" 407 | } #}}} 408 | pacman_key() { #{{{ 409 | if [[ ! -d /etc/pacman.d/gnupg ]]; then 410 | print_title "PACMAN KEY - https://wiki.archlinux.org/index.php/pacman-key" 411 | print_info "Pacman uses GnuPG keys in a web of trust model to determine if packages are authentic." 412 | package_install "haveged" 413 | haveged -w 1024 414 | pacman-key --init 415 | pacman-key --populate archlinux 416 | pkill haveged 417 | package_remove "haveged" 418 | fi 419 | } #}}} 420 | add_line() { #{{{ 421 | local _add_line=${1} 422 | local _filepath=${2} 423 | 424 | local _has_line=$(grep -ci "${_add_line}" "${_filepath}" 2>&1) 425 | [[ $_has_line -eq 0 ]] && echo "${_add_line}" >>"${_filepath}" 426 | } #}}} 427 | replace_line() { #{{{ 428 | local _search=${1} 429 | local _replace=${2} 430 | local _filepath=${3} 431 | local _filebase=$(basename "${3}") 432 | 433 | sed -e "s/${_search}/${_replace}/" "${_filepath}" >/tmp/"${_filebase}" 2>"$LOG" 434 | if [[ ${?} -eq 0 ]]; then 435 | mv /tmp/"${_filebase}" "${_filepath}" 436 | else 437 | cecho "failed: ${_search} - ${_filepath}" 438 | fi 439 | } #}}} 440 | update_early_modules() { #{{{ 441 | local _new_module=${1} 442 | local _current_modules=$(grep -E ^MODULES= /etc/mkinitcpio.conf) 443 | 444 | if [[ -n ${_new_module} ]]; then 445 | # Determine if the new module is already listed. 446 | local _exists=$(echo "${_current_modules}" | grep "${_new_module}") 447 | if [ $? -eq 1 ]; then 448 | source /etc/mkinitcpio.conf 449 | if [[ -z ${MODULES} ]]; then 450 | _new_moduleS="${_new_module}" 451 | else 452 | _new_moduleS="${MODULES} ${_new_module}" 453 | fi 454 | replace_line "MODULES=\"${MODULES}\"" "MODULES=\"${_new_moduleS}\"" /etc/mkinitcpio.conf 455 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Rebuilding init " 456 | mkinitcpio -p linux >>"$LOG" 2>&1 & 457 | pid=$! 458 | progress $pid 459 | fi 460 | fi 461 | } #}}} 462 | is_package_installed() { #{{{ 463 | #check if a package is already installed 464 | for PKG in $1; do 465 | pacman -Q "$PKG" &>/dev/null && return 0 466 | done 467 | return 1 468 | } #}}} 469 | checkbox() { #{{{ 470 | #display [X] or [ ] 471 | [[ "$1" -eq 1 ]] && echo -e "${BBlue}[${Reset}${Bold}X${BBlue}]${Reset}" || echo -e "${BBlue}[ ${BBlue}]${Reset}" 472 | } #}}} 473 | checkbox_package() { #{{{ 474 | #check if [X] or [ ] 475 | is_package_installed "$1" && checkbox 1 || checkbox 0 476 | } #}}} 477 | aui_download_packages() { #{{{ 478 | for PKG in $1; do 479 | #exec command as user instead of root 480 | su - "${username}" -c " 481 | [[ ! -d aui_packages ]] && mkdir aui_packages 482 | cd aui_packages 483 | curl -o ${PKG}.tar.gz https://aur.archlinux.org/cgit/aur.git/snapshot/${PKG}.tar.gz 484 | tar zxvf ${PKG}.tar.gz 485 | rm ${PKG}.tar.gz 486 | cd ${PKG} 487 | makepkg -csi --noconfirm 488 | " 489 | done 490 | } #}}} 491 | aur_package_install() { #{{{ 492 | su - "${username}" -c "sudo -v" 493 | #install package from aur 494 | for PKG in $1; do 495 | if ! is_package_installed "${PKG}"; then 496 | if [[ $AUTOMATIC_MODE -eq 1 ]]; then 497 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Installing ${AUR} ${Bold}${PKG}${Reset} " 498 | su - "${username}" -c "${AUR_PKG_MANAGER} --noconfirm -S ${PKG}" >>"$LOG" 2>&1 & 499 | pid=$! 500 | progress $pid 501 | else 502 | su - "${username}" -c "${AUR_PKG_MANAGER} --noconfirm -S ${PKG}" 503 | fi 504 | else 505 | if [[ $VERBOSE_MODE -eq 0 ]]; then 506 | cecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Installing ${AUR} ${Bold}${PKG}${Reset} success" 507 | else 508 | echo -e "Warning: ${PKG} is up to date --skipping" 509 | fi 510 | fi 511 | done 512 | } #}}} 513 | package_install() { #{{{ 514 | #install packages using pacman 515 | if [[ $AUTOMATIC_MODE -eq 1 || $VERBOSE_MODE -eq 0 ]]; then 516 | for PKG in ${1}; do 517 | local _pkg_repo=$(pacman -Sp --print-format %r "${PKG}" | uniq | sed '1!d') 518 | case $_pkg_repo in 519 | "core") 520 | _pkg_repo="${BRed}${_pkg_repo}${Reset}" 521 | ;; 522 | "extra") 523 | _pkg_repo="${BYellow}${_pkg_repo}${Reset}" 524 | ;; 525 | "community") 526 | _pkg_repo="${BGreen}${_pkg_repo}${Reset}" 527 | ;; 528 | "multilib") 529 | _pkg_repo="${BCyan}${_pkg_repo}${Reset}" 530 | ;; 531 | esac 532 | if ! is_package_installed "${PKG}"; then 533 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Installing (${_pkg_repo}) ${Bold}${PKG}${Reset} " 534 | pacman -S --noconfirm --needed "${PKG}" >>"$LOG" 2>&1 & 535 | pid=$! 536 | progress $pid 537 | else 538 | cecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Installing (${_pkg_repo}) ${Bold}${PKG}${Reset} exists " 539 | fi 540 | done 541 | else 542 | pacman -S --needed "${1}" 543 | fi 544 | } #}}} 545 | package_remove() { #{{{ 546 | #remove package 547 | for PKG in ${1}; do 548 | if is_package_installed "${PKG}"; then 549 | if [[ $AUTOMATIC_MODE -eq 1 || $VERBOSE_MODE -eq 0 ]]; then 550 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Removing ${Bold}${PKG}${Reset} " 551 | pacman -Rcsn --noconfirm "${PKG}" >>"$LOG" 2>&1 & 552 | pid=$! 553 | progress $pid 554 | else 555 | pacman -Rcsn "${PKG}" 556 | fi 557 | fi 558 | done 559 | } #}}} 560 | system_update() { #{{{ 561 | pacman -Sy 562 | } #}}} 563 | npm_install() { #{{{ 564 | #install packages using pacman 565 | npm install -g "$1" 566 | } #}}} 567 | gem_install() { #{{{ 568 | #install packages using pacman 569 | for PKG in ${1}; do 570 | sudo -u "${username}" gem install -V "$PKG" 571 | done 572 | } #}}} 573 | contains_element() { #{{{ 574 | #check if an element exist in a string 575 | for e in "${@:2}"; do [[ "$e" == "$1" ]] && break; done 576 | } #}}} 577 | config_xinitrc() { #{{{ 578 | #create a xinitrc file in home user directory 579 | cp -fv /etc/X11/xinit/xinitrc /home/"${username}"/.xinitrc 580 | echo -e "exec $1" >>/home/"${username}"/.xinitrc 581 | chown -R "${username}":users /home/"${username}"/.xinitrc 582 | } #}}} 583 | invalid_option() { #{{{ 584 | print_line 585 | echo "Invalid option. Try another one." 586 | pause_function 587 | } #}}} 588 | pause_function() { #{{{ 589 | print_line 590 | if [[ $AUTOMATIC_MODE -eq 0 ]]; then 591 | read -e -sn 1 -p "Press enter to continue..." 592 | fi 593 | } #}}} 594 | menu_item() { #{{{ 595 | #check if the number of arguments is less then 2 596 | [[ $# -lt 2 ]] && _package_name="$1" || _package_name="$2" 597 | #list of chars to remove from the package name 598 | local _chars=("Ttf-" "-bzr" "-hg" "-svn" "-git" "-stable" "-icon-theme" "Gnome-shell-theme-" "Gnome-shell-extension-") 599 | #remove chars from package name 600 | for char in "${_chars[@]}"; do _package_name=$(echo "${_package_name^}" | sed 's/'"$char"'//'); done 601 | #display checkbox and package name 602 | echo -e "$(checkbox_package "$1") ${Bold}${_package_name}${Reset}" 603 | } #}}} 604 | mainmenu_item() { #{{{ 605 | #if the task is done make sure we get the state 606 | if [ "$1" == 1 ] && [ "$3" != "" ]; then 607 | state="${BGreen}[${Reset}$3${BGreen}]${Reset}" 608 | fi 609 | echo -e "$(checkbox "$1") ${Bold}$2${Reset} ${state}" 610 | } #}}} 611 | system_ctl() { #{{{ 612 | local _action=${1} 613 | local _object=${2} 614 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} systemctl ${_action} ${_object} " 615 | systemctl "${_action}" "${_object}" >>"$LOG" 2>&1 616 | pid=$! 617 | progress $pid 618 | } 619 | #}}} 620 | arch_chroot() { #{{{ 621 | arch-chroot $MOUNTPOINT /bin/bash -c "${1}" 622 | } 623 | #}}} 624 | run_as_user() { #{{{ 625 | sudo -H -u "${username}" "${1}" 626 | } 627 | #}}} 628 | add_user_to_group() { #{{{ 629 | local _user=${1} 630 | local _group=${2} 631 | 632 | if [[ -z ${_group} ]]; then 633 | error_msg "ERROR! 'add_user_to_group' was not given enough parameters." 634 | fi 635 | 636 | ncecho " ${BBlue}[${Reset}${Bold}X${BBlue}]${Reset} Adding ${Bold}${_user}${Reset} to ${Bold}${_group}${Reset} " 637 | groupadd "${_group}" >>"$LOG" 2>&1 & 638 | gpasswd -a "${_user}" "${_group}" >>"$LOG" 2>&1 & 639 | pid=$! 640 | progress $pid 641 | } #}}} 642 | setlocale() { #{{{ 643 | local _locale_list=($(grep UTF-8 /etc/locale.gen | sed 's/\..*$//' | sed '/@/d' | awk '{print $1}' | uniq | sed 's/#//g')) 644 | PS3="$prompt1" 645 | echo "Select locale:" 646 | select LOCALE in "${_locale_list[@]}"; do 647 | if contains_element "$LOCALE" "${_locale_list[@]}"; then 648 | LOCALE_UTF8="${LOCALE}.UTF-8" 649 | break 650 | else 651 | invalid_option 652 | fi 653 | done 654 | } 655 | #}}} 656 | settimezone() { #{{{ 657 | local _zones=($(timedatectl list-timezones | sed 's/\/.*$//' | uniq)) 658 | PS3="$prompt1" 659 | echo "Select zone:" 660 | select ZONE in "${_zones[@]}"; do 661 | if contains_element "$ZONE" "${_zones[@]}"; then 662 | local _subzones=($(timedatectl list-timezones | grep "${ZONE}" | sed 's/^.*\///')) 663 | PS3="$prompt1" 664 | echo "Select subzone:" 665 | select SUBZONE in "${_subzones[@]}"; do 666 | if contains_element "$SUBZONE" "${_subzones[@]}"; then 667 | break 668 | else 669 | invalid_option 670 | fi 671 | done 672 | break 673 | else 674 | invalid_option 675 | fi 676 | done 677 | } #}}} 678 | #}}} 679 | -------------------------------------------------------------------------------- /sharedfuncs_elihw: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | #shellcheck disable=SC2105 3 | 4 | [[ $OPT == b || $OPT == d ]] && break 5 | --------------------------------------------------------------------------------