|
| 1 | +- [1. run on local](#1-run-on-local) |
| 2 | + - [1.1. prepare environment](#11-prepare-environment) |
| 3 | + - [1.2. debug](#12-debug) |
| 4 | +- [2. How to use "mapping path then opening in vscode feature"](#2-how-to-use-mapping-path-then-opening-in-vscode-feature) |
| 5 | +- [3. Patch current guake](#3-patch-current-guake) |
| 6 | + - [3.1. create patch](#31-create-patch) |
| 7 | + - [3.2. apply patch](#32-apply-patch) |
| 8 | +- [4. change stk css style](#4-change-stk-css-style) |
| 9 | + - [4.1. css file localtion](#41-css-file-localtion) |
| 10 | + - [4.2. using GTK Inspector for debug css](#42-using-gtk-inspector-for-debug-css) |
| 11 | + - [4.3. references](#43-references) |
| 12 | +- [5. cherry-pick and rebase into one commit](#5-cherry-pick-and-rebase-into-one-commit) |
| 13 | +- [6. install](#6-install) |
| 14 | + |
| 15 | +# 1. run on local |
| 16 | + |
| 17 | +## 1.1. prepare environment |
| 18 | + |
| 19 | +```shell |
| 20 | +pyenv local 3.9.0 |
| 21 | +venv-create |
| 22 | + |
| 23 | +make local-setup-development-environment |
| 24 | +# ./scripts/bootstrap-dev-debian.sh |
| 25 | +make local-run |
| 26 | +# make local-run-logging-DEBUG |
| 27 | +``` |
| 28 | + |
| 29 | +## 1.2. debug |
| 30 | + |
| 31 | +1. run guake with debugpy |
| 32 | + |
| 33 | +```shell |
| 34 | +make local-debug |
| 35 | +``` |
| 36 | + |
| 37 | +2. run debug mode vscode |
| 38 | +3. set breakpoints |
| 39 | +4. reduce guake windows size, because when debug, guake terminal will stay in screen |
| 40 | +5. do something in guake terminale |
| 41 | + |
| 42 | +# 2. How to use "mapping path then opening in vscode feature" |
| 43 | + |
| 44 | +1. Create configs file [.guake.json](.guake.json) in the root folder |
| 45 | + |
| 46 | + |
| 47 | +2. cd to guake repo |
| 48 | + |
| 49 | +```shell |
| 50 | +cd /home/xuananh/repo/guake/ |
| 51 | +git checkout xuananh |
| 52 | +``` |
| 53 | + |
| 54 | +3. copy bellow log and paste to terminal |
| 55 | + |
| 56 | +```shell |
| 57 | +Traceback (most recent call last): |
| 58 | + File "/app/main.py", line 190, in on_task_received |
| 59 | + strategy = strategies[type_] |
| 60 | +``` |
| 61 | + |
| 62 | +4. Ctrl + click to "app/main.py", it will open [guake/main.py](guake/main.py) on vscode based on setting in file [.guake.json](.guake.json) |
| 63 | + |
| 64 | +# 3. Patch current guake |
| 65 | + |
| 66 | +## 3.1. create patch |
| 67 | + |
| 68 | +```shell |
| 69 | +git --no-pager diff --no-index --patch \ |
| 70 | + --output=/home/xuananh/Dropbox/Work/Other/conf.d/guake/guake_patch.diff \ |
| 71 | + terminal_origin.py \ |
| 72 | + terminal_customized.py |
| 73 | +``` |
| 74 | + |
| 75 | +## 3.2. apply patch |
| 76 | + |
| 77 | +```shell |
| 78 | +sudo patch -p1 /usr/lib/python3/dist-packages/guake/terminal.py \ |
| 79 | + /home/xuananh/Dropbox/Work/Other/conf.d/guake/guake_patch.diff |
| 80 | + |
| 81 | +# ------- output |
| 82 | +# patching file /usr/lib/python3/dist-packages/guake/terminal.py |
| 83 | +# Hunk #1 succeeded at 272 (offset 14 lines). |
| 84 | +# Hunk #2 succeeded at 340 (offset 14 lines). |
| 85 | +# Hunk #3 succeeded at 424 (offset 14 lines). |
| 86 | + |
| 87 | +``` |
| 88 | + |
| 89 | +You can see that the above file is patched successfully with offset, it means that this file change quite lot from the time creating patch file. |
| 90 | + |
| 91 | +In case patching fail because there is a lot of change, you should create new patch file by these steps: |
| 92 | + |
| 93 | +1. create 2 new file to create patch |
| 94 | + |
| 95 | +```shell |
| 96 | +cp /usr/lib/python3/dist-packages/guake/terminal.py ~/Downloads/terminal_origin.py |
| 97 | +cp /usr/lib/python3/dist-packages/guake/terminal.py ~/Downloads/terminal_customized.py |
| 98 | +``` |
| 99 | + |
| 100 | +2. change file `~/Downloads/terminal_origin.py` based on branch `xuananh`, then create patch file again using command in [3.1. create patch](#31-create-patch) |
| 101 | + |
| 102 | +# 4. change stk css style |
| 103 | + |
| 104 | +## 4.1. css file localtion |
| 105 | + |
| 106 | +~/.config/gtk-3.0/gtk.css |
| 107 | + |
| 108 | +## 4.2. using GTK Inspector for debug css |
| 109 | + |
| 110 | +Run guake by command: |
| 111 | + |
| 112 | +```shell |
| 113 | +GTK_DEBUG=interactive make local-run |
| 114 | +``` |
| 115 | + |
| 116 | +it will run guake and GTK Inspector : |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | +do as above image to inspect element in guake, it will show as below |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | +choose another function: CSS nodes as bellow |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | +you can see above image to know how to get right css selector and set attribute for it |
| 130 | + |
| 131 | +in above image, we got css selector for selected tab in guake terminal, then set its box-shadow color to highlight selected tab |
| 132 | + |
| 133 | +you can test your css by switch to css tab |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | +## 4.3. references |
| 138 | + |
| 139 | +https://blog.gtk.org/2017/04/05/the-gtk-inspector/ |
| 140 | + |
| 141 | +https://gtkthemingguide.vercel.app/#/creating_gtk_themes?id=selectors |
| 142 | + |
| 143 | +# 5. cherry-pick and rebase into one commit |
| 144 | + |
| 145 | +```shell |
| 146 | +# create new branch to cherry-pick |
| 147 | +git checkout -b xuananh-add-new-feature-mapping-file-path-to-open-in-vscode xuananh-backup |
| 148 | + |
| 149 | +# reset new branch to the commit from that XuanAnh start add new commit |
| 150 | +git checkout master |
| 151 | +git branch -f xuananh-add-new-feature-mapping-file-path-to-open-in-vscode c3f3a60d943ece1918aad3f077118145d9f61aeb |
| 152 | +git checkout xuananh-add-new-feature-mapping-file-path-to-open-in-vscode |
| 153 | + |
| 154 | +# cherry pick 11 commits from branch xuananh-backup |
| 155 | +git cherry-pick d685fe66132fc5f4c811dbae90a27bd7154e7840 |
| 156 | +git cherry-pick 78f69d20cb8d5cc0bd27a15d090cbc2c98ce6a5a |
| 157 | +git cherry-pick 417fcbc82ab6420928dfaf666511855b73438040 |
| 158 | +git cherry-pick f1efff96d51f921d42874e04399d7b65358aa47b |
| 159 | +git cherry-pick 2162ce10374b493374c36fc1f899e02d3a55c008 |
| 160 | +git cherry-pick f0d06d0c5023991f5977e5f2b437ab4ceea653e4 |
| 161 | +git cherry-pick 93cbcbe445f012e5264b303ac364665b173e7231 |
| 162 | +git cherry-pick 1cb171f96f08d04577261df43abd17bedb57fdd9 |
| 163 | +git cherry-pick 9a13c20707b9841812fb223628676e38146340a3 |
| 164 | +git cherry-pick 0348b2988d03e8290cbf0dbd91457b61078f44b0 |
| 165 | +git cherry-pick 286977fcf754168ca7e13dd0ec8fa92cec60f824 |
| 166 | + |
| 167 | +# create new branch to rebase |
| 168 | +git checkout -b xuananh-add-new-feature-mapping-file-path-to-open-in-vscode-rebased xuananh-add-new-feature-mapping-file-path-to-open-in-vscode |
| 169 | + |
| 170 | +# rebase above 11 commits, reference on how to rebase |
| 171 | +# https://www.freecodecamp.org/news/git-squash-commits/ |
| 172 | +# https://stackoverflow.com/a/21278908 |
| 173 | +git rebase --interactive HEAD~11 |
| 174 | + |
| 175 | +# create new branch with shorter name |
| 176 | +git checkout -b xuananh xuananh-add-new-feature-mapping-file-path-to-open-in-vscode-rebased |
| 177 | + |
| 178 | +``` |
| 179 | + |
| 180 | +# 6. install |
| 181 | + |
| 182 | +https://guake.readthedocs.io/en/latest/contributing/dev_env.html#install-on-system |
| 183 | + |
| 184 | +`make && sudo make install` |
| 185 | + |
| 186 | +or reinstall |
| 187 | + |
| 188 | +`make reinstall` |
0 commit comments