Skip to content

Instantly share code, notes, and snippets.

{
"remote.SSH.useLocalServer": false,
"workbench.colorTheme": "Catppuccin Frappé",
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
"workbench.list.smoothScrolling": true,
"terminal.integrated.smoothScrolling": true,
"svelte.enable-ts-plugin": true,
"editor.minimap.enabled": false,
"editor.lineNumbers": "relative",
@stefanwatt
stefanwatt / switchResolution.sh
Created February 11, 2023 01:46
switch resolution
#!/bin/bash
mode1="3440x1440"
mode2="1920x1080"
output="HDMI-1"
currentMode=$(xrandr | sed '/\s[0-9].*\*/!d' | awk '{print $1}')
newMode=$mode1
if [[ $currentMode == $mode1 ]]
then
newMode=$mode2
@stefanwatt
stefanwatt / xrandr.mjs
Created February 11, 2023 01:16
xrandr startup
#!/usr/bin/env node
import childProcess from "node:child_process";
import { promisify } from "util";
const exec = promisify(childProcess.exec);
const {stdout,stderr} = await exec('xrandr')
const xrandrLines=stdout.split('\n')
const hdmiLine = xrandrLines.find(line => line.includes('HDMI-1'))
@stefanwatt
stefanwatt / switchResolution.mjs
Created February 11, 2023 01:16
switch resolution
#!/usr/bin/env node
import childProcess from "node:child_process";
import { promisify } from "util";
const UWQHD = '3440x1440'
const FHD = '1920x1080'
const OUTPUT = 'HDMI-1'
const exec = promisify(childProcess.exec);
@stefanwatt
stefanwatt / keybindings.json
Created February 11, 2023 01:15
vscodvim keybindings
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "shift+right",
"command": "workbench.action.nextEditor",
"when": "!editorFocus || inputFocus && vim.mode == 'Normal'"
},
{
"key": "ctrl+pagedown",
"command": "-workbench.action.nextEditor"
@stefanwatt
stefanwatt / settings.json
Created February 11, 2023 01:14
vscodevim settings
{
"remote.SSH.useLocalServer": false,
"remote.SSH.remotePlatform": {
"vDuc": "windows"
},
"workbench.colorTheme": "Catppuccin Frappé",
"editor.cursorSmoothCaretAnimation": "on",
"editor.smoothScrolling": true,
"workbench.list.smoothScrolling": true,
"terminal.integrated.smoothScrolling": true,
@stefanwatt
stefanwatt / .zshrc
Created October 13, 2022 19:46
.zshrc
# Personal Zsh configuration file. It is strongly recommended to keep all
# shell customization and configuration (including exported environment
# variables such as PATH) in this file or in files sourced from it.
#
# Documentation: https://github.com/romkatv/zsh4humans/blob/v5/README.md.
# Periodic auto-update on Zsh startup: 'ask' or 'no'.
# You can manually run `z4h update` to update everything.
zstyle ':z4h:' auto-update 'no'
# Ask whether to auto-update this often; has no effect if auto-update is 'no'.
@stefanwatt
stefanwatt / changeAudioDevice.mjs
Created August 7, 2022 09:37
script to alternate between 2 audio devices
#!/usr/bin/env node
import childProcess from 'node:child_process';
import { promisify } from 'util';
const allowedSinks = ['PRO X Wireless Gaming Headset Analog Stereo', 'SoundCore 2']
const exec = promisify(childProcess.exec);
const switchInputToSink= async (input,sink) =>{
await exec(`ponymix -t sink-input -d ${input} move ${sink}`)