Advertisement
rokytnji

Antixcc.sh

Oct 7th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.87 KB | None | 0 0
  1. # File Name: controlcenter.sh
  2. # Purpose: all-in-one control centre for antiX
  3. # Authors: OU812 and minor modifications by anticapitalista
  4. # Latest Change: 20 August 2008
  5. # Latest Change: 11 January 2009 and renamed antixcc.sh
  6. # Latest Change: 15 August 2009 some apps and labels altered.
  7. # Latest Change: 09 March 2012 by anticapitalista. Added Live section.
  8. # Latest Change: 22 March 2012 by anticapitalista. Added jwm config options and edited admin options.
  9. # Latest Change: 18 April 2012 by anticapitalista. mountbox-antix opens as user not root.
  10. # Latest Change: 06 October 2012 by anticapitalista. Function for ICONS. New icon theme.
  11. # Latest Change: 26 October 2012 by anticapitalista. Includes gksudo and ktsuss.
  12. # Latest Change: 12 May 2013 by anticapitalista. Let user set default apps.
  13. # Latest Change: 05 March 2015 by BitJam: Add alsa-set-card, edit excludes, edit bootloader. Fix indentation.
  14. # Hide live tab on non-live systems. Use echo instead of gettext.
  15. # Remove unneeded doublequotes between tags. Use $(...) instead of `...`.
  16. # Acknowledgements: Original script by KDulcimer of TinyMe. http://tinyme.mypclinuxos.com
  17. #################################################################################################################################################
  18.  
  19. TEXTDOMAINDIR=/usr/share/locale
  20. TEXTDOMAIN=antixcc.sh
  21. # Options
  22. ICONS=/usr/share/icons/antiX
  23.  
  24. EDITOR="geany -i"
  25.  
  26. Desktop=$"Desktop" System=$"System" Network=$"Network" Session=$"Session"
  27. Live=$"Live" Disks=$"Disks" Hardware=$"Hardware"
  28.  
  29. [ -d $HOME/.fluxbox -a -e /usr/share/xsessions/fluxbox.desktop ] \
  30. && edit_fluxbox=$(cat <<Edit_Fluxbox
  31. <hbox>
  32. <button>
  33. <input file>$ICONS/cs-desktop-effects.png</input>
  34. <action>$EDITOR $HOME/.fluxbox/overlay $HOME/.fluxbox/keys $HOME/.fluxbox/init $HOME/.fluxbox/startup $HOME/.fluxbox/apps $HOME/.fluxbox/menu&</action>
  35. </button>
  36. <text use-markup="true" width-chars="28">
  37. <label>$(echo $"Edit Fluxbox Settings")</label>
  38. </text>
  39. </hbox>
  40. Edit_Fluxbox
  41. )
  42.  
  43. [ -d $HOME/.icewm -a -e /usr/share/xsessions/IceWM.desktop ] \
  44. && edit_icewm=$(cat <<Edit_Icewm
  45. <hbox>
  46. <button>
  47. <input file>$ICONS/cs-desktop-effects.png</input>
  48. <action>$EDITOR $HOME/.icewm/winoptions $HOME/.icewm/preferences $HOME/.icewm/keys $HOME/.icewm/startup $HOME/.icewm/toolbar $HOME/.icewm/menu&</action>
  49. </button>
  50. <text use-markup="true" width-chars="28">
  51. <label>$(echo $"Edit IceWM Settings")</label>
  52. </text>
  53. </hbox>
  54. Edit_Icewm
  55. )
  56.  
  57. [ -d $HOME/.jwm -a -e /usr/share/xsessions/Jwm.desktop ] \
  58. && edit_jwm=$(cat <<Edit_Jwm
  59. <hbox>
  60. <button>
  61. <input file>$ICONS/cs-desktop-effects.png</input>
  62. <action>$EDITOR $HOME/.jwm/preferences $HOME/.jwm/keys $HOME/.jwm/tray $HOME/.jwm/startup $HOME/.jwmrc $HOME/.jwm/menu</action>
  63. </button>
  64. <text use-markup="true" width-chars="28">
  65. <label>$(echo $"Edit jwm Settings")</label>
  66. </text>
  67. </hbox>
  68. Edit_Jwm
  69. )
  70.  
  71.  
  72. # Edit syslinux.cfg if the device it is own is mounted read-write
  73. grep -q " /live/boot-dev .*\<rw\>" /proc/mounts \
  74. && edit_bootloader=$(cat <<Edit_Bootloader
  75. <hbox>
  76. <button>
  77. <input file>$ICONS/preferences-desktop.png</input>
  78. <action>gksu "$EDITOR /live/boot-dev/boot/syslinux/syslinux.cfg /live/boot-dev/boot/syslinux/gfxboot.cfg" &</action>
  79. </button>
  80. <text use-markup="true" width-chars="28">
  81. <label>$(echo $"Edit Bootloader menu")</label>
  82. </text>
  83. </hbox>
  84. Edit_Bootloader
  85. )
  86.  
  87. excludes_dir=/usr/local/share/excludes
  88. test -d $excludes_dir && edit_excludes=$(cat <<Edit_Excludes
  89. <hbox>
  90. <button>
  91. <input file>$ICONS/remastersys.png</input>
  92. <action>gksu $EDITOR $excludes_dir/*.list &</action>
  93. </button>
  94. <text use-markup="true" width-chars="28">
  95. <label>$(echo $"Edit Exclude files")</label>
  96. </text>
  97. </hbox>
  98. Edit_Excludes
  99. )
  100.  
  101. global_dir=/etc/desktop-session
  102. test -d $global_dir && edit_global=$(cat <<Edit_Global
  103. <hbox>
  104. <button>
  105. <input file>$ICONS/config-users.png</input>
  106. <action>gksu $EDITOR $global_dir/*.conf $global_dir/startup &</action>
  107. </button>
  108. <text use-markup="true" width-chars="28">
  109. <label>$(echo $"Global Desktop-Session")</label>
  110. </text>
  111. </hbox>
  112. Edit_Global
  113. )
  114.  
  115. [ -e /etc/live/config/save-persist -o -e /etc/live/config/persist-save.conf ] && persist_save=$(cat <<Persist_Save
  116. <hbox>
  117. <button>
  118. <input file>$ICONS/palimpsest.png</input>
  119. <action>gksu persist-save &</action>
  120. </button>
  121. <text use-markup="true" width-chars="28">
  122. <label>$(echo $"Save root persistence")</label>
  123. </text>
  124. </hbox>
  125. Persist_Save
  126. )
  127.  
  128. [ -e /etc/live/config/remasterable -o -e /etc/live/config/remaster-live.conf ] && live_remaster=$(cat <<Live_Remaster
  129. <hbox>
  130. <button>
  131. <input file>$ICONS/preferences-desktop.png</input>
  132. <action>gksu live-remaster &</action>
  133. </button>
  134. <text use-markup="true" width-chars="28">
  135. <label>$(echo $"Remaster")</label>
  136. </text>
  137. </hbox>
  138. Live_Remaster
  139. )
  140.  
  141. live_tab=$(cat <<Live_Tab
  142. <vbox> <frame> <hbox>
  143. <vbox>
  144. <hbox>
  145. <button>
  146. <input file>$ICONS/remastersys.png</input>
  147. <action>gksu persist-config &</action>
  148. </button>
  149. <text use-markup="true" width-chars="28">
  150. <label>$(echo $"Configure live persistence")</label>
  151. </text>
  152. </hbox>
  153. $edit_bootloader
  154. $persist_save
  155. </vbox>
  156. <vbox>
  157. <hbox>
  158. <button>
  159. <input file>$ICONS/palimpsest.png</input>
  160. <action>gksu persist-makefs &</action>
  161. </button>
  162. <text use-markup="true" width-chars="28">
  163. <label>$(echo $"Set up live persistence")</label>
  164. </text>
  165. </hbox>
  166. $edit_excludes
  167. $live_remaster
  168. </vbox>
  169. </hbox> </frame> </vbox>
  170. Live_Tab
  171. )
  172.  
  173. # If we are on a live system then ...
  174. if grep -q " /live/aufs " /proc/mounts; then
  175. tab_labels="$Desktop|$System|$Network|$Session|$Live|$Disks|$Hardware|$CLI|$Tools"
  176.  
  177. else
  178. tab_labels="$Desktop|$System|$Network|$Session|$Disks|$Hardware|$CLI|$Tools"
  179. live_tab=
  180. fi
  181.  
  182. export ControlCenter=$(cat <<End_of_Text
  183. <window title="antiX Control Center" icon="gnome-control-center" window-position="1">
  184. <vbox>
  185. <notebook tab-pos="0" labels="$tab_labels">
  186. <vbox> <frame> <hbox>
  187. <vbox>
  188.  
  189. <hbox>
  190. <button>
  191. <input file>$ICONS/preferences-desktop-wallpaper.png</input>
  192. <action>wallpaper.py &</action>
  193. </button>
  194. <text use-markup="true" width-chars="28">
  195. <label>$(echo $"Choose Wallpaper")</label>
  196. </text>
  197. </hbox>
  198. $edit_fluxbox
  199. $edit_jwm
  200. <hbox>
  201. <button>
  202. <input file>$ICONS/utilities-system-monitor.png</input>
  203. <action>desktop-defaults-run -te $HOME/.conkyrc &</action>
  204. </button>
  205. <text use-markup="true" width-chars="28">
  206. <label>$(echo $"Edit System Monitor(conky)")</label>
  207. </text>
  208. </hbox>
  209. </vbox>
  210.  
  211. <vbox>
  212. <hbox>
  213. <button>
  214. <input file>$ICONS/preferences-desktop-theme.png</input>
  215. <action>lxappearance &</action>
  216. </button>
  217. <text use-markup="true" width-chars="28">
  218. <label>$(echo $"Change Gtk2 and Icon Themes")</label>
  219. </text>
  220. </hbox>
  221. $edit_icewm
  222. <hbox>
  223. <button>
  224. <input file>$ICONS/applications-system.png</input>
  225. <action>desktop-defaults-set &</action>
  226. </button>
  227. <text use-markup="true" width-chars="28">
  228. <label>$(echo $"Preferred Applications")</label>
  229. </text>
  230. </hbox>
  231. <hbox>
  232. <button>
  233. <input file>$ICONS/menu_manager.png</input>
  234. <action>sudo menu_manager.sh &</action>
  235. </button>
  236. <text use-markup="true" width-chars="28">
  237. <label>$(echo $"Edit menus")</label>
  238. </text>
  239. </hbox>
  240. </vbox>
  241. </hbox> </frame> </vbox>
  242. <vbox> <frame> <hbox>
  243. <vbox>
  244.  
  245. <hbox>
  246. <button>
  247. <input file>$ICONS/synaptic.png</input>
  248. <action>gksu synaptic &</action>
  249. </button>
  250. <text use-markup="true" width-chars="28">
  251. <label>$(echo $"Manage Packages")</label>
  252. </text>
  253. </hbox>
  254.  
  255. <hbox>
  256. <button>
  257. <input file>$ICONS/applications-system.png</input>
  258. <action>gksu antix-system.sh &</action>
  259. </button>
  260. <text use-markup="true" width-chars="28">
  261. <label>$(echo $"Configure System")</label>
  262. </text>
  263. </hbox>
  264. <hbox>
  265. <button>
  266. <input file>$ICONS/synaptic.png</input>
  267. <action>gksu install-meta &</action>
  268. </button>
  269. <text use-markup="true" width-chars="28">
  270. <label>$(echo $"Meta Package Installer")</label>
  271. </text>
  272. </hbox>
  273. <hbox>
  274. <button>
  275. <input file>$ICONS/gnome-settings-default-applications.png</input>
  276. <action>desktop-defaults-run -t sudo sysv-rc-conf &</action>
  277. </button>
  278. <text use-markup="true" width-chars="28">
  279. <label>$(echo $"Choose Startup Services")</label>
  280. </text>
  281. </hbox>
  282. </vbox>
  283.  
  284. <vbox>
  285. <hbox>
  286. <button>
  287. <input file>$ICONS/config-users.png</input>
  288. <action>gksu user-management &</action>
  289. </button>
  290. <text use-markup="true" width-chars="28">
  291. <label>$(echo $"Manage Users")</label>
  292. </text>
  293. </hbox>
  294.  
  295. <hbox>
  296. <button>
  297. <input file>$ICONS/preferences-desktop.png</input>
  298. <action>gksu $EDITOR /etc/fstab /etc/default/keyboard /etc/grub.d/* /etc/slim.conf /etc/apt/sources.list.d/*.list &</action>
  299. </button>
  300. <text use-markup="true" width-chars="28">
  301. <label>$(echo $"Edit Config Files")</label>
  302. </text>
  303. </hbox>
  304.  
  305. <hbox>
  306. <button>
  307. <input file>$ICONS/hwinfo.png</input>
  308. <action>hardinfo &</action>
  309. </button>
  310. <text use-markup="true" width-chars="28">
  311. <label>$(echo $"System Information")</label>
  312. </text>
  313. </hbox>
  314. <hbox>
  315. <button>
  316. <input file>$ICONS/time-admin.png</input>
  317. <action>desktop-defaults-run -t sudo "dpkg-reconfigure tzdata" &</action>
  318. </button>
  319. <text use-markup="true" width-chars="28">
  320. <label>$(echo $"Set Date and Time")</label>
  321. </text>
  322. </hbox>
  323. </vbox>
  324.  
  325. </hbox> </frame> </vbox>
  326. <vbox> <frame> <hbox>
  327.  
  328. <vbox>
  329. <hbox>
  330. <button>
  331. <input file>$ICONS/network-wired.png</input>
  332. <action>desktop-defaults-run -t sudo ceni &</action>
  333. </button>
  334. <text use-markup="true" width-chars="28">
  335. <label>$(echo $"Network Interfaces (ceni)")</label>
  336. </text>
  337. </hbox>
  338.  
  339. <hbox>
  340. <button>
  341. <input file>$ICONS/network-wired.png</input>
  342. <action>umts-panel &</action>
  343. </button>
  344. <text use-markup="true" width-chars="28">
  345. <label>$(echo $"Configure GPRS/UMTS")</label>
  346. </text>
  347. </hbox>
  348.  
  349. <hbox>
  350. <button>
  351. <input file>$ICONS/nm-device-wireless.png</input>
  352. <action>wicd-gtk &</action>
  353. </button>
  354. <text use-markup="true" width-chars="28">
  355. <label>$(echo $"Connect Wirelessly (wicd)")</label>
  356. </text>
  357. </hbox>
  358.  
  359. <hbox>
  360. <button>
  361. <input file>$ICONS/connectshares-config.png</input>
  362. <action>connectshares-config &</action>
  363. </button>
  364. <text use-markup="true" width-chars="28">
  365. <label>$(echo $"Configure Connectshares")</label>
  366. </text>
  367. </hbox>
  368. </vbox>
  369. <vbox>
  370. <hbox>
  371. <button>
  372. <input file>$ICONS/internet-telephony.png</input>
  373. <action>gnome-ppp &</action>
  374. </button>
  375. <text use-markup="true" width-chars="28">
  376. <label>$(echo $"Configure Dial-Up")</label>
  377. </text>
  378. </hbox>
  379. <hbox>
  380. <button>
  381. <input file>$ICONS/nm-device-wireless.png</input>
  382. <action>/usr/sbin/wpa_gui &</action>
  383. </button>
  384. <text use-markup="true" width-chars="28">
  385. <label>$(echo $"Configure wpa_supplicant")</label>
  386. </text>
  387. </hbox>
  388. <hbox>
  389. <button>
  390. <input file>$ICONS/firewall.png</input>
  391. <action>gksu gufw &</action>
  392. </button>
  393. <text use-markup="true" width-chars="28">
  394. <label>$(echo $"Manage Firewall")</label>
  395. </text>
  396. </hbox>
  397. <hbox>
  398. <button>
  399. <input file>$ICONS/advert-block.png</input>
  400. <action>gksu block-advert.sh &</action>
  401. </button>
  402. <text use-markup="true" width-chars="28">
  403. <label>$(echo $"Adblock")</label>
  404. </text>
  405. </hbox>
  406. </vbox>
  407. </hbox> </frame></vbox>
  408. <vbox> <frame> <hbox>
  409. <vbox>
  410. <hbox>
  411. <button>
  412. <input file>$ICONS/keyboard.png</input>
  413. <action>antixcckeyboard.sh &</action>
  414. </button>
  415. <text use-markup="true" width-chars="28">
  416. <label>$(echo $"Change Keyboard Layout")</label>
  417. </text>
  418. </hbox>
  419. <hbox>
  420. <button>
  421. <input file>$ICONS/preferences-desktop-wallpaper.png</input>
  422. <action>gksu antixccslim.sh</action>
  423. </button>
  424. <text use-markup="true" width-chars="28">
  425. <label>$(echo $"Change Slim Background")</label>
  426. </text>
  427. </hbox>
  428. <hbox>
  429. <button>
  430. <input file>$ICONS/video-display.png</input>
  431. <action>gksu arandr &</action>
  432. </button>
  433. <text use-markup="true" width-chars="28">
  434. <label>$(echo $"Set Screen Resolution")</label>
  435. </text>
  436. </hbox>
  437. $edit_global
  438. </vbox>
  439. <vbox>
  440. <hbox>
  441. <button>
  442. <input file>$ICONS/gnome-session.png</input>
  443. <action>gksu-properties &</action>
  444. </button>
  445. <text use-markup="true" width-chars="28">
  446. <label>$(echo $"Password Prompt(su/sudo)")</label>
  447. </text>
  448. </hbox>
  449. <hbox>
  450. <button>
  451. <input file>$ICONS/preferences-system-login.png</input>
  452. <action>gksu slim-login &</action>
  453. </button>
  454. <text use-markup="true" width-chars="28">
  455. <label>$(echo $"Set auto-login")</label>
  456. </text>
  457. </hbox>
  458. <hbox>
  459. <button>
  460. <input file>$ICONS/screensaver.png</input>
  461. <action>set-screen-blank &</action>
  462. </button>
  463. <text use-markup="true" width-chars="28">
  464. <label>$(echo $"Set Screen Blanking")</label>
  465. </text>
  466. </hbox>
  467. <hbox>
  468. <button>
  469. <input file>$ICONS/config-users.png</input>
  470. <action>$EDITOR $HOME/.desktop-session/*.conf $HOME/.desktop-session/startup &</action>
  471. </button>
  472. <text use-markup="true" width-chars="28">
  473. <label>$(echo $"User Desktop-Session")</label>
  474. </text>
  475. </hbox>
  476.  
  477. </vbox>
  478. </hbox> </frame> </vbox>
  479. $live_tab
  480. <vbox> <frame> <hbox>
  481. <vbox>
  482. <hbox>
  483. <button>
  484. <input file>$ICONS/gparted.png</input>
  485. <action>gksu gparted &</action>
  486. </button>
  487. <text use-markup="true" width-chars="28">
  488. <label>$(echo $"Partition a Drive")</label>
  489. </text>
  490. </hbox>
  491. <hbox>
  492. <button>
  493. <input file>$ICONS/mountbox.png</input>
  494. <action>mountbox &</action>
  495. </button>
  496. <text use-markup="true" width-chars="28">
  497. <label>$(echo $"Mount Connected Devices")</label>
  498. </text>
  499. </hbox>
  500. <hbox>
  501. <button>
  502. <input file>$ICONS/luckybackup.png</input>
  503. <action>gksu luckybackup &</action>
  504. </button>
  505. <text use-markup="true" width-chars="28">
  506. <label>$(echo $"Backup Your System")</label>
  507. </text>
  508. </hbox>
  509. <hbox>
  510. <button>
  511. <input file>$ICONS/usb-creator.png</input>
  512. <action>gksu unetbootin &</action>
  513. </button>
  514. <text use-markup="true" width-chars="28">
  515. <label>$(echo $"UNetbootin")</label>
  516. </text>
  517. </hbox>
  518. </vbox>
  519. <vbox>
  520. <hbox>
  521. <button>
  522. <input file>$ICONS/usb-creator.png</input>
  523. <action>gksu antix2usb.py &</action>
  524. </button>
  525. <text use-markup="true" width-chars="28">
  526. <label>$(echo $"antiX2usb")</label>
  527. </text>
  528. </hbox>
  529. <hbox>
  530. <button>
  531. <input file>$ICONS/drive-harddisk-system.png</input>
  532. <action>desktop-defaults-run -t sudo partimage &</action>
  533. </button>
  534. <text use-markup="true" width-chars="28">
  535. <label>$(echo $"Image a Partition")</label>
  536. </text>
  537. </hbox>
  538. <hbox>
  539. <button>
  540. <input file>$ICONS/grsync.png</input>
  541. <action>grsync &</action>
  542. </button>
  543. <text use-markup="true" width-chars="28">
  544. <label>$(echo $"Synchronize Directories")</label>
  545. </text>
  546. </hbox>
  547. </vbox>
  548. </hbox> </frame> </vbox>
  549. <vbox> <frame> <hbox>
  550. <vbox>
  551. <hbox>
  552. <button>
  553. <input file>$ICONS/printer.png</input>
  554. <action>system-config-printer &</action>
  555. </button>
  556. <text use-markup="true" width-chars="28">
  557. <label>$(echo $"Setup a Printer")</label>
  558. </text>
  559. </hbox>
  560. <hbox>
  561. <button>
  562. <input file>$ICONS/computer.png</input>
  563. <action>inxi-gui &</action>
  564. </button>
  565. <text use-markup="true" width-chars="28">
  566. <label>$(echo $"PC Information")</label>
  567. </text>
  568. </hbox>
  569. <hbox>
  570. <button>
  571. <input file>$ICONS/input-mouse.png</input>
  572. <action>ds-mouse &</action>
  573. </button>
  574. <text use-markup="true" width-chars="28">
  575. <label>$(echo $"Configure Mouse")</label>
  576. </text>
  577. </hbox>
  578.  
  579. </vbox>
  580. <vbox>
  581. <hbox>
  582. <button>
  583. <input file>$ICONS/audacity.png</input>
  584. <action>alsa-set-default-card &</action>
  585. </button>
  586. <text use-markup="true" width-chars="28">
  587. <label>$(echo $"Set Default Sound Card")</label>
  588. </text>
  589. </hbox>
  590. <hbox>
  591. <button>
  592. <input file>$ICONS/preferences-desktop-sound.png</input>
  593. <action>urxvt -e speaker-test --channels 2 --test wav --nloops 3 &</action>
  594. </button>
  595. <text use-markup="true" width-chars="28">
  596. <label>$(echo $"Test Sound")</label>
  597. </text>
  598. </hbox>
  599. <hbox>
  600. <button>
  601. <input file>$ICONS/audio-volume-high-panel.png</input>
  602. <action>desktop-defaults-run -t alsamixer &</action>
  603. </button>
  604. <text use-markup="true" width-chars="28">
  605. <label>$(echo $"Adjust Mixer")</label>
  606. </text>
  607. </hbox>
  608. <hbox>
  609. <button>
  610. <input file>$ICONS/audio-equalizer.png</input>
  611. <action>desktop-defaults-run -t alsamixer -D equal &</action>
  612. </button>
  613. <text use-markup="true" width-chars="28">
  614. <label>$(echo $"Alsamixer Equalizer")</label>
  615. </text>
  616. </hbox>
  617.  
  618. </vbox>
  619. </hbox> </frame> </vbox>
  620.  
  621. </notebook>
  622. </vbox>
  623. </window>
  624. End_of_Text
  625. )
  626.  
  627. #echo "$ControlCenter"
  628.  
  629. gtkdialog --program=ControlCenter
  630. #unset ControlCenter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement