Compare commits
No commits in common. "6c6320d1f8ee97074973981e5c426d8e49379611" and "b9d4d6b180fb316fd5931a1e2b0dc9af959f0a15" have entirely different histories.
6c6320d1f8
...
b9d4d6b180
@ -24,7 +24,7 @@
|
||||
"requestsplitn": 150,
|
||||
"sortmode": 0,
|
||||
"completionrefreshtime": 7,
|
||||
"sudoloop": true,
|
||||
"sudoloop": false,
|
||||
"timeupdate": true,
|
||||
"devel": false,
|
||||
"cleanAfter": false,
|
||||
|
@ -924,8 +924,7 @@ Most of these keybindings are available at root-level of Awesome and will be dec
|
||||
| u | modkey, meta | shell | rofi-umount | volume unmounting helper | rofi |
|
||||
| w | modkey, control | shell | wacom-setup | set up my wacom tablet | rofi |
|
||||
| w | modkey, shift | shell | rofi-wifi-menu | connect to available wifi | rofi |
|
||||
| y | modkey | shell | ytplay | play web video in mpv | rofi |
|
||||
| y | modkey, shift | shell | rofi-ytdl | download video from web | rofi |
|
||||
| y | modkey | shell | rofi-ytdl | download video from web | rofi |
|
||||
|
||||
** Awesome
|
||||
:PROPERTIES:
|
||||
|
@ -1268,40 +1268,6 @@ A quick and useful script I often use is a ~curl~ request to [[http://v2.wttr.in
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
* ytplay
|
||||
:PROPERTIES:
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/ytplay
|
||||
:CUSTOM_ID: Weather-4ed00bb0
|
||||
:END:
|
||||
~ytplay~ is a simple script I’ve written that allows me to play in mpv any YouTube video at the desired resolution. The script relies on ~dmenu~ (or ~rofi~ in dmenu-mode), ~youtube-dl~ and of course ~mpv~ itself.
|
||||
#+BEGIN_SRC fish
|
||||
set URL (rofi -dmenu -i -p "Video URL")
|
||||
if test -n "$URL"
|
||||
set FORMAT \
|
||||
(youtube-dl --list-formats "$URL" | \
|
||||
egrep "webm.*[0-9]+x[0-9]+" | \
|
||||
awk '{print $3 " " $1}' | \
|
||||
sort -gu | \
|
||||
rofi -dmenu -i -p "Resolution" | \
|
||||
string split " ")
|
||||
set FCODE $FORMAT[2]
|
||||
mpv --ytdl-format=$FCODE "$URL"
|
||||
end
|
||||
#+END_SRC
|
||||
|
||||
I’ll even add a ~.desktop~ entry for this script:
|
||||
#+BEGIN_SRC conf-desktop :tangle ~/.local/share/applications/ytplay.desktop :mkdirp yes
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Version=1.0
|
||||
Name=ytplay (YouTube in mpv)
|
||||
Comment=Play YouTube videos in mpv
|
||||
Exec=/home/phundrak/.local/bin/ytplay
|
||||
Path=/home/phundrak/.local/bin
|
||||
Terminal=false
|
||||
Categories=Media
|
||||
#+END_SRC
|
||||
|
||||
* ytdl - a ~youtube-dl~ wrapper
|
||||
:PROPERTIES:
|
||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/ytdl
|
||||
|
@ -1579,15 +1579,6 @@ Finally, let’s enable globally ~diredfl~ so we can get a colourful Dired buffe
|
||||
(diredfl-global-mode 1)
|
||||
#+END_SRC
|
||||
|
||||
*** Emacs Lisp
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User-Configuration-Emacs-builtins-Emacs-Lisp-36d134d8
|
||||
:END:
|
||||
This chapter will be really short, as most of the defaults I get with Emacs quite fit my needs. However, I wish to declare a custom leader key chord for evil-lisp-state:
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(evil-lisp-state-leader ", l")
|
||||
#+END_SRC
|
||||
|
||||
*** Eshell
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Eshell-3012e67e
|
||||
@ -2420,7 +2411,6 @@ Will be exported as if it were the buffer
|
||||
**** Capture
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-f58979cf
|
||||
:header-args:org: :mkdirp yes
|
||||
:END:
|
||||
Org-capture is an amazing feature of Org-mode which allows me to quickly save links, resources, reminders, and notes in neatly organized org files. Here they are described:
|
||||
#+NAME: org-capture-target-files
|
||||
@ -2443,7 +2433,7 @@ With Spacemacs, an Org capture can be invoked with the shortcut ~SPC a o c~. It
|
||||
| ew | Write Email | Emails | file+headline | org-default-notes-file | emails.orgcaptmpl |
|
||||
| j | Journal | | file+datetree | org-journal-file | journal.orgcaptmpl |
|
||||
| l | Link | | | | |
|
||||
| ll | General | | file+headline | org-default-notes-file | link.orgcaptmpl |
|
||||
| ll | General | | file+headline | org-default-notes-file | |
|
||||
| ly | YouTube | | file+headline | org-default-notes-file | youtube.orgcaptmpl |
|
||||
| L | Protocol Link | Link | file+headline | org-default-notes-file | protocol-link.orgcaptmpl |
|
||||
| n | Notes | | | | |
|
||||
@ -2460,7 +2450,6 @@ With Spacemacs, an Org capture can be invoked with the shortcut ~SPC a o c~. It
|
||||
| re | Emacs | | file+headline | org-default-notes-file | resource.orgcaptmpl |
|
||||
| ri | Informatique | | file+headline | org-default-notes-file | resource.orgcaptmpl |
|
||||
| rl | Linguistics | | file+headline | org-default-notes-file | resource.orgcaptmpl |
|
||||
| rL | Linux | | file+headline | org-default-notes-file | resource.orgcaptmpl |
|
||||
| rw | Worldbuilding | Resource | file+headline | org-wordbuilding-file | resource.orgcaptmpl |
|
||||
| t | Tasks | | | | |
|
||||
| tb | Birthday | | file+headline | org-private-agenda-file | birthday.orgcaptmpl |
|
||||
@ -2490,7 +2479,7 @@ The following code snipped is not tangled into my configuration file, but instea
|
||||
table "\n "))
|
||||
#+END_SRC
|
||||
|
||||
#+RESULTS[d5195b883b39aa51a31e7e572d2eaf8b09c434cd]: org-capture-shortcut-gen
|
||||
#+RESULTS[1fec26dc1d0158ebcaf9b282eb997901321593fa]: org-capture-shortcut-gen
|
||||
#+begin_example
|
||||
'(("e" "Email")
|
||||
("ew" "Write Email" entry
|
||||
@ -2502,7 +2491,7 @@ The following code snipped is not tangled into my configuration file, but instea
|
||||
("l" "Link")
|
||||
("ll" "General" entry
|
||||
(file+headline org-default-notes-file "General")
|
||||
(file "~/org/capture/link.orgcaptmpl"))
|
||||
(file "~/org/capture/"))
|
||||
("ly" "YouTube" entry
|
||||
(file+headline org-default-notes-file "YouTube")
|
||||
(file "~/org/capture/youtube.orgcaptmpl"))
|
||||
@ -2545,9 +2534,6 @@ The following code snipped is not tangled into my configuration file, but instea
|
||||
("rl" "Linguistics" entry
|
||||
(file+headline org-default-notes-file "Linguistics")
|
||||
(file "~/org/capture/resource.orgcaptmpl"))
|
||||
("rL" "Linux" entry
|
||||
(file+headline org-default-notes-file "Linux")
|
||||
(file "~/org/capture/resource.orgcaptmpl"))
|
||||
("rw" "Worldbuilding" entry
|
||||
(file+headline org-wordbuilding-file "Resource")
|
||||
(file "~/org/capture/resource.orgcaptmpl"))
|
||||
@ -2583,7 +2569,7 @@ In the next sub-sections will be described my org capture templates. These are n
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Emails-d87336fe
|
||||
:END:
|
||||
This is my template for a new Email:
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/email.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/email.orgcaptmpl
|
||||
,** TODO [#A] Write Email
|
||||
SCHEDULED: %^t
|
||||
:PROPERTIES:
|
||||
@ -2609,7 +2595,7 @@ I use it in case my computer is not yet connected to the internet and I need to
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Journal-9916f9bf
|
||||
:END:
|
||||
This template is quite simple: it creates a new entry with the current timestamp as its title, a brief title of my choosing, and then I can write whatever I wish to write. This is exported to =~/org/capture/journal.orgcaptmpl=.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/journal.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/journal.orgcaptmpl
|
||||
,* %U %^{Title}
|
||||
%?
|
||||
#+END_SRC
|
||||
@ -2619,7 +2605,7 @@ This template is quite simple: it creates a new entry with the current timestamp
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Notes-4b4c10aa
|
||||
:END:
|
||||
This template is used for taking note about various subjects that can go from conlanging to development. I wrote it so I can know from where this capture was made and when, and it even supports text that was highlighted in Emacs that will be inserted in a quote block. This is exported to =~/org/capture/notes.orgcaptmpl=.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/notes.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/notes.orgcaptmpl
|
||||
,* %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2627,7 +2613,7 @@ This template is used for taking note about various subjects that can go from co
|
||||
%?
|
||||
#+END_SRC
|
||||
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/notes-quote.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/notes-quote.orgcaptmpl
|
||||
,* %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2645,7 +2631,7 @@ This template is used for taking note about various subjects that can go from co
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Protocol-ec45ec49
|
||||
:END:
|
||||
This capture is used when received through org-protocol, with the Org-protocol Extension for Firefox. It allows me to save in a quote block what I’ve highlighted, as well as the link of the webpage on which my saved content was highlighted. This file is exported to =~/org/capture/protocol.orgcaptmpl=.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/protocol.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/protocol.orgcaptmpl
|
||||
,* TODO [#C] %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2660,7 +2646,7 @@ This capture is used when received through org-protocol, with the Org-protocol E
|
||||
#+END_SRC
|
||||
|
||||
This next capture template is used only when a link is sent to Emacs and no content was highlighted.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/protocol-link.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/protocol-link.orgcaptmpl
|
||||
,* TODO [#C] Link: %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2675,7 +2661,7 @@ This next capture template is used only when a link is sent to Emacs and no cont
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Resources-b23bfbd0
|
||||
:END:
|
||||
This is the default template for resources, which generally are located on the Internet. By default, I give them the lowest priority, because although this is something for me to remember later, it is not by default important. You can see in the properties I record when the capture happened, and what the link is. The title of the capture is a summary of what this is, while the body of the capture is a more detailed explanation of what I capture, why, and how it could be useful to me.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/resource.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/resource.orgcaptmpl
|
||||
,* TODO [#C] %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2693,7 +2679,7 @@ This is the default template for resources, which generally are located on the I
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Computers_and_stuff-a4eef8e3
|
||||
:END:
|
||||
One type of task I often capture is related to my servers or thing about computers in general. With this, I can capture a task for which I will either set a schedule or a deadline.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/informatique.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/informatique.orgcaptmpl
|
||||
,* TODO %^{Title}
|
||||
%^{Scheduled or Deadline?||SCHEDULED||DEADLINE}: %^t
|
||||
:PROPERTIES:
|
||||
@ -2707,7 +2693,7 @@ One type of task I often capture is related to my servers or thing about compute
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Health-74f8f338
|
||||
:END:
|
||||
This capture is rarely used (I’m lucky to have a good health), but it can be useful.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/health.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/health.orgcaptmpl
|
||||
,* %^{Title}
|
||||
SCHEDULED: %^t
|
||||
|
||||
@ -2719,7 +2705,7 @@ This capture is rarely used (I’m lucky to have a good health), but it can be u
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Birthdays-ec3b27be
|
||||
:END:
|
||||
This capture is used to store new birthdays I have to remember. They are set to be repeated yearly.
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/birthday.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/birthday.orgcaptmpl
|
||||
,* %^{Name}
|
||||
SCHEDULED: %^t
|
||||
#+END_SRC
|
||||
@ -2728,7 +2714,7 @@ This capture is used to store new birthdays I have to remember. They are set to
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Events-7f0f8dee
|
||||
:END:
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/event.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/event.orgcaptmpl
|
||||
,* %^{Title}
|
||||
%^{Scheduled or deadline?||SCHEDULED||DEADLINE}: %^t
|
||||
%?
|
||||
@ -2742,7 +2728,7 @@ This capture is used to store new birthdays I have to remember. They are set to
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-General-1f0732db
|
||||
:END:
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/link.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/link.orgcaptmpl
|
||||
,* TODO [#C] %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -2755,7 +2741,7 @@ This capture is used to store new birthdays I have to remember. They are set to
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-YouTube-b89fe20e
|
||||
:END:
|
||||
#+BEGIN_SRC org :tangle ~/org/capture/youtube.orgcaptmpl
|
||||
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/youtube.orgcaptmpl
|
||||
,* TODO [#C] %^{Title}
|
||||
:PROPERTIES:
|
||||
:CAPTURED: %U
|
||||
@ -3711,7 +3697,7 @@ Pinentry should use the ~loopback~ mode when communicating with GnuPG. Let’s s
|
||||
(setq epg-pinentry-mode 'loopback)
|
||||
#+END_SRC
|
||||
|
||||
*** Wttr.in
|
||||
*** Wttr.in cities
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Miscellaneous-Wttr.in_cities-dd24f8c5
|
||||
:END:
|
||||
@ -3721,23 +3707,6 @@ Thanks to the wttrin package, I can get the weather forecast in Emacs for a coup
|
||||
"Saint Agrève"))
|
||||
#+END_SRC
|
||||
|
||||
However, the package is currently broken (it was last updated in 2017): wttr.in now returns by default an HTML page instead of an ASCII result. In order to fix it, a ~?A~ must be added at the end of the request in order to get a nice output. Also, let’s use the HTTPS protocol while we’re at it.
|
||||
#+BEGIN_SRC emacs-lisp
|
||||
(defun wttrin-fetch-raw-string (query)
|
||||
"Get the weather information based on your QUERY."
|
||||
(let ((url-user-agent "curl"))
|
||||
(add-to-list 'url-request-extra-headers wttrin-default-accept-language)
|
||||
(with-current-buffer
|
||||
(url-retrieve-synchronously
|
||||
(format "http%s://wttr.in/%s?A"
|
||||
(if (gnutls-available-p) "s" "")
|
||||
query)
|
||||
(lambda (status)
|
||||
(switch-to-buffer (current-buffer))))
|
||||
(decode-coding-string (buffer-string)
|
||||
'utf-8))))
|
||||
#+END_SRC
|
||||
|
||||
** Visual configuration
|
||||
:PROPERTIES:
|
||||
:CUSTOM_ID: User_Configuration-Visual_configuration-78e6cafc
|
||||
|
Loading…
x
Reference in New Issue
Block a user