Skip to content

Instantly share code, notes, and snippets.

View brospars's full-sized avatar

Benoit Rospars brospars

View GitHub Profile
@brospars
brospars / bye.md
Created March 21, 2018 08:12
Ubuntu : lock session and go to sleep

This alias lock the session (lightdm) and enter sleep mode

# Lock session and go to sleep
alias bye='function _bye(){ dm-tool lock; sleep 10; sudo pm-suspend;};_bye'
@brospars
brospars / switch_monitor.md
Created March 21, 2018 08:09
Switch between monitor configurations

Make an alias in $HOME/.bash_aliases

# switch monitor mode
alias sm='function _switch_monitor(){ $HOME/switch_monitor.sh $1;};_switch_monitor'

Here is an example of xrandr settings for switching between the built-in screen and the dual screen config (built-in uses a new mode no present by default)

#!/bin/bash
@brospars
brospars / github-pages-setup
Created October 16, 2015 11:21
Github pages in subfolder "demo/"
// Create Github Page branch
git checkout -b gh-pages
git push origin gh-pages
// Update Github Page branch from master
git checkout gh-pages
git pull .master
git push origin gh-pages
git checkout master