Rename folder
This commit is contained in:
60
laptop/scripts/lock-laptop.sh
Executable file
60
laptop/scripts/lock-laptop.sh
Executable file
@@ -0,0 +1,60 @@
|
||||
#!/bin/sh
|
||||
|
||||
blank="ffffff00"
|
||||
|
||||
nord0="2e3440"
|
||||
nord1="3b4252"
|
||||
|
||||
frost2="eceff4"
|
||||
|
||||
blue2="88c0d0"
|
||||
blue3="5e81ac"
|
||||
|
||||
red="bf616a"
|
||||
yellow="ebcb8b"
|
||||
green="a3be8c"
|
||||
|
||||
inside="${nord0}77"
|
||||
|
||||
i3lock \
|
||||
-i ~/data/wallpaper/forest_staircase.png \
|
||||
\
|
||||
--insidecolor=${inside} \
|
||||
--ringcolor=${nord0}ff \
|
||||
--linecolor=${blank} \
|
||||
--keyhlcolor=${green}ff \
|
||||
--bshlcolor=${red}ff \
|
||||
--separatorcolor=${blue3}ff \
|
||||
\
|
||||
--insidevercolor=${inside} \
|
||||
--ringvercolor=${yellow}ff \
|
||||
--verifcolor=${yellow}ff \
|
||||
\
|
||||
--insidewrongcolor=${inside} \
|
||||
--ringwrongcolor=${red}ff \
|
||||
--wrongcolor=${red}ff \
|
||||
\
|
||||
--layoutcolor=ECEFF4ff \
|
||||
--timecolor=ECEFF4ff \
|
||||
--datecolor=ECEFF4ff \
|
||||
\
|
||||
--clock \
|
||||
--indicator \
|
||||
\
|
||||
--timestr="%H:%M" \
|
||||
--datestr="%B %d, %Y" \
|
||||
--timepos="ix:iy-10" \
|
||||
\
|
||||
--timesize=17 \
|
||||
--datesize=13 \
|
||||
\
|
||||
--time-font="InconsolataLGC Nerd Font Mono" \
|
||||
--date-font="InconsolataLGC Nerd Font Mono" \
|
||||
\
|
||||
--veriftext="" \
|
||||
--noinputtext="" \
|
||||
--locktext="" \
|
||||
--wrongtext="" \
|
||||
\
|
||||
--ring-width 4 \
|
||||
--radius 100
|
||||
23
laptop/scripts/powermenu.sh
Executable file
23
laptop/scripts/powermenu.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
# options to be displayed
|
||||
option0=" Lock"
|
||||
option1=" Logout"
|
||||
option2=" Reboot"
|
||||
option3=" Shutdown"
|
||||
|
||||
# options passed into variable
|
||||
options="$option0\n$option1\n$option2\n$option3"
|
||||
|
||||
chosen="$(echo -e "$options" | rofi -lines 8 -dmenu -p "")"
|
||||
|
||||
case $chosen in
|
||||
$option0)
|
||||
~/scripts/lock-laptop;;
|
||||
$option1)
|
||||
i3-msg exit;;
|
||||
$option2)
|
||||
systemctl reboot;;
|
||||
$option3)
|
||||
systemctl poweroff;;
|
||||
esac
|
||||
4
laptop/scripts/startup-laptop.sh
Executable file
4
laptop/scripts/startup-laptop.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
dunst &
|
||||
picom &
|
||||
70
laptop/scripts/wallpaper.py
Executable file
70
laptop/scripts/wallpaper.py
Executable file
@@ -0,0 +1,70 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import random
|
||||
import re
|
||||
import argparse
|
||||
|
||||
|
||||
def get_wallpapers(query: str, path: str):
|
||||
"Fetch a wallpaper"
|
||||
|
||||
# Search through all wallpapers
|
||||
wallpapers = [f for f in os.listdir(path) if re.search(r"png|jpg", f)]
|
||||
queried_wallpapers = [f for f in wallpapers if re.search(rf"{query}", f)]
|
||||
|
||||
return queried_wallpapers
|
||||
|
||||
def pick_wallpaper(wallpaper_list, *args):
|
||||
# Error handling
|
||||
if not wallpaper_list:
|
||||
print("No wallpapers found!")
|
||||
sys.exit(1)
|
||||
else:
|
||||
new_wallpaper = random.choice(wallpaper_list)
|
||||
|
||||
return new_wallpaper
|
||||
|
||||
def list_wallpapers(wallpaper_list, *args):
|
||||
print("Wallpapers matching your query:")
|
||||
for wallpaper in wallpaper_list:
|
||||
print(wallpaper)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
### DEFAULT WALLPAPER DIRECTORY HERE
|
||||
path = "data/wallpaper"
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-q", "--query", help="Refine selection")
|
||||
parser.add_argument("-p", "--path", help="Path to wallpaper directory")
|
||||
parser.add_argument("-l", "--list", action="store_true", help="List potential wallpapers" )
|
||||
args = parser.parse_args()
|
||||
|
||||
query = ""
|
||||
if args.query:
|
||||
query = args.query
|
||||
print(f"Searching for wallpapers filename matching: {query}")
|
||||
|
||||
if args.path:
|
||||
path = args.path
|
||||
print(f"Searching in: {path}")
|
||||
|
||||
# Get a list of all wallpapers
|
||||
wallpaper_list = get_wallpapers(query, path)
|
||||
|
||||
if args.list:
|
||||
print("=================================================")
|
||||
print("Arg '--list' is set. No wallpaper will be applied")
|
||||
print("=================================================")
|
||||
list_wallpapers(wallpaper_list)
|
||||
sys.exit(1)
|
||||
|
||||
# Pick one wallpaper
|
||||
query_result = pick_wallpaper(wallpaper_list)
|
||||
wallpaper = path + "/" + query_result
|
||||
|
||||
os.system(f"feh --bg-scale {wallpaper}")
|
||||
print(f"Updated wallpaper to: {wallpaper}")
|
||||
Reference in New Issue
Block a user