#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xorg)
#:use-module (gnu services)
- #:export (autorandr-services
+ #:export (autorandr-service
desktop-services
screenshot-service))
-(define autorandr-services
- (list (service home-program-service-type
- (home-program-configuration
- (packages
- (list autorandr
- xrandr))
- (dotfiles
- (list "autorandr/.config/autorandr/postswitch"))))
- notify-service))
+(define autorandr-service
+ (service home-program-service-type
+ (home-program-configuration
+ (packages
+ (list autorandr
+ xrandr))
+ (dotfiles
+ (list "autorandr/.config/autorandr/postswitch")))))
(define desktop-services
(list status-bar-service
--- /dev/null
+;; Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+;; License: GPL-3.0 or later.
+;;
+;; emoji.scm - package for copying emojis to the clipboard.
+
+(define-module (conf home emoji)
+ #:use-module (guix build-system trivial)
+ #:use-module (guix gexp)
+ #:use-module (guix licenses)
+ #:use-module (guix packages)
+ #:export (select-emoji))
+
+(define select-emoji
+ (package
+ (name "select-emoji")
+ (version "1.0")
+ (source
+ (local-file
+ (string-concatenate
+ (list (getenv "GUIX_PACKAGE_PATH")
+ "/scripts/select_emoji"))))
+ (build-system trivial-build-system)
+ (arguments
+ '(#:modules ((guix build utils))
+ #:builder
+ (begin
+ (use-modules (guix build utils))
+
+ (let* ((ins (assoc-ref %build-inputs "source"))
+ (out (assoc-ref %outputs "out"))
+ (dir (string-concatenate (list out "/bin")))
+ (file (string-append dir "/select_emoji")))
+ (mkdir-p dir)
+ (copy-file ins file)
+ (chmod file #o555)))))
+ (synopsis "Script for copying emojis to the clipboard through dmenu.")
+ (description "`select_emoji` displays a list of emojis with dmenu and copies
+the selection to the clipboard.")
+ (home-page "https://git.ekhem.eu.org")
+ (license gpl3+)))
;; home.scm - home directory configuration for GNU Guix.
(use-modules (conf home bash)
+ (conf home emoji)
(conf home desktop)
(conf home emacs)
+ (conf home notify)
(conf home suckless)
(gnu packages package-management))
(home-environment
(packages
- (list st-libxft-bgra
+ (list select-emoji
+ st-libxft-bgra
stow))
(services
(append
(list autorandr-service
+ notify-service
screenshot-service)
bash-services
desktop-services
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2022 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+
+EMOJI=$(cat ${XDG_DATA_HOME}/emojis \
+ | dmenu -i -l 15 \
+ | cut --delimiter=" " --fields=1)
+
+if [ -n "${EMOJI}" ]
+then
+ echo -n ${EMOJI} | xclip \
+ && dunstify "${EMOJI} copied to clipboard"
+fi