Skip to content

Instantly share code, notes, and snippets.

@rbreaves
rbreaves / calendarUID.scpt
Created June 30, 2023 18:19
macOS Clone Calendars
-- list all calendars in order they appear in Calendar app, w/ name and uid
-- this works in Catalina & up, a bug breaks the old uid param.
on identifyCalendars()
set ATID to AppleScript's text item delimiters
set AppleScript's text item delimiters to {"Can’t make «class wres» id \"", "\" of application \"Calendar\" into type text."}
tell application "Calendar"
set calendarList to {}
repeat with aCalendar in calendars
try

Window Decoration Outline for GNOME/GTK apps w/ Mojave-dark theme

WARNING: This was only tested with GNOME 3.38. No plan on working around with GNOME 40+ and libadwaita.

This will add black and highlight outline to the window decoration for GNOME desktop/GTK apps w/ Mojave-dark theme, it will look similar to how MacOS windows edge look like. Should work well with Adwaita theme.

Screenshot (using AdwaitaEx theme)

screenshot

Rounded teriminal corner is not included, it is from https://github.com/owozsh/adwaita-rounded

@rbreaves
rbreaves / com.startup.startup.plist
Created December 5, 2022 05:21
Remap right cmd key to backspace (macos)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:</string>
</dict>
<key>Label</key>
@rbreaves
rbreaves / Instructions
Created August 18, 2022 05:07
Linux - VSCode - Sublime Text 3 conversion for keymappings, plus some
Edit ~/.config/kinto/kinto.py
Summary
- Find Sublime Texts app name in the file & then add it to the array that contains the VSCode app names (aka VSCodium), add it to the array.
- Then relocate the VSCode group name filter to the Sublime one and comment out the VSCode code block so that VSCode remaps no longer occur.
@rbreaves
rbreaves / toggleTerminalProfile.scpt
Created August 16, 2022 03:14
Applescript to toggle iterm2 profile
tell application "System Events"
# Sets Alt ~ combo to toggle iterm2
key code 50 using {option down}
end tell
@rbreaves
rbreaves / Preferences.sublime-settings
Created August 11, 2022 04:05
macOS Sublime Text 3/4 Preferences
/*
~/Library/Application Support/Sublime Text/Preferences.sublime-settings
On OS X, basic text manipulations (left, right, command+left, etc) make use of the system key bindings,
and don't need to be repeated here. Anything listed here will take precedence, however.
*/
[
{ "keys": ["super+shift+n"], "command": "new_window" },
{ "keys": ["super+shift+w"], "command": "close_window" },
{ "keys": ["super+alt+shift+n"], "command": "new_os_tab" },
{ "keys": ["ctrl+alt+tab"], "command": "next_os_tab" },
@rbreaves
rbreaves / toggleTerminal.scpt
Created July 20, 2022 18:17
Allow macOS to toggle Terminal window on hotkey
set appName to "Terminal"
tell application "System Events"
if visible of application process appName is true then
set visible of application process appName to false
else
set visible of application process appName to true
set frontmost of application process appName to true
end if
end tell
@rbreaves
rbreaves / README.md
Last active September 30, 2022 23:32 — forked from djfdyuruiry/README.md
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

cd /tmp

#/bin/bash
# Clone, compile & install
git clone --single-branch --branch Super-with-Scrolling https://github.com/rbreaves/x11vnc.git
# Enable all sources
sudo sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list"
cd ./x11vnc
sudo apt update
@rbreaves
rbreaves / Preferences.sublime-settings
Created May 26, 2022 22:57
Preferences.sublime-settings - Windows
[
{ "keys": ["ctrl+shift+n"], "command": "new_window" },
{ "keys": ["ctrl+shift+w"], "command": "close_window" },
{ "keys": ["ctrl+o"], "command": "prompt_open_file" },
{ "keys": ["ctrl+shift+t"], "command": "reopen_last_file" },
{ "keys": ["alt+o"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"]} },
{ "keys": ["alt+shift+o"], "command": "switch_file", "args": {"extensions": ["cpp", "cxx", "cc", "c", "hpp", "hxx", "hh", "h", "ipp", "inl", "m", "mm"], "side_by_side": true} },
{ "keys": ["ctrl+n"], "command": "new_file" },
{ "keys": ["ctrl+s"], "command": "save", "args": { "async": true } },
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" },