first please read the macrodroid wiki to understand some features of macrodroid
by "magic variable" we mean a special predefined variable that has some interesting value eg. battery level, screen resolution etc.
what you can do
1. add action
2. select "set variable" (in category "Macrodroid specific")
3. choose or create a text variable ( let's call it sreen_x and assume it's local)
4. at the "enter value" screen , click on button at the right with 3 dots inside
and scroll down until you find and select "Screen Resolution (X)"
regarding the shell script , it's easy to do this using the variable with the resolution value above
in the "enter script" screen , enter
MyXrsolution:[ [lv=screen_x] ]
(the [lv=screen_x] can be entered by typing it or by clicking on the button at the right with 3 dots inside and selecting the local variable screen_x
alternatively, if you don't use the resolution value in other place in your program
you can just follow the instructions for the shell script above but instead of selecting the local variable screen_x , you go further down in the list and select immediately "Screen Resolution (X)"
so your script is
MyXrsolution:[ [screen_res_x] ]