Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
OUTPUT_MONITOR=$(xrandr | grep -w connected | grep -v 1920x1080 | awk '{print $1}')
MODE_NAME="1680x1050_60"
# from: gtf 1680 1050 60
#
# # 1680x1050 @ 60.00 Hz (GTF) hsync: 65.22 kHz; pclk: 147.14 MHz
# Modeline "1680x1050_60.00" 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
#
xrandr --newmode $MODE_NAME 147.14 1680 1784 1968 2256 1050 1051 1054 1087 -HSync +Vsync
@emachado
emachado / gist:691e1c01a88dd9a16356468efcac5a9f
Created October 15, 2020 09:11
controlling spotify via dbus-send
# listing names
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
#(...)
# string "org.mpris.MediaPlayer2.spotify"
#(...)
# controlling play/pause, next and previous
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause
dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.Next
@emachado
emachado / orangepi-mini.md
Last active January 30, 2018 00:42
orangepi mini armbian install

Download Armbian image:

http://www.armbian.com/orange-pi-mini/

Preparing 2gb microsd card:

sudo dd if=./Armbian_5.38_Bananapi_Debian_stretch_next_4.14.14.img of=/dev/mmcblk0

Accessing orangepi (root's password: 1234):

@emachado
emachado / orangepi mini asound.conf
Created March 29, 2017 16:31
orangepi mini /etc/asound.conf for orangepi mini to use alternative sound output (webcam)
defaults.pcm.card 1
defaults.ctl.card 1
@emachado
emachado / Fedora 27 ARM Pandaboard install
Last active January 17, 2018 09:50
Fedora 25 ARM Pandaboard install
Source
https://fedoraproject.org/wiki/Architectures/ARM/F23/Installation#Manual
Choose a disk image.
Fedora 23:
http://download.fedoraproject.org/pub/fedora/linux/releases/23/Images/armhfp/
Fedora 25:
http://fedora.c3sl.ufpr.br/linux/releases/25/Spins/armhfp/images/Fedora-Xfce-armhfp-25-1.3-sda.raw.xz
Fedora 27:
U-Boot SPL 2014.04-10693-gf954935 (Aug 06 2014 - 11:18:37)
Board: Bananapi
DRAM: 1024 MiB
Failed to set core voltage! Can't set CPU frequency
spl: not an uImage at 1600
U-Boot 2014.04-10693-gf954935 (Aug 06 2014 - 11:18:37) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
U-Boot SPL 2015.04-rc1-00004-g7f641d5-dirty (Feb 06 2015 - 15:41:13)
DRAM: 1024 MiB
CPU: 960000000Hz, AXI/AHB/APB: 3/2/2
U-Boot 2015.04-rc1-00004-g7f641d5-dirty (Feb 06 2015 - 15:41:13) Allwinner Technology
CPU: Allwinner A20 (SUN7I)
I2C: ready
DRAM: 1015 MiB