Guest User

Untitled

a guest
Feb 8th, 2024
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. run_session.sh
  2. #!/usr/bin/bash
  3.  
  4. UNIQAPPS=~/bin/uniq_apps.txt
  5.  
  6. #ls /usr/share/applications > "$MENUAPPS"
  7.  
  8. while read -r line; do
  9. #if grep "${line}" "$MENUAPPS"; then
  10. if [ "${line}" = "/usr/bin/lxqt-panel" ]; then
  11. :
  12. else
  13. "${line}" &
  14. fi
  15. done < "$UNIQAPPS"
  16.  
  17. save_session.sh &
  18.  
  19.  
  20. save_session.sh
  21. #!/usr/bin/bash
  22. while true; do
  23.  
  24. LAST_PIDS=~/bin/last_pids.txt
  25. LAST_APPS=~/bin/last_apps.txt
  26. UNIQ_APPS=~/bin/uniq_apps.txt
  27.  
  28. > "$LAST_PIDS"
  29.  
  30. wmctrl -lp | awk '{print $3}' > "$LAST_PIDS"
  31.  
  32. > "$LAST_APPS"
  33.  
  34. while read -r line; do
  35. ps -ux | grep "${line}" | awk '{ print $11 }' >> "$LAST_APPS"
  36. sort "$LAST_APPS" | uniq > "$UNIQ_APPS"
  37. done < "$LAST_PIDS"
  38.  
  39. sleep 2s
  40. done
Advertisement
Add Comment
Please, Sign In to add comment