매크로 레코더 리눅스

Description:

GNU Xnee is a suite of programs that can record, replay, and distribute user actions under the X11 window system (Linux graphical user interface). We use this tool to set up and run click simulation macros on Linux images.

Installation

  • Open a terminal window from the Desktop
  • Update the system repositories:

sudo apt update

(if promped for a password use 00000000)

  • Install Xnee
sudo apt install xnee

Recording a mouse macro

  • connect a USB mouse to the system
  • open the terminal
  • open the visualisation and press Alt + Tab to display the terminal window on top of it
  • input the following command into the terminal and press Enter to start recording
cnee --record --mouse -o macro.xns
  • once you are done recording your clicks press Alt + Tab to switch back to the terminal
  • press Ctrl + C to stop the macro recording

Now you have a file called macro.xns that contains the recorded actions in the /home/woojin directory.

Replaying the macro

To replay the we first need to set up a bash script. Follow the next steps to do this:

  • open the /home/woojin directory
  • right click and select Create New.. -> Empty File
  • chose a name, for example MacroLoop.sh
  • right click on the file and open it with Visual Studio Code
  • write the following code inside and save the file:
#!/bin/bash
# Infinite loop to replay the macro

keep_running=1

while [ $keep_running -eq 1 ]
do
    cnee --replay --file macro.xnl --stop-key q
    
    if [ $? -ne 0 ]; then
       keep_running=0
       break
    fi

    sleep 5  
done
  • make the script executable with the following command in terminal:
chmod +x MacroLoop.sh
  • open the terminal
  • open the visualisation and press Alt + Tab to display the terminal window on top of it
  • input the following command into the terminal and press Enter to start recording
./MacroLoop.sh

Stopping the macro

By defaul the macro will run in an endless loop. To stop the execution of the macro press Q key. This will stop the execution for 5 seconds. In this time you can either press Alt + Tab to display the terminal window again, and then stop the macro execution with Ctrl + C . If you don’t stop it in these 5 seconds window, the macro will be executed again.

구독하다
알림
0 댓글
가장 오래된
최신 가장 많이 투표된
인라인 피드백
모든 댓글 보기
위로 스크롤
0
여러분의 생각을 들려주시면 감사하겠습니다. 댓글로 남겨주세요.엑스