I have getRuntime().exec() calls in my program; however, two of them will not work:
public static final ROTCW = "xrandr -o left"
public static final CALCW1 = "xinput --set-prop 11 \"Evdev Axis Inversion\" 0 1"
public static final CALCW2 = "xinput --set-prop 11 \"Evdev Axes Swap\" 1";
public void actionPerformed(ActionEvent e)
{
try {
Runtime.getRuntime().exec(ROTCW);
Runtime.getRuntime().exec(CALCW1);
Runtime.getRuntime().exec(CALCW2);}
catch (IOException ioe){ ioe.printStackTrace();}
}});
ROTCW definitely works (the screen rotates cw), but it does not calibrate (CALCW). Typing the CALCWs manually in the same terminal tab as the one I started the program with does not work, but typing it into a new terminal tab/window does work.
Why does this happen, and what fixes it?
You could implement the
&&logic directly in Java: