Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
59181b2772
|
@ -4,6 +4,7 @@ dev_stuffs:
|
||||||
- ansible
|
- ansible
|
||||||
- docker
|
- docker
|
||||||
- network
|
- network
|
||||||
|
- perl
|
||||||
- php
|
- php
|
||||||
- python
|
- python
|
||||||
- shell
|
- shell
|
||||||
|
|
|
@ -4,9 +4,11 @@ dev_stuffs:
|
||||||
- shell
|
- shell
|
||||||
- network
|
- network
|
||||||
- ansible
|
- ansible
|
||||||
|
- perl
|
||||||
- python
|
- python
|
||||||
extensions:
|
extensions:
|
||||||
- gh
|
- gh
|
||||||
x11_screens:
|
x11_screens:
|
||||||
- HDMI-1
|
- HDMI-1
|
||||||
- HDMI-2
|
- HDMI-2
|
||||||
|
base16_scheme: solarized-light
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
register: base16_schemes
|
register: base16_schemes
|
||||||
tags:
|
tags:
|
||||||
- color
|
- color
|
||||||
|
- i3
|
||||||
|
|
||||||
- name: Configure Alacritty
|
- name: Configure Alacritty
|
||||||
template:
|
template:
|
||||||
|
@ -106,6 +107,7 @@
|
||||||
- i3-reload
|
- i3-reload
|
||||||
tags:
|
tags:
|
||||||
- color
|
- color
|
||||||
|
- i3
|
||||||
when: display_server == 'x11'
|
when: display_server == 'x11'
|
||||||
|
|
||||||
- name: Set base16 theme for rofi
|
- name: Set base16 theme for rofi
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
ansible
|
ansible
|
||||||
ansible-lint
|
ansible-lint
|
||||||
|
ansible-language-server
|
||||||
{# EOF #}
|
{# EOF #}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{% if arch_based %}
|
||||||
|
perl-perl-languageserver
|
||||||
|
{% endif %}
|
|
@ -1,5 +1,5 @@
|
||||||
Section "Device"
|
Section "Device"
|
||||||
Identifier "intel"
|
Identifier "Intel Graphics"
|
||||||
Driver "intel"
|
Driver "intel"
|
||||||
Option "Backlight" "intel_backlight"
|
Option "Backlight" "intel_backlight"
|
||||||
EndSection
|
EndSection
|
||||||
|
|
|
@ -39,3 +39,8 @@
|
||||||
debug:
|
debug:
|
||||||
msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied."
|
msg: "The Panfrost display driver configuration was changed, but needs a reboot to be applied."
|
||||||
listen: panfrost config changed
|
listen: panfrost config changed
|
||||||
|
|
||||||
|
- name: Reload systemd-logind
|
||||||
|
command: systemctl kill -s HUP systemd-logind
|
||||||
|
become: yes
|
||||||
|
listen: systemd-logind config changed
|
||||||
|
|
|
@ -356,6 +356,19 @@
|
||||||
- etc changed
|
- etc changed
|
||||||
- systemd changed
|
- systemd changed
|
||||||
|
|
||||||
|
- name: Disable power button
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/systemd/logind.conf
|
||||||
|
line: 'HandlePowerKey=ignore'
|
||||||
|
regexp: '^#? *HandlePowerKey='
|
||||||
|
insertafter: '^\[Login\]$'
|
||||||
|
become: yes
|
||||||
|
notify: systemd-logind config changed
|
||||||
|
# Reason: I sometimes press it accidentally
|
||||||
|
# (hoping to start it when it's already started,
|
||||||
|
# or really accidentally on the Pinebook).
|
||||||
|
# Suspend would be nice, but it doesn't have the locker then
|
||||||
|
|
||||||
# TODO Hibernation, if that's relevant
|
# TODO Hibernation, if that's relevant
|
||||||
# $ sudo blkid | grep 'TYPE="swap"'
|
# $ sudo blkid | grep 'TYPE="swap"'
|
||||||
# $ sudoedit /etc/default/grub
|
# $ sudoedit /etc/default/grub
|
||||||
|
|
|
@ -3,44 +3,49 @@
|
||||||
lua << EOF
|
lua << EOF
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
|
|
||||||
|
-- Mappings.
|
||||||
|
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||||
|
local opts = { noremap=true, silent=true }
|
||||||
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
|
vim.keymap.set('n', '[e', vim.diagnostic.goto_prev, opts)
|
||||||
|
vim.keymap.set('n', ']e', vim.diagnostic.goto_next, opts)
|
||||||
|
-- vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||||
|
|
||||||
-- Use an on_attach function to only map the following keys
|
-- Use an on_attach function to only map the following keys
|
||||||
-- after the language server attaches to the current buffer
|
-- after the language server attaches to the current buffer
|
||||||
local on_attach = function(client, bufnr)
|
local on_attach = function(client, bufnr)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
|
|
||||||
|
|
||||||
--Enable completion triggered by <c-x><c-o>
|
|
||||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
|
||||||
|
|
||||||
-- Mappings.
|
-- Mappings.
|
||||||
local opts = { noremap=true, silent=true }
|
|
||||||
|
|
||||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
buf_set_keymap('n', 'gD', '<Cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
local bufopts = { noremap=true, silent=true, buffer=bufnr }
|
||||||
-- buf_set_keymap('n', 'gd', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
buf_set_keymap('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
-- vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
buf_set_keymap('n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
buf_set_keymap('n', '<C-S-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
buf_set_keymap('n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
vim.keymap.set('n', '<C-S-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
buf_set_keymap('n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||||
buf_set_keymap('n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||||
buf_set_keymap('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
vim.keymap.set('n', '<space>wl', function()
|
||||||
buf_set_keymap('n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
-- buf_set_keymap('n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
end, bufopts)
|
||||||
-- buf_set_keymap('n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
buf_set_keymap('n', '<space>e', '<cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>', opts)
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
buf_set_keymap('n', '[e', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
|
-- vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
buf_set_keymap('n', ']e', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
|
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
-- buf_set_keymap('n', '<space>q', '<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>', opts)
|
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
buf_set_keymap("n", "<space>f", "<cmd>lua vim.lsp.buf.formatting()<CR>", opts)
|
|
||||||
buf_set_keymap("v", "<space>f", "<cmd>lua vim.lsp.buf.range_formatting()<CR><Esc>", opts)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
local servers = {
|
local servers = {
|
||||||
|
{% if 'ansible' in dev_stuffs %}
|
||||||
|
"ansiblels",
|
||||||
|
{% endif %}
|
||||||
|
{% if 'perl' in dev_stuffs %}
|
||||||
|
"perlls",
|
||||||
|
{% endif %}
|
||||||
{% if 'python' in dev_stuffs %}
|
{% if 'python' in dev_stuffs %}
|
||||||
"pylsp",
|
"pylsp",
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -56,7 +61,6 @@ for _, lsp in ipairs(servers) do
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
flags = {
|
flags = {
|
||||||
debounce_text_changes = 150,
|
debounce_text_changes = 150,
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
@ -23,6 +23,7 @@ vnoremap ga <cmd>Telescope lsp_range_code_actions<cr>
|
||||||
noremap ge <cmd>Telescope lsp_document_diagnostics<cr>
|
noremap ge <cmd>Telescope lsp_document_diagnostics<cr>
|
||||||
noremap gE <cmd>Telescope lsp_workspace_diagnostics<cr>
|
noremap gE <cmd>Telescope lsp_workspace_diagnostics<cr>
|
||||||
noremap gd <cmd>Telescope lsp_definitions<cr>
|
noremap gd <cmd>Telescope lsp_definitions<cr>
|
||||||
|
noremap gs <cmd>Telescope lsp_document_symbols<cr>
|
||||||
|
|
||||||
lua << EOF
|
lua << EOF
|
||||||
require('telescope').setup{
|
require('telescope').setup{
|
||||||
|
|
|
@ -5,7 +5,44 @@
|
||||||
#}
|
#}
|
||||||
lua <<EOF
|
lua <<EOF
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
ensure_installed = "maintained",
|
ensure_installed = {
|
||||||
|
"bash",
|
||||||
|
"bibtex",
|
||||||
|
"c",
|
||||||
|
"cmake",
|
||||||
|
"comment",
|
||||||
|
"cpp",
|
||||||
|
"css",
|
||||||
|
"diff",
|
||||||
|
"dockerfile",
|
||||||
|
"dot",
|
||||||
|
"git_rebase",
|
||||||
|
"gitattributes",
|
||||||
|
"gitignore",
|
||||||
|
"go",
|
||||||
|
"help",
|
||||||
|
"html",
|
||||||
|
"http",
|
||||||
|
"java",
|
||||||
|
"javascript",
|
||||||
|
"json",
|
||||||
|
"latex",
|
||||||
|
"llvm",
|
||||||
|
"lua",
|
||||||
|
"make",
|
||||||
|
"markdown",
|
||||||
|
"markdown_inline",
|
||||||
|
"perl",
|
||||||
|
"php",
|
||||||
|
"python",
|
||||||
|
"regex",
|
||||||
|
"ruby",
|
||||||
|
"scss",
|
||||||
|
"sql",
|
||||||
|
"verilog",
|
||||||
|
"vim",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
ignore_install = {},
|
ignore_install = {},
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
|
|
@ -24,3 +24,9 @@ fi
|
||||||
|
|
||||||
feh --no-fehbg --bg-fill "$filepath"
|
feh --no-fehbg --bg-fill "$filepath"
|
||||||
|
|
||||||
|
# Make i3 distribute the workspaces on all screens
|
||||||
|
monitors_json="$(xrandr --listmonitors | tail -n+2 | awk '{ print $4 }' | sed 's|.\+|"\0"|' | tr '\n' ',')"
|
||||||
|
automatrop -e '{"x11_screens":['"$monitors_json"']}' --tags i3
|
||||||
|
|
||||||
|
# TODO Make sure it goes from left to right
|
||||||
|
# Either with the "main" display or using the geometry data
|
||||||
|
|
|
@ -50,7 +50,7 @@ bindsym $mod+Shift+d exec --no-startup-id rofi -modi drun -show drun
|
||||||
|
|
||||||
# Start Applications
|
# Start Applications
|
||||||
# bindsym $mod+Return exec urxvtc
|
# bindsym $mod+Return exec urxvtc
|
||||||
bindsym $mod+Return exec alacritty -e zsh
|
bindsym $mod+Return exec ~/.config/i3/terminal
|
||||||
bindsym $mod+Shift+Return exec urxvt
|
bindsym $mod+Shift+Return exec urxvt
|
||||||
bindsym $mod+p exec thunar
|
bindsym $mod+p exec thunar
|
||||||
bindsym $mod+m exec qutebrowser --override-restore --backend=webengine
|
bindsym $mod+m exec qutebrowser --override-restore --backend=webengine
|
||||||
|
|
3
config/i3/terminal
Executable file
3
config/i3/terminal
Executable file
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
alacritty msg create-window || exec alacritty -e zsh
|
|
@ -19,7 +19,7 @@ chmod 700 "$BASEDIR"
|
||||||
name_base64="$(echo "$name" | base64)"
|
name_base64="$(echo "$name" | base64)"
|
||||||
file="${BASEDIR}/${name_base64}"
|
file="${BASEDIR}/${name_base64}"
|
||||||
|
|
||||||
if [ ! -f "${file}" ]
|
if [ ! -s "${file}" ]
|
||||||
then
|
then
|
||||||
notify-send -u low "cached_pass" "Asking to cache: ${name}"
|
notify-send -u low "cached_pass" "Asking to cache: ${name}"
|
||||||
pass ${name} > "${file}"
|
pass ${name} > "${file}"
|
||||||
|
|
|
@ -67,8 +67,8 @@ def main(args: argparse.Namespace) -> None:
|
||||||
new_filename = (
|
new_filename = (
|
||||||
f"{m['Y']}-{m['M']}-{m['D']}_"
|
f"{m['Y']}-{m['M']}-{m['D']}_"
|
||||||
f"{m['h']}-{m['m']}-{m['s']}"
|
f"{m['h']}-{m['m']}-{m['s']}"
|
||||||
f"{m.get('dup', '')}"
|
f"{m.get('dup') or ''}"
|
||||||
f"{m.get('spec', '')}"
|
f"{m.get('spec') or ''}"
|
||||||
f"{args.suffix}"
|
f"{args.suffix}"
|
||||||
f".{m['ext']}"
|
f".{m['ext']}"
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO De-hardcode
|
if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
echo 3000 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
echo 10000 | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||||
xrandr --output DP-1 --brightness 1
|
elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
|
echo 3000 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
||||||
|
fi
|
||||||
automatrop -e base16_scheme=solarized-dark --tags color
|
automatrop -e base16_scheme=solarized-dark --tags color
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO De-hardcode
|
if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
echo 3500 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
echo 40000 | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||||
xrandr --output DP-1 --brightness 1
|
elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
|
echo 3500 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
||||||
|
fi
|
||||||
automatrop -e base16_scheme=solarized-light --tags color
|
automatrop -e base16_scheme=solarized-light --tags color
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO De-hardcode
|
if [ "$(cat /etc/hostname)" = "curacao.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
echo 700 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
echo 1 | sudo tee /sys/class/backlight/intel_backlight/brightness
|
||||||
xrandr --output DP-1 --brightness 0.5
|
elif [ "$(cat /etc/hostname)" = "pindakaas.geoffrey.frogeye.fr" ]
|
||||||
|
then
|
||||||
|
echo 700 | sudo tee /sys/class/backlight/edp-backlight/brightness
|
||||||
|
fi
|
||||||
automatrop -e base16_scheme=solarized-dark --tags color
|
automatrop -e base16_scheme=solarized-dark --tags color
|
||||||
|
|
|
@ -9,7 +9,6 @@ import typing
|
||||||
|
|
||||||
import coloredlogs
|
import coloredlogs
|
||||||
import exifread
|
import exifread
|
||||||
import progressbar
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s", logger=log)
|
coloredlogs.install(level="DEBUG", fmt="%(levelname)s %(message)s", logger=log)
|
||||||
|
@ -38,12 +37,7 @@ def main(args: argparse.Namespace) -> None:
|
||||||
log.warning("Counting files...")
|
log.warning("Counting files...")
|
||||||
kwargs = {"directory": args.dir, "skip_renamed": args.skip_renamed}
|
kwargs = {"directory": args.dir, "skip_renamed": args.skip_renamed}
|
||||||
log.warning("Processing files...")
|
log.warning("Processing files...")
|
||||||
if args.hide_bar:
|
for full_path in get_pictures(**kwargs):
|
||||||
iterator = get_pictures(**kwargs)
|
|
||||||
else:
|
|
||||||
nb_imgs = len(list(get_pictures(**kwargs)))
|
|
||||||
iterator = progressbar.progressbar(get_pictures(**kwargs), max_value=nb_imgs)
|
|
||||||
for full_path in iterator:
|
|
||||||
# Find date
|
# Find date
|
||||||
with open(full_path, 'rb') as fd:
|
with open(full_path, 'rb') as fd:
|
||||||
exif_data = exifread.process_file(fd)
|
exif_data = exifread.process_file(fd)
|
||||||
|
@ -62,7 +56,7 @@ def main(args: argparse.Namespace) -> None:
|
||||||
ext = os.path.splitext(full_path)[1].lower()
|
ext = os.path.splitext(full_path)[1].lower()
|
||||||
if ext == '.jpeg':
|
if ext == '.jpeg':
|
||||||
ext = '.jpg'
|
ext = '.jpg'
|
||||||
new_name = date.isoformat().replace(":", "-").replace("T", "_")
|
new_name = date.isoformat().replace(":", "-").replace("T", "_") + args.suffix
|
||||||
# First substitution is to allow images being sent to a NTFS filesystem
|
# First substitution is to allow images being sent to a NTFS filesystem
|
||||||
# Second substitution is for esthetics
|
# Second substitution is for esthetics
|
||||||
new_path = os.path.join(args.dir, f"{new_name}{ext}")
|
new_path = os.path.join(args.dir, f"{new_name}{ext}")
|
||||||
|
@ -71,7 +65,7 @@ def main(args: argparse.Namespace) -> None:
|
||||||
while os.path.exists(new_path):
|
while os.path.exists(new_path):
|
||||||
if full_path == new_path:
|
if full_path == new_path:
|
||||||
break
|
break
|
||||||
log.debug(f"{full_path} already exists, incrementing")
|
log.debug(f"{new_path} already exists, incrementing")
|
||||||
i += 1
|
i += 1
|
||||||
new_path = os.path.join(args.dir, f"{new_name}_{i}{ext}")
|
new_path = os.path.join(args.dir, f"{new_name}_{i}{ext}")
|
||||||
|
|
||||||
|
@ -103,16 +97,16 @@ if __name__ == "__main__":
|
||||||
help="Do not actually rename, just show old and new path",
|
help="Do not actually rename, just show old and new path",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-s",
|
"-r",
|
||||||
"--skip-renamed",
|
"--skip-renamed",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Skip images whose filename doesn't match usual camera output filenames.",
|
help="Skip images whose filename doesn't match usual camera output filenames.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-b",
|
"-s",
|
||||||
"--hide-bar",
|
"--suffix",
|
||||||
action="store_true",
|
default="",
|
||||||
help="Do not show a progress bar. Also skip counting images",
|
help="Text to add before the extension",
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
main(args)
|
main(args)
|
||||||
|
|
|
@ -148,7 +148,12 @@ class RVElement:
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def date(self) -> datetime.datetime:
|
def date(self) -> datetime.datetime:
|
||||||
return datetime.datetime.fromtimestamp(self.item["published"])
|
timestamp = (
|
||||||
|
int(self.item.get("timestampUsec", "0")) / 1000000
|
||||||
|
or int(self.item.get("crawlTimeMsec", "0")) / 1000
|
||||||
|
or self.item["published"]
|
||||||
|
)
|
||||||
|
return datetime.datetime.fromtimestamp(timestamp)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_researched(self) -> bool:
|
def is_researched(self) -> bool:
|
||||||
|
@ -475,7 +480,7 @@ class RVDatabase:
|
||||||
def ytdl_opts(self) -> dict:
|
def ytdl_opts(self) -> dict:
|
||||||
# Get user/system options
|
# Get user/system options
|
||||||
prev_argv = sys.argv
|
prev_argv = sys.argv
|
||||||
sys.argv = ['yt-dlp']
|
sys.argv = ["yt-dlp"]
|
||||||
_, _, _, ydl_opts = yt_dlp.parse_options()
|
_, _, _, ydl_opts = yt_dlp.parse_options()
|
||||||
sys.argv = prev_argv
|
sys.argv = prev_argv
|
||||||
return ydl_opts
|
return ydl_opts
|
||||||
|
|
|
@ -31,7 +31,7 @@ alias please=sudo
|
||||||
alias ll="ls -l"
|
alias ll="ls -l"
|
||||||
alias la="ls -la"
|
alias la="ls -la"
|
||||||
alias s='sudo -s -E'
|
alias s='sudo -s -E'
|
||||||
alias n='alacritty & disown'
|
alias n='$HOME/.config/i3/terminal & disown'
|
||||||
alias x='startx $HOME/.config/xinitrc; logout'
|
alias x='startx $HOME/.config/xinitrc; logout'
|
||||||
alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout'
|
alias nx='nvidia-xrun $HOME/.config/xinitrc; sudo systemctl start nvidia-xrun-pm; logout'
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue