Compare commits
No commits in common. "6c6320d1f8ee97074973981e5c426d8e49379611" and "b9d4d6b180fb316fd5931a1e2b0dc9af959f0a15" have entirely different histories.
6c6320d1f8
...
b9d4d6b180
@ -24,7 +24,7 @@
|
|||||||
"requestsplitn": 150,
|
"requestsplitn": 150,
|
||||||
"sortmode": 0,
|
"sortmode": 0,
|
||||||
"completionrefreshtime": 7,
|
"completionrefreshtime": 7,
|
||||||
"sudoloop": true,
|
"sudoloop": false,
|
||||||
"timeupdate": true,
|
"timeupdate": true,
|
||||||
"devel": false,
|
"devel": false,
|
||||||
"cleanAfter": 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 |
|
| u | modkey, meta | shell | rofi-umount | volume unmounting helper | rofi |
|
||||||
| w | modkey, control | shell | wacom-setup | set up my wacom tablet | 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 |
|
| w | modkey, shift | shell | rofi-wifi-menu | connect to available wifi | rofi |
|
||||||
| y | modkey | shell | ytplay | play web video in mpv | rofi |
|
| y | modkey | shell | rofi-ytdl | download video from web | rofi |
|
||||||
| y | modkey, shift | shell | rofi-ytdl | download video from web | rofi |
|
|
||||||
|
|
||||||
** Awesome
|
** Awesome
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
@ -1268,40 +1268,6 @@ A quick and useful script I often use is a ~curl~ request to [[http://v2.wttr.in
|
|||||||
end
|
end
|
||||||
#+END_SRC
|
#+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
|
* ytdl - a ~youtube-dl~ wrapper
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:HEADER-ARGS: :shebang "#!/usr/bin/env fish" :mkdirp yes :tangle ~/.local/bin/ytdl
|
: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)
|
(diredfl-global-mode 1)
|
||||||
#+END_SRC
|
#+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
|
*** Eshell
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Eshell-3012e67e
|
:CUSTOM_ID: User_Configuration-Eshell-3012e67e
|
||||||
@ -2420,7 +2411,6 @@ Will be exported as if it were the buffer
|
|||||||
**** Capture
|
**** Capture
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-f58979cf
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-f58979cf
|
||||||
:header-args:org: :mkdirp yes
|
|
||||||
:END:
|
: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:
|
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
|
#+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 |
|
| ew | Write Email | Emails | file+headline | org-default-notes-file | emails.orgcaptmpl |
|
||||||
| j | Journal | | file+datetree | org-journal-file | journal.orgcaptmpl |
|
| j | Journal | | file+datetree | org-journal-file | journal.orgcaptmpl |
|
||||||
| l | Link | | | | |
|
| 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 |
|
| ly | YouTube | | file+headline | org-default-notes-file | youtube.orgcaptmpl |
|
||||||
| L | Protocol Link | Link | file+headline | org-default-notes-file | protocol-link.orgcaptmpl |
|
| L | Protocol Link | Link | file+headline | org-default-notes-file | protocol-link.orgcaptmpl |
|
||||||
| n | Notes | | | | |
|
| 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 |
|
| re | Emacs | | file+headline | org-default-notes-file | resource.orgcaptmpl |
|
||||||
| ri | Informatique | | 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 | 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 |
|
| rw | Worldbuilding | Resource | file+headline | org-wordbuilding-file | resource.orgcaptmpl |
|
||||||
| t | Tasks | | | | |
|
| t | Tasks | | | | |
|
||||||
| tb | Birthday | | file+headline | org-private-agenda-file | birthday.orgcaptmpl |
|
| 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 "))
|
table "\n "))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+RESULTS[d5195b883b39aa51a31e7e572d2eaf8b09c434cd]: org-capture-shortcut-gen
|
#+RESULTS[1fec26dc1d0158ebcaf9b282eb997901321593fa]: org-capture-shortcut-gen
|
||||||
#+begin_example
|
#+begin_example
|
||||||
'(("e" "Email")
|
'(("e" "Email")
|
||||||
("ew" "Write Email" entry
|
("ew" "Write Email" entry
|
||||||
@ -2502,7 +2491,7 @@ The following code snipped is not tangled into my configuration file, but instea
|
|||||||
("l" "Link")
|
("l" "Link")
|
||||||
("ll" "General" entry
|
("ll" "General" entry
|
||||||
(file+headline org-default-notes-file "General")
|
(file+headline org-default-notes-file "General")
|
||||||
(file "~/org/capture/link.orgcaptmpl"))
|
(file "~/org/capture/"))
|
||||||
("ly" "YouTube" entry
|
("ly" "YouTube" entry
|
||||||
(file+headline org-default-notes-file "YouTube")
|
(file+headline org-default-notes-file "YouTube")
|
||||||
(file "~/org/capture/youtube.orgcaptmpl"))
|
(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
|
("rl" "Linguistics" entry
|
||||||
(file+headline org-default-notes-file "Linguistics")
|
(file+headline org-default-notes-file "Linguistics")
|
||||||
(file "~/org/capture/resource.orgcaptmpl"))
|
(file "~/org/capture/resource.orgcaptmpl"))
|
||||||
("rL" "Linux" entry
|
|
||||||
(file+headline org-default-notes-file "Linux")
|
|
||||||
(file "~/org/capture/resource.orgcaptmpl"))
|
|
||||||
("rw" "Worldbuilding" entry
|
("rw" "Worldbuilding" entry
|
||||||
(file+headline org-wordbuilding-file "Resource")
|
(file+headline org-wordbuilding-file "Resource")
|
||||||
(file "~/org/capture/resource.orgcaptmpl"))
|
(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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Emails-d87336fe
|
||||||
:END:
|
:END:
|
||||||
This is my template for a new Email:
|
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
|
,** TODO [#A] Write Email
|
||||||
SCHEDULED: %^t
|
SCHEDULED: %^t
|
||||||
:PROPERTIES:
|
: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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Journal-9916f9bf
|
||||||
:END:
|
: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=.
|
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}
|
,* %U %^{Title}
|
||||||
%?
|
%?
|
||||||
#+END_SRC
|
#+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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Notes-4b4c10aa
|
||||||
:END:
|
: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=.
|
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}
|
,* %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
:CAPTURED: %U
|
||||||
@ -2627,7 +2613,7 @@ This template is used for taking note about various subjects that can go from co
|
|||||||
%?
|
%?
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
#+BEGIN_SRC org :tangle ~/org/capture/notes-quote.orgcaptmpl
|
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/notes-quote.orgcaptmpl
|
||||||
,* %^{Title}
|
,* %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
: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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Protocol-ec45ec49
|
||||||
:END:
|
: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=.
|
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}
|
,* TODO [#C] %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
:CAPTURED: %U
|
||||||
@ -2660,7 +2646,7 @@ This capture is used when received through org-protocol, with the Org-protocol E
|
|||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
This next capture template is used only when a link is sent to Emacs and no content was highlighted.
|
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}
|
,* TODO [#C] Link: %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
: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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Resources-b23bfbd0
|
||||||
:END:
|
: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.
|
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}
|
,* TODO [#C] %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
: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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Computers_and_stuff-a4eef8e3
|
||||||
:END:
|
: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.
|
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}
|
,* TODO %^{Title}
|
||||||
%^{Scheduled or Deadline?||SCHEDULED||DEADLINE}: %^t
|
%^{Scheduled or Deadline?||SCHEDULED||DEADLINE}: %^t
|
||||||
:PROPERTIES:
|
: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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Health-74f8f338
|
||||||
:END:
|
:END:
|
||||||
This capture is rarely used (I’m lucky to have a good health), but it can be useful.
|
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}
|
,* %^{Title}
|
||||||
SCHEDULED: %^t
|
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
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Birthdays-ec3b27be
|
||||||
:END:
|
:END:
|
||||||
This capture is used to store new birthdays I have to remember. They are set to be repeated yearly.
|
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}
|
,* %^{Name}
|
||||||
SCHEDULED: %^t
|
SCHEDULED: %^t
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
@ -2728,7 +2714,7 @@ This capture is used to store new birthdays I have to remember. They are set to
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Events-7f0f8dee
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Tasks-Events-7f0f8dee
|
||||||
:END:
|
:END:
|
||||||
#+BEGIN_SRC org :tangle ~/org/capture/event.orgcaptmpl
|
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/event.orgcaptmpl
|
||||||
,* %^{Title}
|
,* %^{Title}
|
||||||
%^{Scheduled or deadline?||SCHEDULED||DEADLINE}: %^t
|
%^{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:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-General-1f0732db
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-General-1f0732db
|
||||||
:END:
|
:END:
|
||||||
#+BEGIN_SRC org :tangle ~/org/capture/link.orgcaptmpl
|
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/link.orgcaptmpl
|
||||||
,* TODO [#C] %^{Title}
|
,* TODO [#C] %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
:CAPTURED: %U
|
||||||
@ -2755,7 +2741,7 @@ This capture is used to store new birthdays I have to remember. They are set to
|
|||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-YouTube-b89fe20e
|
:CUSTOM_ID: User_Configuration-Org-mode-Org_capture-Links-YouTube-b89fe20e
|
||||||
:END:
|
:END:
|
||||||
#+BEGIN_SRC org :tangle ~/org/capture/youtube.orgcaptmpl
|
#+BEGIN_SRC org :mkdirp yes :tangle ~/org/capture/youtube.orgcaptmpl
|
||||||
,* TODO [#C] %^{Title}
|
,* TODO [#C] %^{Title}
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CAPTURED: %U
|
:CAPTURED: %U
|
||||||
@ -3711,7 +3697,7 @@ Pinentry should use the ~loopback~ mode when communicating with GnuPG. Let’s s
|
|||||||
(setq epg-pinentry-mode 'loopback)
|
(setq epg-pinentry-mode 'loopback)
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
*** Wttr.in
|
*** Wttr.in cities
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Miscellaneous-Wttr.in_cities-dd24f8c5
|
:CUSTOM_ID: User_Configuration-Miscellaneous-Wttr.in_cities-dd24f8c5
|
||||||
:END:
|
:END:
|
||||||
@ -3721,23 +3707,6 @@ Thanks to the wttrin package, I can get the weather forecast in Emacs for a coup
|
|||||||
"Saint Agrève"))
|
"Saint Agrève"))
|
||||||
#+END_SRC
|
#+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
|
** Visual configuration
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
:CUSTOM_ID: User_Configuration-Visual_configuration-78e6cafc
|
:CUSTOM_ID: User_Configuration-Visual_configuration-78e6cafc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user