file get_updated
This commit is contained in:
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
brightnessctl | awk '/Current/{print substr($NF, 2, length($NF) -2)}'
|
||||
Executable
+14
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
case $1 in
|
||||
d) cliphist list | rofi -dmenu -replace -config ~/.dotfiles/home/configs/rofi/config-cliphist.rasi | cliphist delete
|
||||
;;
|
||||
|
||||
w) if [ `echo -e "Clear\nCancel" | rofi -dmenu -config ~/.dotfiles/home/configs/rofi/config-short.rasi` == "Clear" ] ; then
|
||||
cliphist wipe
|
||||
fi
|
||||
;;
|
||||
|
||||
*) cliphist list | rofi -dmenu -replace -config ~/.dotfiles/home/configs/rofi/config-cliphist.rasi | cliphist decode | wl-copy
|
||||
;;
|
||||
esac
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/run/current-system/sw/bin/python
|
||||
import os.path
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
def get_last_updated():
|
||||
lock_file = f"{os.path.expanduser('~')}/.dotfiles/flake.lock"
|
||||
updated = datetime.fromtimestamp(os.path.getmtime(lock_file))
|
||||
today = datetime.now()
|
||||
last_updated = (today - updated).days
|
||||
if last_updated == 1:
|
||||
print(f'{last_updated} day')
|
||||
else:
|
||||
print(f'{last_updated} days')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
get_last_updated()
|
||||
|
||||
Executable
+48
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# If an instance of wf-recorder is running under this user kill it with SIGINT and exit
|
||||
pkill --euid "$USER" --signal SIGINT wf-recorder && exit
|
||||
|
||||
# Define paths
|
||||
DefaultSaveDir=$HOME'/Videos'
|
||||
TmpPathPrefix='/tmp/gif-record'
|
||||
TmpRecordPath=$TmpPathPrefix'-cap.mp4'
|
||||
TmpPalettePath=$TmpPathPrefix'-palette.png'
|
||||
|
||||
# Trap for cleanup on exit
|
||||
OnExit() {
|
||||
[[ -f $TmpRecordPath ]] && rm -f "$TmpRecordPath"
|
||||
[[ -f $TmpPalettePath ]] && rm -f "$TmpPalettePath"
|
||||
}
|
||||
trap OnExit EXIT
|
||||
|
||||
# Set umask so tmp files are only acessible to the user
|
||||
umask 177
|
||||
|
||||
# Get selection and honor escape key
|
||||
Coords=$(slurp) || exit
|
||||
|
||||
# Capture video using slurp for screen area
|
||||
# timeout and exit after 10 minutes as user has almost certainly forgotten it's running
|
||||
timeout 600 wf-recorder -g "$Coords" -f "$TmpRecordPath" || exit
|
||||
|
||||
# Get the filename from the user and honor cancel
|
||||
SavePath=$( zenity \
|
||||
--file-selection \
|
||||
--save \
|
||||
--confirm-overwrite \
|
||||
--file-filter=*.gif \
|
||||
--filename="$DefaultSaveDir"'/.gif' \
|
||||
) || exit
|
||||
|
||||
# Append .gif to the SavePath if it's missing
|
||||
[[ $SavePath =~ \.gif$ ]] || SavePath+='.gif'
|
||||
|
||||
# Produce a pallete from the video file
|
||||
ffmpeg -i "$TmpRecordPath" -filter_complex "palettegen=stats_mode=full" "$TmpPalettePath" -y || exit
|
||||
|
||||
# Return umask to default
|
||||
umask 022
|
||||
|
||||
# Use pallete to produce a gif from the video file
|
||||
ffmpeg -i "$TmpRecordPath" -i "$TmpPalettePath" -filter_complex "paletteuse=dither=sierra2_4a" "$SavePath" -y || exit
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
rofi -modi "clipboard:greenclip print" -show clipboard -replace -config ~/.dotfiles/home/configs/rofi/config-cliphist.rasi -run-command '{cmd}'
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
DIR="$HOME/Pictures/screenshots/"
|
||||
NAME="screenshot_$(date +%d%m%Y_%H%M%S).png"
|
||||
|
||||
option2="Selected area"
|
||||
option3="Fullscreen (delay 3 sec)"
|
||||
|
||||
options="$option2\n$option3"
|
||||
|
||||
choice=$(echo -e "$options" | rofi -dmenu -replace -config ~/.dotfiles/home/configs/rofi/config-screenshot.rasi -i -no-show-icons -l 2 -width 30 -p "Take Screenshot")
|
||||
|
||||
case $choice in
|
||||
$option2)
|
||||
grim -g "$(slurp)" - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Selected area"
|
||||
;;
|
||||
$option3)
|
||||
sleep 3
|
||||
grim - | swappy -f -
|
||||
notify-send "Screenshot created" "Mode: Fullscreen"
|
||||
;;
|
||||
esac
|
||||
Executable
+52
@@ -0,0 +1,52 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
state=`cat /sys/class/power_supply/AC/online`
|
||||
|
||||
if [ $state == "1" ]
|
||||
then
|
||||
echo $(system76-power charge-thresholds)
|
||||
echo ""
|
||||
echo "Select a Charge Threshold"
|
||||
select threshold in "Full Charge" "Balanced" "Max Lifespan" "Quit"
|
||||
do
|
||||
case $threshold in
|
||||
"Full Charge")
|
||||
system76-power charge-thresholds --profile full_charge
|
||||
break;;
|
||||
"Balanced")
|
||||
system76-power charge-thresholds --profile balanced
|
||||
break;;
|
||||
"Max Lifespan")
|
||||
system76-power charge-thresholds --profile max_lifespan
|
||||
break;;
|
||||
"Quit")
|
||||
echo "Closing"
|
||||
break;;
|
||||
*)
|
||||
echo "Oops!";;
|
||||
esac
|
||||
done
|
||||
else
|
||||
echo $(system76-power profile | grep "Power Profile")
|
||||
echo ""
|
||||
echo "Select a Power Profile:"
|
||||
select profile in Battery Balanced Performance Quit
|
||||
do
|
||||
case $profile in
|
||||
"Battery")
|
||||
system76-power profile battery
|
||||
break;;
|
||||
"Balanced")
|
||||
system76-power profile balanced
|
||||
break;;
|
||||
"Performance")
|
||||
system76-power profile performance
|
||||
break;;
|
||||
"Quit")
|
||||
echo "Closing"
|
||||
break;;
|
||||
*)
|
||||
echo "Oops!";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
state=`cat /sys/class/power_supply/AC/online`
|
||||
|
||||
if [ $state == "1" ]
|
||||
then
|
||||
threshold=`system76-power charge-thresholds | awk '/Profile/{print $NF}'`
|
||||
echo $threshold
|
||||
else
|
||||
profile=`system76-power profile | awk '/Profile/{print $NF}'`
|
||||
echo \($profile\)
|
||||
fi
|
||||
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
image=$1
|
||||
|
||||
# Create the color profile with pywal
|
||||
wal -i $image
|
||||
|
||||
# Copy image to the .cache
|
||||
cp $image ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# Set the image as wallpaper using swww
|
||||
swww img ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# Reload Qtile
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
|
||||
Executable
+12
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
image=$1
|
||||
|
||||
# Create the color profile with wallust
|
||||
wallust run $image
|
||||
|
||||
# Copy image to the .cache
|
||||
cp $image ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# Set wallpaper in qtile
|
||||
qtile cmd-obj -o cmd -f reload_config
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
image=$1
|
||||
|
||||
# Create the color profile with wallust
|
||||
wallust run $image
|
||||
|
||||
# Copy image to the .cache
|
||||
cp $image ~/.cache/current_wallpaper.jpg
|
||||
|
||||
# Set wallpaper in qtile
|
||||
qtile cmd-obj -o cmd -f restart
|
||||
|
||||
# Update betterlockscreen image
|
||||
betterlockscreen -u ~/.cache/current_wallpaper.jpg
|
||||
Executable
+5
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
volume=`wpctl get-volume @DEFAULT_AUDIO_SINK@ | awk '{v = $2; print (v*100)"%"}'`
|
||||
|
||||
echo $volume
|
||||
Executable
+11
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP &
|
||||
awww-daemon &
|
||||
dunst &
|
||||
|
||||
wl-paste --type text --watch cliphist store &
|
||||
wl-paste --type image --watch cliphist store &
|
||||
awww img ~/.config/qtile/wallpaper.png &
|
||||
wlr-randr --output DP-1 --left-of HDMI-A-1 &
|
||||
wlr-randr --output DP-3 --right-of HDMI-A-1 &
|
||||
Executable
+17
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
function run {
|
||||
if ! pgrep $1 ;
|
||||
then
|
||||
$@&
|
||||
fi
|
||||
}
|
||||
|
||||
#starting utility applications at boot time
|
||||
numlockx &
|
||||
picom &
|
||||
/nix/store/$(ls -la /nix/store | grep polkit-gnome | grep '^d' | awk '{print $9}')/libexec/polkit-gnome-authentication-agent-1 &
|
||||
dunst &
|
||||
greenclip daemon &
|
||||
cp ~/.dotfiles/home/configs/qtile/scripts/variety-x11.sh ~/.config/variety/scripts/set_wallpaper &
|
||||
variety
|
||||
Reference in New Issue
Block a user