From 50042dc9c0bad9074a429418352c3d2e3bf01d76 Mon Sep 17 00:00:00 2001 From: Severin Kaderli Date: Mon, 25 Feb 2019 15:44:33 +0100 Subject: [PATCH] Add new scripts Signed-off-by: Severin Kaderli --- install.sh | 1 - system/.config/X11/xresources | 3 ++ system/.config/X11/xsetup | 2 +- system/.config/compton/compton.conf | 1 - system/.config/cron/crontab | 3 +- system/.config/custom/aliases | 9 +++-- system/.config/i3/config | 6 ++-- system/.config/redshift/redshift.conf | 2 +- system/.local/bin/games.sh | 32 +++++++++++++++++ system/.local/bin/power.sh | 52 +++++++++++++-------------- system/.local/bin/sync_notes.sh | 19 ++++++++++ 11 files changed, 95 insertions(+), 35 deletions(-) create mode 100755 system/.local/bin/games.sh create mode 100755 system/.local/bin/sync_notes.sh diff --git a/install.sh b/install.sh index d6c9961..eaaebfa 100755 --- a/install.sh +++ b/install.sh @@ -45,7 +45,6 @@ LINKED_FILES_HOME=( ".config/mpv" ".config/npm" ".config/polybar" - ".config/pulse" ".config/python" ".config/redshift" ".config/streamlink" diff --git a/system/.config/X11/xresources b/system/.config/X11/xresources index e3f690b..f959740 100644 --- a/system/.config/X11/xresources +++ b/system/.config/X11/xresources @@ -19,3 +19,6 @@ rofi.color-normal: #273238, #c1c1c1, #273238, #394249, #ffffff rofi.color-active: #273238, #80cbc4, #273238, #394249, #80cbc4 rofi.color-urgent: #273238, #ff1844, #273238, #394249, #ff1844 rofi.seperator-style: solid +rofi.opacity: 100 +rofi.location: 2 +rofi.yoffset: 35 \ No newline at end of file diff --git a/system/.config/X11/xsetup b/system/.config/X11/xsetup index 0625114..8854f3a 100644 --- a/system/.config/X11/xsetup +++ b/system/.config/X11/xsetup @@ -23,7 +23,7 @@ setxkbmap -model pc105 -layout ch nm-applet & # Start redshift -redshift & +redshift-gtk & # Merge .Xresources on boot xrdb -merge "${XDG_CONFIG_HOME}/X11/xresources" diff --git a/system/.config/compton/compton.conf b/system/.config/compton/compton.conf index d6b4676..99939aa 100644 --- a/system/.config/compton/compton.conf +++ b/system/.config/compton/compton.conf @@ -24,5 +24,4 @@ glx-copy-from-front = false; glx-swap-method = "undefined"; refresh-rate = 0; vsync = "none"; -sw-opti = true; xrender-sync-fence = true; \ No newline at end of file diff --git a/system/.config/cron/crontab b/system/.config/cron/crontab index 6dbb183..9fe056a 100644 --- a/system/.config/cron/crontab +++ b/system/.config/cron/crontab @@ -11,4 +11,5 @@ # This file is loaded on boot by crontab. # Synchronize Google Drive every 30 minutes -*/30 * * * * grive -d -p /home/severin/GoogleDrive/ >> $XDG_LOG_HOME/cron.log 2>&1 +*/30 * * * * grive -d -p /home/severin/GoogleDrive/ >> /home/severin/.local/log/cron.log 2>&1 +*/5 * * * * /home/severin/.local/bin/sync_notes.sh >> /home/severin/.local/log/notes.log 2>&1 diff --git a/system/.config/custom/aliases b/system/.config/custom/aliases index ce41b94..ed15e2d 100644 --- a/system/.config/custom/aliases +++ b/system/.config/custom/aliases @@ -15,8 +15,10 @@ # Alias for clear because I sometimes type the DOS command instead alias cls="clear" -# Alias for using exa as ls replacement -alias ls="exa -l" +# Alias for using lsd as ls replacement +alias ls='lsd' +alias la="ls -al" +alias lt="ls --tree" # Alias for using ripgrep as grep replacement alias grep="rg -n" @@ -27,6 +29,9 @@ alias cat="bat" # Alias to get to my Projects folder alias pj="cd ~/Projects" +# Alias to get to my Downloads folder +alias dl="cd ~/Downloads" + # Alias for opening my code editor alias e="code" diff --git a/system/.config/i3/config b/system/.config/i3/config index 3bd6ef1..0b819f9 100644 --- a/system/.config/i3/config +++ b/system/.config/i3/config @@ -43,8 +43,9 @@ bindsym $mod+Return exec termite -c ~/.config/termite/config # kill focused window bindsym $mod+Shift+q kill -# Start rofi -bindsym $mod+r exec rofi -show run -opacity 100 -lines 5 -location 2 +# Rofi menus +bindsym $mod+r exec rofi -show run -lines 5 +bindsym $mod+g exec games.sh # change focus bindsym $mod+Left focus left @@ -221,6 +222,7 @@ exec discord exec nemo exec nemo exec keepassxc +exec notable exec termite -e cmus --name cmus # Assign programs to specific workspaces diff --git a/system/.config/redshift/redshift.conf b/system/.config/redshift/redshift.conf index 217b179..1f911ba 100644 --- a/system/.config/redshift/redshift.conf +++ b/system/.config/redshift/redshift.conf @@ -12,7 +12,7 @@ [redshift] ; Set the day and night screen temperatures temp-day=5700 -temp-night=4000 +temp-night=3700 ; Disable the smooth fade between temperatures when Redshift starts and stops. ; 0 will cause an immediate change between screen temperatures. diff --git a/system/.local/bin/games.sh b/system/.local/bin/games.sh new file mode 100755 index 0000000..d12f776 --- /dev/null +++ b/system/.local/bin/games.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# SCRIPT NAME: +# games.sh +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Displays a game menu using rofi. +# +# USAGE: +# ./games.sh + +# The rofi prompt +PROMPT="Games" + +# Actions for the menu +ACTIONS=( + "1: Steam" + "2: Guild Wars 2" +) + +SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -p "${PROMPT}" | cut -d ":" -f1) +case "${SELECTION}" in + "1") + steam + ;; + "2") + g2.sh + ;; +esac diff --git a/system/.local/bin/power.sh b/system/.local/bin/power.sh index 723e7a2..8588092 100755 --- a/system/.local/bin/power.sh +++ b/system/.local/bin/power.sh @@ -7,36 +7,36 @@ # Severin Kaderli # # DESCRIPTION: -# Displays a power menu using zenity. +# Displays a power menu using rofi. # # USAGE: # ./power.sh -TEXT="Choose action" -WIDTH=400 -HEIGHT=300 +# The rofi prompt +PROMPT="Power Options" + +# Actions for the menu ACTIONS=( - "Reboot" - "Shutdown" - "Performance Mode" - "Powersave Mode" + "1: Reboot" + "2: Shutdown" + "3: Performance Mode" + "4: Powersave Mode" ) -action=$(zenity --list --width="${WIDTH}" --height="${HEIGHT}" --text="${TEXT}" --column="Action" "${ACTIONS[@]}") - -if [ "${action}" == "Reboot" ] -then - systemctl reboot -elif [ "${action}" == "Shutdown" ] -then - systemctl poweroff -elif [ "${action}" == "Performance Mode" ] -then - gksudo "cpupower frequency-set -g performance" - optirun -b primus nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=2' -c :8 > /dev/null -elif [ "${action}" == "Powersave Mode" ] -then - gksudo "cpupower frequency-set -g powersave" - optirun -b primus nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=0' -c :8 > /dev/null -fi - +SELECTION=$(printf '%s\n' "${ACTIONS[@]}" | rofi -dmenu -p "${PROMPT}" | cut -d ":" -f1) +case "${SELECTION}" in + "1") + systemctl reboot + ;; + "2") + systemctl poweroff + ;; + "3") + gksudo "cpupower frequency-set -g performance" + optirun -b primus nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=2' -c :8 > /dev/null + ;; + "4") + gksudo "cpupower frequency-set -g powersave" + optirun -b primus nvidia-settings -a '[gpu:0]/GPUPowerMizerMode=0' -c :8 > /dev/null + ;; +esac diff --git a/system/.local/bin/sync_notes.sh b/system/.local/bin/sync_notes.sh new file mode 100755 index 0000000..77d3af0 --- /dev/null +++ b/system/.local/bin/sync_notes.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# +# SCRIPT NAME: +# sync_notes.sh +# +# AUTHOR: +# Severin Kaderli +# +# DESCRIPTION: +# Sync notes in ~/Notes using git +# +# USAGE: +# ./sync_notes.sh +# Set custom wineprefix +cd "/home/severin/Notes" +git pull +git add --all +git commit -s -m "Update notes" +git push origin master