Commit f36a2918 authored by Franciszek Madej's avatar Franciszek Madej 🤞

stuff

parent 533174e0
......@@ -82,12 +82,11 @@ if dein#load_state('~/.config/nvim/dein')
call dein#add('Shougo/defx.nvim')
call dein#add('chriskempson/base16-vim')
call dein#add('chaoren/vim-wordmotion')
call dein#add('myusuf3/numbers.vim')
" call dein#add('myusuf3/numbers.vim')
call dein#add('tpope/vim-commentary')
call dein#add('framallo/taskwarrior.vim')
call dein#add('sheerun/vim-polyglot')
call dein#add('iamcco/markdown-preview.nvim', { 'build': 'cd app & yarn install' })
call dein#add('editorconfig/editorconfig-vim')
......
#!/bin/sh
xautolock -time 1 -locker ~/documents/scripts/i3lock-custom-x200
#!/bin/sh
output=$(khal list --notstarted -f '{start-time} | {title} :: {location}' today 1 day \
-a 'agh' | rg '[A-z]+, [A-z0-9/]*$' -v)
if [ "$output" = "No events" ]; then
echo "No classes left today"
else
echo $output
fi
#!/bin/sh
output=$(khal list --notstarted -f '{start-time} | {title}' today 1 day \
-a 'studia' -a 'osobiste' | rg '[A-z]+, [A-z0-9/]*$' -v)
if [ "$output" = "No events" ]; then
echo "No stuff left today"
else
echo $output
fi
#!/bin/sh
output=$(khal list --notstarted -f '{start-time} | {title} :: {location}' '1/10/2018' 1 day \
-a 'wisla' -a 'arsenal' | rg '[A-z]+, [A-z0-9/]*$' -v)
if [ "$output" = "No events" ]; then
echo "No matches left today"
else
echo $output
fi
#!/bin/sh
output=$(khal list --notstarted -f '{start-time} | {title} :: {description}' today 1 day \
-a 'praca' | rg '[A-z]+, [A-z0-9/]*$' -v)
if [ "$output" = "No events" ]; then
echo "No work left today"
else
echo $output
fi
status=$(swaymsg -t get_outputs | rg "transform" | awk '{ print substr($2, 2, length($2) - 3) }')
echo $status
status=$(swaymsg -t get_outputs | rg "transform" | awk '{ print substr($2, 2, length($2) - 3) }')
rotated="right"
if [[ "$status" == "normal" ]]; then
notify-send "rotating to 90 degrees";
swaymsg "output * transform 90"
fi
if [[ "$status" == "90" ]]; then
notify-send "rotating to 180 degrees";
swaymsg "output * transform 180"
fi
if [[ "$status" == "180" ]]; then
notify-send "rotating to 270 degrees";
swaymsg "output * transform 270"
fi
if [[ "$status" == "270" ]]; then
notify-send "rotating to normal orientation";
swaymsg "output * transform normal"
fi
#!/usr/bin/env python
from os import get_terminal_size, system
from time import sleep
from colorama import Fore, Style, init
from pyfiglet import Figlet
import sounddevice as sd
import soundfile as sf
def play_notification_sound():
data, fs = sf.read('/home/kosciak/documents/scripts/stretch.wav',
dtype='float32')
sd.play(data, fs)
status = sd.wait()
if status:
print(status)
SCREEN_WIDTH = get_terminal_size().columns
SCREEN_HEIGHT = get_terminal_size().lines
STRETCH_TIME = 60
DIM_TIME = 15
END_TIME = 45
init(autoreset=True)
f = Figlet(font='doh')
s = Figlet(font='xtty')
system('clear')
print('input interval (in seconds) to start workout')
STRETCH_TIME = int(input('>'))
play_notification_sound()
while True:
for i in range(STRETCH_TIME):
system('clear')
count = f.renderText(str(STRETCH_TIME - i)).split("\n")
new_string = ''
top_margin = int((SCREEN_HEIGHT - len(count)) / 2)
for i in range(top_margin):
new_string += '\n'
for c in count:
new_string += c.center(SCREEN_WIDTH) + '\n'
if i > END_TIME:
print(Fore.RED + new_string)
elif i < DIM_TIME:
print(Style.DIM + new_string)
else:
print(new_string)
sleep(1)
system('clear')
play_notification_sound()
print(s.renderText('enter to continue'))
print('or f to finish workout')
end = input('> ')
if end == 'f':
break
#!/usr/bin/env python3
# Simple bar script using lemonbar
from libqtile.command import Client
from datetime import datetime
from socket import gethostname
from psutil import sensors_battery
import pulsectl
from mpd import MPDClient
from subprocess import Popen, PIPE
from time import sleep
# start with functions
def print_groups():
end_string = ''
c = Client()
groups = c.groups()
for name, group in groups.items():
# if currently focused group, underline and color orange - unless no
# windows, then keep gray
# if group with any window on it, change color to white
# if group without focus nor windows - grey
if group['focus']:
end_string += '%{F#FFDDDDDD}'
else:
end_string += '%{F#FF969896}'
if group['screen'] == 0:
end_string += '%{F#FFF0C674}%{+u}%{U#FFF0C674}'
if group['focus']:
end_string += '%{F#FFF0C674}'
else:
end_string += '%{F#FFA2906D}'
name = f'\u2009 {name} \u2009'
# name = f' {name} '
end_string += name + '%{-u}%{F-}%{B-}'
return end_string
def print_date():
today = datetime.now()
end_string = '%{B#FF81A2BE}'
# end_string += ' %{T4} ' + '%{T1}' + today.strftime('%b %d').lower()
# end_string += '%{T4}  ' + '%{T1}' + today.strftime('%H:%M') + ' '
end_string += ' ' + today.strftime('%H:%M') + ' '
end_string += '%{B#FF5F819D} '
end_string += today.strftime('%d.%m.%y').lower() + ' '
end_string += '%{B-}'
return end_string
def print_volume():
hdmi_volume = 0
analog_volume = 0
hdmi_active = False
with pulsectl.Pulse('volume-getter') as pulse:
hdmi_active = 'hdmi' in pulse.server_info().default_sink_name
for sink in pulse.sink_list():
if 'hdmi' in sink.name:
if sink.mute:
hdmi_volume = 'Muted'
else:
hdmi_volume = str(int(sink.volume.value_flat * 100)) + '%'
if 'analog' in sink.name:
if sink.mute:
analog_volume = 'Muted'
else:
analog_volume = str(int(sink.volume.value_flat * 100))
analog_volume += '%'
end_string = '%{B#FFB5BD68}%{F#FF232F3A}%{U#FF232F3A} '
if hdmi_active:
end_string += '%{+u}'
end_string += f'HDMI: {hdmi_volume}' + '%{-u} '
if not hdmi_active:
end_string += '%{+u}'
end_string += f'Line Out: {analog_volume}'
end_string += '%{-u} %{F-}%{B-}'
return end_string
def print_music(client):
current_song = client.currentsong()
title = ''
artist = ''
try:
title = current_song['title']
artist = current_song['artist']
title = (title[:15] + '..') if len(title) > 15 else title
artist = (artist[:15] + '..') if len(artist) > 15 else artist
except KeyError:
pass
end_string = '%{B#FF85678F}%{F#FFDDDDDD} '
end_string += f'{title} - {artist}'
end_string += ' %{B-}%{F-}'
return end_string
if __name__ == '__main__':
# constantly running loop with result
settings = {
'hostname': gethostname(),
'laptop': bool(sensors_battery()),
}
client = MPDClient()
client.timeout = 10
disable_mpd = False
try:
client.connect('localhost', 6600)
except:
disable_mpd = True
process = Popen([
'lemonbar',
'-f', 'Fira Code Retina-7',
'-o', '0',
'-f', 'Font Awesome 5 Free-11',
'-o', '0',
'-f', 'Font Awesome 5 Brands-11',
'-o', '0',
'-f', 'Font Awesome 5 Free-9',
'-o', '0',
'-f', 'Font Awesome 5 Brands-9',
'-o', '0',
'-gx24', '-p',
'-B', '#1D1F21'],
stdout=PIPE,
stdin=PIPE,
bufsize=1)
last_string = ""
while True:
end_string = '%{l} ' + print_groups()
end_string += '%{r}'
if not disable_mpd:
end_string += print_music(client)
end_string += print_volume()
end_string += print_date()
if end_string != last_string:
process.stdin.write(end_string.encode())
process.stdin.flush()
last_string = end_string
sleep(5)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment