As you know while working with computer there are so many pop-up or advertising on internet so It’s easy to lose focus what we are doing. To keep myself away from it While I am working, I use different windows for all different topics which is not deal with the topic.
In the first window and tabs there are general things like Youtube, Mail accounts.
The Second one is main part of what I am doing such as articles. If it is necessary(Generally it is 🙂 ) When some problems occur about my work such as some code blocks are necessary let’s call it I should send request in Python via Curl to a server.
But If I don’t have the pycurl in my computer, It will be in third window how to install and use pycurl for Python. This situation maybe will continue like that.
At least we have 3 Firefox windows 1 terminal 1 IDE for our job. At this time, using Alt-tab is so useless because you will look little previews which is to explain what it is in this window. It’s just a losing time and attention for work.
For being productive. I found code block ,which is about seeing changing windows much better, on the Internet for not losing attention.
After bounding these code blocks to any shortcut, it only supplies to see windows fast by starting opposite way among Firefox windows.
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 |
#!/bin/bash # Copied from http://askubuntu.com/questions/269574/wmctrl-focus-most-recent-window-of-an-app # Usage # Download wmctrl by using apt-get or yum # Bound shortcut that sh code from your environment # If you press more than one it will change windows app_name=Firef workspace_number=`wmctrl -d | grep '\*' | cut -d' ' -f 1` win_list=`wmctrl -lx | grep $app_name | grep " $workspace_number " | awk '{print $1}'` active_win_id=`xprop -root | grep '^_NET_ACTIVE_W' | awk -F'# 0x' '{print $2}' | awk -F', ' '{print $1}'` if [ "$active_win_id" == "0" ]; then active_win_id="" fi # If you open new windows for you all new work that will help to you to start from last tab to see your app # It is convenient while using Firefox #If you want to start from beggining just comment that line win_list=$(echo $win_list | awk 'BEGIN{FS="[ ]*"; OFS=" "} { for (i=NF; i>0; i--) { printf "%s", $i;11 ; if (i>1) { printf "%s", OFS; } } printf "\n" }') switch_to=`echo $win_list | sed s/.*$active_win_id// | awk '{print $1}'` # if the current window is the last in the list ... take the first one if [ "$switch_to" == "" ];then switch_to=`echo $win_list | awk '{print $1}'` fi if [[ -n "${switch_to}" ]] then (wmctrl -ia "$switch_to") & else if [[ -n "$2" ]] then ($2) & fi fi exit 0 |
Use it wisely. 🙂