Archlinux basic installation configuration scripts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.5 KiB

  1. #!/usr/bin/env sh
  2. DIR="$HOME/.config/polybar/pwidgets"
  3. kill_bar() {
  4. # Terminate already running bar instances
  5. killall -q polybar
  6. # Wait until the processes have been shut down
  7. while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
  8. }
  9. ## Main
  10. if [[ "$1" == "--main" ]]; then
  11. kill_bar
  12. polybar -q primary -c $DIR/main.ini &
  13. polybar -q secondary -c $DIR/main.ini &
  14. polybar -q top -c $DIR/main.ini &
  15. ## Apps
  16. elif [[ "$1" == "--apps" ]]; then
  17. kill_bar
  18. polybar -q primary -c $DIR/apps.ini &
  19. polybar -q secondary -c $DIR/apps.ini &
  20. ## System
  21. elif [[ "$1" == "--system" ]]; then
  22. kill_bar
  23. polybar -q primary -c $DIR/system.ini &
  24. polybar -q secondary -c $DIR/system.ini &
  25. ## Mpd
  26. elif [[ "$1" == "--mpd" ]]; then
  27. kill_bar
  28. polybar -q primary -c $DIR/mpd.ini &
  29. polybar -q secondary -c $DIR/mpd.ini &
  30. ## Workspaces
  31. elif [[ "$1" == "--ws" ]]; then
  32. kill_bar
  33. polybar -q primary -c $DIR/workspace.ini &
  34. polybar -q secondary -c $DIR/workspace.ini &
  35. ## CPU
  36. elif [[ "$1" == "--cpu" ]]; then
  37. kill_bar
  38. polybar -q primary -c $DIR/cpu.ini &
  39. polybar -q secondary -c $DIR/cpu.ini &
  40. ## Memory
  41. elif [[ "$1" == "--memory" ]]; then
  42. kill_bar
  43. polybar -q primary -c $DIR/memory.ini &
  44. polybar -q secondary -c $DIR/memory.ini &
  45. ## Filesystem
  46. elif [[ "$1" == "--fs" ]]; then
  47. kill_bar
  48. polybar -q primary -c $DIR/fs.ini &
  49. polybar -q secondary -c $DIR/fs.ini &
  50. else
  51. cat <<- _EOF_
  52. No widget specified, Available widgets:
  53. --main --apps --system --mpd
  54. --ws --cpu --memory --fs
  55. _EOF_
  56. fi