From 88f79788842c6f933a7877e46b94b70b8a862410 Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Wed, 16 Aug 2023 00:48:08 +0530 Subject: removed docs page and moved pages to blog --- .../blog/2022/making-your-own-doom-emacs-theme.md | 50 ++++++++++++++ .../blog/2023/distributing-gtk-app-for-windows.md | 76 +++++++++++++++++++++ content/docs/_index.md | 5 -- .../distributing-gtk-app-for-windows/_index.md | 77 ---------------------- .../making-your-own-doom-emacs-theme/_index.md | 50 -------------- 5 files changed, 126 insertions(+), 132 deletions(-) create mode 100644 content/blog/2022/making-your-own-doom-emacs-theme.md create mode 100644 content/blog/2023/distributing-gtk-app-for-windows.md delete mode 100644 content/docs/_index.md delete mode 100644 content/docs/distributing-gtk-app-for-windows/_index.md delete mode 100644 content/docs/making-your-own-doom-emacs-theme/_index.md diff --git a/content/blog/2022/making-your-own-doom-emacs-theme.md b/content/blog/2022/making-your-own-doom-emacs-theme.md new file mode 100644 index 0000000..31c9990 --- /dev/null +++ b/content/blog/2022/making-your-own-doom-emacs-theme.md @@ -0,0 +1,50 @@ +--- +title: "Customizing a Doom Emacs Theme" +description: "How to create your own Doom Emacs theme" +date: 2022-12-02T21:33:31+05:30 +--- + +Creating your theme/modifying an existing one, or overriding some faces (globally) in Emacs, especially Doom Emacs is +really easy once you understand how to do it... but it wasn't very easy to *understand* how to do it. Most likely +I was doing something wrong, or maybe it's just because I don't fully know how lisp or emacs works that's why it took me long +but I spent a good part of my evening trying to make even small changes to work. + +So, I have created this short tutorial to leave me (and others having problems) some notes on how to modify a Doom Emacs theme. +I'm using Doom Emacs which comes with the doom-themes packages doing some basic setup so we only need to define some variables and it +automatically applies other faces and stuff, and I'm pretty sure doom-themes can be installed on regular Emacs. + +## Overriding faces + +Each element in an emacs buffer has a "face" which defines its foreground/background color, font styling, etc. +You can do `M-x RET` `describe-char` or `describe-face` to get the face of the area under the cursor, or to get a +list of all the available faces (which is very long) + +The `custom-set-faces!` macro (or `custom-set-faces` for Emacs users) can be used to customize any face: + +``` lisp +(custom-set-faces! + '(default :background "#100b13") + '(cursor :background "#0ec685" :foreground) + '(line-number :slant normal :background "#100b13") + '(line-number-current-line :slant normal :background "#21242b")) +``` + +You can add something like this to your `~/.doom.d/config.el` + +## Using a doom theme as a template + +Another way to modify your Doom theme is to use an existing theme as a template (or, starting from bottom up!) +and modifying it. + +### How to modify an existing theme: + +1. Go to [this page](https://github.com/doomemacs/themes) and choose any theme you like, and download the raw file into +`~/.doom.d/themes/-theme.el`. The theme name can be anything, but make sure it ends with "-theme.el" +or Doom won't recognise it as a theme. + +2. Open the theme in your favourite text editor (I wonder which one it is) and edit the line that says `(def-doom-theme ` +and replace `` with any name you like, make sure not to use the original name (or the name of any other theme that already exists on your system) or it would create a clash. +Now, edit the theme to your liking and you're good to go! + +3. Open a new Doom Emacs frame and enter `SPC h t t` and select your new theme! + diff --git a/content/blog/2023/distributing-gtk-app-for-windows.md b/content/blog/2023/distributing-gtk-app-for-windows.md new file mode 100644 index 0000000..fb279a9 --- /dev/null +++ b/content/blog/2023/distributing-gtk-app-for-windows.md @@ -0,0 +1,76 @@ +--- +title: "Distributing a GTK App for Windows" +date: 2023-01-02T18:01:23+05:30 +--- + +# Setting up msys2 + +## Installation using chocolatey + +You need to install msys2 before you can start developing on windows. +The easiest way to set it up is to use the [chocolatey package manager](https://chocolatey.org). + +If you don't already have choco installed, just follow the installation instructions on then run + +``` fish +choco install msys2 +``` + +After msys2 is set up, open a new (non-administrator) powershell window, and in that run msys2 + +## Installing necessary packages + +``` fish +sudo pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-toolchain base-devel glib2-devel +``` + +Refer to the installation instructions on GTK's website on which other packages you might need. +I believe this is enough to get started. + +# Compiling your app + +Now, clone your project's repository and build the app as you normally would on linux and place the executable in the `bin` +directory inside your installation directory. Use the ldd command (`ldd bin/MyApp.exe`) to list the necessary DLLs required +by your app and copy all the DLLs starting with `"/mingw"` to the `bin` directory. This script automatically does that: + +``` fish +ldd bin/MyApp.exe | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" ./bin +``` + +Credit goes to ; Replace MyApp.exe with your executable's name. + +# Adding other required files + +## Icon Theme + +Create a directory for the icon theme with `mkdir -p ./share/icons`, and download the hicolor (mandatory) and another icon pack (I'll be using Adwaita) +and place both files into `share/icons`. + +Or just copy from your mingw installation + +``` fish +cp /mingw64/share/icons/* -r share/icons/ +``` + +## GLib Schemas + +Settings schemas need to be compiled in order for the app to work. The quickest way is to just copy the default ones from your mingw installation. +In a real-world scenaro you might want to edit these files and delete any irrelevant settings but just for testing I don't care. + +``` fish +mkdir -p share/glib-2.0/schemas +cp /mingw64/share/glib-2.0/schemas/* share/glib-2.0/schemas/ +glib-compile-schemas.exe share/glib-2.0/schemas/ +``` + +## Pixbuf loaders + +GTK needs Pixbuf loaders to be able to load images, else it will crash. Just copy the loaders from your mingw installation: + +``` fish +cp /mingw64/lib/gdk-pixbuf-2.0 -r lib/gdk-pixbuf-2.0 +``` + +# Finishing up + +Check that your app runs, and either zip the file or create a microsoft installer to distribute the app! diff --git a/content/docs/_index.md b/content/docs/_index.md deleted file mode 100644 index 231c63a..0000000 --- a/content/docs/_index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Contents -heading: Vidhu Kant's Docs -description: Here I aggregate and store the documentation of all the programs I've written along with some other tutorials ---- diff --git a/content/docs/distributing-gtk-app-for-windows/_index.md b/content/docs/distributing-gtk-app-for-windows/_index.md deleted file mode 100644 index 9a197fa..0000000 --- a/content/docs/distributing-gtk-app-for-windows/_index.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "Distributing a GTK App for Windows" -Description: "Building a GTK app to run natively on Windows" -date: 2023-01-02T18:01:23+05:30 ---- - -# Setting up msys2 - -## Installation using chocolatey - -You need to install msys2 before you can start developing on windows. -The easiest way to set it up is to use the [chocolatey package manager](https://chocolatey.org). - -If you don't already have choco installed, just follow the installation instructions on then run - -``` fish -choco install msys2 -``` - -After msys2 is set up, open a new (non-administrator) powershell window, and in that run msys2 - -## Installing necessary packages - -``` fish -sudo pacman -S mingw-w64-x86_64-gtk3 mingw-w64-x86_64-toolchain base-devel glib2-devel -``` - -Refer to the installation instructions on GTK's website on which other packages you might need. -I believe this is enough to get started. - -# Compiling your app - -Now, clone your project's repository and build the app as you normally would on linux and place the executable in the `bin` -directory inside your installation directory. Use the ldd command (`ldd bin/MyApp.exe`) to list the necessary DLLs required -by your app and copy all the DLLs starting with `"/mingw"` to the `bin` directory. This script automatically does that: - -``` fish -ldd bin/MyApp.exe | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" ./bin -``` - -Credit goes to ; Replace MyApp.exe with your executable's name. - -# Adding other required files - -## Icon Theme - -Create a directory for the icon theme with `mkdir -p ./share/icons`, and download the hicolor (mandatory) and another icon pack (I'll be using Adwaita) -and place both files into `share/icons`. - -Or just copy from your mingw installation - -``` fish -cp /mingw64/share/icons/* -r share/icons/ -``` - -## GLib Schemas - -Settings schemas need to be compiled in order for the app to work. The quickest way is to just copy the default ones from your mingw installation. -In a real-world scenaro you might want to edit these files and delete any irrelevant settings but just for testing I don't care. - -``` fish -mkdir -p share/glib-2.0/schemas -cp /mingw64/share/glib-2.0/schemas/* share/glib-2.0/schemas/ -glib-compile-schemas.exe share/glib-2.0/schemas/ -``` - -## Pixbuf loaders - -GTK needs Pixbuf loaders to be able to load images, else it will crash. Just copy the loaders from your mingw installation: - -``` fish -cp /mingw64/lib/gdk-pixbuf-2.0 -r lib/gdk-pixbuf-2.0 -``` - -# Finishing up - -Check that your app runs, and either zip the file or create a microsoft installer to distribute the app! diff --git a/content/docs/making-your-own-doom-emacs-theme/_index.md b/content/docs/making-your-own-doom-emacs-theme/_index.md deleted file mode 100644 index 31c9990..0000000 --- a/content/docs/making-your-own-doom-emacs-theme/_index.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "Customizing a Doom Emacs Theme" -description: "How to create your own Doom Emacs theme" -date: 2022-12-02T21:33:31+05:30 ---- - -Creating your theme/modifying an existing one, or overriding some faces (globally) in Emacs, especially Doom Emacs is -really easy once you understand how to do it... but it wasn't very easy to *understand* how to do it. Most likely -I was doing something wrong, or maybe it's just because I don't fully know how lisp or emacs works that's why it took me long -but I spent a good part of my evening trying to make even small changes to work. - -So, I have created this short tutorial to leave me (and others having problems) some notes on how to modify a Doom Emacs theme. -I'm using Doom Emacs which comes with the doom-themes packages doing some basic setup so we only need to define some variables and it -automatically applies other faces and stuff, and I'm pretty sure doom-themes can be installed on regular Emacs. - -## Overriding faces - -Each element in an emacs buffer has a "face" which defines its foreground/background color, font styling, etc. -You can do `M-x RET` `describe-char` or `describe-face` to get the face of the area under the cursor, or to get a -list of all the available faces (which is very long) - -The `custom-set-faces!` macro (or `custom-set-faces` for Emacs users) can be used to customize any face: - -``` lisp -(custom-set-faces! - '(default :background "#100b13") - '(cursor :background "#0ec685" :foreground) - '(line-number :slant normal :background "#100b13") - '(line-number-current-line :slant normal :background "#21242b")) -``` - -You can add something like this to your `~/.doom.d/config.el` - -## Using a doom theme as a template - -Another way to modify your Doom theme is to use an existing theme as a template (or, starting from bottom up!) -and modifying it. - -### How to modify an existing theme: - -1. Go to [this page](https://github.com/doomemacs/themes) and choose any theme you like, and download the raw file into -`~/.doom.d/themes/-theme.el`. The theme name can be anything, but make sure it ends with "-theme.el" -or Doom won't recognise it as a theme. - -2. Open the theme in your favourite text editor (I wonder which one it is) and edit the line that says `(def-doom-theme ` -and replace `` with any name you like, make sure not to use the original name (or the name of any other theme that already exists on your system) or it would create a clash. -Now, edit the theme to your liking and you're good to go! - -3. Open a new Doom Emacs frame and enter `SPC h t t` and select your new theme! - -- cgit v1.2.3