Advertisement
nerdemma

xenodm

Jul 13th, 2023 (edited)
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.49 KB | Source Code | 0 0
  1. #!/bin/ksh
  2.  
  3. #Archivos de configuracion
  4. FONT_NAME="SF Regular"
  5. FONT_COLOR="#FFFFFF"
  6. BACKGROUND="#203051"
  7.  
  8. X_PATH="/usr/X11R6/bin/"
  9. $X_PATH/xrandr --output default --dpí 96
  10.  
  11. #call to the fonts
  12. $_PATH/xset fp+ /usr/local/fonts/$FONT_NAME
  13.  
  14. $X_PATH/setroot -solid $BACKGROUND
  15.  
  16. SIZES=$($X_PATH/randr | /usr/bin/awk ' /\*/ { print $1}')
  17. WIDTH=${SIZES%x*}
  18. HEIGHT=${SIZES#*x}
  19. POSY=$(($HEIGHT * 5 / 100))
  20. PUFFY_WIDTH=$(( 700 - 2 * $POSY))
  21. POSX=$((($WIDTH - $PUFFY_WIDTH)/2))
  22. PICTURE_FILE="/tmp/xenodm.jpg"
  23.  
  24. if [! -f $PICTURE_FILE]; then
  25. cp /etc/X11/xenodm/pixmaps/bluepuffy.jpg $PICTURE_FILE
  26. fi
  27. chmod 666 $PICTURE_FILE
  28.  
  29. #show bluepuffy
  30. /usr/local/bin/feh -B$BG_COLOR -g${PUFFY_WIDTH}x{PUFFY_WIDTH}+$POSX+$POSY -. -Z "$PICTURE_FILE" &
  31.  
  32. (
  33. while true; do
  34. POS=$(($WIDTH -12*34)/2)
  35. /usr/X11R6/bin/xmessage -geometry +$POS-150 -buttons "[ Sleep ]"
  36. ACTION=$? #Press Key
  37. echo "Xmessage said $ACTION"
  38. if[$ACTION -eq 20]; then /usr/bin/zzz
  39. elif[$ACTION -eq 21 ];then
  40. /usr/X11R6/bin/xsetroot -cursor_name watch
  41. /sbin/shutdown -r now
  42. elif[$ACTION -eq 22];then
  43. /usr/X11R6/bin/xsetroot -cursor_name watch
  44. /sbin/shutdown -r now
  45. else echo "Something bad happened to Xmessage"
  46. fi
  47. #stop looping
  48. if[ -z "$(/usr/bin/pgrep -qx -U xclock)"]; then break; fi
  49. done
  50. )&
  51.  
  52. OS_NAME=$(/usr/bin/uname -n)
  53. OS_INFO=$(/usr/bin/uname -smr)
  54. KEYBD=$(/usr/X11/bin/setxkbmap -print | grep xkb_symbols | cut -d"+" -f2)
  55. /usr/X11R6/bin/xclock -geometry -0+20 -strftime "OS_NAME ($OS_INFO) $KEYBD | %a. %d %b. %Y %H:%M:%S" &
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement