Quick viewing(Text Mode)

Custom Keybindings Openbox

Custom Keybindings Openbox

How to Add Custom Keybindings in | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-...

Daniel Rosehill Blog , writing, and more

ALL GENERAL FREELANCING HOW TO LINUX BACKUP TECH  MISC  REVIEWS  VIDEO ABOUT  I’M HERE TOO  LINKS  MY WRITING

17 IYYAR 5780 How to Add Custom Keybindings in Openbox Topics: Customiza�on, Linux, Openbox,

If you’re s�ll running LXDE, or are using Openbox through some other lightweight (DE) then you might be interested in crea�ng custom keybindings to be able to do everything from shu�ng down the computer to opening your favorite Chrome app at the touch of a bu�on.

Fortunately, because Openbox, like LXDE, is a lightweight piece of so�ware, crea�ng these is not too complicated. Follow these steps to have your keyboard doing exactly what you want — just be careful not to overwrite keyboard shortcuts built into programs which you might use regularly!

Open the Openbox con�guration �le

1 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

Creating Openbox keybindings in LXDE (Linux Ubuntu)

Firstly, navigate to the default Openbox configura�on file. In both LXDE and Ubuntu this can be found within:

1. /home/$user/.config/openbox

(Replacing $user with your username).

If you’re using LXDE the file is -rc.xml. In , the corresponding file is lubuntu-rc.xml.

It’s best prac�ce to take a backup of the file before making any chances. I typically just append the date as a suffix in DDMMYY format:

1. cp lxde-rc.xml lxde-rc-DDMMYY.xml

You can then open the file in your IDE of choice.

Use xev to capture key

2 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

identi�ers

A�aching keys to specific commands is as easy as looking up the key’s iden�fier. You can use the xev tool in order to do this.

Xev will output the coordinates of your mouse movements and the iden�fiers of the keys that you type back into the terminal. Just make sure to type the keystrokes while the capture box is in focus:

Assign Keybindings

A�er ge�ng familiar with the layout of lxde.rc.xml you can begin adding in your own custom keybindings — or reassigning exis�ng ones.

Just pay a�en�on to the tags as these will determine where

3 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

the keybindings are allowed to run.

But you can easily decipher the basic format:

1. 2. 3. sudo pm-suspend 4. 5.

The above is a keybinding I have been using for years to make it easy for me to put my desktop into suspend rather than turning it off. It requires the pm-u�ls u�lity. But simply pressing the scroll lock key will automa�cally put my PC into the suspend state.

The only other edit I had to create to make this work was to disable wake from USB devices.

You can find the wake states of your various devices using:

1. cat /proc/acpi/wakeup

A�er some experimenta�on I was then able to pass:

1.
sudo sh -c “echo XHC > /proc/acpi/wakeup”

If you like the thought of se�ng a suspend keybinding but are running into difficulty with your wireless mouse/keyboard waking the device without your interven�on, you can find more informa�on and details on AskUbuntu and here.

Sample edited default Openbox

4 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

con�guration �le

Lower (10%), raise (10%), and toggle mute using the bo�om three bu�ons on the numeric keypad:

1. 2. 3. amixer -D pulse set Master 10%- 4. 5. 6. 7. 8. amixer -D pulse set Master 10%+ 9. 10. 11. 12. 13. amixer -D pulse set Master 1+ toggle 14. 15.

I use the Pause Break key to call up a Chrome App shortcut that launches Brain.fm:

1. 2. 3. /opt/google/chrome/google-chrome — profile- directory=Default — app-id=dgksfs9fsfsfksf 4. 5.

I use Flameshot for screenshots. I mapped the flameshot gui command onto the Print Screen key:

1. 2. 3. flameshot gui 4. 5.

And of course I can suspend the computer directly using Scroll Lock.

Just make sure to install pm-utils first:

5 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

1. 2. 3. sudo pm-suspend 4. 5.

Here’s the snippet in full:

1. 2. 3. 5. 6. 7. 10 8. 20 9. 10. 11. yes 12. 14. no 15. 16. yes 17. 19. no 20. 21. 200 22. 24. no 25. 27. 28. 29. Smart 30. 31.

