From 4504c8e6adb7ed4a2839bfbf6e3a2d0672998db7 Mon Sep 17 00:00:00 2001 From: Rokas Puzonas Date: Sun, 4 Jun 2023 16:32:00 +0300 Subject: [PATCH] initial commit --- adjust-brightness | 3 +++ cleanup-home | 41 +++++++++++++++++++++++++++++++++++++++++ disable-sleep | 4 ++++ enable-sleep | 3 +++ pac-cleanup | 11 +++++++++++ screenshot | 2 ++ setup-task-aoc.sh | 26 ++++++++++++++++++++++++++ task-add-daily | 2 ++ task-add-monthly | 2 ++ task-add-quaterly | 2 ++ task-add-weekly | 2 ++ task-add-yearly | 2 ++ tmux-sessionizer | 25 +++++++++++++++++++++++++ 13 files changed, 125 insertions(+) create mode 100644 adjust-brightness create mode 100755 cleanup-home create mode 100755 disable-sleep create mode 100755 enable-sleep create mode 100755 pac-cleanup create mode 100755 screenshot create mode 100755 setup-task-aoc.sh create mode 100755 task-add-daily create mode 100755 task-add-monthly create mode 100755 task-add-quaterly create mode 100755 task-add-weekly create mode 100755 task-add-yearly create mode 100755 tmux-sessionizer diff --git a/adjust-brightness b/adjust-brightness new file mode 100644 index 0000000..571d78e --- /dev/null +++ b/adjust-brightness @@ -0,0 +1,3 @@ +To list screens: xrandr --prop | grep " connected" +To set brightness: xrandr --output HDMI2 --brightness 0.4 + diff --git a/cleanup-home b/cleanup-home new file mode 100755 index 0000000..527354e --- /dev/null +++ b/cleanup-home @@ -0,0 +1,41 @@ +#!/bin/sh +trash ~/.python_history* +trash ~/.xsession-errors* +trash ~/.rnd +trash ~/.viminfo +trash ~/.wget-hsts +trash ~/.rediscli_history +trash ~/.pydoro.ini +trash ~/.odbc.ini +trash ~/.octave_hist +trash ~/.nuxtrc +trash ~/.node_repl_history +trash ~/.NERDTreeBookmarks +trash ~/.mongorc.js +trash ~/.lyxauth +trash ~/.lyrics +trash ~/.lesshst +trash ~/.festival_history +trash ~/.emulator_console_auth_token +trash ~/.babel.json +trash ~/.awesome-client_history +# trash ~/.adventofcode.session +trash ~/.zoom +trash ~/.fromscratch +trash ~/.templateengine +trash ~/.pork +trash ~/.subversion +trash ~/.ngrok +trash ~/.putty +trash ~/.pylint.d +trash ~/.IdeaIC2019.3 +trash ~/.ColorGrab +trash ~/.ccemuredux +trash ~/.designer +trash ~/.mcreator +trash ~/.runelite +trash ~/.osbuddy +trash ~/.paradoxlauncher +trash ~/.gnomato +trash ~/.gnome +trash ~/.genius diff --git a/disable-sleep b/disable-sleep new file mode 100755 index 0000000..72304e8 --- /dev/null +++ b/disable-sleep @@ -0,0 +1,4 @@ +#!/bin/sh +sudo -A systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target +sudo xset s off +sudo xset s 0 diff --git a/enable-sleep b/enable-sleep new file mode 100755 index 0000000..c9f818a --- /dev/null +++ b/enable-sleep @@ -0,0 +1,3 @@ +#!/bin/sh +sudo -A systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target +sudo xset s on diff --git a/pac-cleanup b/pac-cleanup new file mode 100755 index 0000000..8aab7d1 --- /dev/null +++ b/pac-cleanup @@ -0,0 +1,11 @@ +#!/bin/bash + +[[ `whoami` != "root" ]] && echo "Must be root." && exit 1 + +echo -e "\e[1;36mCleaning package caches\e[0m" + +# All packages +paccache -rk3 -c /var/cache/pacman/pkg + +# Uninstalled packages +paccache -ruk1 -c /var/cache/pacman/pkg diff --git a/screenshot b/screenshot new file mode 100755 index 0000000..168fb04 --- /dev/null +++ b/screenshot @@ -0,0 +1,2 @@ +#!/bin/sh +maim -s | xclip -selection clipboard -t image/png diff --git a/setup-task-aoc.sh b/setup-task-aoc.sh new file mode 100755 index 0000000..492eac5 --- /dev/null +++ b/setup-task-aoc.sh @@ -0,0 +1,26 @@ +# Create 25 recurring tasks for each advent of code day +task add AOC day 1 recur:yearly due:2021-12-02T00:00-05:00 until:2022-01-01 wait:2021-12-01T00:00-05:00 +task add AOC day 2 recur:yearly due:2021-12-03T00:00-05:00 until:2022-01-01 wait:2021-12-02T00:00-05:00 +task add AOC day 3 recur:yearly due:2021-12-04T00:00-05:00 until:2022-01-01 wait:2021-12-03T00:00-05:00 +task add AOC day 4 recur:yearly due:2021-12-05T00:00-05:00 until:2022-01-01 wait:2021-12-04T00:00-05:00 +task add AOC day 5 recur:yearly due:2021-12-06T00:00-05:00 until:2022-01-01 wait:2021-12-05T00:00-05:00 +task add AOC day 6 recur:yearly due:2021-12-07T00:00-05:00 until:2022-01-01 wait:2021-12-06T00:00-05:00 +task add AOC day 7 recur:yearly due:2021-12-08T00:00-05:00 until:2022-01-01 wait:2021-12-07T00:00-05:00 +task add AOC day 8 recur:yearly due:2021-12-09T00:00-05:00 until:2022-01-01 wait:2021-12-08T00:00-05:00 +task add AOC day 9 recur:yearly due:2021-12-10T00:00-05:00 until:2022-01-01 wait:2021-12-09T00:00-05:00 +task add AOC day 10 recur:yearly due:2021-12-11T00:00-05:00 until:2022-01-01 wait:2021-12-10T00:00-05:00 +task add AOC day 11 recur:yearly due:2021-12-12T00:00-05:00 until:2022-01-01 wait:2021-12-11T00:00-05:00 +task add AOC day 12 recur:yearly due:2021-12-13T00:00-05:00 until:2022-01-01 wait:2021-12-12T00:00-05:00 +task add AOC day 13 recur:yearly due:2021-12-14T00:00-05:00 until:2022-01-01 wait:2021-12-13T00:00-05:00 +task add AOC day 14 recur:yearly due:2021-12-15T00:00-05:00 until:2022-01-01 wait:2021-12-14T00:00-05:00 +task add AOC day 15 recur:yearly due:2021-12-16T00:00-05:00 until:2022-01-01 wait:2021-12-15T00:00-05:00 +task add AOC day 16 recur:yearly due:2021-12-17T00:00-05:00 until:2022-01-01 wait:2021-12-16T00:00-05:00 +task add AOC day 17 recur:yearly due:2021-12-18T00:00-05:00 until:2022-01-01 wait:2021-12-17T00:00-05:00 +task add AOC day 18 recur:yearly due:2021-12-19T00:00-05:00 until:2022-01-01 wait:2021-12-18T00:00-05:00 +task add AOC day 19 recur:yearly due:2021-12-20T00:00-05:00 until:2022-01-01 wait:2021-12-19T00:00-05:00 +task add AOC day 20 recur:yearly due:2021-12-21T00:00-05:00 until:2022-01-01 wait:2021-12-20T00:00-05:00 +task add AOC day 21 recur:yearly due:2021-12-22T00:00-05:00 until:2022-01-01 wait:2021-12-21T00:00-05:00 +task add AOC day 22 recur:yearly due:2021-12-23T00:00-05:00 until:2022-01-01 wait:2021-12-22T00:00-05:00 +task add AOC day 23 recur:yearly due:2021-12-24T00:00-05:00 until:2022-01-01 wait:2021-12-23T00:00-05:00 +task add AOC day 24 recur:yearly due:2021-12-25T00:00-05:00 until:2022-01-01 wait:2021-12-24T00:00-05:00 +task add AOC day 25 recur:yearly due:2021-12-26T00:00-05:00 until:2022-01-01 wait:2021-12-25T00:00-05:00 diff --git a/task-add-daily b/task-add-daily new file mode 100755 index 0000000..9e85d39 --- /dev/null +++ b/task-add-daily @@ -0,0 +1,2 @@ +#!/bin/sh +task add +DAILY_GOAL due:eod $@ diff --git a/task-add-monthly b/task-add-monthly new file mode 100755 index 0000000..c406aff --- /dev/null +++ b/task-add-monthly @@ -0,0 +1,2 @@ +#!/bin/sh +task add +MONTHLY_GOAL due:eom $@ diff --git a/task-add-quaterly b/task-add-quaterly new file mode 100755 index 0000000..15cf820 --- /dev/null +++ b/task-add-quaterly @@ -0,0 +1,2 @@ +#!/bin/sh +task add +QUARTERLTY_GOAL due:eoq $@ diff --git a/task-add-weekly b/task-add-weekly new file mode 100755 index 0000000..d904f71 --- /dev/null +++ b/task-add-weekly @@ -0,0 +1,2 @@ +#!/bin/sh +task add +WEEKLY_GOAL due:eow $@ diff --git a/task-add-yearly b/task-add-yearly new file mode 100755 index 0000000..fdaf3b3 --- /dev/null +++ b/task-add-yearly @@ -0,0 +1,2 @@ +#!/bin/sh +task add +YEARLY_GOAL due:eoy $@ diff --git a/tmux-sessionizer b/tmux-sessionizer new file mode 100755 index 0000000..7631ba4 --- /dev/null +++ b/tmux-sessionizer @@ -0,0 +1,25 @@ +#!/usr/bin/env zsh + +if [[ $# -eq 1 ]]; then + selected=$1 +else + selected=$(ls-repos ~/code | fzf) +fi + +if [[ -z $selected ]]; then + exit 0 +fi + +selected_name=$(basename "$selected" | tr . _) +tmux_running=$(pgrep tmux) + +if [[ -z $TMUX ]] && [[ -z $tmux_running ]]; then + tmux new-session -s $selected_name -c $selected + exit 0 +fi + +if ! tmux has-session -t=$selected_name 2> /dev/null; then + tmux new-session -ds $selected_name -c $selected +fi + +tmux switch-client -t $selected_name