-
Notifications
You must be signed in to change notification settings - Fork 0
/
dminfo
executable file
·60 lines (56 loc) · 2.91 KB
/
dminfo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/env bash
# Div System
OS=$( lsb_release -a | awk 'NR==2 {print $3 " \"Just keep rolling\"" }' )
KERNEL=$( uname -r )
PACKAGES_INSTALLED=$( pacman -Q | wc -l )
SHELL_VERSION=$( "$SHELL" --version | awk '{print $1 " " $2}')
WINDOW_MANAGER=$( echo $DESKTOP_SESSION )
TERMINAL_EMULATOR=$( echo $TERM )
# CPU
sensor=$( sensors )
cpu=$( bat /proc/cpuinfo )
gpu=$( nvidia-smi )
mem=$(free -mh)
CPU_FREQUENCY=$( lscpu | awk 'NR==17 {print $4}' )
CPU=$( echo "$cpu" | awk 'NR==5 {print $4 " " $5 " " $6}' )
CPU_THREADS=$( echo "$cpu" | awk 'NR==11 {print $3}' )
CPU_CORE_0_TEMP=$( echo "$sensor" | awk 'NR==4 {print $3}')
CPU_CORE_1_TEMP=$( echo "$sensor" | awk 'NR==5 {print $3}')
CPU_CORE_2_TEMP=$( echo "$sensor" | awk 'NR==6 {print $3}')
CPU_CORE_3_TEMP=$( echo "$sensor" | awk 'NR==7 {print $3}')
GPU_NAME=$( echo "$gpu" | awk 'NR==9 {print $3 " " $4 " " $5}')
GPU_DRIVER=$( echo "$gpu" | awk 'NR==3 {print $4 " " $5 " " $6}')
CUDA_VERSION=$( echo "$gpu" | awk 'NR==3 {print $7 " " $8 " " $9}')
GPU_FAN=$( echo "$gpu" | awk 'NR==10 {print $2}')
GPU_TEMP=$( echo "$gpu" | awk 'NR==10 {print $3}')
GPU_POWER=$( echo "$gpu" | awk 'NR==10 {print $5 " / " $7}')
GPU_RAM=$( echo "$gpu" | awk 'NR==10 {print $9 " / " $11}')
GPU_UTIL=$( echo "$gpu" | awk 'NR==10 {print $13}')
MEM_TOTAL=$( echo "$mem" | awk 'NR==2 {print $2}' )
MEM_USED=$( echo "$mem" | awk 'NR==2 {print $3}' )
MOTHERBOARD_VENDOR=$( cat /sys/devices/virtual/dmi/id/board_vendor | awk '{print $1}')
MOTHERBOARD_NAME=$( cat /sys/devices/virtual/dmi/id/board_name )
MOTHERBOARD_REV=$( cat /sys/devices/virtual/dmi/id/board_version )
declare -a INFO=(
"OS: $OS"
"WM: $WINDOW_MANAGER"
"Kernel: $KERNEL"
"shell: $SHELL_VERSION"
"terminal: $TERMINAL_EMULATOR"
"Installed Packages: $PACKAGES_INSTALLED"
"memory: $MEM_USED / $MEM_TOTAL"
"Motherboard $MOTHERBOARD_VENDOR $MOTHERBOARD_NAME $MOTHERBOARD_REV"
"cpu: $CPU ($CPU_THREADS) @ $CPU_FREQUENCY MHz"
"cpu temperature: Core0 Core1 Core2 Core3"
" $CPU_CORE_0_TEMP $CPU_CORE_1_TEMP $CPU_CORE_2_TEMP $CPU_CORE_3_TEMP"
"gpu: $GPU_NAME - $GPU_DRIVER - $CUDA_VERSION"
"gpu info: Fan: temp: power: ram: GPU:"
" $GPU_FAN $GPU_TEMP $GPU_POWER $GPU_RAM $GPU_UTIL"
""
"Filesystem -->"
"Processes --->"
)
CHOICE=$(printf '%s\n' "${INFO[@]}" | dmenu -i -l 25 -p 'test' | awk '{print $2}')
[[ "$CHOICE" = "-->" ]] && ( df -Ph | dmenu -i -l 25 -p 'File System: ' )
[[ "$CHOICE" = "--->" ]] && ( dmkill )
[[ "$CHOICE" ]] && exit || exit