yes
32. 34. Any 35. 38. 39.

6 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

40. 41. TraditionalOk 42. NLIMC 43. 53. yes 54. yes 55. 56. sans 57. 10 58. 59. bold 60. 61. normal 62. 63. 64. 65. sans 66. 10 67. 68. bold 69. 70. normal 71. 72. 73. 74. sans 75. 10 76. 77. normal 78. 79. normal 80. 81. 82. 83. sans 84. 10 85. 86. normal 87. 88. normal 89. 90. 91. 92. 93. 8 94. 95. 96. 97.

7 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

98. Sans 99. 8 100. 101. 102. 103. 104. 105. 111. 2 112. 1 113. 114. Work 115. Backups 116. 117. 0 118. 120. 121. 122. yes 123. Nonpixel 124. 125. Center 126. 127. 128. 129. 10 130. 132. 10 133. 135. 136. 137. 141. 142. 0 143. 0 144. 0 145. 0 146. 147.

8 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

148. TopLeft 149. 150. 0 151. 0 152. no 153. Above 154. 155. Vertical 156. 157. no 158. 300 159. 160. 300 161. 162. Middle 163. 164. 165. 166. C-g 167. 168. 169. 170.

no 171. no 172. 173. 174. 175. 176. no 177. no 178. 179. 180. 181. 182. no 183. no 184. 185. 186. 187. 188. no 189. no 190. 191. 192. 193. 194. no 195. no 196. 197. 198. 199. 200. no 201. no 202. 203. 204.

9 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

205. 206.

no 207. no 208. 209.
210. 211. 212. no 213. no 214. 215. 216. 217. 218. 1 219. 220. 221. 222. 223. 2 224. 225. 226. 227. 228. 3 229. 230. 231. 232. 233. 4 234. 235. 236. 237. 238. 239. 240. 241. 242. 243. 244. 245. 246. 247. 248. 249. 250. 251. 252. 253. client-menu 254. 255. 256. 257. 258. 259. 260. 261. 262.

10 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

263. 264. 265. yes 266. yes 267. 268. 269. 270. 271. 272. 273. true 274. PCManFM 275. 276. pcmanfm 277. 278. 279. 280. 281. 282. pcmanfm --find-files 283. 284. 285. 286. 287. 288. lxpanelctl run 289. 290. 291. 292. 293. lxpanelctl run 294. 295. 296. 297. 298. lxpanelctl menu 299. 300. 301. 302. 303. lxpanelctl menu 304. 305. 306. 307. 308. 309. 310. 311. 312. lxtask 313. 314. 315. 316. 317. 318. xscreensaver-command -lock 319. 320.

11 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

321. 322. 323. sudo pm-suspend 324. 325. 326. 327. 328. /opt/google/chrome/google-chrome --profile- directory=Default --app-id=glmdedgogilpdojjefbolklppahonlae 329. 330. 331. 332. 333. flameshot gui 334. 335. 336. 337. 338. gnome-clocks 339. 340. 341. 342. 343. 344. 345. 346. amixer -D pulse set Master 10%- 347. 348. 349. 350. 351. 352. amixer -D pulse set Master 10%+ 353. 354. 355. 356. 357. 358. amixer -D pulse set Master 1+ toggle 359. 360. 361. 362. 363. 364. 365. lxrandr 366. 367. 368. 369. 370. 371. 372. 373. 8 374. 375. 200 376.

12 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

377. 400 378. 381. 382. 383. 384. 385. 386. 387. 388. 389. 390. 391. 392. 393. 394. 395. 396. 397. 398. 399. 400. 401. 402. 403. 404. 405. 406. 407. 408. 409. 410. 411. 412. 413. 414. 415. 416. 417. 418. 419. 420. 421. 422. 423. 424. 425. 426. 427. 428. 429. 430. 431. 432.

13 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

433. 434. 435. 436. 437. 438.

