From d391fd360a5793963cf21b9748a993e48a2703cf Mon Sep 17 00:00:00 2001 From: Ian Mancini Date: Sun, 12 Apr 2020 13:59:12 -0300 Subject: [PATCH] Bring back old scripts --- bg-feh | 13 +++++++++++++ launch-dunst | 14 ++++++++++++++ launch-polybar | 14 ++++++++++++++ rofi-xrandr | 17 +++++++++++++++++ scrot-area | 5 +++++ scrot-screen | 4 ++++ set-keymap | 5 +++++ 7 files changed, 72 insertions(+) create mode 100755 bg-feh create mode 100755 launch-dunst create mode 100755 launch-polybar create mode 100755 rofi-xrandr create mode 100755 scrot-area create mode 100755 scrot-screen create mode 100755 set-keymap diff --git a/bg-feh b/bg-feh new file mode 100755 index 0000000..23d0975 --- /dev/null +++ b/bg-feh @@ -0,0 +1,13 @@ +#!/bin/sh + +[ -f "$1" ] || exit 1 + +if [ -d $1 ]; then + bg=$(ls $1 | shuf -n 1) +elif [ -f $1 ]; then + bg=$1 +else + exit 1 +fi + +feh --bg-fill "$bg" diff --git a/launch-dunst b/launch-dunst new file mode 100755 index 0000000..35e7664 --- /dev/null +++ b/launch-dunst @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q dunst + +# Wait until the processes have been shut down +while pgrep -x dunst > /dev/null; do sleep 1; done + +# Launch bar1 and bar2 + +dunst & + +echo "Dunst launched..." +notify-send "Dunst launched" diff --git a/launch-polybar b/launch-polybar new file mode 100755 index 0000000..4a4a4e2 --- /dev/null +++ b/launch-polybar @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +# Terminate already running bar instances +killall -q polybar + +# Wait until the processes have been shut down +while pgrep -x polybar > /dev/null; do sleep 1; done + +# Launch bar1 and bar2 + +polybar bar & + +echo "Bar launched..." + diff --git a/rofi-xrandr b/rofi-xrandr new file mode 100755 index 0000000..8bf5740 --- /dev/null +++ b/rofi-xrandr @@ -0,0 +1,17 @@ +#!/bin/bash + +OPTIONS="Laptop\nHDMI\nVGA\nDual (Laptop main + HDMI)\nDual (HDMI main + laptop)\nDual (VGA main + laptop)\nDual (Laptop main + VGA)\nManual" + +SELECTED=$(echo -e $OPTIONS | rofi -dmenu -i -p "xrandr") + +case "$SELECTED" in + Laptop) xrandr --output eDP-1 --auto --output HDMI-2 --off --output DP-1 --off;; + HDMI) xrandr --output HDMI-2 --auto --output eDP-1 --off --output DP-1 --off;; + VGA) xrandr --output DP-1 --auto --output HDMI-2 --off --output eDP-1 --off;; + "Dual (Laptop main + HDMI)") xrandr --output eDP-1 --primary --auto --output HDMI-2 --auto --right-of eDP-1 --output DP-1 --off;; + "Dual (Laptop main + VGA)") xrandr --output eDP-1 --primary --auto --output DP-1 --auto --right-of eDP-1 --output HDMI-2 --off;; + "Dual (HDMI main + laptop)") xrandr --output eDP-1 --auto --output DP-1 --off --output HDMI-2 --auto --primary --left-of eDP-1;; + "Dual (VGA main + laptop)") xrandr --output eDP-1 --auto --output DP-1 --auto --primary --left-of eDP-1;; + Manual) arandr;; +esac + diff --git a/scrot-area b/scrot-area new file mode 100755 index 0000000..b5b72f7 --- /dev/null +++ b/scrot-area @@ -0,0 +1,5 @@ +#! /bin/bash +FILENAME=`date +%Y-%m-%d-%H-%M-%S`.png +scrot -d 0.1 -selection $FILENAME -e 'xclip -selection clipboard -t image/png $f && mv $f ~/Pictures/screenshots/' +notify-send "📷 Saved screenshot as $FILENAME" + diff --git a/scrot-screen b/scrot-screen new file mode 100755 index 0000000..86accae --- /dev/null +++ b/scrot-screen @@ -0,0 +1,4 @@ +#! /bin/bash +FILENAME=`date +%Y-%m-%d-%H-%M-%S`.png +scrot -d 0.1 "$FILENAME" -e 'xclip -selection clipboard -t image/png $f && mv $f ~/Pictures/screenshots/' +notify-send "📷 Saved screenshot as $FILENAME" diff --git a/set-keymap b/set-keymap new file mode 100755 index 0000000..b9928ec --- /dev/null +++ b/set-keymap @@ -0,0 +1,5 @@ +#!/bin/sh + +# Enable switch between keyboard layouts using setxkbmap + +setxkbmap -model pc105 -layout us,es -option grp:alt_shift_toggle