Posts

Mission control in GNU Emacs

Image
  Mission control or desktop/window overview in GNU Emacs. This is an Emacs buffer showing some images in a fullscreen frame. The first line shows images of workspaces. The rest are images of active windows in current workspace. It uses the following external tools: wmctrl - For switching applications and workspaces xdotool - For getting id of active window xwd - For taking screenshots in XWD format ffmpeg - For scaling and converting XWD to PNG format Install these essential tools in your system.  $ sudo apt install wmctrl xdotool xwd ffmpeg Load library task.el  (require 'task) Run M-x task-view or M-x task-view-fullscreen . Use mouse to select, g to group, G to ungroup, m to start a move operation and ESC to cancel. Use double click to activate a window or desktop. Press q or RET to exit. Pro Tip: You can select multiple windows.   Code: https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/svg.el https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/task.el   Note: xfda

GNU Emacs as a Desktop widget

Image
    GNU Emacs has a lot of in-built features which can enhance your computing experience while acting as a desktop widget .e.g. calendar, scratch pad, clock (external) etc. Even when you are not using it as the main application, it can prove useful as a companion application. In the image, menu bar, tool bar and scroll bars have been turned off. You might want to make it sticky (appears in all desktops) and maximized vertically using following command (you can get <win-id> using xwininfo command): $ wmctrl -b add,sticky,maximized_vert -r <win-id> -i  

GNU Emacs Gestures

Image
 Use multi-touch gestures in GNU Emacs.   - Install touchegg https://github.com/JoseExposito/touchegg - Create a copy of touchegg.conf $ mkdir -p ~/.config/touchegg && cp -n /usr/share/touchegg/touchegg.conf ~/.config/touchegg/touchegg.conf   - Add a section for Emacs (pinch to zoom) before closing <touchegg> tag.    <application name="Emacs">     <gesture type="PINCH" fingers="2" direction="IN">       <action type="SEND_KEYS">         <repeat>true</repeat>         <modifiers>Control_L</modifiers>         <keys>x+KP_Subtract</keys>         <decreaseKeys>KP_Add</decreaseKeys>       </action>     </gesture>     <gesture type="PINCH" fingers="2" direction="OUT">       <action type="SEND_KEYS">         <repeat>true</repeat>         <modifiers>Control_L</modifiers>         <

Rabbit hole: Windows + Linux + Emacs + Vim

Image
A computing Rabbit hole!!! Windows 10 running WSL2 (debian) and VcXsrv X server GNU Emacs compiled under WSL2 with XWidget support GNU Emacs running embedded Vim using XWidget's XEMBED protocol

Screen Mirroring in GNU Linux

Image
Screen mirroring allows you to display your laptop screen on a TV via Wifi Direct . This is also known as screen casting, Miracast, Wifi Display or Wifi P2P. Usage of Wifi Direct means you don't necessarily need a router or a working network. The data is streamed using RTSP . However, it doesn't use the standard RTSP port. The port information is shared during connection process (usually defaults to 7236 as per Miracast specifications). Also, the RTSP server must support additional Miracast related negotiations. Note: Feature-wise, Second Screen or DIAL (DIscovery And Launch) provides similar experience (primarily for Youtube and Netflix apps). But this (DIAL) requires both the devices to be in the same network. Debian XFCE meets LG 4K TV (UJ632T) The core of this technology in Linux is wpa_supplicant (or its variant - connmand or miracle-wifid). connmand (for WDS ) and miracle-wifid (for MiracleCast ) also manage your network interface. You might also have NetworkManager

LG WebOS TV and GNU Emacs

Image
Modern LG TVs with WebOS allow remote control via websockets. Since this is a web technology, you might want to automate this using Node JS [1] . However, if you want a fair balance between scripting and interactive use, Emacs will serve you better. Toast (top right) sent from Emacs   Completing LG TV commands in Emacs Steps Install package websocket from ELPA. M-x package-install RET websocket RET  Download tv.el and pairing.json Load tv.el M-x load-library RET tv RET  Ensure variable lgtv--pairing-json is pointing to pairing.json file. Run M-x lgtv-command Enter a command for LG TV. Use TAB for completion. Enter a JSON object for command parameter. Leave empty if the command doesn't require a parameter. ( Note: Remember to quote the keys in JSON.) ;; Sample payload passed to TV. You need to provide URI (without ssap://) and payload parts   ;; Show toast { "id": "0c8b18a10002", "type": "request", "uri": "ssap://system

Multi-select Tree widget in GNU Emacs

Image
Here's an example of multi-select tree widget in GNU Emacs. It is cobbled up from visibility and option widgets. If you want different icons, see . (widget-create 'tree            :name "Tree" :checkbox t            '(item "One") '(item "Two"))   ;; Uncomment if you don't need images ;; (setq widget-image-enable nil)   ;; Following two lines are necessary to interact with the widget (use-local-map widget-keymap) (widget-setup)   ;; This is a list of values of effectively selected leaf nodes. (widget-tree-flat-value widget)   For placement, you can use :indent property on parent. For indentation of children, either use :offset on parent or :extra-offset on child. Code: https://gitlab.com/atamariya/emacs/-/blob/dev/lisp/wid-edit.el