client-menu 439. 440. 441. 442. 443. 444. 445. 446. 447. 448. 449. 450. top 451. 452. 453. 454. 455. 456. 457. 458. 459. 460. 461. left 462. 463. 464. 465. 466. 467. 468. 469. 470. 471. 472. right 473. 474. 475. 476. 477. 478. 479. 480. 481. 482. 483. bottom 484. 485. 486. 487. 488. 489. 490.

14 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

491. 492. 493. 494. 495.

client-menu 496. 497. 498.
499. 500. 501. 502. 503. 504. 505. 506. 507. 508. 509. 510. 511. 512. 513. 514. 515. 516. 517. 518. 519. 520. 521. 522. 523. 524. 525. 526. 527. 528. 529. 530. 531. 532. 533. 534. 535. 536. 537. 538. 539. 540. 541. 542. 543. 544. 545. 546. 547. 548.

15 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

549. 550. 551. 552. 553. 554. 555. 556. 557.

client-menu 558.
559.
560. 561. 562. 563. 564. client-menu 565. 566. 567.
568. 569. 570. 571. 572. 573. 574. 575. 576. 577. 578. 579. 580. 581. 582. 583. 584. 585. 586. 587. 588. 589. 590. 591. 592. 593. 594. 595. 596. 597. 598. 599. 600. 601. 602. 603. 604. 605. 606.

16 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

607. 608. 609. 610. 611. 612. 613. 614. 615. 616. 617. 618. 619. 620. 621. 622. 623. 624. 625. 626. 627. 628. 629. 630. 631. 632. 633. 634. 635. 636. 637. 638. 639. 640. 641. 642. 643. 644. 645. 646. 647. 648.

client-list-combined-menu 649. 650. 651. 652. 653. root-menu 654. 655. 656.
657. 658. 659. 660. 661. 662. 663. 664.

17 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

665. 667. 668. /usr/share/lxde/openbox/menu.xml 669. 200 670. 672. no 673. 674. 100 675. 677. yes 678. 679. yes 680. 681.

682. 683. 737. 738.

POSTED IN LINUX & UBUNTU, TECHNOLOGY • TAGGED CUSTOMIZATION, LINUX, OPENBOX, UBUNTU

If a backup copy of this post exists as a PDF, then it can be found here

OTHER LINKS

19 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

Newsle�er

Wri�ng on Other Sites

Ghostwri�ng

Github

Amazon

Danbuntu 18.04 (LTS)

Contact Me

Contact Me (Anon)

TOP POSTS

Freelance Wri�ng Pricing: Per Word, Per Hour, or Per Project? And How Much Of Each?

How to: Create a Password-Protected WordPress Staging Environment Using So�aculous And Cloudflare Access

My (Unorthodox) Produc�vity Resolu�on For This Year — Be Less ‘Responsive’!

The #weddingofalife�me PR campaign

Ireland vs. Israel: My Thoughts A�er 5 Years

MY RANDOM INTERESTS

Aliexpress ⁄ Amazon ⁄ Android ⁄ AWS ⁄ Backblaze ⁄ backups ⁄ Clonezilla ⁄ Cloud storage ⁄ cooking ⁄ CRM ⁄ cybersecurity ⁄ email ⁄ Facebook ⁄ Freelancing ⁄ GPUs ⁄ Gsuite ⁄ Hardware ⁄ Host4Geeks ⁄ hos�ng ⁄ Ireland ⁄ Israel ⁄ kaizen ⁄

20 of 21 06/07/2020, 21:19 How to Add Custom Keybindings in Openbox | Daniel ... https://www.danielrosehill.co.il/myblog/how-to-add-c...

LinkedIN ⁄ Linux ⁄ marke�ng ⁄ Mental Health ⁄ Monitors ⁄ Mul�monitor ⁄ Mul�ple monitors ⁄ OSINT ⁄ phishing ⁄ Produc�vity ⁄ Quora ⁄ recipes ⁄ Reddit ⁄ reviews ⁄ sales ⁄ shopping ⁄ technology ⁄ TransferWise ⁄ Ubuntu ⁄ WhatsApp ⁄ Worksta�ons ⁄ wri�ng ⁄ Zoho ⁄

FIND POSTS ABOUT:

Search … 

21 of 21 06/07/2020, 21:19